Commit f3c2f851 authored by cq990612's avatar cq990612

优化代码结构

parent c3a91864
...@@ -215,6 +215,7 @@ public class WorkUserServiceImpl implements WorkUserService { ...@@ -215,6 +215,7 @@ public class WorkUserServiceImpl implements WorkUserService {
if (CollectionUtils.isEmpty(roleIds)) { if (CollectionUtils.isEmpty(roleIds)) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.CHOOSEATLEASTONEROLE); throw new BaseCustomException(BASE_RESP_CODE_ENUM.CHOOSEATLEASTONEROLE);
} }
// 判断设置的权限是否重复
if (UserRoleLevelUtils.roleIsRepeat(roleIds)) { if (UserRoleLevelUtils.roleIsRepeat(roleIds)) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.DUPLICATEROLEPERMISSIONS); throw new BaseCustomException(BASE_RESP_CODE_ENUM.DUPLICATEROLEPERMISSIONS);
} }
...@@ -238,7 +239,6 @@ public class WorkUserServiceImpl implements WorkUserService { ...@@ -238,7 +239,6 @@ public class WorkUserServiceImpl implements WorkUserService {
// 部门经理 // 部门经理
if (2 == role) { if (2 == role) {
workDeptService.updateManagerIdISNullById(workDept.getId()); workDeptService.updateManagerIdISNullById(workDept.getId());
System.out.println("部门经理被我设置为空了");
DeptUpdateIndex++; DeptUpdateIndex++;
} }
// 中心管理 // 中心管理
...@@ -282,13 +282,13 @@ public class WorkUserServiceImpl implements WorkUserService { ...@@ -282,13 +282,13 @@ public class WorkUserServiceImpl implements WorkUserService {
workCentreService.updateById(centre); workCentreService.updateById(centre);
} }
} }
if (null != status && status == 0 && !CollectionUtils.isEmpty(roleIds)) { /* if (null != status && status == 0 && !CollectionUtils.isEmpty(roleIds)) {
if (roleIds.size() == 1 && roleIds.get(0).equals(0)) { if (roleIds.size() == 1 && roleIds.get(0).equals(0)) {
}else{ }else{
throw new BaseCustomException(BASE_RESP_CODE_ENUM.PLEASE_CANCELTHE_MANAGEMENTROLE); throw new BaseCustomException(BASE_RESP_CODE_ENUM.PLEASE_CANCELTHE_MANAGEMENTROLE);
} }
} }*/
workUserRoleMapper.insertBatch(userId, roleIds); workUserRoleMapper.insertBatch(userId, roleIds);
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment