1.调整pms国网主配网监测点问题

This commit is contained in:
2024-02-26 19:08:29 +08:00
parent c682b7f198
commit f8e28fc4b1
5 changed files with 46 additions and 1 deletions

View File

@@ -188,6 +188,16 @@ public class DeptController extends BaseController {
}
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("/existMonitorDeptTree")
@ApiOperation("获取部门树(存在监测点的)")
public HttpResult<List<DeptTreeVO>> existMonitorDeptTree(){
String methodDescribe = getMethodDescribe("deptTree");
List<DeptTreeVO> result = deptService.existMonitorDeptTree();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
/**
* 根据条件获取后代部门索引
*

View File

@@ -63,6 +63,9 @@ public interface IDeptService extends IService<Dept> {
*/
List<DeptTreeVO> deptTree();
List<DeptTreeVO> existMonitorDeptTree();
/**
* 根据登录用户获取区域树
* @return 结果

View File

@@ -68,6 +68,8 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
private final CommLedgerDeptClient commLedgerDeptClient;
@Override
public Page<DeptVO> listDept(DeptParam.QueryParam queryParam) {
QueryWrapper<DeptVO> queryWrapper = new QueryWrapper<>();
@@ -173,6 +175,22 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
.collect(Collectors.toList());
}
@Override
public List<DeptTreeVO> existMonitorDeptTree() {
List<String> deptIds = commLedgerDeptClient.existMonitorDeptTree().getData();
if(CollectionUtil.isEmpty(deptIds)){
throw new BusinessException("当前没有部门存在监测点");
}
List<Integer> deptType = WebUtil.filterDeptType();
String deptIndex = RequestUtil.getDeptIndex();
List<DeptTreeVO> deptList = this.baseMapper.getDeptTree(deptIndex, deptType);
List<DeptTreeVO> finalDeptList = deptList.stream().filter(item->deptIds.contains(item.getCode())).collect(Collectors.toList());
return finalDeptList.stream()
.filter(deptVO -> deptVO.getId().equals(deptIndex))
.peek(deptFirst -> deptFirst.setChildren(getChildren(deptFirst, finalDeptList)))
.collect(Collectors.toList());
}
@Override
public List<DeptAllTreeVO> loginDeptTree() {
List<Integer> deptType = WebUtil.filterDeptType();