From e5d1c798ba4b30b6d33f9f9ca795903a5d98acc9 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Thu, 30 Mar 2023 10:59:18 +0800 Subject: [PATCH] 1 --- business/partner/delivery/uupt/waybill.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/business/partner/delivery/uupt/waybill.go b/business/partner/delivery/uupt/waybill.go index fd84f9412..a2f0cadfc 100644 --- a/business/partner/delivery/uupt/waybill.go +++ b/business/partner/delivery/uupt/waybill.go @@ -256,6 +256,15 @@ func getOrderPrice(order *model.GoodsOrder) (orderPrice *uuptapi.GetOrderPriceRe Lng: jxutils.IntCoordinate2Standard(order.ConsigneeLng), }) coords, err = api.BaiDuNaviAPI.BatchCoordinateConvert(coords, baidunavi.CoordSysGCJ02, baidunavi.CoordSysBaiDu) + weight := 4 + tempWeight := 0 + if order.Weight/1000 >= weight { + tempWeight = weight + } else if order.Weight/1000 < 1 { + tempWeight = 1 + } else { + tempWeight = int(order.Weight / 1000) + } param := map[string]interface{}{ "origin_id": order.VendorOrderID, "from_address": store.Address, @@ -267,7 +276,9 @@ func getOrderPrice(order *model.GoodsOrder) (orderPrice *uuptapi.GetOrderPriceRe "from_lng": coords[0].Lng, "to_lat": coords[1].Lat, "to_lng": coords[1].Lng, + "goods_weight": tempWeight, } + if orderPrice, err = api.UuAPI.GetOrderPrice(param); err != nil { return nil, err } else {