- refactor cancel waybill reason.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user