- purchase platform, cancel waybill added.
This commit is contained in:
@@ -57,7 +57,7 @@ func (c *WaybillController) callbackMsg2Waybill(msg *dadaapi.CallbackMsg) (retVa
|
||||
return retVal
|
||||
}
|
||||
|
||||
//
|
||||
// DeliveryPlatformHandler
|
||||
func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) {
|
||||
billParams := &dadaapi.OperateOrderRequiredParams{
|
||||
ShopNo: utils.Int2Str(order.StoreID), // 当前达达的门店号与京西是一样的
|
||||
@@ -81,5 +81,15 @@ func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) {
|
||||
}
|
||||
|
||||
func (c *WaybillController) CancelWaybill(bill *model.Waybill) (err error) {
|
||||
return nil
|
||||
reasonID := dadaapi.ReasonIDOther
|
||||
reasonMsg := "other reason"
|
||||
if bill.Status < model.WaybillStatusAccepted {
|
||||
reasonID = dadaapi.ReasonIDNobodyAccept
|
||||
reasonMsg = "ReasonIDNobodyAccept"
|
||||
} else if bill.Status < model.WaybillStatusCourierArrived {
|
||||
reasonID = dadaapi.ReasonIDNobodyPickup
|
||||
reasonMsg = "ReasonIDNobodyPickup"
|
||||
}
|
||||
_, err = api.DadaAPI.CancelOrder(bill.VendorWaybillID, reasonID, reasonMsg)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user