aa
This commit is contained in:
@@ -2,6 +2,7 @@ package permission
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -94,7 +95,9 @@ func GetRole(ctx *jxcontext.Context, name string) (roles []*model.Role, err erro
|
|||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
)
|
)
|
||||||
roles, err = dao.GetRole(db, name, "")
|
roles, err = dao.GetRole(db, name, "")
|
||||||
for _, v := range roles {
|
task := tasksch.NewParallelTask("GetRole", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||||
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
|
v := batchItemList[0].(*model.Role)
|
||||||
if v.CityCodes != "" {
|
if v.CityCodes != "" {
|
||||||
if cityInfos, err := dao.GetPlaces(db, jxutils.StrListToIntList(strings.Split(v.CityCodes, ","))); err == nil {
|
if cityInfos, err := dao.GetPlaces(db, jxutils.StrListToIntList(strings.Split(v.CityCodes, ","))); err == nil {
|
||||||
v.CityInfo = cityInfos
|
v.CityInfo = cityInfos
|
||||||
@@ -105,7 +108,10 @@ func GetRole(ctx *jxcontext.Context, name string) (roles []*model.Role, err erro
|
|||||||
v.Stores = stores
|
v.Stores = stores
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return retVal, err
|
||||||
|
}, roles)
|
||||||
|
tasksch.HandleTask(task, nil, false).Run()
|
||||||
|
task.GetResult(0)
|
||||||
return roles, err
|
return roles, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user