部门相关代码提交

This commit is contained in:
2022-11-16 13:33:46 +08:00
parent c4749c57ae
commit f368ebd623
7 changed files with 28 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
SELECT sys_dept.pids pids
FROM sys_dept sys_dept
WHERE sys_dept.id = #{id}
and sys_dept.state = 1
</select>
<select id="getDeptTree" resultType="DeptTreeVO">

View File

@@ -90,13 +90,17 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
BeanUtil.copyProperties(deptParam, dept);
//进行先解绑,再新增
Integer httpResult = deptLineFeignClient.removeBind(deptParam.getPid()).getData();
System.out.println(httpResult);
if (deptParam.getPid().equals("-1")) {
//上层节点
dept.setPids("0");
} else {
String pids = "," + deptParam.getPid();
String pid = this.baseMapper.getIdString(deptParam.getPid());
if(StrUtil.isBlank(deptParam.getPid())){
throw new BusinessException(UserResponseEnum.DEPT_PID_EXCEPTION);
}
//上层节点
dept.setPids(pid + pids);
}