京东物流超重验证

This commit is contained in:
苏尹岚
2020-10-28 17:18:54 +08:00
parent 53fcb9f57f
commit 5088f29456

View File

@@ -710,6 +710,7 @@ func CheckJdDeliveryWeight(ctx *jxcontext.Context) (err error) {
return retVal, err
}
if waybill.DeliveryID == deliveryOrder.VendorWaybillID {
deliveryOrder.IsWeight = 1
if waybill.Weight > 3 && math.Floor(deliveryOrder.Weight) < math.Floor(waybill.Weight) {
diffPrice := (math.Floor(waybill.Weight) - math.Floor(deliveryOrder.Weight)) * waybillKgPrice
if err != nil {
@@ -718,8 +719,10 @@ func CheckJdDeliveryWeight(ctx *jxcontext.Context) (err error) {
if err = financial.AddExpendUpdateAccount(db, userBill, model.BillTypeJdWaybillOverWeight, utils.Float64TwoInt(diffPrice)); err != nil {
return retVal, err
}
deliveryOrder.IsWeight = 2
}
}
dao.UpdateEntity(db, deliveryOrder, "IsWeight")
return retVal, err
}, deliveryOrders)
tasksch.HandleTask(task, nil, true).Run()