Merge branch 'master' into jxstore
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -144,20 +144,21 @@ 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()
|
||||
totalSeconds := hour*3600 + min*60 + sec
|
||||
if totalSeconds >= 11*3600+30*60 && totalSeconds <= 13*3600 { // 11:30 -- 13:00
|
||||
addFee += jxutils.StandardPrice2Int(3)
|
||||
} else if totalSeconds >= 21*3600 || totalSeconds <= 6*3600 { // 21:00 -- 06:00
|
||||
if totalSeconds >= 11*3600 && totalSeconds <= 14*3600 { // 11:00 -- 14:00
|
||||
addFee += jxutils.StandardPrice2Int(3)
|
||||
}
|
||||
// else if totalSeconds >= 21*3600 || totalSeconds <= 6*3600 { // 21:00 -- 06:00
|
||||
// addFee += jxutils.StandardPrice2Int(3)
|
||||
// }
|
||||
return deliveryFee + addFee, addFee, nil
|
||||
}
|
||||
|
||||
@@ -191,7 +192,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,
|
||||
}
|
||||
|
||||
@@ -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"])),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user