From 33fe05ab46f342e49358255cfa13451a7c764ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 26 Oct 2023 09:44:41 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/system_store_sku.go | 40 ++---------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/business/jxstore/cms/system_store_sku.go b/business/jxstore/cms/system_store_sku.go index 9d32fe27d..1bec2eaee 100644 --- a/business/jxstore/cms/system_store_sku.go +++ b/business/jxstore/cms/system_store_sku.go @@ -188,10 +188,7 @@ func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mt foodData["min_order_count"] = storeSku.MinOrderCount foodData["unit"] = storeSku.Unit //todo 增加商品必填属性 - //attr := mtwm.SwitchAttr(toApi, vendorStoreID, int64(storeSku.TagID), 0, storeSku.Name) - //if attr != "" { foodData["common_attr_value"] = storeSku.CommonAttrValue - //} if storeSku.SecondaryCategoryCode != "" { foodData["category_code"] = storeSku.SecondaryCategoryCode } else { @@ -212,29 +209,6 @@ func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mt foodData["sequence"] = storeSku.Sequence foodData["tag_id"] = storeSku.TagID - //skusAttr := make([]*Skus, 0, 0) - //if err := json.Unmarshal([]byte(storeSku.Skus), &skusAttr); err != nil { - // return err - //} - ////skus2 := make([]*Skus, 0, 0) - //for i2 := 0; i2 < len(skusAttr); i2++ { - // if skusAttr[i2].Weight != "" && skusAttr[i2].WeightForUnit != "" { - // skusAttr[i2].WeightForUnit = "" - // } - // //skus2 = append(skus2, skusAttr[i2]) - // skus[0]["spec"] = skusAttr[i2].Spec - // skus[0]["price"] = skusAttr[i2].Price - // skus[0]["stock"] = skusAttr[i2].Stock - // if skusAttr[i2].Upc != "" { - // skus[0]["upc"] = skusAttr[i2].Upc - // } - // skus[0]["ladder_box_num"] = skusAttr[i2].LadderBoxNum - // skus[0]["ladder_box_price"] = skusAttr[i2].BoxPrice - // if foodData["tag_id"] != nil { - // skus[0]["weight"] = skusAttr[i2].Weight // weight字段仅限服饰鞋帽、美妆、日用品、母婴、生鲜果蔬、生活超市下的便利店/超市门店品类的商家使用 - // } - // break - //} foodDataList[i] = foodData } @@ -244,23 +218,13 @@ func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mt } for i := 0; i < count; i++ { if i == count-1 { - failedFoodList, err2 := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:]) - if err2 != nil { - globals.SugarLogger.Debugf("RetailBatchInitData err3 :%v", err2) - globals.SugarLogger.Debugf("RetailBatchInitData1 failedFoodList :%s", utils.Format4Output(failedFoodList, false)) - } + failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:]) if len(failedFoodList) != 0 { - globals.SugarLogger.Debugf("RetailBatchInitData err4 :%s", utils.Format4Output(failedFoodList, false)) globals.SugarLogger.Debugf("RetailBatchInitData2 failedFoodList :%s", utils.Format4Output(failedFoodList, false)) } } else { - failedFoodList, err2 := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:(i+1)*10]) - if err2 != nil { - globals.SugarLogger.Debugf("RetailBatchInitData err3 :%v", err2) - globals.SugarLogger.Debugf("RetailBatchInitData3 failedFoodList :%s", utils.Format4Output(failedFoodList, false)) - } + failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:(i+1)*10]) if len(failedFoodList) != 0 { - globals.SugarLogger.Debugf("RetailBatchInitData err4 :%s", utils.Format4Output(failedFoodList, false)) globals.SugarLogger.Debugf("RetailBatchInitData4 failedFoodList :%s", utils.Format4Output(failedFoodList, false)) } }