1
This commit is contained in:
@@ -212,6 +212,7 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA
|
||||
//}
|
||||
case 2:
|
||||
i := offSet
|
||||
errList := make([]string, 0, 0)
|
||||
for {
|
||||
// 同步商品
|
||||
fromFoodList, err1 := fromApi.RetailListAll(fromStore.VendorStoreID, i)
|
||||
@@ -220,10 +221,12 @@ 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))
|
||||
errs := utils.Format4Output(err, false)
|
||||
errList = append(errList, errs)
|
||||
}
|
||||
globals.SugarLogger.Debugf("==============i: %d len: %d", i, len(fromFoodList))
|
||||
if len(fromFoodList) < 100 {
|
||||
globals.SugarLogger.Debugf("BatchInitData : %s", utils.Format4Output(errList, false))
|
||||
return nil, nil
|
||||
}
|
||||
i++
|
||||
@@ -309,6 +312,7 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
|
||||
if len(foodDataList)%10 != 0 {
|
||||
count += 1
|
||||
}
|
||||
globals.SugarLogger.Debugf("=====data := %s", utils.Format4Output(foodDataList, false))
|
||||
for i := 0; i < count; i++ {
|
||||
if i == count-1 {
|
||||
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:])
|
||||
|
||||
Reference in New Issue
Block a user