From 32b50de6b9c1b0862a6844c16e735fd58cfc0b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 20 Aug 2025 18:15:40 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/system_store_sku.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/system_store_sku.go b/business/jxstore/cms/system_store_sku.go index aa0336ffc..03872bbb7 100644 --- a/business/jxstore/cms/system_store_sku.go +++ b/business/jxstore/cms/system_store_sku.go @@ -302,6 +302,7 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, offset int) ([]*mtwmapi.AppFoodResult, error) { errList := make([]*mtwmapi.AppFoodResult, 0, 0) foodDataList := make([]map[string]interface{}, len(fromSku)) + nameList := make(map[string]string, len(fromSku)) //apiObj := apimanager.CurAPIManager.GetAPI(model.VendorIDJD, "320406").(*jdapi.API) for k, storeSku := range fromSku { @@ -309,7 +310,7 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi if storeSku.AppFoodCode != "" { foodData[mtwmapi.KeyAppFoodCode] = storeSku.AppFoodCode } else { - foodData[mtwmapi.KeyAppFoodCode] = time.Now().UnixNano() + int64(k*3) + foodData[mtwmapi.KeyAppFoodCode] = utils.Int64ToStr(time.Now().UnixNano() + int64(k*3)) } skus := make([]interface{}, 0) @@ -404,6 +405,7 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi } foodDataList[k] = foodData + nameList[foodData[mtwmapi.KeyAppFoodCode].(string)] = foodData["name"].(string) } count := len(foodDataList) / 10 @@ -414,14 +416,22 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi if i == count-1 { failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:]) if len(failedFoodList) != 0 { - globals.SugarLogger.Debugf("failedFoodList := %s", utils.Format4Output(failedFoodList, false)) errList = append(errList, failedFoodList...) + for _, ffl := range failedFoodList { + if nameList[ffl.AppFoodCode] != "" { + globals.SugarLogger.Debugf("name := %s", nameList[ffl.AppFoodCode]) + } + } } } else { failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:(i+1)*10]) if len(failedFoodList) != 0 { - globals.SugarLogger.Debugf("failedFoodList := %s", utils.Format4Output(failedFoodList, false)) errList = append(errList, failedFoodList...) + for _, ffl := range failedFoodList { + if nameList[ffl.AppFoodCode] != "" { + globals.SugarLogger.Debugf("name := %s", nameList[ffl.AppFoodCode]) + } + } } } }