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