1 查询拥有权限的ppm_code人力,费用 bmt 三张表。聚合所有ppmcode。
2 反查人力费用获取全量pdt层级,ppmcode
3 使用聚合后的ppmcode反查 bmt 张表获取对应的ppmcde ppmname pdtname 带过阶段点 已过阶段点 type 一个集合 。
4 三个方面有权限传入无对应权限集合为空 直接返回
5 三集合 按三个传入权限名称 取交集(有两个及以上取交集)
6 分页查询获取数据。
7 取交集后数据 组装回显数据。
两个集合取交集
List<Person> intersection = list1.stream()
.filter(person1 -> list2.stream()
.anyMatch(person2 -> person1.getName().equals(person2.getName())))
.collect(Collectors.toList());
时间复杂度低一些
Set<String> namesInList2 = list2.stream()
.map(Person::getName)
.collect(Collectors.toSet());
List<Person> intersection = list1.stream()
.filter(person -> namesInList2.contains(person.getName()))
.collect(Collectors.toList());