|
|
|
|
@ -593,13 +593,42 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<StationEntity> getStationList(List<Dept> authList, Long deptId, List<Integer> types, Integer servrType, boolean make) { |
|
|
|
|
List<Long> refDepList; |
|
|
|
|
if (null != deptId) { |
|
|
|
|
// 取此部门及其所有子部门中已绑定站点的机构(stationId 不为空)
|
|
|
|
|
List<Long> deptIds = new ArrayList<>(); |
|
|
|
|
deptIds.add(deptId); |
|
|
|
|
this.getChildDeptIds(authList, deptId, deptIds); |
|
|
|
|
refDepList = authList.stream().filter(o -> deptIds.contains(o.getId()) && StringUtils.isNotBlank(o.getStationId())).map(Dept::getId).collect(Collectors.toList()); |
|
|
|
|
} else { |
|
|
|
|
// 取权限机构中已绑定站点的机构(stationId 不为空)
|
|
|
|
|
List<Long> refDepList = authList.stream().filter(o -> StringUtils.isNotBlank(o.getStationId())).map(Dept::getId).collect(Collectors.toList()); |
|
|
|
|
refDepList = authList.stream().filter(o -> StringUtils.isNotBlank(o.getStationId())).map(Dept::getId).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
// 获取水利站点(过滤其他站点类型)
|
|
|
|
|
return this.getWaterList(refDepList, types, servrType, make); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 递归获取子机构id集合 |
|
|
|
|
* |
|
|
|
|
* @param departList |
|
|
|
|
* @param deptId |
|
|
|
|
* @param list |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private void getChildDeptIds(List<Dept> departList, Long deptId, List<Long> list) { |
|
|
|
|
if (null == deptId || CollectionUtil.isEmpty(departList)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
departList.forEach(dept -> { |
|
|
|
|
if (deptId.equals(dept.getParentId())) { |
|
|
|
|
list.add(dept.getId()); |
|
|
|
|
getChildDeptIds(departList, dept.getId(), list); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取参数类型站点(过滤其他站点类型) |
|
|
|
|
* |
|
|
|
|
* @param refDepList |
|
|
|
|
|