1
This commit is contained in:
@@ -1728,14 +1728,13 @@ func UpdateStoresSkus(ctx *jxcontext.Context, causeFlag int, storeIDs []int, sku
|
||||
if !flag {
|
||||
var num int64
|
||||
db := dao.GetDB()
|
||||
skuIDs, err := updateStoresSkusWithoutSync(ctx, db, storeIDs, skuBindInfos, isScale, isRefreshHigh)
|
||||
skuIDs, err := updateStoresSkusWithoutSync(ctx, db, storeIDs, skuBindInfos, isScale, isRefreshHigh) // 这个方法再通知京东创建商品
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
isAsync = asyncStoreSkuOpFilter(ctx, isAsync)
|
||||
num = int64(len(skuIDs))
|
||||
if num > 0 {
|
||||
globals.SugarLogger.Debug("====UpdateStoresSkus causeFlag[%d],vendorIds[%d],storeIDs[%s],skuIDs[%s],isForce[%s],isAsync[%s],isContinueWhenError[%s]", causeFlag, utils.Format4Output("", false), utils.Format4Output(storeIDs, false), utils.Format4Output(skuIDs, false), utils.Format4Output("false", false), utils.Format4Output(isAsync, false), utils.Format4Output(isContinueWhenError, false))
|
||||
if num > 0 { // 这个方法非京东的创建商品,京东的改为同步库存,上下架等!
|
||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, causeFlag, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
}
|
||||
if num == 0 || !isAsync || hint == "" {
|
||||
|
||||
@@ -202,6 +202,7 @@ func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFla
|
||||
|
||||
func FullSyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID, storeID int, vendorStoreID string, excludeSkuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
singleStoreHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||
globals.SugarLogger.Debugf("====singleStoreHandler==== %s", utils.Format4Output(singleStoreHandler, false))
|
||||
task := tasksch.NewParallelTask("FullSyncStoreSkuNew", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
step := batchItemList[0].(int)
|
||||
@@ -215,8 +216,10 @@ func FullSyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
||||
}
|
||||
case 1:
|
||||
if singleStoreHandler != nil {
|
||||
// 同步分类在同步商品
|
||||
_, err = SyncStoreSkuNew(ctx, task, 0, vendorID, storeID, vendorStoreID, "", nil, nil, excludeSkuIDs, false, isContinueWhenError)
|
||||
} else {
|
||||
// 直接同步商品
|
||||
err = syncStoreSkuNew(ctx, task, 0, true, vendorID, storeID, "", nil, nil, excludeSkuIDs, false, isContinueWhenError)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/panjf2000/ants"
|
||||
"io"
|
||||
"sync"
|
||||
@@ -39,9 +38,7 @@ func (c *SyncController) SyncStoresSkus() {
|
||||
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.SkuIDs, &skuIDs, params.VendorIDs, &vendorIDs); err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
globals.SugarLogger.Debug("====SyncStoresSkus causeFlag[%d],vendorIds[%d],storeIDs[%s],skuIDs[%s],isForce[%s],isAsync[%s],isContinueWhenError[%s]", 0, utils.Format4Output(vendorIDs, false), utils.Format4Output(storeIDs, false), utils.Format4Output(skuIDs, false), utils.Format4Output(params.IsForce, false), utils.Format4Output(params.IsAsync, false), utils.Format4Output(params.IsContinueWhenError, false))
|
||||
//retVal, err = cms.CurVendorSync.SyncStoresSkus(params.Ctx, nil, 0, db, vendorIDs, storeIDs, skuIDs, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||||
retVal, err = cms.CurVendorSync.SyncStoresSkus(params.Ctx, nil, 0, db, vendorIDs, storeIDs, skuIDs, false, false, false)
|
||||
retVal, err = cms.CurVendorSync.SyncStoresSkus(params.Ctx, nil, 0, db, vendorIDs, storeIDs, skuIDs, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user