Merge remote-tracking branch 'remotes/origin/master' into jx-callback

This commit is contained in:
lyb
2018-08-09 16:39:23 +08:00
3 changed files with 9 additions and 10 deletions

View File

@@ -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"

View File

@@ -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