- purchase platform, cancel waybill added.
This commit is contained in:
@@ -78,7 +78,7 @@ func (c *WaybillController) callbackMsg2Waybill(msg *mtpsapi.CallbackOrderMsg) (
|
||||
return retVal
|
||||
}
|
||||
|
||||
//
|
||||
// DeliveryPlatformHandler
|
||||
func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) {
|
||||
db := orm.NewOrm()
|
||||
// 忽略坐标转换错误,即使是转换出错,也只能当成转换成功来处理,底层会有错误日志输出
|
||||
@@ -119,6 +119,17 @@ func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) {
|
||||
}
|
||||
|
||||
func (c *WaybillController) CancelWaybill(bill *model.Waybill) (err error) {
|
||||
reasonID := mtpsapi.CancelReasonMerchantOther
|
||||
reasonMsg := "other reason"
|
||||
if bill.Status < model.WaybillStatusAccepted {
|
||||
} 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