|
@@ -69,7 +69,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
private BasicCourseService basicCourseService;
|
|
|
|
|
|
@Override
|
|
|
- public List<OrgDto> listOrgTree(RoleTypeEnum specialPrivilegeEnum, boolean withoutPrintingRoom, Long courseId, Set<Long> orgIds) {
|
|
|
+ public List<OrgDto> listOrgTree(RoleTypeEnum specialPrivilegeEnum, boolean withoutPrintingRoom, Long courseId, Set<Long> orgIds, boolean withoutSecondOrg) {
|
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
List<SysUserResult> finalSysUserResultList = sysUserService.findSysUserResultListNew(schoolId, specialPrivilegeEnum);
|
|
|
if (!CollectionUtils.isEmpty(finalSysUserResultList)) {
|
|
@@ -89,6 +89,14 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
if (withoutPrintingRoom) {
|
|
|
orgList = orgList.stream().filter(e -> !OrgTypeEnum.PRINTING_HOUSE.name().equals(e.getType())).collect(Collectors.toList());
|
|
|
}
|
|
|
+ if (withoutSecondOrg) {
|
|
|
+ List<OrgDto> orgDtoSchoolList = orgList.stream().filter(s -> Objects.nonNull(s.getType()) && Objects.equals(s.getType(), "SCHOOL")).collect(Collectors.toList());
|
|
|
+ if (!CollectionUtils.isEmpty(orgDtoSchoolList) && orgDtoSchoolList.size() == 1) {
|
|
|
+ orgList = orgList.stream().filter(e -> !OrgTypeEnum.PRINTING_HOUSE.name().equals(e.getType()) && Objects.nonNull(e.getParentId()) && e.getParentId().longValue() == orgDtoSchoolList.get(0).getId().longValue()).collect(Collectors.toList());
|
|
|
+ } else {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("有多条顶级机构");
|
|
|
+ }
|
|
|
+ }
|
|
|
if (CollectionUtils.isNotEmpty(orgIds)) {
|
|
|
orgList = orgList.stream().filter(e -> orgIds.contains(e.getId())).collect(Collectors.toList());
|
|
|
}
|