Commit 0479a0d8 authored by chenyuxi's avatar chenyuxi

feat:部门调整

parent f10c2242
......@@ -352,6 +352,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
// 先存当前部门ID
allDepartIdSet.add(deptVo.getDeptId().toString());
String ancestors = deptVo.getAncestors();
if(Common.isNotNull(ancestors)){
String[] ancestorArr = ancestors.split(CommonConstants.COMMA_STRING);
Set<String> ancestorDeptIdSet = Arrays.stream(ancestorArr).collect(Collectors.toSet());
if(Common.isNotNull(ancestorDeptIdSet)){
......@@ -359,6 +360,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
}
}
}
}
sysDeptList = baseMapper.cspDeptListByDeptIdSet(dept, allDepartIdSet);
}
......@@ -534,6 +536,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
if (Common.isEmpty(findInfo)) {
return R.failed("部门未找到");
}
if(findInfo.getName().equals(dept.getName())){
return R.failed("名称未发生变化,未做更新");
}
SysDept nameInfo = baseMapper.checkDeptNameUnique(findInfo.getProjectNo(),dept.getName(), findInfo.getParentId());
if (Common.isNotNull(nameInfo) && nameInfo.getDeptId().longValue() != dept.getDeptId().longValue()) {
return R.failed("已存在同级同名部门");
......
......@@ -19,7 +19,7 @@
<mapper namespace="com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDeptMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept">
<id column="deptId" property="deptId"/>
<id column="dept_id" property="deptId"/>
<result column="name" property="name"/>
<result column="parent_id" property="parentId"/>
<result column="dept_dn" property="deptDn"/>
......
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