diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 8ce14f16e..993655a8a 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -1548,9 +1548,22 @@ func UpdateWaybillDesiredFee(ctx *jxcontext.Context, vendorOrderID string, desir return err } if bill == nil { - return fmt.Errorf("未找到此订单对应的运单!orderID: %v", vendorOrderID) + waybill := &model.Waybill{ + VendorOrderID: order.VendorOrderID, + OrderVendorID: order.VendorID, + VendorWaybillID: "-1", + WaybillVendorID: -1, + Status: model.WaybillStatusDelivered, + WaybillCreatedAt: time.Now(), + StatusTime: time.Now(), + WaybillFinishedAt: utils.DefaultTimeValue, + DeliveryFlag: model.OrderDeliveryFlagMaskScheduleDisabled, + DesiredFee: int64(desiredFee), + } + dao.CreateEntity(db, waybill) + } else { + bill.DesiredFee = int64(desiredFee) + _, err = dao.UpdateEntity(db, bill, "DesiredFee") } - bill.DesiredFee = int64(desiredFee) - _, err = dao.UpdateEntity(db, bill, "DesiredFee") return err }