diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java index 5224748..3c74d02 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java @@ -593,59 +593,13 @@ public class StationServiceImpl extends BaseServiceImpl getStationList(List authList, Long deptId, List types, Integer servrType, boolean make) { - Dept dept; - if (null == deptId) { - // 最小类型机构 - Optional min = authList.stream().min(Comparator.comparing(Dept::getDeptCategory)); - dept = min.orElse(null); - if (ObjectUtil.isEmpty(dept)) { - return null; - } - } else { - // 检查是否存在传入机构 - List list = authList.stream().filter(o -> deptId.equals(o.getId())).collect(Collectors.toList()); - if (CollectionUtil.isEmpty(list)) { - return null; - } - // 传入机构为站点 - dept = list.get(0); - } - List refDepList; - if (dept.getDeptCategory().equals(4)) { - refDepList = Collections.singletonList(dept.getId()); - // 传入机构为区域、省子公司、集团 - } else { - // 递归权限机构获取站点级机构 - refDepList = this.getStationDeptList(authList, dept.getId(), new ArrayList<>()); - } + // 取权限机构中已绑定站点的机构(stationId 不为空) + List refDepList = authList.stream().filter(o -> StringUtils.isNotBlank(o.getStationId())).map(Dept::getId).collect(Collectors.toList()); // 获取水利站点(过滤其他站点类型) return this.getWaterList(refDepList, types, servrType, make); } /** - * 递归权限机构获取站点级机构 - * - * @param departList - * @param deptId - * @param list - * @return - */ - private List getStationDeptList(List departList, Long deptId, List list) { - if (null == deptId || CollectionUtil.isEmpty(departList)) { - return null; - } - departList.forEach(dept -> { - if (dept.getParentId().equals(deptId)) { - if (dept.getDeptCategory().equals(4)) { - list.add(dept.getId()); - } - getStationDeptList(departList, dept.getId(), list); - } - }); - return list; - } - - /** * 获取参数类型站点(过滤其他站点类型) * * @param refDepList