- refactor
- load pending orders, fixed bug.
This commit is contained in:
@@ -39,7 +39,7 @@ func (c *WaybillController) OnWaybillExcept(msg *mtpsapi.CallbackOrderExceptionM
|
||||
CourierMobile: msg.CourierPhone,
|
||||
Status: model.WaybillStatusFailed, // todo 这里要再确定一下是否只要收到订单异常消息就视为订单失败
|
||||
VendorStatus: utils.Int2Str(msg.ExceptionCode),
|
||||
WaybillCreatedAt: utils.Timestamp2Time(msg.Timestamp),
|
||||
StatusTime: utils.Timestamp2Time(msg.Timestamp),
|
||||
}
|
||||
order.VendorOrderID, order.OrderVendorID = jxutils.SplitUniversalOrderID(msg.OrderID)
|
||||
retVal = mtpsapi.Err2CallbackResponse(controller.WaybillManager.OnWaybillStatusChanged(order), "mtps OnWaybillExcept")
|
||||
@@ -76,7 +76,7 @@ func (c *WaybillController) callbackMsg2Waybill(msg *mtpsapi.CallbackOrderMsg) (
|
||||
CourierName: msg.CourierName,
|
||||
CourierMobile: msg.CourierPhone,
|
||||
VendorStatus: utils.Int2Str(msg.Status),
|
||||
WaybillCreatedAt: utils.Timestamp2Time(msg.Timestamp),
|
||||
StatusTime: utils.Timestamp2Time(msg.Timestamp),
|
||||
}
|
||||
retVal.VendorOrderID, retVal.OrderVendorID = jxutils.SplitUniversalOrderID(msg.OrderID)
|
||||
return retVal
|
||||
@@ -127,7 +127,7 @@ func (c *WaybillController) calculateDeliveryFee(bill *model.Waybill) (retVal in
|
||||
delieveryFee += jxutils.StandardPrice2Int(2.5 + 10 + 2*float64(order.Weight/1000-20))
|
||||
}
|
||||
|
||||
hour, min, sec := bill.WaybillCreatedAt.Clock()
|
||||
hour, min, sec := bill.StatusTime.Clock()
|
||||
totalSeconds := hour*3600 + min*60 + sec
|
||||
if totalSeconds >= 11*3600+30*60 && totalSeconds <= 13*3600 { // 11:30 -- 13:00
|
||||
delieveryFee += jxutils.StandardPrice2Int(3)
|
||||
|
||||
Reference in New Issue
Block a user