dyps cancelwaybill

This commit is contained in:
richboo111
2022-12-29 18:14:55 +08:00
parent acd05db63c
commit 1bbebdb773
6 changed files with 15 additions and 15 deletions

View File

@@ -106,13 +106,12 @@ func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, maxDeliveryFee
}
func (c *DeliveryHandler) CancelWaybill(bill *model.Waybill, cancelReasonID int, cancelReason string) (err error) {
globals.SugarLogger.Debugf("进入DYPS CancelWaybill")
if localOrder, _, err := dao.GetOrders(dao.GetDB(), []int64{utils.Str2Int64(bill.VendorOrderID)}, false, false, "", "", false, []int{0}, false, "", nil, 0, 0); err != nil {
params := make(map[string]interface{}, 0)
params["vendorOrderID"] = bill.VendorOrderID
if localOrder, _, err := dao.GetOrders(dao.GetDB(), nil, false, false, "", "", false, []int{0}, false, "", params, 0, 0); err != nil {
return errors.New("取消运单时获取平台门店ID失败请重试")
} else {
globals.SugarLogger.Debugf("localOrder=%s", utils.Format4Output(localOrder, false))
if err = getAPI(bill.VendorOrgCode).ShopOrderDispatcher(utils.Str2Int64(localOrder[0].VendorStoreID), bill.VendorOrderID, tiktok_api.DispatcherFeeTypeCancel); err != nil {
globals.SugarLogger.Debugf("抖音配送取消运力失败:%v", err)
return fmt.Errorf("抖音配送取消运力失败:%v", err)
}
bill.Status = model.WaybillStatusCanceled