- 达达运单在创建时就记录费用信息
This commit is contained in:
@@ -97,9 +97,9 @@ 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
|
// addParams["desired_fee"] = bill.DesiredFee
|
||||||
}
|
// }
|
||||||
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
|
||||||
|
|||||||
@@ -58,12 +58,16 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
|
|||||||
order := c.callbackMsg2Waybill(msg)
|
order := c.callbackMsg2Waybill(msg)
|
||||||
switch msg.OrderStatus {
|
switch msg.OrderStatus {
|
||||||
case dadaapi.OrderStatusWaitingForAccept:
|
case dadaapi.OrderStatusWaitingForAccept:
|
||||||
order.Status = model.WaybillStatusNew
|
|
||||||
case dadaapi.OrderStatusAccepted:
|
|
||||||
if result, err := api.DadaAPI.QueryOrderInfo(msg.OrderID); err == nil {
|
if result, err := api.DadaAPI.QueryOrderInfo(msg.OrderID); err == nil {
|
||||||
order.ActualFee = jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["actualFee"], 0.0))
|
order.ActualFee = jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["actualFee"], 0.0))
|
||||||
order.DesiredFee = jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["deliveryFee"], 0.0))
|
order.DesiredFee = jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["deliveryFee"], 0.0))
|
||||||
}
|
}
|
||||||
|
order.Status = model.WaybillStatusNew
|
||||||
|
case dadaapi.OrderStatusAccepted:
|
||||||
|
// if result, err := api.DadaAPI.QueryOrderInfo(msg.OrderID); err == nil {
|
||||||
|
// order.ActualFee = jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["actualFee"], 0.0))
|
||||||
|
// order.DesiredFee = jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["deliveryFee"], 0.0))
|
||||||
|
// }
|
||||||
order.Status = model.WaybillStatusAccepted
|
order.Status = model.WaybillStatusAccepted
|
||||||
case dadaapi.OrderStatusDelivering:
|
case dadaapi.OrderStatusDelivering:
|
||||||
order.Status = model.WaybillStatusDelivering
|
order.Status = model.WaybillStatusDelivering
|
||||||
|
|||||||
Reference in New Issue
Block a user