This commit is contained in:
邹宗楠
2024-12-04 14:11:47 +08:00
parent 2c7dd39195
commit a4d92205fd
7 changed files with 67 additions and 54 deletions

View File

@@ -316,6 +316,9 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
Weight: int(utils.Interface2Int64WithDefault(product["total_weight"], 0)) / productAmount,
VendorPrice: utils.MustInterface2Int64(product["product_price"]),
}
if shelfPosition, ok := product["shelf_position"]; ok {
sku.LocationCode = shelfPosition.(string)
}
var baiduRate int64
sku.SalePrice, baiduRate, sku.StoreSubName = getSkuSalePrice(product)
order.PmSubsidyMoney += baiduRate

View File

@@ -524,6 +524,12 @@ func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate, isE
if isCreate /*storeSku.SkuSyncStatus&(model.SyncFlagPriceMask| model.SyncFlagNewMask) != 0 */ {
params["sale_price"] = storeSku.VendorPrice
}
if storeSku.LocationCode != "" {
params["shelf_number"] = storeSku.LocationCode
}
if storeSku.LocationCode == "EMPTY_VALUE" { // EMPTY_VALUE 美团置空
params["shelf_number"] = ""
}
if storeSku.SkuSyncStatus&(model.SyncFlagSaleMask|model.SyncFlagNewMask) != 0 {
params["status"] = jxSkuStatus2Ebai(storeSku.MergedStatus)
}
@@ -539,6 +545,7 @@ func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate, isE
if storeSku.MinOrderCount == 0 {
params["minimum"] = utils.Int2Float64(1)
}
return params
}

View File

@@ -435,6 +435,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
if storeSku.Upc != "" {
skus[0]["upc"] = storeSku.Upc
}
if storeSku.LocationCode != "" {
skus[0]["location_code"] = storeSku.LocationCode
}
//skus[0]["ladder_box_num"] = "0"
//skus[0]["ladder_box_price"] = "0"
// 下面这个两个和上面有点重复,但是上面两个在更新的时候美团不识别,不知道创建的时候会不会覆盖一下吧(更新只能用下面这个)