diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 32f34ba0e..294716276 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -1105,12 +1105,12 @@ func (v *VendorSync) SyncJdsStoresSkus(ctx *jxcontext.Context, storeIDs []int, i func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, storeMap *model.StoreMap, isAsync, isContinueWhenError bool) (err error) { var ( - mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo) - skusMap = make(map[int][]*dao.StoreSkuSyncInfo) - updateList []*dao.StoreSkuSyncInfo - addList []*dao.StoreSkuSyncInfo - skuBindInfos1 []*StoreSkuBindInfo - skuBindInfos2 []*StoreSkuBindInfo + mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo) + skusMap = make(map[int][]*dao.StoreSkuSyncInfo) + updateList []*dao.StoreSkuSyncInfo + addList []*dao.StoreSkuSyncInfo + // skuBindInfos1 []*StoreSkuBindInfo + // skuBindInfos2 []*StoreSkuBindInfo ) storeSkusMain, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, 0) for _, v := range storeSkusMain { @@ -1149,19 +1149,21 @@ func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch } } } - if len(updateList) > 0 { - for _, v := range updateList { - skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false)) - } - _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false) - } + fmt.Println("updateList", utils.Format4Output(updateList, false)) + fmt.Println("addList", utils.Format4Output(addList, false)) + // if len(updateList) > 0 { + // for _, v := range updateList { + // skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false)) + // } + // _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false) + // } - if len(addList) > 0 { - for _, v := range addList { - skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true)) - } - _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false) - } + // if len(addList) > 0 { + // for _, v := range addList { + // skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true)) + // } + // _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false) + // } return err }