- 在创建美团运单时生成费用信息
This commit is contained in:
@@ -97,9 +97,14 @@ func (w *OrderManager) OnWaybillStatusChanged(bill *model.Waybill) (err error) {
|
|||||||
} else {
|
} else {
|
||||||
addParams := orm.Params{}
|
addParams := orm.Params{}
|
||||||
if bill.Status >= model.WaybillStatusAccepted && bill.Status < model.WaybillStatusEndBegin {
|
if bill.Status >= model.WaybillStatusAccepted && bill.Status < model.WaybillStatusEndBegin {
|
||||||
// if bill.Status == model.WaybillStatusAccepted {
|
if bill.Status == model.WaybillStatusAccepted {
|
||||||
// addParams["desired_fee"] = bill.DesiredFee
|
if bill.DesiredFee > 0 {
|
||||||
// }
|
addParams["desired_fee"] = bill.DesiredFee
|
||||||
|
}
|
||||||
|
if bill.ActualFee > 0 {
|
||||||
|
addParams["actual_fee"] = bill.ActualFee
|
||||||
|
}
|
||||||
|
}
|
||||||
if bill.CourierMobile != "" {
|
if bill.CourierMobile != "" {
|
||||||
addParams["courier_name"] = bill.CourierName
|
addParams["courier_name"] = bill.CourierName
|
||||||
addParams["courier_mobile"] = bill.CourierMobile
|
addParams["courier_mobile"] = bill.CourierMobile
|
||||||
|
|||||||
@@ -81,9 +81,9 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
|
|||||||
order := c.callbackMsg2Waybill(msg)
|
order := c.callbackMsg2Waybill(msg)
|
||||||
switch msg.Status {
|
switch msg.Status {
|
||||||
case mtpsapi.OrderStatusWaitingForSchedule:
|
case mtpsapi.OrderStatusWaitingForSchedule:
|
||||||
|
order.DesiredFee, _ = delivery.CalculateBillDeliveryFee(order)
|
||||||
order.Status = model.WaybillStatusNew
|
order.Status = model.WaybillStatusNew
|
||||||
case mtpsapi.OrderStatusAccepted:
|
case mtpsapi.OrderStatusAccepted:
|
||||||
order.DesiredFee, _ = delivery.CalculateBillDeliveryFee(order)
|
|
||||||
order.Status = model.WaybillStatusAccepted
|
order.Status = model.WaybillStatusAccepted
|
||||||
case mtpsapi.OrderStatusPickedUp:
|
case mtpsapi.OrderStatusPickedUp:
|
||||||
order.Status = model.WaybillStatusDelivering
|
order.Status = model.WaybillStatusDelivering
|
||||||
|
|||||||
Reference in New Issue
Block a user