pv终端台帐 部门增加id查询所有子部门

This commit is contained in:
2022-07-28 20:36:19 +08:00
parent 9bcabf659c
commit d23053251f
69 changed files with 1032 additions and 258 deletions

View File

@@ -60,4 +60,11 @@ public interface DeptFeignClient {
@GetMapping("/getDeptById")
HttpResult<Dept> getDeptById(@RequestParam("deptId") String deptId);
/**
* 获取所有部门
*/
@GetMapping("/getDepSonIdtByDeptId")
HttpResult<List<String>> getDepSonIdtByDeptId(@RequestParam("deptId") String deptId);
}

View File

@@ -69,6 +69,13 @@ public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeign
log.error("{}异常,降级处理,异常为:{}","查询所部门异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<String>> getDepSonIdtByDeptId(String deptId) {
log.error("{}异常,降级处理,异常为:{}","查询所部门索引异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -285,5 +285,22 @@ public class DeptController extends BaseController {
}
/**
* 根据部门id获取所有子部门ids
* @author cdf
* @date 2022/7/26
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@GetMapping("/getDepSonIdtByDeptId")
@ApiOperation("根据部门id获取所有子部门ids")
public HttpResult<List<String>> getDepSonIdtByDeptId(@RequestParam("deptId")String deptId) {
String methodDescribe = getMethodDescribe("getDepSonIdtByDeptId");
List<String> deptList = deptService.getDepSonIdtByDeptId(deptId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptList, methodDescribe);
}
}

View File

@@ -95,4 +95,11 @@ public interface DeptMapper extends BaseMapper<Dept> {
List<PvTerminalTreeVO> allDeptList();
/**
* 根据部门id获取所有子部门id集合
* @author cdf
* @date 2022/7/26
*/
List<String> getDeptSonIds(@Param("deptId") String deptId);
}

View File

@@ -155,9 +155,14 @@
</select>
<select id="allDeptList" resultType="DeptAllTreeVO">
<select id="allDeptList" resultType="PvTerminalTreeVO">
select id,name,pid, 0 as level from sys_dept where type = 0 and state = 1 order by sort
</select>
<select id="getDeptSonIds" resultType="String">
select id from sys_dept where find_in_set(#{deptId},pids) and state = 1
</select>
</mapper>

View File

@@ -147,4 +147,12 @@ public interface IDeptService extends IService<Dept> {
* @date 2022/7/13
*/
Dept getDeptById(String id);
/**
* 根据部门id获取部门详情
* @author cdf
* @date 2022/7/13
*/
List<String> getDepSonIdtByDeptId(String id);
}

View File

@@ -306,4 +306,13 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
deptVo.setChildren(getChildrens(deptVo, allDept));
}).collect(Collectors.toList());
}
/**
* 根据部门id获取部门详情
*/
@Override
public List<String> getDepSonIdtByDeptId(String id){
return this.baseMapper.getDeptSonIds(id);
}
}