- fixed some price bug.

This commit is contained in:
gazebo
2018-07-26 16:49:21 +08:00
parent 11db08e4c3
commit 5f4af9ced0
3 changed files with 35 additions and 34 deletions

View File

@@ -181,7 +181,7 @@ func (c *OrderController) GetOrder(orderID string) (order *model.GoodsOrder, err
SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["extendCode"]), 0)),
VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["skuId"])),
SkuName: product["name"].(string),
SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["userPrice"])),
SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])), // todo 这个其实不是用户实付价但之前用的userPrice取出来是空暂时先用到
Weight: int(math.Round(utils.Interface2FloatWithDefault(product["weight"], 0.0))),
}
order.Skus = append(order.Skus, sku)

View File

@@ -148,18 +148,18 @@ func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) {
// 忽略坐标转换错误,即使是转换出错,也只能当成转换成功来处理,底层会有错误日志输出
lngFloat, latFloat, _ := jxutils.IntCoordinate2MarsStandard(order.ConsigneeLng, order.ConsigneeLat, order.CoordinateType)
billParams := &mtpsapi.CreateOrderByShopParam{
OrderID: jxutils.ComposeUniversalOrderID(order.VendorOrderID, order.VendorID),
DeliveryServiceCode: mtpsapi.DeliveryServiceCodeRapid,
ReceiverName: order.ConsigneeName,
ReceiverAddress: order.ConsigneeAddress,
ReceiverPhone: order.ConsigneeMobile,
CoordinateType: model.CoordinateTypeMars,
ReceiverLng: jxutils.StandardCoordinate2Int(lngFloat),
ReceiverLat: jxutils.StandardCoordinate2Int(latFloat),
GoodsValue: jxutils.IntPrice2Standard(order.SalePrice), // todo 超价处理
GoodsWeight: float64(order.Weight) / 1000,
ExpectedDeliveryTime: order.ExpectedDeliveredTime.Unix(),
OrderType: mtpsapi.OrderTypeASAP,
OrderID: jxutils.ComposeUniversalOrderID(order.VendorOrderID, order.VendorID),
DeliveryServiceCode: mtpsapi.DeliveryServiceCodeRapid,
ReceiverName: order.ConsigneeName,
ReceiverAddress: order.ConsigneeAddress,
ReceiverPhone: order.ConsigneeMobile,
CoordinateType: model.CoordinateTypeMars,
ReceiverLng: jxutils.StandardCoordinate2Int(lngFloat),
ReceiverLat: jxutils.StandardCoordinate2Int(latFloat),
GoodsValue: jxutils.IntPrice2Standard(order.SalePrice), // todo 超价处理
GoodsWeight: float64(order.Weight) / 1000,
// ExpectedDeliveryTime: order.ExpectedDeliveredTime.Unix(),
OrderType: mtpsapi.OrderTypeASAP,
}
if billParams.DeliveryID, err = c.getDeliveryID(order, db); err == nil {
if billParams.ShopID, err = c.getMTPSShopID(order, db); err == nil {

View File

@@ -148,27 +148,28 @@ func (c *OrderController) legacyWriteJxOrder(order *model.GoodsOrder, db orm.Orm
orderStatus = JX_ORDER_STATUS_PICKING
}
jxorder := &legacymodel.Jxorder2{
VenderId: int8(order.VendorID),
OrderId: utils.Str2Int64(order.VendorOrderID),
JxStoreId: utils.Int2Str(jxutils.GetJxStoreIDFromOrder(order)),
JxStoreName: order.StoreName,
OrderNum: order.OrderSeq,
OrderStatus: orderStatus,
OrderStatusTime: utils.Time2Str(order.StatusTime),
BusinessTag: businessTags,
SkuCount: order.SkuCount,
OrderBuyerRemark: order.BuyerComment,
BuyerFullName: order.ConsigneeName,
BuyerFullAddress: order.ConsigneeAddress,
BuyerMobile: order.ConsigneeMobile,
BuyerCoordType: legacyMapCoordinateType(order.CoordinateType),
BuyerLng: jxutils.IntCoordinate2Standard(order.ConsigneeLng),
BuyerLat: jxutils.IntCoordinate2Standard(order.ConsigneeLat),
CityName: "all",
OrderStartTime: utils.Time2Str(order.StatusTime),
JdStoreId: order.VendorStoreID,
OrderTotalMoney: int(order.SalePrice),
OrderDiscountMoney: int(order.SalePrice - order.ActualPayPrice),
VenderId: int8(order.VendorID),
OrderId: utils.Str2Int64(order.VendorOrderID),
JxStoreId: utils.Int2Str(jxutils.GetJxStoreIDFromOrder(order)),
JxStoreName: order.StoreName,
OrderNum: order.OrderSeq,
OrderStatus: orderStatus,
OrderStatusTime: utils.Time2Str(order.StatusTime),
BusinessTag: businessTags,
SkuCount: order.SkuCount,
OrderBuyerRemark: order.BuyerComment,
BuyerFullName: order.ConsigneeName,
BuyerFullAddress: order.ConsigneeAddress,
BuyerMobile: order.ConsigneeMobile,
BuyerCoordType: legacyMapCoordinateType(order.CoordinateType),
BuyerLng: jxutils.IntCoordinate2Standard(order.ConsigneeLng),
BuyerLat: jxutils.IntCoordinate2Standard(order.ConsigneeLat),
CityName: "all",
OrderStartTime: utils.Time2Str(order.StatusTime),
JdStoreId: order.VendorStoreID,
OrderTotalMoney: int(order.SalePrice),
OrderDiscountMoney: int(order.SalePrice - order.ActualPayPrice),
OrderBuyerPayableMoney: int(order.ActualPayPrice),
// DeliveryPackageWeight: float64(order.Weight) / 1000,
}
if order.VendorID == model.VendorIDELM {