无运单配送费

This commit is contained in:
苏尹岚
2020-08-12 10:50:07 +08:00
parent 602a5c1444
commit 44ba055029

View File

@@ -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")
}
return err
}