This commit is contained in:
邹宗楠
2025-02-26 16:56:55 +08:00
parent 4253fbcda7
commit a650d94aaf

View File

@@ -260,9 +260,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
VendorOrgCode: utils.Interface2String(result["source"]),
}
globals.SugarLogger.Debugf("----------------1")
invoiceType, _ := utils.TryInterface2Int64(orderMap["invoice_type"])
globals.SugarLogger.Debugf("----------------2")
switch invoiceType {
case 2: // 纸质发票
order.InvoiceEmail += "(纸质发票)"
@@ -289,6 +287,7 @@ 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()
@@ -302,6 +301,7 @@ 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)
@@ -315,6 +315,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
order.ConsigneeLat = jxutils.StandardCoordinate2Int(originalLat)
products := result["products"].([]interface{})[0].([]interface{})
globals.SugarLogger.Debugf("----------------6")
for _, product2 := range products {
product := product2.(map[string]interface{})
skuName := product["product_name"].(string)
@@ -354,6 +355,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
// }
order.Skus = append(order.Skus, sku)
}
globals.SugarLogger.Debugf("----------------7")
giftSkus, discountMoney := getZengSkus(vendorOrderID, orderData)
order.DiscountMoney = discountMoney
order.Skus = append(order.Skus, giftSkus...)
@@ -362,6 +364,7 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
order.PackagePrice = store.PackageSetting
jxutils.RefreshOrderSkuRelated(order)
globals.SugarLogger.Debugf("----------------8")
return order
}