pv终端台帐 部门增加id查询所有子部门
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user