1
This commit is contained in:
@@ -188,10 +188,7 @@ func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mt
|
|||||||
foodData["min_order_count"] = storeSku.MinOrderCount
|
foodData["min_order_count"] = storeSku.MinOrderCount
|
||||||
foodData["unit"] = storeSku.Unit
|
foodData["unit"] = storeSku.Unit
|
||||||
//todo 增加商品必填属性
|
//todo 增加商品必填属性
|
||||||
//attr := mtwm.SwitchAttr(toApi, vendorStoreID, int64(storeSku.TagID), 0, storeSku.Name)
|
|
||||||
//if attr != "" {
|
|
||||||
foodData["common_attr_value"] = storeSku.CommonAttrValue
|
foodData["common_attr_value"] = storeSku.CommonAttrValue
|
||||||
//}
|
|
||||||
if storeSku.SecondaryCategoryCode != "" {
|
if storeSku.SecondaryCategoryCode != "" {
|
||||||
foodData["category_code"] = storeSku.SecondaryCategoryCode
|
foodData["category_code"] = storeSku.SecondaryCategoryCode
|
||||||
} else {
|
} else {
|
||||||
@@ -212,29 +209,6 @@ func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mt
|
|||||||
foodData["sequence"] = storeSku.Sequence
|
foodData["sequence"] = storeSku.Sequence
|
||||||
foodData["tag_id"] = storeSku.TagID
|
foodData["tag_id"] = storeSku.TagID
|
||||||
|
|
||||||
//skusAttr := make([]*Skus, 0, 0)
|
|
||||||
//if err := json.Unmarshal([]byte(storeSku.Skus), &skusAttr); err != nil {
|
|
||||||
// return err
|
|
||||||
//}
|
|
||||||
////skus2 := make([]*Skus, 0, 0)
|
|
||||||
//for i2 := 0; i2 < len(skusAttr); i2++ {
|
|
||||||
// if skusAttr[i2].Weight != "" && skusAttr[i2].WeightForUnit != "" {
|
|
||||||
// skusAttr[i2].WeightForUnit = ""
|
|
||||||
// }
|
|
||||||
// //skus2 = append(skus2, skusAttr[i2])
|
|
||||||
// skus[0]["spec"] = skusAttr[i2].Spec
|
|
||||||
// skus[0]["price"] = skusAttr[i2].Price
|
|
||||||
// skus[0]["stock"] = skusAttr[i2].Stock
|
|
||||||
// if skusAttr[i2].Upc != "" {
|
|
||||||
// skus[0]["upc"] = skusAttr[i2].Upc
|
|
||||||
// }
|
|
||||||
// skus[0]["ladder_box_num"] = skusAttr[i2].LadderBoxNum
|
|
||||||
// skus[0]["ladder_box_price"] = skusAttr[i2].BoxPrice
|
|
||||||
// if foodData["tag_id"] != nil {
|
|
||||||
// skus[0]["weight"] = skusAttr[i2].Weight // weight字段仅限服饰鞋帽、美妆、日用品、母婴、生鲜果蔬、生活超市下的便利店/超市门店品类的商家使用
|
|
||||||
// }
|
|
||||||
// break
|
|
||||||
//}
|
|
||||||
foodDataList[i] = foodData
|
foodDataList[i] = foodData
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,23 +218,13 @@ func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mt
|
|||||||
}
|
}
|
||||||
for i := 0; i < count; i++ {
|
for i := 0; i < count; i++ {
|
||||||
if i == count-1 {
|
if i == count-1 {
|
||||||
failedFoodList, err2 := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:])
|
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:])
|
||||||
if err2 != nil {
|
|
||||||
globals.SugarLogger.Debugf("RetailBatchInitData err3 :%v", err2)
|
|
||||||
globals.SugarLogger.Debugf("RetailBatchInitData1 failedFoodList :%s", utils.Format4Output(failedFoodList, false))
|
|
||||||
}
|
|
||||||
if len(failedFoodList) != 0 {
|
if len(failedFoodList) != 0 {
|
||||||
globals.SugarLogger.Debugf("RetailBatchInitData err4 :%s", utils.Format4Output(failedFoodList, false))
|
|
||||||
globals.SugarLogger.Debugf("RetailBatchInitData2 failedFoodList :%s", utils.Format4Output(failedFoodList, false))
|
globals.SugarLogger.Debugf("RetailBatchInitData2 failedFoodList :%s", utils.Format4Output(failedFoodList, false))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
failedFoodList, err2 := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:(i+1)*10])
|
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:(i+1)*10])
|
||||||
if err2 != nil {
|
|
||||||
globals.SugarLogger.Debugf("RetailBatchInitData err3 :%v", err2)
|
|
||||||
globals.SugarLogger.Debugf("RetailBatchInitData3 failedFoodList :%s", utils.Format4Output(failedFoodList, false))
|
|
||||||
}
|
|
||||||
if len(failedFoodList) != 0 {
|
if len(failedFoodList) != 0 {
|
||||||
globals.SugarLogger.Debugf("RetailBatchInitData err4 :%s", utils.Format4Output(failedFoodList, false))
|
|
||||||
globals.SugarLogger.Debugf("RetailBatchInitData4 failedFoodList :%s", utils.Format4Output(failedFoodList, false))
|
globals.SugarLogger.Debugf("RetailBatchInitData4 failedFoodList :%s", utils.Format4Output(failedFoodList, false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user