1
This commit is contained in:
@@ -245,7 +245,7 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA
|
|||||||
// BatchInitSkuMT2MT 批量创建商品
|
// BatchInitSkuMT2MT 批量创建商品
|
||||||
func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, i int) error {
|
func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, i int) error {
|
||||||
foodDataList := make([]map[string]interface{}, len(fromSku))
|
foodDataList := make([]map[string]interface{}, len(fromSku))
|
||||||
for i, storeSku := range fromSku {
|
for _, storeSku := range fromSku {
|
||||||
foodData := make(map[string]interface{})
|
foodData := make(map[string]interface{})
|
||||||
if storeSku.AppFoodCode != "" {
|
if storeSku.AppFoodCode != "" {
|
||||||
foodData[mtwmapi.KeyAppFoodCode] = storeSku.AppFoodCode
|
foodData[mtwmapi.KeyAppFoodCode] = storeSku.AppFoodCode
|
||||||
@@ -294,7 +294,10 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
|
|||||||
foodData["picture_contents"] = storeSku.PictureContents
|
foodData["picture_contents"] = storeSku.PictureContents
|
||||||
foodData["sequence"] = storeSku.Sequence
|
foodData["sequence"] = storeSku.Sequence
|
||||||
foodData["tag_id"] = storeSku.TagID
|
foodData["tag_id"] = storeSku.TagID
|
||||||
foodData["upc"] = "no_upc"
|
foodData["upc"] = storeSku.UpcCode
|
||||||
|
if storeSku.UpcCode == "" {
|
||||||
|
foodData["upc"] = "no_upc"
|
||||||
|
}
|
||||||
|
|
||||||
foodDataList[i] = foodData
|
foodDataList[i] = foodData
|
||||||
}
|
}
|
||||||
@@ -303,6 +306,7 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
|
|||||||
if len(foodDataList)%10 != 0 {
|
if len(foodDataList)%10 != 0 {
|
||||||
count += 1
|
count += 1
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("===============data := %s", utils.Format4Output(foodDataList, false))
|
||||||
for i := 0; i < count; i++ {
|
for i := 0; i < count; i++ {
|
||||||
if i == count-1 {
|
if i == count-1 {
|
||||||
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:])
|
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:])
|
||||||
|
|||||||
Reference in New Issue
Block a user