修改增加顶级公司 不校验部门名称唯一性的问题

This commit is contained in:
weiweiw 2024-09-20 09:23:40 +08:00
parent 7adc846c3a
commit c436674445
1 changed files with 4 additions and 1 deletions

View File

@ -184,7 +184,10 @@ public class SysDeptServiceImpl implements ISysDeptService
public boolean checkDeptNameUnique(SysDept dept) public boolean checkDeptNameUnique(SysDept dept)
{ {
Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); //如果没有parentid则认为是根节点检查根节点是否重名added by weiweiwang 2024/9/20
Long parentId = StringUtils.isNull(dept.getParentId()) ? 0L : dept.getParentId();
SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), parentId);
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
{ {
return UserConstants.NOT_UNIQUE; return UserConstants.NOT_UNIQUE;