diff --git a/business/controller/dada/waybill.go b/business/controller/dada/waybill.go index 83b004256..abeaebb9e 100644 --- a/business/controller/dada/waybill.go +++ b/business/controller/dada/waybill.go @@ -128,7 +128,7 @@ func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) { func (c *WaybillController) CancelWaybill(bill *model.Waybill) (err error) { reasonID := dadaapi.ReasonIDOther - reasonMsg := "other reason" + reasonMsg := "send not in time" if bill.Status < model.WaybillStatusAccepted { reasonID = dadaapi.ReasonIDNobodyAccept reasonMsg = "ReasonIDNobodyAccept" diff --git a/business/controller/mtps/waybill.go b/business/controller/mtps/waybill.go index f56dcf69e..099747b2e 100644 --- a/business/controller/mtps/waybill.go +++ b/business/controller/mtps/waybill.go @@ -237,15 +237,14 @@ func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) { } func (c *WaybillController) CancelWaybill(bill *model.Waybill) (err error) { - reasonID := mtpsapi.CancelReasonMerchantOther - reasonMsg := "other reason" + reasonID := mtpsapi.CancelReasonRidderSendNotIntime + reasonMsg := "CancelReasonRidderSendNotIntime" if bill.Status < model.WaybillStatusAccepted { + reasonID = mtpsapi.CancelReasonMerchantOther + reasonMsg = "nobody accept order" } else if bill.Status < model.WaybillStatusCourierArrived { reasonID = mtpsapi.CancelReasonRideerGetGoodNotIntime reasonMsg = "CancelReasonRideerGetGoodNotIntime" - } else { - reasonID = mtpsapi.CancelReasonRidderSendNotIntime - reasonMsg = "CancelReasonRidderSendNotIntime" } _, err = api.MtpsAPI.CancelOrder(utils.Str2Int64(bill.VendorWaybillID2), bill.VendorWaybillID, reasonID, reasonMsg) return nil diff --git a/business/scheduler/defsch/defsch.go b/business/scheduler/defsch/defsch.go index f610a3c83..86334f8d9 100644 --- a/business/scheduler/defsch/defsch.go +++ b/business/scheduler/defsch/defsch.go @@ -304,7 +304,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo if s.isBillCandidate(order, bill) { } else { // s.CancelWaybill(bill) - globals.SugarLogger.Warnf("OnWaybillStatusChanged CourierArrived order(%d, %s) bill(%d, %s), bill:%v shouldn't get here", order.WaybillVendorID, order.VendorWaybillID, bill.WaybillVendorID, bill.VendorWaybillID, bill) + globals.SugarLogger.Infof("OnWaybillStatusChanged CourierArrived order(%d, %s) bill(%d, %s), bill:%v shouldn't get here", order.WaybillVendorID, order.VendorWaybillID, bill.WaybillVendorID, bill.VendorWaybillID, bill) } case model.WaybillStatusFailed: // todo WaybillStatusFailed理解成订单整个失败了,不需要再尝试创建运单了,注意这里应该加个zabbix日志的报警 s.removeWaybillFromMap(savedOrderInfo, bill) @@ -317,7 +317,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo } } else { // 创建运单失败时,可能到这里来(比如:818874313000121) - globals.SugarLogger.Warnf("OnWaybillStatusChanged Failed bill:%v shouldn't got here, order details:%v", bill, order) + globals.SugarLogger.Infof("OnWaybillStatusChanged Failed bill:%v shouldn't got here, order details:%v", bill, order) } case model.WaybillStatusCanceled: s.removeWaybillFromMap(savedOrderInfo, bill) @@ -339,7 +339,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo // do nothing } else { // s.CancelWaybill(bill) - globals.SugarLogger.Warnf("OnWaybillStatusChanged Delivering order(%d, %s) bill(%d, %s), bill:%v shouldn't get here", order.WaybillVendorID, order.VendorWaybillID, bill.WaybillVendorID, bill.VendorWaybillID, bill) + globals.SugarLogger.Infof("OnWaybillStatusChanged Delivering order(%d, %s) bill(%d, %s), bill:%v shouldn't get here", order.WaybillVendorID, order.VendorWaybillID, bill.WaybillVendorID, bill.VendorWaybillID, bill) } case model.WaybillStatusDelivered: s.resetTimer(savedOrderInfo, bill, isPending) @@ -354,7 +354,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo if !s.isBillCandidate(order, bill) { // 一般只会消息乱序才会到这里,即新订单消息在运单接单消息后到达 // 典型的一个:1223633660228537567 - globals.SugarLogger.Warnf("OnWaybillStatusChanged Delivered order(%d, %s) bill(%d, %s), bill:%v shouldn't get here", order.WaybillVendorID, order.VendorWaybillID, bill.WaybillVendorID, bill.VendorWaybillID, bill) + globals.SugarLogger.Infof("OnWaybillStatusChanged Delivered order(%d, %s) bill(%d, %s), bill:%v shouldn't get here", order.WaybillVendorID, order.VendorWaybillID, bill.WaybillVendorID, bill.VendorWaybillID, bill) if order.WaybillVendorID == model.VendorIDUnknown { s.updateOrderByBill(order, bill, false) }