aa
This commit is contained in:
@@ -4098,9 +4098,9 @@ func RefreshStoreBind(ctx *jxcontext.Context) (err error) {
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
store := batchItemList[0].(*model.Store)
|
||||
var (
|
||||
userIDmap1 = make(map[string]string)
|
||||
userIDmap2 = make(map[string]string)
|
||||
mobileList, userIDs []string
|
||||
userIDmap1 = make(map[string]string)
|
||||
userIDmap2 = make(map[string]string)
|
||||
mobileList, userIDsAdd, userIDsDel []string
|
||||
)
|
||||
// userList := getAllUsers4Store(ctx, db, store)
|
||||
if store.Tel1 != "" {
|
||||
@@ -4121,6 +4121,7 @@ func RefreshStoreBind(ctx *jxcontext.Context) (err error) {
|
||||
if store.OperatorPhone3 != "" {
|
||||
mobileList = append(mobileList, store.OperatorPhone3)
|
||||
}
|
||||
mobileList = append(mobileList, "18160030913", "15520595380", "18980410281", "18048531223", "18080188338", "13012345678")
|
||||
for _, v := range mobileList {
|
||||
if user, err := dao.GetUserByID(db, "mobile", v); err == nil && user != nil {
|
||||
userIDmap1[user.UserID] = user.UserID
|
||||
@@ -4129,13 +4130,17 @@ func RefreshStoreBind(ctx *jxcontext.Context) (err error) {
|
||||
nowUserIDs, _ := GetRoleUserList(ctx, autils.NewRole(authz.StoreRoleBoss, store.ID))
|
||||
for _, v := range nowUserIDs {
|
||||
userIDmap2[v] = v
|
||||
if userIDmap1[v] == "" {
|
||||
userIDsDel = append(userIDsDel, v)
|
||||
}
|
||||
}
|
||||
for _, v := range userIDmap1 {
|
||||
if userIDmap2[v] == "" {
|
||||
userIDs = append(userIDs, v)
|
||||
userIDsAdd = append(userIDsAdd, v)
|
||||
}
|
||||
}
|
||||
AddUsers4Role(ctx, autils.NewRole(authz.StoreRoleBoss, store.ID), userIDs)
|
||||
AddUsers4Role(ctx, autils.NewRole(authz.StoreRoleBoss, store.ID), userIDsAdd)
|
||||
// DeleteUsers4Role(ctx, autils.NewRole(authz.StoreRoleBoss, store.ID), userIDsDel)
|
||||
return retVal, err
|
||||
}, stores)
|
||||
tasksch.HandleTask(task, nil, true).Run()
|
||||
|
||||
Reference in New Issue
Block a user