同步京东商城修改测试
This commit is contained in:
@@ -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) {
|
func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, storeMap *model.StoreMap, isAsync, isContinueWhenError bool) (err error) {
|
||||||
var (
|
var (
|
||||||
mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||||
skusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
skusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||||
updateList []*dao.StoreSkuSyncInfo
|
updateList []*dao.StoreSkuSyncInfo
|
||||||
addList []*dao.StoreSkuSyncInfo
|
addList []*dao.StoreSkuSyncInfo
|
||||||
skuBindInfos1 []*StoreSkuBindInfo
|
// skuBindInfos1 []*StoreSkuBindInfo
|
||||||
skuBindInfos2 []*StoreSkuBindInfo
|
// skuBindInfos2 []*StoreSkuBindInfo
|
||||||
)
|
)
|
||||||
storeSkusMain, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, 0)
|
storeSkusMain, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, 0)
|
||||||
for _, v := range storeSkusMain {
|
for _, v := range storeSkusMain {
|
||||||
@@ -1149,19 +1149,21 @@ func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(updateList) > 0 {
|
fmt.Println("updateList", utils.Format4Output(updateList, false))
|
||||||
for _, v := range updateList {
|
fmt.Println("addList", utils.Format4Output(addList, false))
|
||||||
skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false))
|
// if len(updateList) > 0 {
|
||||||
}
|
// for _, v := range updateList {
|
||||||
_, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false)
|
// skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false))
|
||||||
}
|
// }
|
||||||
|
// _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false)
|
||||||
|
// }
|
||||||
|
|
||||||
if len(addList) > 0 {
|
// if len(addList) > 0 {
|
||||||
for _, v := range addList {
|
// for _, v := range addList {
|
||||||
skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true))
|
// skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true))
|
||||||
}
|
// }
|
||||||
_, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false)
|
// _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false)
|
||||||
}
|
// }
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user