bug--代码规范优化

This commit is contained in:
taochengbo
2020-10-11 18:44:17 +08:00
parent 61a09632d8
commit cb5f228ac6
7 changed files with 22 additions and 7 deletions

View File

@ -169,8 +169,12 @@ public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, Dept> implement
int jobCount = jobMapper.selectCount(Wrappers.<Job>lambdaQuery().in(Job::getDeptId,deptIds));
int roleCount = rolesDeptsMapper.selectCount(Wrappers.<RolesDepts>lambdaQuery()
.in(RolesDepts::getDeptId,deptIds));
if(jobCount > 0) throw new BadRequestException( "所选部门中存在与岗位关联,请取消关联后再试");
if(roleCount > 0) throw new BadRequestException( "所选部门中存在与角色关联,请取消关联后再试");
if(jobCount > 0) {
throw new BadRequestException( "所选部门中存在与岗位关联,请取消关联后再试");
}
if(roleCount > 0) {
throw new BadRequestException( "所选部门中存在与角色关联,请取消关联后再试");
}
this.removeByIds(deptIds);
}