aa
This commit is contained in:
@@ -429,12 +429,7 @@ func RefreshStoreManageState(ctx *jxcontext.Context) {
|
||||
createList = append(createList, v)
|
||||
}
|
||||
}
|
||||
task2 := tasksch.NewParallelTask("GetStoreManageState2", tasksch.NewParallelConfig().SetParallelCount(50).SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
step := batchItemList[0].(int)
|
||||
switch step {
|
||||
case 0:
|
||||
task3 := tasksch.NewParallelTask("deleteList", tasksch.NewParallelConfig().SetParallelCount(50).SetIsContinueWhenError(true), ctx,
|
||||
task2 := tasksch.NewParallelTask("deleteList", tasksch.NewParallelConfig().SetParallelCount(50).SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
storeID := batchItemList[0].(int)
|
||||
storeManage := &model.StoreManageState{
|
||||
@@ -444,9 +439,8 @@ func RefreshStoreManageState(ctx *jxcontext.Context) {
|
||||
dao.DeleteEntity(db, storeManage, "StoreID", "VendorID")
|
||||
return retVal, err
|
||||
}, deleteList)
|
||||
tasksch.HandleTask(task3, nil, true).Run()
|
||||
task3.GetResult(0)
|
||||
case 1:
|
||||
tasksch.HandleTask(task2, task, true).Run()
|
||||
task2.GetResult(0)
|
||||
task3 := tasksch.NewParallelTask("createList", tasksch.NewParallelConfig().SetParallelCount(50).SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
storeMap := batchItemList[0].(*model.StoreMap)
|
||||
@@ -458,10 +452,9 @@ func RefreshStoreManageState(ctx *jxcontext.Context) {
|
||||
dao.UpdateEntity(db, storeManage)
|
||||
return retVal, err
|
||||
}, createList)
|
||||
tasksch.HandleTask(task3, nil, true).Run()
|
||||
tasksch.HandleTask(task3, task, true).Run()
|
||||
task3.GetResult(0)
|
||||
case 2:
|
||||
task3 := tasksch.NewParallelTask("updateList", tasksch.NewParallelConfig().SetParallelCount(50).SetIsContinueWhenError(true), ctx,
|
||||
task4 := tasksch.NewParallelTask("updateList", tasksch.NewParallelConfig().SetParallelCount(50).SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
storeMap := batchItemList[0].(*model.StoreMap)
|
||||
if storeMap.VendorOrgCode == "" || storeMap.VendorStoreID == "" {
|
||||
@@ -472,13 +465,8 @@ func RefreshStoreManageState(ctx *jxcontext.Context) {
|
||||
dao.CreateEntity(db, storeManage)
|
||||
return retVal, err
|
||||
}, updateList)
|
||||
tasksch.HandleTask(task3, nil, true).Run()
|
||||
task3.GetResult(0)
|
||||
}
|
||||
return retVal, err
|
||||
}, []int{0, 1, 2})
|
||||
tasksch.HandleTask(task2, nil, true).Run()
|
||||
task2.GetResult(0)
|
||||
tasksch.HandleTask(task4, task, true).Run()
|
||||
task4.GetResult(0)
|
||||
return retVal, err
|
||||
}, vendorIDs)
|
||||
tasksch.HandleTask(task, nil, true).Run()
|
||||
|
||||
Reference in New Issue
Block a user