uu 配送费

This commit is contained in:
richboo111
2023-02-21 13:03:06 +08:00
parent 2a06560c82
commit 511a0b7f79

View File

@@ -287,17 +287,19 @@ func OnWaybillMsg(req *uuptapi.WaybillCallbackParam) (resp *uuptapi.CallbackResp
Remark: req.StateText,
}
var good *model.GoodsOrder
var reallyPrice int64
sql := `SELECT * FROM goods_order WHERE vendor_order_id = ? ORDER BY order_created_at DESC LIMIT 1 OFFSET 0`
sqlParams := []interface{}{req.OriginID}
dao.GetRow(dao.GetDB(), &good, sql, sqlParams)
globals.SugarLogger.Debugf("uupt OnWaybillMsg good=====%s ", utils.Format4Output(good, false))
param.OrderVendorID = good.VendorID
//查询运单价格
uuPrice, err := api.UuAPI.GetOrderDetail(req.OrderCode)
if err != nil {
if uuPrice, err := api.UuAPI.GetOrderDetail(req.OrderCode); err != nil {
globals.SugarLogger.Debugf("uuGetPrice err====%v", err)
reallyPrice = 0
} else {
reallyPrice = utils.Str2Int64(uuPrice.OrderPrice) - utils.Str2Int64(uuPrice.PriceOff)
}
reallyPrice := utils.Str2Int64(uuPrice.OrderPrice) - utils.Str2Int64(uuPrice.PriceOff)
switch req.State {
case uuptapi.StateConfirmSuccess:
param.Status = model.WaybillStatusNew //5 待调度