This commit is contained in:
邹宗楠
2024-04-22 17:46:16 +08:00
parent cc8580c226
commit 32c2e1e7b9
4 changed files with 17 additions and 18 deletions

View File

@@ -281,8 +281,8 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA
}
// BatchInitSkuMT2MT 批量创建商品
func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, offset int) (errList []*mtwmapi.AppFoodResult, err error) {
errList = make([]*mtwmapi.AppFoodResult, 0, 0)
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))
for k, storeSku := range fromSku {
foodData := make(map[string]interface{})
@@ -363,11 +363,13 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:])
if len(failedFoodList) != 0 {
errList = append(errList, failedFoodList...)
globals.SugarLogger.Debugf("failedFoodList := %s", utils.Format4Output(failedFoodList, false))
}
} else {
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:(i+1)*10])
if len(failedFoodList) != 0 {
errList = append(errList, failedFoodList...)
globals.SugarLogger.Debugf("failedFoodList := %s", utils.Format4Output(failedFoodList, false))
}
}