瀏覽代碼

Merge remote-tracking branch 'origin/V0.0.2' into V0.0.2

luowei 2 年之前
父節點
當前提交
06b868da03

+ 3 - 1
project_data/sql/0.0.2/soc/soc.sql

@@ -1331,4 +1331,6 @@ INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `co
 INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (00000000000000002354, '异议审批', 2351, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'question:list:confirmDissent', '1', NULL, NULL, '超级管理员', '2023-09-23 16:29:56', '', NULL, '');
 INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (00000000000000002355, '整改', 2351, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'question:list:reform', '1', NULL, NULL, '超级管理员', '2023-09-23 16:30:16', '', NULL, '');
 INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (00000000000000002356, '消息中心', 2065, 3, '/message', NULL, NULL, 1, 0, 'M', '0', '0', NULL, '0', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFYAAABWCAMAAABiiJHFAAAAMFBMVEVHcExsnHRsnHRsnHRsnHRsnHRsnHRsnHRsnHRsnHRsnHRsnHRsnHRsnHRsnHRsnHQnA1lLAAAAD3RSTlMAQIDA0PAQMKDgcGAgUJBBLOu8AAAACXBIWXMAAAsSAAALEgHS3X78AAABJ0lEQVRYhe3Y2Y6DMAwF0Js9gbT5/7+tspg+jMqwxA+d8X2yUDgCAwIDieTbow7n1ImWwxFWWGGFFfY265469SJqW0aVBhftRdZ6AJGKpW5aADwa6oHcYJifZ6D32FwL70oJbZOh5bqU1IpwhbUY2ihW8v22n73D9kOrXehsvsV2pDZBfWiCutRbmwFfD8gFwEe6ZCtdsuAusaUY43phqUiG7jQzuAvskQgrrLDC/hO2TmXLtszuDGmn2JbNNXurTrPtI+HNqsON+YUldzYLy8O2N+98trvz2fY1wMBWl4OF4mGx8rAIPCw1Q9gvY7P+nDf51Fqf++e2k01dZ4ktpMapKnhUGmEmq51ts/F0Nk1XMYbC+SyHilIeDComPwYUHlUi+UsB8AJnTJyCMJLPUQAAAABJRU5ErkJggg==', NULL, '超级管理员', '2023-09-25 08:43:50', '', NULL, '');
-INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (00000000000000002357, '删除', 2317, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:checkplan:remove', '1', NULL, NULL, '超级管理员', '2023-09-25 11:35:35', '', NULL, '');
+INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (00000000000000002357, '删除', 2317, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:checkplan:remove', '1', NULL, NULL, '超级管理员', '2023-09-25 11:35:35', '', NULL, '');
+INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (00000000000000002317, '检查计划', 2326, 3, 'check/plan', 'check/index', NULL, 1, 0, 'C', '0', '0', '', '1', 'documentation', NULL, '超级管理员', '2023-09-21 10:35:38', '超级管理员', '2023-09-22 09:42:15', '');
+INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (00000000000000002318, '检查任务', 2326, 4, 'check/task/index', 'check/task/index', NULL, 1, 0, 'C', '0', '0', '', '1', 'documentation', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');

+ 11 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/web/domain/PageDto.java

@@ -2,9 +2,12 @@ package com.xunmei.common.core.web.domain;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * @author : 高雄
  * @date :2022/4/28 17:07
@@ -25,6 +28,14 @@ public class PageDto<T> {
     @ApiModelProperty(value = "机构id")
     private Long orgId;
 
+    @ApiModelProperty(value = "机构path")
+    @JsonIgnore
+    private String orgPath;
+
+    @ApiModelProperty(value = "上级机构id")
+    @JsonIgnore
+    private List<Long> parentOrgIds;
+
     @ApiModelProperty(value = "是否下穿查询")
     private Boolean checkSub = false;
 

+ 29 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/ServiceImplBase.java

@@ -0,0 +1,29 @@
+package com.xunmei.core;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.common.core.domain.OrgTreeReq;
+import com.xunmei.common.core.domain.OrgTreeResp;
+import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.web.domain.PageDto;
+import com.xunmei.system.api.RemoteOrgService;
+
+import javax.annotation.Resource;
+
+public class ServiceImplBase<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> {
+    @Resource
+    protected RemoteOrgService remoteOrgService;
+
+    protected void handleSupOrgPage(PageDto page) {
+        OrgTreeReq req = new OrgTreeReq();
+        req.setOrgId(page.getOrgId());
+        req.setCheckSub(page.getCheckSub());
+        R<OrgTreeResp> r = remoteOrgService.getOrgTreeResp(req);
+        if (ObjectUtil.isNotNull(r) && ObjectUtil.equal(r.getCode(), 200)) {
+            page.setOrgId(r.getData().getOrgId());
+            page.setOrgPath(r.getData().getOrgPath());
+            page.setParentOrgIds(r.getData().getOrgIdList());
+        }
+    }
+}

+ 0 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/rule/AppRulePageDto.java

@@ -15,7 +15,4 @@ public class AppRulePageDto extends PageDto<AppRulePageVo> {
 
     @ApiModelProperty(value = "履职机构类型")
     private String orgType;
-
-    private Long orgId;
-
 }

+ 4 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleServiceImpl.java

@@ -10,6 +10,7 @@ import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.ServiceImplBase;
 import com.xunmei.core.resumption.domain.AppRule;
 import com.xunmei.core.resumption.dto.rule.AppRuleListForOrgDto;
 import com.xunmei.core.resumption.dto.rule.AppRulePageDto;
@@ -43,16 +44,15 @@ import java.util.stream.Collectors;
  */
 @Slf4j
 @Service("appRuleService")
-public class AppRuleServiceImpl extends ServiceImpl<AppRuleMapper, AppRule> implements IAppRuleService {
+public class AppRuleServiceImpl extends ServiceImplBase<AppRuleMapper, AppRule> implements IAppRuleService {
     @Resource
     private AppRuleMapper appRuleMapper;
 
-    @Resource
-    RemoteOrgService remoteOrgService;
-
     @Override
     public TableDataInfo getAppRulePage(AppRulePageDto query) {
         Page<AppRulePageVo> page = query.getPageDto();
+
+        handleSupOrgPage(query);
         page = appRuleMapper.selectPageByCondition(page, query);
 
         return TableDataInfo.success(page);

+ 11 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppRuleMapper.xml

@@ -23,12 +23,21 @@
             <if test="appRule.orgType != null">
                 and a.org_type = #{appRule.orgType}
             </if>
+
             <if test="appRule.checkSub==false">
                 and a.org_id=#{appRule.orgId}
             </if>
             <if test="appRule.checkSub==true">
-                and a.org_id in (select id from sys_org where `path` like concat((select `path` from sys_org where id =
-                #{appRule.orgId}),'%'))
+                and (a.org_id in (select id from sys_org where `path` like concat(#{appRule.orgPath},'%'))
+                <if test="appRule.parentOrgIds!=null and appRule.parentOrgIds.size()>0">
+                    or a.org_id in
+                    <foreach collection="appRule.parentOrgIds" separator="," open="(" close=")" item="id">
+                        #{id}
+                    </foreach>)
+                </if>
+                <if test="appRule.parentOrgIds==null or appRule.parentOrgIds.size()==0">
+                    and 1=1)
+                </if>
             </if>
         </where>
         order by a.create_time desc

+ 10 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java

@@ -152,11 +152,19 @@ public class SysDeptController extends BaseController {
     }
 
     /**
-     * 获取机构树列表(机构)
+     * 获取登录用户机构及下级机构树列表(机构)
      */
     @GetMapping("/deptTree/hangshe")
     public AjaxResult hangsheDeptTree() {
-        return success(deptService.selectTreeByOrgType(OrgTypeEnum.HANG_SHE));
+        return success(deptService.selectTreeByOrgType(false,OrgTypeEnum.HANG_SHE));
+    }
+
+    /**
+     * 获取登录用户机构及下级机构树列表+路径上的上级机构
+     */
+    @GetMapping("/deptTree/wholetree/bytype")
+    public AjaxResult wholeTreeByType(@RequestParam Integer orgType) {
+        return success(deptService.selectTreeByOrgType(true,OrgTypeEnum.getOrgTypeEnum(orgType)));
     }
 
     @PostMapping("/deptTree/business")

+ 4 - 4
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysDeptService.java

@@ -34,21 +34,21 @@ public interface ISysDeptService extends IService<SysDept> {
     List<SysOrgVO> selectDeptTreeList(SysOrg dept);
 
     /**
-     * 返回行社树
+     * 返回用户机构及(指定类型)下级机构
      *
      * @return
      */
-    List<SysOrgVO> selectTreeByOrgType(OrgTypeEnum orgType);
+    List<SysOrgVO> selectTreeByOrgType(Boolean includeUp, OrgTypeEnum orgType);
 
     List<SysOrgVO> selectBusinessTreeList(SysOrgTreeRequestDto request);
 
     /**
-     * 获取缓存的行社及行社上级机构
+     * 获取缓存的机构及行社上级机构,不组装树
      *
      * @param path
      * @return
      */
-    List<SysOrgVO> getWholeTreeInCache(String path, OrgTypeEnum orgType);
+    List<SysOrgVO> getWholePathInCache(String path, OrgTypeEnum orgType);
 
     /**
      * 获取指定机构树,包含到顶级节点的路径及下级所有机构

+ 54 - 60
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeptServiceImpl.java

@@ -135,22 +135,29 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
             orgs.add(org);
         }
         if (dept.getRemoveId() != null) {
-            orgs.removeIf(d -> d.getTreeShowPath().endsWith(dept.getId()+"-"));
+            orgs.removeIf(d -> d.getTreeShowPath().endsWith(dept.getId() + "-"));
         }
         return generateTree(orgs, sysOrg);
     }
 
     /**
-     * 获取指定机构类型及其上级机构
+     * 获取用户机构下的指定机构类型及其上级机构
+     *
      * @param orgType
      * @return
      */
     @Override
-    public List<SysOrgVO> selectTreeByOrgType(OrgTypeEnum orgType) {
+    public List<SysOrgVO> selectTreeByOrgType(Boolean includeUp, OrgTypeEnum orgType) {
+        String path="";
         SysOrg sysOrg = getLoginUserOrg();
-        List<SysOrgVO> hangshelist = getWholeTreeInCache(sysOrg.getPath(),orgType);
+        path=sysOrg.getPath();
+        if(includeUp){
+            sysOrg=null;
+        }
+
+        List<SysOrgVO> orglist = getWholePathInCache(path, orgType);
 
-        return generateTree(hangshelist, sysOrg);
+        return generateTree(orglist, sysOrg);
     }
 
     @Override
@@ -160,11 +167,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
         sysOrg = getLoginUserOrg();
         List<SysOrgVO> cacheList = getOrgCache();
         List<SysOrgVO> orgs = new ArrayList<>();
-        if(StringUtils.isNotEmpty(request.getExcludeOrgCode())){
+        if (StringUtils.isNotEmpty(request.getExcludeOrgCode())) {
             final Optional<SysOrgVO> first = cacheList.stream().filter(x -> ObjectUtil.equal(x.getCode(), request.getExcludeOrgCode())).findFirst();
-            if(first.isPresent())
-            {
-                excludeOrg=first.get();
+            if (first.isPresent()) {
+                excludeOrg = first.get();
             }
         }
 
@@ -186,9 +192,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
             }
             orgs.add(org);
         }
-        if(!StringUtils.isEmpty(request.getExcludeOrgName()))
-        {
-            orgs= excludeOrgByOrgName(orgs,request.getExcludeOrgName());
+        if (!StringUtils.isEmpty(request.getExcludeOrgName())) {
+            orgs = excludeOrgByOrgName(orgs, request.getExcludeOrgName());
         }
 
         return generateTree(orgs, sysOrg);
@@ -196,22 +201,20 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
 
     /**
      * 排除指定机构名称的机构以及该机构的下级机构
-     * @param orgs 待排出机构列表
+     *
+     * @param orgs           待排出机构列表
      * @param excludeOrgName 需排出机构的名称
      * @return
      */
-    private List<SysOrgVO> excludeOrgByOrgName(List<SysOrgVO> orgs,String excludeOrgName)
-    {
+    private List<SysOrgVO> excludeOrgByOrgName(List<SysOrgVO> orgs, String excludeOrgName) {
         List<SysOrgVO> result = new ArrayList<>();
 
         final List<SysOrgVO> excludeOrgList = orgs.stream().filter(x -> ObjectUtil.equal(x.getName(), excludeOrgName)).collect(Collectors.toList());
-        if(ObjectUtil.isEmpty(excludeOrgList))
-        {
+        if (ObjectUtil.isEmpty(excludeOrgList)) {
             return orgs;
         }
         for (SysOrgVO org : orgs) {
-            if(excludeOrgList.stream().anyMatch(e-> org.getPath().startsWith(e.getPath())))
-            {
+            if (excludeOrgList.stream().anyMatch(e -> org.getPath().startsWith(e.getPath()))) {
                 continue;
             }
             result.add(org);
@@ -226,10 +229,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
      * @return
      */
     @Override
-    public List<SysOrgVO> getWholeTreeInCache(String path, OrgTypeEnum orgType) {
+    public List<SysOrgVO> getWholePathInCache(String path, OrgTypeEnum orgType) {
         List<SysOrgVO> cacheList = getOrgCache();
         List<SysOrgVO> hangshelist = cacheList.stream().filter(c -> ObjectUtil.equal(c.getType(), orgType.getCode())
-                && ObjectUtil.isNotEmpty(c.getPath()) && c.getPath().startsWith(path))
+                        && ObjectUtil.isNotEmpty(c.getPath()) && c.getPath().startsWith(path))
                 .collect(Collectors.toList());
         Set<Long> hangsheSet = hangshelist.stream().map(o -> o.getId()).collect(Collectors.toSet());
         Set<Long> parentIds = new HashSet<>();
@@ -243,7 +246,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
                     });
         });
         hangshelist.addAll(cacheList.stream()
-                .filter(o -> parentIds.contains(o.getId()) && ObjectUtil.isNotEmpty(o.getPath()) && o.getPath().startsWith(path))
+                .filter(o -> parentIds.contains(o.getId()))
                 .collect(Collectors.toList()));
 
         return hangshelist;
@@ -257,7 +260,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
      */
     @Override
     public List<SysOrgVO> hangsheWholePathTree(Long orgId) {
-        List<SysOrgVO> orgs = getWholeTreeInCache("", OrgTypeEnum.HANG_SHE);
+        List<SysOrgVO> orgs = getWholePathInCache("", OrgTypeEnum.HANG_SHE);
         Map<Long, SysOrgVO> orgMap = orgs.stream().collect(Collectors.toMap(o -> o.getId(), o -> o));
         if (!orgMap.containsKey(orgId)) {
             return new ArrayList<>();
@@ -274,73 +277,65 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
     }
 
 
-
     @Override
     public List<SysOrgVO> orgWholePathTree(SysOrgTreeRequestDto request) {
         SysOrgVO sysOrg = null;
         Long orgId = null;
-        LoginUser loginUser=SecurityUtils.getLoginUser();
-        if(ObjectUtil.isEmpty(request) || ObjectUtil.isEmpty(request.getOrgId()))
-        {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        if (ObjectUtil.isEmpty(request) || ObjectUtil.isEmpty(request.getOrgId())) {
             orgId = loginUser.getOrgId();
-        }
-        else {
-            orgId =request.getOrgId();
+        } else {
+            orgId = request.getOrgId();
         }
 
         List<SysOrgVO> cacheList = getOrgCache();
-        if(ObjectUtil.isNotEmpty(orgId)){
+        if (ObjectUtil.isNotEmpty(orgId)) {
             Long finalOrgId = orgId;
             final Optional<SysOrgVO> first = cacheList.stream().filter(x -> ObjectUtil.equal(x.getId(), finalOrgId)).findFirst();
-            if(first.isPresent())
-            {
-                sysOrg=first.get();
+            if (first.isPresent()) {
+                sysOrg = first.get();
             }
         }
-        if(ObjectUtil.isEmpty(sysOrg))
-        {
+        if (ObjectUtil.isEmpty(sysOrg)) {
             return new ArrayList<>();
         }
 
-        final List<SysOrgVO> orgList = getWholePathTreeOrgFromCache(sysOrg, cacheList,request.getIncludeSub(),request.getExcludeOrgName());
+        final List<SysOrgVO> orgList = getWholePathTreeOrgFromCache(sysOrg, cacheList, request.getIncludeSub(), request.getExcludeOrgName());
 
-        return generateTree(orgList,null);
+        return generateTree(orgList, null);
     }
 
     /**
      * 根据业务机构path 获取指定机构的所有下级以及所有直接上级机构
+     *
      * @param orgVO
      * @param cacheList
      * @return
      */
-    public List<SysOrgVO> getWholePathTreeOrgFromCache(SysOrgVO orgVO,List<SysOrgVO> cacheList,Boolean includeSub,String excludeOrgName) {
-        List<SysOrgVO> selfAndAllChildOrglist =null;
-        if(includeSub)
-        {
-            selfAndAllChildOrglist=cacheList.stream().filter(c ->ObjectUtil.isNotEmpty(c.getPath()) && c.getPath().startsWith(orgVO.getPath())).collect(Collectors.toList());
-        }
-        else {
-            selfAndAllChildOrglist=cacheList.stream().filter(c ->ObjectUtil.equal(orgVO.getId(),c.getId())).collect(Collectors.toList());
+    public List<SysOrgVO> getWholePathTreeOrgFromCache(SysOrgVO orgVO, List<SysOrgVO> cacheList, Boolean includeSub, String excludeOrgName) {
+        List<SysOrgVO> selfAndAllChildOrglist = null;
+        if (includeSub) {
+            selfAndAllChildOrglist = cacheList.stream().filter(c -> ObjectUtil.isNotEmpty(c.getPath()) && c.getPath().startsWith(orgVO.getPath())).collect(Collectors.toList());
+        } else {
+            selfAndAllChildOrglist = cacheList.stream().filter(c -> ObjectUtil.equal(orgVO.getId(), c.getId())).collect(Collectors.toList());
         }
 
 
-
         Set<Long> parentIds = new HashSet<>();
-            Arrays.stream(orgVO.getPath().split("-")).map(p -> Long.parseLong(p))
-                    .collect(Collectors.toList())
-                    .forEach(id -> {
-                        if (!ObjectUtil.equal(orgVO.getId(),id)) {
-                            parentIds.add(id);
-                        }
-                    });
+        Arrays.stream(orgVO.getPath().split("-")).map(p -> Long.parseLong(p))
+                .collect(Collectors.toList())
+                .forEach(id -> {
+                    if (!ObjectUtil.equal(orgVO.getId(), id)) {
+                        parentIds.add(id);
+                    }
+                });
         selfAndAllChildOrglist.addAll(cacheList.stream()
                 .filter(o -> parentIds.contains(o.getId()))
                 .collect(Collectors.toList()));
 
         // 排除指定机构名称的机构以及该机构的下级机构
-        if(StringUtils.isNotEmpty(excludeOrgName))
-        {
-            selfAndAllChildOrglist= excludeOrgByOrgName(selfAndAllChildOrglist,excludeOrgName);
+        if (StringUtils.isNotEmpty(excludeOrgName)) {
+            selfAndAllChildOrglist = excludeOrgByOrgName(selfAndAllChildOrglist, excludeOrgName);
         }
 
 
@@ -378,9 +373,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
         List<Long> parentIds = orgs.stream().filter(x -> !orgs.stream().anyMatch(y -> x.getTreeShowParentId().equals(y.getId()))).map(SysOrgVO::getTreeShowParentId).collect(Collectors.toList());
         if (parentIds.size() == 0) {
             parentIds.add(parentId);
-        }
-        else {
-            parentIds=parentIds.stream().distinct().collect(Collectors.toList());
+        } else {
+            parentIds = parentIds.stream().distinct().collect(Collectors.toList());
         }
         final Map<Long, List<SysOrgVO>> collect = orgs.stream().collect(Collectors.groupingBy(SysOrgVO::getTreeShowParentId));
         List<SysOrgVO> result = new ArrayList<>();