Commit f3c2f851 authored by cq990612's avatar cq990612

优化代码结构

parent c3a91864
......@@ -215,6 +215,7 @@ public class WorkUserServiceImpl implements WorkUserService {
if (CollectionUtils.isEmpty(roleIds)) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.CHOOSEATLEASTONEROLE);
}
// 判断设置的权限是否重复
if (UserRoleLevelUtils.roleIsRepeat(roleIds)) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.DUPLICATEROLEPERMISSIONS);
}
......@@ -238,7 +239,6 @@ public class WorkUserServiceImpl implements WorkUserService {
// 部门经理
if (2 == role) {
workDeptService.updateManagerIdISNullById(workDept.getId());
System.out.println("部门经理被我设置为空了");
DeptUpdateIndex++;
}
// 中心管理
......@@ -282,13 +282,13 @@ public class WorkUserServiceImpl implements WorkUserService {
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)) {
}else{
throw new BaseCustomException(BASE_RESP_CODE_ENUM.PLEASE_CANCELTHE_MANAGEMENTROLE);
}
}
}*/
workUserRoleMapper.insertBatch(userId, roleIds);
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