...
|
...
|
@@ -58,7 +58,7 @@ func (l *SystemUpdateLogic) SystemUpdate(req *types.DepartmentUpdateRequest) (re |
|
|
// 获取公司下的所有用户
|
|
|
_, users, err := l.svcCtx.UserRepository.Find(l.ctx, conn, domain.NewQueryOptions().
|
|
|
WithFindOnly().
|
|
|
WithKV(" companyId", one.CompanyId))
|
|
|
WithKV("companyId", one.CompanyId))
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
...
|
...
|
@@ -83,7 +83,7 @@ func (l *SystemUpdateLogic) SystemUpdate(req *types.DepartmentUpdateRequest) (re |
|
|
if _, ok := newIdMap[user.Id]; ok {
|
|
|
var targetIndex = findIndex(user.Departments, req.Id)
|
|
|
if targetIndex == -1 { // 归属分组不存在,则新增
|
|
|
user.Departments = append(user.Departments)
|
|
|
user.Departments = append(user.Departments, req.Id)
|
|
|
_, err = l.svcCtx.UserRepository.UpdateWithVersion(l.ctx, conn, user)
|
|
|
if err != nil {
|
|
|
return err
|
...
|
...
|
|