|
@@ -305,54 +305,75 @@ public class ReimbursementInfoService {
|
|
// 公司id
|
|
// 公司id
|
|
String companyId = split[2];
|
|
String companyId = split[2];
|
|
// 过滤出登录人所属公司和集团
|
|
// 过滤出登录人所属公司和集团
|
|
|
|
+ List<TreeUserDto> finalFilterList5 = filterList;
|
|
officeList.stream().forEach(o -> {
|
|
officeList.stream().forEach(o -> {
|
|
if (split[2].equals(o.getId())) {
|
|
if (split[2].equals(o.getId())) {
|
|
- filterList.add(o);
|
|
|
|
|
|
+ finalFilterList5.add(o);
|
|
} else if(split[1].equals(o.getId())) {
|
|
} else if(split[1].equals(o.getId())) {
|
|
- filterList.add(o);
|
|
|
|
|
|
+ finalFilterList5.add(o);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// 根据公司id找到其下部门
|
|
// 根据公司id找到其下部门
|
|
List<Office> oList = officeMapper.selectList(new QueryWrapper<Office>().lambda().eq(Office::getParentId, companyId));
|
|
List<Office> oList = officeMapper.selectList(new QueryWrapper<Office>().lambda().eq(Office::getParentId, companyId));
|
|
// 过滤出这些部门
|
|
// 过滤出这些部门
|
|
|
|
+ List<TreeUserDto> finalFilterList4 = filterList;
|
|
oList.stream().forEach(item -> {
|
|
oList.stream().forEach(item -> {
|
|
officeList.stream().forEach(o -> {
|
|
officeList.stream().forEach(o -> {
|
|
if (item.getId().equals(o.getId())) {
|
|
if (item.getId().equals(o.getId())) {
|
|
- filterList.add(o);
|
|
|
|
|
|
+ finalFilterList4.add(o);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
// 找到所有的公有部门
|
|
// 找到所有的公有部门
|
|
List<Office> publicOfficeList = officeMapper.selectList(new QueryWrapper<Office>().lambda().eq(Office::getIsPublic, "1"));
|
|
List<Office> publicOfficeList = officeMapper.selectList(new QueryWrapper<Office>().lambda().eq(Office::getIsPublic, "1"));
|
|
// 过滤出这些部门
|
|
// 过滤出这些部门
|
|
|
|
+ List<TreeUserDto> finalFilterList3 = filterList;
|
|
publicOfficeList.stream().forEach(item -> {
|
|
publicOfficeList.stream().forEach(item -> {
|
|
officeList.stream().forEach(o -> {
|
|
officeList.stream().forEach(o -> {
|
|
if (item.getId().equals(o.getId())) {
|
|
if (item.getId().equals(o.getId())) {
|
|
- filterList.add(o);
|
|
|
|
|
|
+ finalFilterList3.add(o);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}else{
|
|
}else{
|
|
- // 公司id
|
|
|
|
- String companyId = UserUtils.getCurrentUserDTO().getOfficeDTO().getId();
|
|
|
|
- // 过滤出登录人所属公司和集团
|
|
|
|
- officeList.stream().forEach(o -> {
|
|
|
|
- if (companyId.equals(o.getId())) {
|
|
|
|
- filterList.add(o);
|
|
|
|
- } else if(split[1].equals(o.getId()) && !split[1].equals(companyId)) {
|
|
|
|
- filterList.add(o);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- // 找到所有的公有部门
|
|
|
|
- List<Office> publicOfficeList = officeMapper.selectList(new QueryWrapper<Office>().lambda().eq(Office::getIsPublic, "1"));
|
|
|
|
- // 过滤出这些部门
|
|
|
|
- publicOfficeList.stream().forEach(item -> {
|
|
|
|
|
|
+ // 私有的
|
|
|
|
+ if ("0".equals(UserUtils.getCurrentUserDTO().getOfficeDTO().getIsPublic())) {
|
|
|
|
+ // 公司id
|
|
|
|
+ String companyId = UserUtils.getCurrentUserDTO().getOfficeDTO().getId();
|
|
|
|
+ // 过滤出登录人所属公司和集团
|
|
|
|
+ List<TreeUserDto> finalFilterList2 = filterList;
|
|
officeList.stream().forEach(o -> {
|
|
officeList.stream().forEach(o -> {
|
|
- if (item.getId().equals(o.getId())) {
|
|
|
|
- filterList.add(o);
|
|
|
|
|
|
+ if (companyId.equals(o.getId())) {
|
|
|
|
+ finalFilterList2.add(o);
|
|
|
|
+ } else if(split[1].equals(o.getId()) && !split[1].equals(companyId)) {
|
|
|
|
+ finalFilterList2.add(o);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ // 根据公司id找到其下部门
|
|
|
|
+ List<Office> oList = officeMapper.selectList(new QueryWrapper<Office>().lambda().eq(Office::getParentId, companyId));
|
|
|
|
+ // 过滤出这些部门
|
|
|
|
+ List<TreeUserDto> finalFilterList1 = filterList;
|
|
|
|
+ oList.stream().forEach(item -> {
|
|
|
|
+ officeList.stream().forEach(o -> {
|
|
|
|
+ if (item.getId().equals(o.getId())) {
|
|
|
|
+ finalFilterList1.add(o);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ // 找到所有的公有部门
|
|
|
|
+ List<Office> publicOfficeList = officeMapper.selectList(new QueryWrapper<Office>().lambda().eq(Office::getIsPublic, "1"));
|
|
|
|
+ // 过滤出这些部门
|
|
|
|
+ List<TreeUserDto> finalFilterList = filterList;
|
|
|
|
+ publicOfficeList.stream().forEach(item -> {
|
|
|
|
+ officeList.stream().forEach(o -> {
|
|
|
|
+ if (item.getId().equals(o.getId())) {
|
|
|
|
+ finalFilterList.add(o);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ filterList = officeList;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
/*if (CollectionUtils.isNotEmpty(officeList)) {
|
|
/*if (CollectionUtils.isNotEmpty(officeList)) {
|
|
list.addAll(officeList);
|
|
list.addAll(officeList);
|