This commit is contained in:
邹宗楠
2022-06-02 17:22:31 +08:00
parent d520628837
commit c3d223ffc2
3 changed files with 5 additions and 6 deletions

View File

@@ -457,7 +457,6 @@ func (v *VendorSync) SyncSkus(ctx *jxcontext.Context, db *dao.DaoDB, nameIDs []i
// }
func (v *VendorSync) SyncStoresCategory(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, isForce, isAsync, isContinueWhenError bool) (hint string, err error) {
globals.SugarLogger.Debug("SyncStoresCategory")
isManageIt := len(storeIDs) != 1
hint, err = v.LoopStoresMap(ctx, db, fmt.Sprintf("同步门店分类信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs,
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {

View File

@@ -104,8 +104,9 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
catInfo.Seq = catInfo.StoreCatSeq
}
}
globals.SugarLogger.Debug("=================", catInfo.StoreCatName, catInfo.CatSyncStatus)
globals.SugarLogger.Debug("=================1111", catInfo.StoreCatName, catInfo.CatSyncStatus)
if model.IsSyncStatusDelete(catInfo.CatSyncStatus) { // 删除 4
globals.SugarLogger.Debug("=================刘磊删除", catInfo.StoreCatName, catInfo.ID)
if model.IsSyncStatusDelete(catInfo.CatSyncStatus) && !dao.IsVendorThingIDEmpty(catInfo.VendorCatID) {
err = handler.DeleteStoreCategory(ctx, storeID, vendorStoreID, catInfo.VendorCatID, level)
if err != nil && handler.IsErrCategoryNotExist(err) {
@@ -115,6 +116,7 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
}
}
} else if model.IsSyncStatusNew(catInfo.CatSyncStatus) { // 新增 2
globals.SugarLogger.Debug("=================刘磊新增", catInfo.StoreCatName, catInfo.ID)
err = handler.CreateStoreCategory(ctx, storeID, vendorStoreID, catInfo)
if err != nil && handler.IsErrCategoryExist(err) {
if cat, err2 := handler.GetStoreCategory(ctx, storeID, vendorStoreID, catInfo.Name); err2 == nil {
@@ -132,6 +134,7 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
// }
}
} else if model.IsSyncStatusUpdate(catInfo.CatSyncStatus) { // 修改 1
globals.SugarLogger.Debug("=================刘磊修改", catInfo.StoreCatName, catInfo.ID)
err = handler.UpdateStoreCategory(ctx, storeID, vendorStoreID, catInfo)
globals.SugarLogger.Debug("errrrr================", err)
if err == nil {

View File

@@ -182,11 +182,8 @@ func Init() {
ScheduleTimerFunc("RefreshStoreOperator", func() {
cms.UpdateStoreOperatorConfig()
}, []string{
"16:00:00", "16:10:00",
"04:00:00",
})
ScheduleTimerFuncByInterval(func() {
cms.UpdateStoreOperatorConfig()
}, 10*time.Second, 2*time.Minute)
ScheduleTimerFuncByInterval(func() {
defsch.FixedScheduler.ConfirmSelfTakeOrders(jxcontext.AdminCtx, []int{model.VendorIDJD}, time.Now().Add(-48*time.Hour), time.Now().Add(-30*time.Minute), true, true)