diff --git a/business/jxcallback/orderman/order_legacy.go b/business/jxcallback/orderman/order_legacy.go index b77f707c5..84555f237 100644 --- a/business/jxcallback/orderman/order_legacy.go +++ b/business/jxcallback/orderman/order_legacy.go @@ -170,7 +170,7 @@ func (c *OrderManager) legacyWriteJxOrder(order *model.GoodsOrder, db orm.Ormer, OrderTotalMoney: int(order.SalePrice), OrderDiscountMoney: int(order.SalePrice - order.ActualPayPrice), OrderBuyerPayableMoney: int(order.ActualPayPrice), - // DeliveryPackageWeight: float64(order.Weight) / 1000, + // DeliveryPackageWeight: float64(jxutils.IntWeight2Float(order.Weight)), } if order.VendorID == model.VendorIDELM { jxorder.OrderStatus = JX_ORDER_STATUS_WAIT_FOR_DELIVERY diff --git a/business/partner/delivery/dada/waybill.go b/business/partner/delivery/dada/waybill.go index 0c42a25e6..5b5f0913c 100644 --- a/business/partner/delivery/dada/waybill.go +++ b/business/partner/delivery/dada/waybill.go @@ -112,7 +112,7 @@ func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, policy func(del // "origin_mark": model.VendorNames[order.VendorID], "origin_mark_no": fmt.Sprintf("%d", order.OrderSeq), "cargo_type": 13, - "cargo_weight": float64(order.Weight) / 1000.0, + "cargo_weight": jxutils.IntWeight2Float(order.Weight), "cargo_num": order.GoodsCount, } diff --git a/business/partner/delivery/mtps/waybill.go b/business/partner/delivery/mtps/waybill.go index bd9495861..b8b4ceddc 100644 --- a/business/partner/delivery/mtps/waybill.go +++ b/business/partner/delivery/mtps/waybill.go @@ -144,11 +144,11 @@ func (c *DeliveryHandler) calculateOrderDeliveryFee(order *model.GoodsOrder, bil if order.Weight < 5*1000 { } else if order.Weight < 10*1000 { - addFee += jxutils.StandardPrice2Int(0.5 * float64(order.Weight/1000-5)) + addFee += jxutils.StandardPrice2Int(0.5 * float64(jxutils.IntWeight2Float(order.Weight)-5)) } else if order.Weight < 20*1000 { - addFee += jxutils.StandardPrice2Int(2.5 + 1*float64(order.Weight/1000-10)) + addFee += jxutils.StandardPrice2Int(2.5 + 1*float64(jxutils.IntWeight2Float(order.Weight)-10)) } else { - addFee += jxutils.StandardPrice2Int(2.5 + 10 + 2*float64(order.Weight/1000-20)) + addFee += jxutils.StandardPrice2Int(2.5 + 10 + 2*float64(jxutils.IntWeight2Float(order.Weight)-20)) } hour, min, sec := billTime.Clock() @@ -191,7 +191,7 @@ func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, policy func(del ReceiverLng: jxutils.StandardCoordinate2Int(lngFloat), ReceiverLat: jxutils.StandardCoordinate2Int(latFloat), GoodsValue: jxutils.IntPrice2Standard(order.ActualPayPrice), // todo 超价处理 - GoodsWeight: float64(order.Weight) / 1000, + GoodsWeight: float64(jxutils.IntWeight2Float(order.Weight)), // ExpectedDeliveryTime: order.ExpectedDeliveredTime.Unix(), OrderType: mtpsapi.OrderTypeASAP, } diff --git a/business/partner/purchase/jd/order.go b/business/partner/purchase/jd/order.go index ee4c40c87..bcc690d14 100644 --- a/business/partner/purchase/jd/order.go +++ b/business/partner/purchase/jd/order.go @@ -114,7 +114,7 @@ func (c *PurchaseHandler) GetOrder(orderID string) (order *model.GoodsOrder, err SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["skuIdIsv"]), 0)), VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["skuId"])), SkuName: product["skuName"].(string), - Weight: int(utils.MustInterface2Float64(product["skuWeight"]) * 1000), + Weight: jxutils.FloatWeight2Int(float32(utils.MustInterface2Float64(product["skuWeight"]))), SalePrice: utils.MustInterface2Int64(product["skuJdPrice"]), PromotionType: int(utils.MustInterface2Int64(product["promotionType"])), }