This commit is contained in:
邹宗楠
2025-02-26 17:00:44 +08:00
parent a650d94aaf
commit acf7aac451

View File

@@ -268,7 +268,6 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
order.InvoiceEmail += "(电子发票)"
default: // 不需要或者错误
}
globals.SugarLogger.Debugf("----------------3")
finishTime := getTimeFromInterface(orderMap["finished_time"])
if finishTime == utils.ZeroTimeValue {
@@ -287,7 +286,6 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
if order.StoreID > math.MaxInt32 {
order.StoreID = 0
}
globals.SugarLogger.Debugf("----------------4")
order.Status = p.getStatusFromVendorStatus(order.VendorStatus)
if order.Status >= model.OrderStatusEndBegin {
order.OrderFinishedAt = time.Now()
@@ -301,7 +299,6 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
}
}
globals.SugarLogger.Debugf("----------------5")
deliveryGeo := userMap["coord_amap"].(map[string]interface{})
originalLng := utils.Interface2Float64WithDefault(deliveryGeo["longitude"], 0.0) // 饿百的订单在过一段时间后,经纬度信息会变成字符串"**"
originalLat := utils.Interface2Float64WithDefault(deliveryGeo["latitude"], 0.0)
@@ -319,8 +316,10 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
for _, product2 := range products {
product := product2.(map[string]interface{})
skuName := product["product_name"].(string)
globals.SugarLogger.Debugf("----------------6.1")
_, _, _, specUnit, _, specQuality := jxutils.SplitSkuName(skuName)
productAmount := int(utils.MustInterface2Int64(product["product_amount"]))
globals.SugarLogger.Debugf("----------------6.2")
sku := &model.OrderSku{
VendorOrderID: order.VendorOrderID,
VendorID: model.VendorIDEBAI,
@@ -334,6 +333,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
if shelfPosition, ok := product["shelf_position"]; ok {
sku.LocationCode = shelfPosition.(string)
}
globals.SugarLogger.Debugf("----------------6.3")
if sku.SkuID == 0 {
if product["upc"] != nil {
sku.SkuID = utils.Str2Int(strings.Split(product["upc"].(string), "-")[1])
@@ -344,12 +344,14 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
}
}
}
globals.SugarLogger.Debugf("----------------6.4")
var baiduRate int64
sku.SalePrice, baiduRate, sku.StoreSubName = getSkuSalePrice(product)
order.PmSubsidyMoney += baiduRate
if sku.Weight == 0 {
sku.Weight = jxutils.FormatSkuWeight(specQuality, specUnit) // 订单信息里没有重量,只有名字里尝试找
}
globals.SugarLogger.Debugf("----------------6.5")
// if product["isGift"].(bool) {
// sku.SkuType = 1
// }