- 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)), SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["extendCode"]), 0)),
VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["skuId"])), VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["skuId"])),
SkuName: product["name"].(string), 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))), Weight: int(math.Round(utils.Interface2FloatWithDefault(product["weight"], 0.0))),
} }
order.Skus = append(order.Skus, sku) 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) lngFloat, latFloat, _ := jxutils.IntCoordinate2MarsStandard(order.ConsigneeLng, order.ConsigneeLat, order.CoordinateType)
billParams := &mtpsapi.CreateOrderByShopParam{ billParams := &mtpsapi.CreateOrderByShopParam{
OrderID: jxutils.ComposeUniversalOrderID(order.VendorOrderID, order.VendorID), OrderID: jxutils.ComposeUniversalOrderID(order.VendorOrderID, order.VendorID),
DeliveryServiceCode: mtpsapi.DeliveryServiceCodeRapid, DeliveryServiceCode: mtpsapi.DeliveryServiceCodeRapid,
ReceiverName: order.ConsigneeName, ReceiverName: order.ConsigneeName,
ReceiverAddress: order.ConsigneeAddress, ReceiverAddress: order.ConsigneeAddress,
ReceiverPhone: order.ConsigneeMobile, ReceiverPhone: order.ConsigneeMobile,
CoordinateType: model.CoordinateTypeMars, CoordinateType: model.CoordinateTypeMars,
ReceiverLng: jxutils.StandardCoordinate2Int(lngFloat), ReceiverLng: jxutils.StandardCoordinate2Int(lngFloat),
ReceiverLat: jxutils.StandardCoordinate2Int(latFloat), ReceiverLat: jxutils.StandardCoordinate2Int(latFloat),
GoodsValue: jxutils.IntPrice2Standard(order.SalePrice), // todo 超价处理 GoodsValue: jxutils.IntPrice2Standard(order.SalePrice), // todo 超价处理
GoodsWeight: float64(order.Weight) / 1000, GoodsWeight: float64(order.Weight) / 1000,
ExpectedDeliveryTime: order.ExpectedDeliveredTime.Unix(), // ExpectedDeliveryTime: order.ExpectedDeliveredTime.Unix(),
OrderType: mtpsapi.OrderTypeASAP, OrderType: mtpsapi.OrderTypeASAP,
} }
if billParams.DeliveryID, err = c.getDeliveryID(order, db); err == nil { if billParams.DeliveryID, err = c.getDeliveryID(order, db); err == nil {
if billParams.ShopID, err = c.getMTPSShopID(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 orderStatus = JX_ORDER_STATUS_PICKING
} }
jxorder := &legacymodel.Jxorder2{ jxorder := &legacymodel.Jxorder2{
VenderId: int8(order.VendorID), VenderId: int8(order.VendorID),
OrderId: utils.Str2Int64(order.VendorOrderID), OrderId: utils.Str2Int64(order.VendorOrderID),
JxStoreId: utils.Int2Str(jxutils.GetJxStoreIDFromOrder(order)), JxStoreId: utils.Int2Str(jxutils.GetJxStoreIDFromOrder(order)),
JxStoreName: order.StoreName, JxStoreName: order.StoreName,
OrderNum: order.OrderSeq, OrderNum: order.OrderSeq,
OrderStatus: orderStatus, OrderStatus: orderStatus,
OrderStatusTime: utils.Time2Str(order.StatusTime), OrderStatusTime: utils.Time2Str(order.StatusTime),
BusinessTag: businessTags, BusinessTag: businessTags,
SkuCount: order.SkuCount, SkuCount: order.SkuCount,
OrderBuyerRemark: order.BuyerComment, OrderBuyerRemark: order.BuyerComment,
BuyerFullName: order.ConsigneeName, BuyerFullName: order.ConsigneeName,
BuyerFullAddress: order.ConsigneeAddress, BuyerFullAddress: order.ConsigneeAddress,
BuyerMobile: order.ConsigneeMobile, BuyerMobile: order.ConsigneeMobile,
BuyerCoordType: legacyMapCoordinateType(order.CoordinateType), BuyerCoordType: legacyMapCoordinateType(order.CoordinateType),
BuyerLng: jxutils.IntCoordinate2Standard(order.ConsigneeLng), BuyerLng: jxutils.IntCoordinate2Standard(order.ConsigneeLng),
BuyerLat: jxutils.IntCoordinate2Standard(order.ConsigneeLat), BuyerLat: jxutils.IntCoordinate2Standard(order.ConsigneeLat),
CityName: "all", CityName: "all",
OrderStartTime: utils.Time2Str(order.StatusTime), OrderStartTime: utils.Time2Str(order.StatusTime),
JdStoreId: order.VendorStoreID, JdStoreId: order.VendorStoreID,
OrderTotalMoney: int(order.SalePrice), OrderTotalMoney: int(order.SalePrice),
OrderDiscountMoney: int(order.SalePrice - order.ActualPayPrice), OrderDiscountMoney: int(order.SalePrice - order.ActualPayPrice),
OrderBuyerPayableMoney: int(order.ActualPayPrice),
// DeliveryPackageWeight: float64(order.Weight) / 1000, // DeliveryPackageWeight: float64(order.Weight) / 1000,
} }
if order.VendorID == model.VendorIDELM { if order.VendorID == model.VendorIDELM {