- 晚上定时同步时强制同步价格与可售状态
This commit is contained in:
@@ -392,15 +392,15 @@ func (v *VendorSync) SyncStoresCategory(ctx *jxcontext.Context, db *dao.DaoDB, v
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, skuIDs []int, isForce, isAsync, isContinueWhenError bool) (hint string, err error) {
|
func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, skuIDs []int, setSyncStatus int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
globals.SugarLogger.Debug("SyncStoresSkus")
|
globals.SugarLogger.Debug("SyncStoresSkus2")
|
||||||
isManageIt := isAsync || len(storeIDs) != 1 || len(skuIDs) == 0 || len(skuIDs) > 8
|
isManageIt := isAsync || len(storeIDs) != 1 || len(skuIDs) == 0 || len(skuIDs) > 8
|
||||||
task, hint, err := v.LoopStoresMap2(ctx, db, fmt.Sprintf("同步门店商品信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs,
|
task, hint, err := v.LoopStoresMap2(ctx, db, fmt.Sprintf("同步门店商品信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs,
|
||||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||||
if handler := v.GetStoreHandler(loopMapInfo.VendorID); handler != nil {
|
if handler := v.GetStoreHandler(loopMapInfo.VendorID); handler != nil {
|
||||||
if isForce {
|
if setSyncStatus != 0 {
|
||||||
dao.SetStoreSkuSyncStatus(db, loopMapInfo.VendorID, storeIDs, skuIDs, model.SyncFlagStoreSkuModifiedMask)
|
dao.SetStoreSkuSyncStatus(db, loopMapInfo.VendorID, storeIDs, skuIDs, setSyncStatus)
|
||||||
}
|
}
|
||||||
parallelCount := 5
|
parallelCount := 5
|
||||||
if model.MultiStoresVendorMap[loopMapInfo.VendorID] == 1 {
|
if model.MultiStoresVendorMap[loopMapInfo.VendorID] == 1 {
|
||||||
@@ -411,7 +411,7 @@ func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendo
|
|||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
storeMap := batchItemList[0].(*model.StoreMap)
|
storeMap := batchItemList[0].(*model.StoreMap)
|
||||||
if _, err = v.proxySyncStoreSku(ctx, task, storeMap, nil, skuIDs, false, isContinueWhenError); err != nil {
|
if _, err = v.proxySyncStoreSku(ctx, task, storeMap, nil, skuIDs, false, isContinueWhenError); err != nil {
|
||||||
globals.SugarLogger.Debugf("SyncStoresSkus failed2 store:%d failed with error:%v", storeMap.StoreID, err)
|
globals.SugarLogger.Debugf("SyncStoresSkus2 failed2 store:%d failed with error:%v", storeMap.StoreID, err)
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}, loopMapInfo.StoreMapList)
|
}, loopMapInfo.StoreMapList)
|
||||||
@@ -438,6 +438,14 @@ func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendo
|
|||||||
return hint, err
|
return hint, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, skuIDs []int, isForce, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
|
setSyncStatus := 0
|
||||||
|
if isForce {
|
||||||
|
setSyncStatus = model.SyncFlagStoreSkuModifiedMask
|
||||||
|
}
|
||||||
|
return v.SyncStoresSkus2(ctx, db, vendorIDs, storeIDs, skuIDs, setSyncStatus, isAsync, isContinueWhenError)
|
||||||
|
}
|
||||||
|
|
||||||
func isUseOldSyncLogic(storeMap *model.StoreMap) bool {
|
func isUseOldSyncLogic(storeMap *model.StoreMap) bool {
|
||||||
return false
|
return false
|
||||||
return globals.IsProductEnv() && storeMap.StoreID != 102652 // 绿城四季鲜店
|
return globals.IsProductEnv() && storeMap.StoreID != 102652 // 绿城四季鲜店
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ func doDailyWork() {
|
|||||||
// cms.CurVendorSync.FullSyncStoresSkus(jxcontext.AdminCtx, dao.GetDB(), []int{model.VendorIDJD}, nil, true, true)
|
// cms.CurVendorSync.FullSyncStoresSkus(jxcontext.AdminCtx, dao.GetDB(), []int{model.VendorIDJD}, nil, true, true)
|
||||||
|
|
||||||
SaveImportantTaskID(TaskNameSyncStoreSku, SpecialTaskID)
|
SaveImportantTaskID(TaskNameSyncStoreSku, SpecialTaskID)
|
||||||
taskID, _ := cms.CurVendorSync.SyncStoresSkus(jxcontext.AdminCtx, dao.GetDB(), []int{model.VendorIDJD, model.VendorIDEBAI, model.VendorIDMTWM}, nil, nil, false, true, true)
|
taskID, _ := cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, dao.GetDB(), []int{model.VendorIDJD, model.VendorIDEBAI, model.VendorIDMTWM}, nil, nil, model.SyncFlagSaleMask|model.SyncFlagPriceMask, true, true)
|
||||||
SaveImportantTaskID(TaskNameSyncStoreSku, taskID)
|
SaveImportantTaskID(TaskNameSyncStoreSku, taskID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user