diff --git a/business/jxstore/cms/system_store_sku.go b/business/jxstore/cms/system_store_sku.go index 2b0af56e7..92ac542a0 100644 --- a/business/jxstore/cms/system_store_sku.go +++ b/business/jxstore/cms/system_store_sku.go @@ -230,7 +230,7 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA } globals.SugarLogger.Debugf("==============i: %d len: %d", i, len(fromFoodList)) if len(fromFoodList) < 100 { - break + return nil, nil } i++ } @@ -261,9 +261,9 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi } skus := make([]interface{}, 0) - for k, v := range storeSku.SkuList { + for _, v := range storeSku.SkuList { if v.SkuId == "" { - v.SkuId = utils.Int64ToStr(time.Now().UnixNano() + int64(k)) + v.SkuId = storeSku.AppFoodCode } mapSkuList := utils.Struct2MapByJson(v) if v.BoxNum == "" { @@ -301,6 +301,7 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi foodData["picture_contents"] = storeSku.PictureContents foodData["sequence"] = storeSku.Sequence foodData["tag_id"] = storeSku.TagID + foodData["upc"] = "no_upc" foodDataList[i] = foodData }