1
This commit is contained in:
@@ -153,12 +153,12 @@ func BatchInitSkuEBai2EBai(ctx *jxcontext.Context, fromSku []*ebaiapi.SkuInfo, t
|
||||
// CopyMtToMT 美团商品复制到美团
|
||||
func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isAsync bool, offSet int) (hint string, err error) {
|
||||
fromAPI := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, fromStore.VendorOrgCode).(*mtwmapi.API)
|
||||
if fromStore.VendorOrgCode == globals.Mtwm2Code {
|
||||
if fromStore.VendorOrgCode == "5873" {
|
||||
fromAPI.SetToken(fromStore.MtwmToken)
|
||||
}
|
||||
|
||||
toAPI := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, toStore.VendorOrgCode).(*mtwmapi.API)
|
||||
if toStore.VendorOrgCode == globals.Mtwm2Code {
|
||||
if toStore.VendorOrgCode == "5873" {
|
||||
toAPI.SetToken(toStore.MtwmToken)
|
||||
}
|
||||
|
||||
@@ -202,22 +202,22 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA
|
||||
}
|
||||
|
||||
case 3:
|
||||
//i := offSet
|
||||
//for {
|
||||
// // 同步商品
|
||||
// fromFoodList, err1 := fromAPI.RetailListAll(fromStore.VendorStoreID, i)
|
||||
// if len(fromFoodList) == 0 || fromFoodList == nil {
|
||||
// return nil, fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i)
|
||||
// }
|
||||
//
|
||||
// if err = BatchInitSkuMT2MT(ctx, fromFoodList, toAPI, toStore.VendorStoreID, i); err != nil {
|
||||
// globals.SugarLogger.Debugf("BatchInitData : %s", utils.Format4Output(err, false))
|
||||
// }
|
||||
// if len(fromFoodList) < 100 {
|
||||
// break
|
||||
// }
|
||||
// i++
|
||||
//}
|
||||
i := offSet
|
||||
for {
|
||||
// 同步商品
|
||||
fromFoodList, err1 := fromAPI.RetailListAll(fromStore.VendorStoreID, i)
|
||||
if len(fromFoodList) == 0 || fromFoodList == nil {
|
||||
return nil, fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i)
|
||||
}
|
||||
|
||||
if err = BatchInitSkuMT2MT(ctx, fromFoodList, toAPI, toStore.VendorStoreID, i); err != nil {
|
||||
globals.SugarLogger.Debugf("BatchInitData : %s", utils.Format4Output(err, false))
|
||||
}
|
||||
if len(fromFoodList) < 100 {
|
||||
break
|
||||
}
|
||||
i++
|
||||
}
|
||||
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user