diff --git a/business/jxstore/cms/system_store_sku.go b/business/jxstore/cms/system_store_sku.go index e16bba1f8..2b0af56e7 100644 --- a/business/jxstore/cms/system_store_sku.go +++ b/business/jxstore/cms/system_store_sku.go @@ -228,7 +228,7 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA if err = BatchInitSkuMT2MT(ctx, fromFoodList, toApi, toStore.VendorStoreID, i); err != nil { globals.SugarLogger.Debugf("BatchInitData : %s", utils.Format4Output(err, false)) } - globals.SugarLogger.Debugf("==============i: %d len: %s", i, len(fromFoodList)) + globals.SugarLogger.Debugf("==============i: %d len: %d", i, len(fromFoodList)) if len(fromFoodList) < 100 { break } @@ -261,7 +261,10 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi } skus := make([]interface{}, 0) - for _, v := range storeSku.SkuList { + for k, v := range storeSku.SkuList { + if v.SkuId == "" { + v.SkuId = utils.Int64ToStr(time.Now().UnixNano() + int64(k)) + } mapSkuList := utils.Struct2MapByJson(v) if v.BoxNum == "" { delete(mapSkuList, "box_num")