Forráskód Böngészése

调试履职内容库管理

jiawuxian 2 éve
szülő
commit
dbb0f877cb
22 módosított fájl, 234 hozzáadás és 166 törlés
  1. 14 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/Eto/OrgListByTypesConditionEto.java
  2. 3 1
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteOrgService.java
  3. 10 11
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteOrgFallbackFactory.java
  4. 0 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/AppRuleController.java
  5. 7 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/AppRuleItemController.java
  6. 5 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRuleItem/AppRuleItemCheckDto.java
  7. 4 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRuleItem/AppRuleItemDetailDto.java
  8. 12 12
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRuleItem/AppRuleItemDto.java
  9. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRuleItem/AppRuleItemPageDto.java
  10. 33 33
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRulePoint/AppRulePointDetailDto.java
  11. 24 24
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRulePoint/AppRulePointDto.java
  12. 9 9
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRulePoint/AppRulePointInfoDto.java
  13. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IAppRuleItemService.java
  14. 0 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IAppRuleService.java
  15. 51 11
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleItemServiceImpl.java
  16. 0 42
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleServiceImpl.java
  17. 3 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRuleItem/AppRuleItemPageVo.java
  18. 24 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRuleItem/RuleTreeItem.java
  19. 1 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaController.java
  20. 6 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java
  21. 4 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysOrgService.java
  22. 19 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

+ 14 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/Eto/OrgListByTypesConditionEto.java

@@ -0,0 +1,14 @@
+package com.xunmei.system.api.Eto;
+
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@Builder
+public class OrgListByTypesConditionEto {
+    Long orgId;
+
+    List<String > orgTypes;
+}

+ 3 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteOrgService.java

@@ -3,6 +3,7 @@ package com.xunmei.system.api;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.constant.ServiceNameConstants;
 import com.xunmei.common.core.domain.R;
+import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
 import com.xunmei.system.api.domain.Org;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.factory.RemoteOrgFallbackFactory;
@@ -37,5 +38,6 @@ public interface RemoteOrgService {
     @PostMapping("/org/sync/batch")
     R<Boolean> batchSaveSyncOrg(@RequestBody List<SysOrg> orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 
-
+    @PostMapping("/dept/findListByOrgTypes")
+    R<List<SysOrg>> listByTypes( @RequestBody OrgListByTypesConditionEto conditionEto, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 }

+ 10 - 11
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteOrgFallbackFactory.java

@@ -1,6 +1,7 @@
 package com.xunmei.system.api.factory;
 
 import com.xunmei.common.core.domain.R;
+import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.RemoteUserService;
 import com.xunmei.system.api.domain.Org;
@@ -15,23 +16,19 @@ import java.util.List;
 
 /**
  * 用户服务降级处理
- * 
+ *
  * @author xunmei
  */
 @Component
-public class RemoteOrgFallbackFactory implements FallbackFactory<RemoteOrgService>
-{
+public class RemoteOrgFallbackFactory implements FallbackFactory<RemoteOrgService> {
     private static final Logger log = LoggerFactory.getLogger(RemoteOrgFallbackFactory.class);
 
     @Override
-    public RemoteOrgService create(Throwable throwable)
-    {
+    public RemoteOrgService create(Throwable throwable) {
         log.error("用户服务调用失败:{}", throwable.getMessage());
-        return new RemoteOrgService()
-        {
+        return new RemoteOrgService() {
             @Override
-            public R<List<SysOrg>> getAllOrg(String source)
-            {
+            public R<List<SysOrg>> getAllOrg(String source) {
                 return R.fail("获取获取机构失败:" + throwable.getMessage());
             }
 
@@ -60,8 +57,10 @@ public class RemoteOrgFallbackFactory implements FallbackFactory<RemoteOrgServic
                 return null;
             }
 
-
-
+            @Override
+            public R<List<SysOrg>> listByTypes(OrgListByTypesConditionEto conditionEto,String srouce) {
+                return null;
+            }
         };
     }
 }

+ 0 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/AppRuleController.java

@@ -67,9 +67,4 @@ public class AppRuleController  extends BaseController {
         return success();
     }
 
-    @ApiOperation(value = "规范组")
-    @PostMapping("group")
-    public AjaxResult getRuleGroupList() {
-        return success(appRuleService.getRuleGroupList());
-    }
 }

+ 7 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/AppRuleItemController.java

@@ -5,6 +5,7 @@ package com.xunmei.core.resumption.controller;
 import com.xunmei.common.core.web.controller.BaseController;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.resumption.domain.AppRuleItem;
 import com.xunmei.core.resumption.dto.appRuleItem.AppRuleItemDto;
 import com.xunmei.core.resumption.service.IAppRuleItemService;
@@ -52,6 +53,12 @@ public class AppRuleItemController extends BaseController {
     public AjaxResult findOne(@PathVariable("id") Long id) {
         return success(appRuleItemService.findOne(id));
     }
+
+    @ApiOperation(value = "规范组")
+    @GetMapping("/rule/tree")
+    public AjaxResult getRuleTree() {
+        return success(appRuleItemService.getRuleTree(4352539158904832L));//SecurityUtils.getLoginUser().getSysUser().getOrgId())
+    }
 //
 //    @ApiOperation(value = "字典下拉框")
 //    @GetMapping("dict")

+ 5 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRuleItem/AppRuleItemCheckDto.java

@@ -22,11 +22,11 @@ public class AppRuleItemCheckDto {
     @ApiModelProperty("要点id")
     private Long pointId;
 
-    @ApiModelProperty("检查项编号")
-    private Integer itemNum;
-
-    @ApiModelProperty("检查点编号")
-    private Integer pointNum;
+//    @ApiModelProperty("检查项编号")
+//    private Integer itemNum;
+//
+//    @ApiModelProperty("检查点编号")
+//    private Integer pointNum;
 
     @ApiModelProperty("检查点名称")
     private String pointName;

+ 4 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRuleItem/AppRuleItemDetailDto.java

@@ -17,13 +17,13 @@ public class AppRuleItemDetailDto {
     private Long id;
 
     @ApiModelProperty(value = "检查项名称")
-    private String itemName;
+    private String name;
 
-    @ApiModelProperty(value = "检查项编号")
-    private Integer itemNum;
+//    @ApiModelProperty(value = "检查项编号")
+//    private Integer itemNum;
 
     @ApiModelProperty(value = "检查项标准及要求")
-    private String itemDesc;
+    private String desc;
 
     @ApiModelProperty(value = "检查点")
     private List<AppRulePointDetailDto> pointDtoList;

+ 12 - 12
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRuleItem/AppRuleItemDto.java

@@ -17,22 +17,22 @@ public class AppRuleItemDto {
     @ApiModelProperty(value = "规则项id")
     private Long id;
 
-    @ApiModelProperty(value = "规则编号")
-    private Integer itemNum;
+//    @ApiModelProperty(value = "规则编号")
+//    private Integer itemNum;
 
-    @ApiModelProperty(value = "规则名称")
-    private String itemName;
+//    @ApiModelProperty(value = "规则名称")
+//    private String itemName;
 
-    @ApiModelProperty(value = "规则标准及要求")
-    private String itemDesc;
+//    @ApiModelProperty(value = "")
+//    private String desc;
 
-    @ApiModelProperty(value = "规范要点id")
+    @ApiModelProperty(value = "履职内容库id")
     private Long ruleId;
+//
+//    @NotNull(message = "规则类型不能为空")
+//    @ApiModelProperty("规范类型id")
+//    private Long ruleTypeId;
 
-    @NotNull(message = "规则类型不能为空")
-    @ApiModelProperty("规范类型id")
-    private Long ruleTypeId;
-
-    @ApiModelProperty(value = "检查点对象")
+    @ApiModelProperty(value = "履职内容")
     private List<AppRulePointDto> pointDtoList;
 }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRuleItem/AppRuleItemPageDto.java

@@ -16,6 +16,6 @@ public class AppRuleItemPageDto extends PageDto<AppRuleItem> {
     private  Long ruleId;
 
     @ApiModelProperty(value = "检查项名称")
-    private  String ruleItemName;
+    private  String name;
 
 }

+ 33 - 33
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRulePoint/AppRulePointDetailDto.java

@@ -15,14 +15,14 @@ public class AppRulePointDetailDto {
     @ApiModelProperty(value = "检查点id")
     private Long id;
 
-    @ApiModelProperty(value = "规范id")
-    private Long ruleId;
+//    @ApiModelProperty(value = "规范id")
+//    private Long ruleId;
 
-    @ApiModelProperty(value = "检查要点编号")
-    private int pointNum;
+//    @ApiModelProperty(value = "检查要点编号")
+//    private int pointNum;
 
     @ApiModelProperty(value = "检查要点名称")
-    private String pointName;
+    private String name;
 
     @ApiModelProperty(value = "检查区域,区域表id")
     @JsonSerialize(using = ToStringSerializer.class)
@@ -31,38 +31,38 @@ public class AppRulePointDetailDto {
     @ApiModelProperty(value = "检查区域名称")
     private String areaName;
 
-    @ApiModelProperty(value = "安防类型,字典表value")
-    private Integer safeType;
-
-    @ApiModelProperty(value = "安防类型名称")
-    private String safeTypeName;
-
-    @ApiModelProperty(value = "整改期限,天数")
-    private int reformDay;
-
-    @ApiModelProperty(value = "检查方法,字典表value")
-    private Integer inspection;
-
-    @ApiModelProperty(value = "检查方法名称")
-    private String inspectionName;
-
-    @ApiModelProperty(value = "数据类型,数据类型表id")
-    private Long dataType;
-
-    @ApiModelProperty(value = "数据类型,数据类型表id")
-    private String dataTypeName;
-
-    @ApiModelProperty(value = "时间类型,0无,1时分")
-    private Integer timeType;
+//    @ApiModelProperty(value = "安防类型,字典表value")
+//    private Integer safeType;
+//
+//    @ApiModelProperty(value = "安防类型名称")
+//    private String safeTypeName;
+//
+//    @ApiModelProperty(value = "整改期限,天数")
+//    private int reformDay;
+//
+//    @ApiModelProperty(value = "检查方法,字典表value")
+//    private Integer inspection;
+//
+//    @ApiModelProperty(value = "检查方法名称")
+//    private String inspectionName;
+//
+//    @ApiModelProperty(value = "数据类型,数据类型表id")
+//    private Long dataType;
+//
+//    @ApiModelProperty(value = "数据类型,数据类型表id")
+//    private String dataTypeName;
+//
+//    @ApiModelProperty(value = "时间类型,0无,1时分")
+//    private Integer timeType;
 
     @ApiModelProperty(value = "备注")
     private String remark;
 
-    @ApiModelProperty(value = "风险等级code")
-    private Long degreeRisk;
-
-    @ApiModelProperty(value = "风险等级名称")
-    private String degreeRiskName;
+//    @ApiModelProperty(value = "风险等级code")
+//    private Long degreeRisk;
+//
+//    @ApiModelProperty(value = "风险等级名称")
+//    private String degreeRiskName;
 
     /*@ApiModelProperty(value = "t_area_check 主键id")
     private Long nfcBindId;*/

+ 24 - 24
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRulePoint/AppRulePointDto.java

@@ -15,45 +15,45 @@ public class AppRulePointDto {
     @ApiModelProperty(value = "检查点id")
     private Long id;
 
-    @ApiModelProperty(value = "规范id")
-    private Long ruleId;
+//    @ApiModelProperty(value = "规范id")
+//    private Long ruleId;
 
     @ApiModelProperty(value = "检查项id")
     private Long itemId;
 
-    @ApiModelProperty(value = "检查要点编号")
-    private int pointNum;
+//    @ApiModelProperty(value = "检查要点编号")
+//    private int pointNum;
 
     @ApiModelProperty(value = "检查要点名称")
-    private String pointName;
+    private String name;
 
     @ApiModelProperty(value = "检查区域,区域表id")
     private Long areaId;
 
-    @ApiModelProperty(value = "安防类型,字典表id")
-    private Integer safeType;
-
-    @ApiModelProperty(value = "整改期限,天数")
-    private int reformDay;
-
-    @ApiModelProperty(value = "检查方法,字典表id")
-    private Integer inspection;
-
-    @ApiModelProperty(value = "数据类型,数据类型表id")
-    private Long dataType;
-
-    @ApiModelProperty(value = "时间类型,0无,1时分")
-    private Integer timeType;
+//    @ApiModelProperty(value = "安防类型,字典表id")
+//    private Integer safeType;
+//
+//    @ApiModelProperty(value = "整改期限,天数")
+//    private int reformDay;
+//
+//    @ApiModelProperty(value = "检查方法,字典表id")
+//    private Integer inspection;
+//
+//    @ApiModelProperty(value = "数据类型,数据类型表id")
+//    private Long dataType;
+//
+//    @ApiModelProperty(value = "时间类型,0无,1时分")
+//    private Integer timeType;
 
     @ApiModelProperty(value = "备注")
     private String remark;
 
-    @NotNull(message = "规则类型不能为空")
-    @ApiModelProperty("规范类型id")
-    private Long ruleTypeId;
+//    @NotNull(message = "规则类型不能为空")
+//    @ApiModelProperty("规范类型id")
+//    private Long ruleTypeId;
 
-    @ApiModelProperty("风险等级")
-    private Long degreeRisk;
+//    @ApiModelProperty("风险等级")
+//    private Long degreeRisk;
 
     /*@ApiModelProperty(value = "nfc采集点id")
     private Long nfcBindId;*/

+ 9 - 9
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/appRulePoint/AppRulePointInfoDto.java

@@ -15,8 +15,8 @@ public class AppRulePointInfoDto {
     @ApiModelProperty(value = "检查项id")
     private Long itemId;
 
-    @ApiModelProperty(value = "检查项编号")
-    private Integer itemNum;
+//    @ApiModelProperty(value = "检查项编号")
+//    private Integer itemNum;
 
     @ApiModelProperty(value = "检查项内容")
     private String itemName;
@@ -27,14 +27,14 @@ public class AppRulePointInfoDto {
     @ApiModelProperty(value = "检查点id")
     private Long id;
 
-    @ApiModelProperty(value = "检查要点编号")
-    private int pointNum;
+//    @ApiModelProperty(value = "检查要点编号")
+//    private int pointNum;
 
-    @ApiModelProperty(value = "安防类型,字典表value")
-    private Integer safeType;
-
-    @ApiModelProperty(value = "安防类型名称")
-    private String safeTypeText;
+//    @ApiModelProperty(value = "安防类型,字典表value")
+//    private Integer safeType;
+//
+//    @ApiModelProperty(value = "安防类型名称")
+//    private String safeTypeText;
 
     @ApiModelProperty(value = "检查区域,区域表id")
     @JsonSerialize(using = ToStringSerializer.class)

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IAppRuleItemService.java

@@ -5,6 +5,9 @@ import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.core.resumption.domain.AppRuleItem;
 import com.xunmei.core.resumption.dto.appRuleItem.AppRuleItemDetailDto;
 import com.xunmei.core.resumption.dto.appRuleItem.AppRuleItemDto;
+import com.xunmei.core.resumption.vo.appRuleItem.RuleTreeItem;
+
+import java.util.List;
 
 /**
  * <p>
@@ -24,6 +27,7 @@ public interface IAppRuleItemService extends IService<AppRuleItem> {
 
     boolean del(Long id);
 
+    List<RuleTreeItem> getRuleTree(Long orgId);
 //    SysDictListDto dict();
 
 //    List<SecBookDtInstDto> dataType();

+ 0 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IAppRuleService.java

@@ -31,7 +31,6 @@ public interface IAppRuleService extends IService<AppRule> {
 
     void del(Long id);
 
-    Object getRuleGroupList();
 
     AppRuleInfoVo get(Long id);
 }

+ 51 - 11
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleItemServiceImpl.java

@@ -1,9 +1,12 @@
 package com.xunmei.core.resumption.service.impl;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.utils.IDHelper;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.core.resumption.domain.AppRule;
@@ -19,14 +22,16 @@ import com.xunmei.core.resumption.dto.appRulePoint.AppRulePointDto;
 import com.xunmei.core.resumption.service.IAppRuleItemService;
 import com.xunmei.core.resumption.service.IAppRulePointService;
 import com.xunmei.core.resumption.vo.appRuleItem.AppRuleItemPageVo;
+import com.xunmei.core.resumption.vo.appRuleItem.RuleTreeItem;
+import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.domain.SysOrg;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -49,6 +54,8 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
 //    private SysDictDetailService sysDictDetailService;
 
     @Resource
+    RemoteOrgService remoteOrgService;
+    @Resource
     private AppRuleMapper appRuleMapper;
 
     @Override
@@ -77,16 +84,12 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
 
         saveOrUpdate(item);
         final List<AppRulePointDto> pointDtoList = appRuleItemDto.getPointDtoList();
-        Map<Object, Object> hashMap = new HashMap<>();
+        Set<String> hashMap = new HashSet<>();
         for (AppRulePointDto appRulePointDto : pointDtoList) {
-            if (hashMap.containsKey(appRulePointDto.getPointNum())) {
-                throw new RuntimeException("检查要点编号重复!");
-            }
-            hashMap.put(appRulePointDto.getPointNum(), appRulePointDto.getPointName());
-            if (hashMap.containsKey(appRulePointDto.getPointName())) {
-                throw new RuntimeException("检查要点名称重复!");
+            if (hashMap.contains(appRulePointDto.getName())) {
+                throw new RuntimeException("履职内容重复!");
             }
-            hashMap.put(appRulePointDto.getPointName(), appRulePointDto.getPointNum());
+            hashMap.add(appRulePointDto.getName());
         }
 
 
@@ -177,7 +180,44 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
         appRulePointMapper.deleteByMap(MapUtil.of("item_id", id));
         return true;
     }
+    @Override
+    public List<RuleTreeItem> getRuleTree(Long orgId) {
+        List<RuleTreeItem> tree=new ArrayList<>();
+        List<SysOrg> orgs= remoteOrgService
+                .listByTypes(OrgListByTypesConditionEto.builder().orgId(orgId).orgTypes(Arrays.asList("1","2","3","4","11")).build(), SecurityConstants.INNER)
+                .getData();
+        if(ObjectUtil.isNull(orgs)){
+            return  tree;
+        }
+        Map<Long,SysOrg> orgMap= orgs.stream().collect(Collectors.toMap(o->o.getId(),o->o));
+        List<SysOrg> tops= orgs.stream().filter(o->!orgMap.containsKey(o.getParentId())).collect(Collectors.toList());
+        if(CollectionUtil.isEmpty(tops)){
+            return tree;
+        }
+        List<Long> orgIds= orgs.stream().map(o->o.getId()).collect(Collectors.toList());
+        List<AppRule> rules= appRuleMapper.selectList(new LambdaQueryWrapper<AppRule>().in(AppRule::getOrgId,orgIds))                ;
+
+        tree= tops.stream().map(o->generateTree(o,orgs,rules)).collect(Collectors.toList());
+
+        return tree;
+    }
+
+    private RuleTreeItem generateTree(SysOrg parent,List<SysOrg> allOrg,List<AppRule> allRule){
+        RuleTreeItem item=RuleTreeItem.builder().isRule(false).id(parent.getId()).label(parent.getName()).children(new ArrayList<>()).build();
+        List<RuleTreeItem> ruleItems= allRule.stream().filter(r->ObjectUtil.equal(r.getOrgId(),parent.getId()))
+                .map(o->RuleTreeItem.builder().isRule(true).id(o.getId()).label(o.getName()).orgType(o.getOrgType()).build())
+                .collect(Collectors.toList());
+        item.getChildren().addAll(ruleItems);
 
+        List<SysOrg> children= allOrg.stream()
+                .filter(o->ObjectUtil.equal(o.getParentId(),parent.getId()))
+                .collect(Collectors.toList());
+        for (SysOrg child : children) {
+            item.getChildren().add(generateTree(child,allOrg,allRule));
+        }
+
+        return  item;
+    }
 //    @Override
 //    public SysDictListDto dict() {
 //        final SysDictListDto dto = new SysDictListDto();

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

@@ -95,48 +95,6 @@ public class AppRuleServiceImpl extends ServiceImpl<AppRuleMapper, AppRule> impl
     }
 
     @Override
-    public Object getRuleGroupList() {
-        List<Map<Object, Object>> mapArrayList = new ArrayList<>();
-        List<AppRuleGroupVo> list = appRuleMapper.getRuleGroupList();
-        List<Long> orgTypeList = list.stream().map(AppRuleGroupVo::getOrgTypeId).distinct().collect(Collectors.toList());
-        for (Long ortTypeId : orgTypeList) {
-            for (AppRuleGroupVo groupVo : list) {
-                if (ortTypeId.equals(groupVo.getOrgTypeId())) {
-                    Map<Object, Object> hashMap = new HashMap<>();
-                    hashMap.put("id", groupVo.getOrgTypeId());
-                    hashMap.put("label", groupVo.getOrgType());
-                    if (mapArrayList.contains(hashMap)) {
-                        continue;
-                    }
-                    mapArrayList.add(hashMap);
-                }
-            }
-        }
-        for (Map<Object, Object> map : mapArrayList) {
-            final Long orgTypeId = (Long) map.get("id");
-            if (ObjectUtil.isNull(orgTypeId)) {
-                continue;
-            }
-            final List<AppRuleGroupVo> groupVoList = list.stream().filter(vo -> orgTypeId.equals(vo.getOrgTypeId())).collect(Collectors.toList());
-            List<Map<Object, Object>> dataList = new ArrayList<>();
-            for (AppRuleGroupVo groupVo : groupVoList) {
-                Map<Object, Object> objectHashMap = new HashMap<>();
-                objectHashMap.put("id", String.valueOf(groupVo.getRuleId()));
-                objectHashMap.put("label", groupVo.getRuleName());
-                objectHashMap.put("children", new ArrayList<>());
-                objectHashMap.put("orgTypeId", orgTypeId);
-                dataList.add(objectHashMap);
-            }
-            map.put("children", dataList);
-        }
-       /* for (Map<Object, Object> objectMap : mapArrayList) {
-            objectMap.remove("id");
-        }*/
-
-        return mapArrayList;
-    }
-
-    @Override
     public AppRuleInfoVo get(Long id) {
         AppRule rule= appRuleMapper.selectById(id);
         return AppRuleInfoVo.of(rule);

+ 3 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRuleItem/AppRuleItemPageVo.java

@@ -14,14 +14,12 @@ import java.util.List;
  */
 @Data
 public class AppRuleItemPageVo {
-
-
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
     private Long ruleId;
-    private String itemName;
-    private Integer itemNum;
-    private String itemDesc;
+    private String name;
+//    private Integer itemNum;
+    private String desc;
     private Integer pointNums;
     @ApiModelProperty(value = "检查点")
     private List<AppRulePointDetailDto> pointDtoList;

+ 24 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appRuleItem/RuleTreeItem.java

@@ -0,0 +1,24 @@
+package com.xunmei.core.resumption.vo.appRuleItem;
+
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@Builder
+
+public class RuleTreeItem {
+     Long id;
+
+     String label;
+
+     boolean isRule;
+
+     /**
+      * 履职机构类型
+      */
+     String orgType;
+
+     List<RuleTreeItem> children;
+}

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaController.java

@@ -91,7 +91,7 @@ public class SysAreaController extends BaseController {
     /**
      * 删除【请填写功能名称】
      */
-    @ApiOperation(value = "删除SysArea")
+    @ApiOperation(value = "按机构类型获取所有区域")
 //    @RequiresPermissions("system:area:list
     @DeleteMapping("/orgType/{orgType}")
     public AjaxResult listByOrgType(@PathVariable Integer orgType) {

+ 6 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java

@@ -10,6 +10,7 @@ import com.xunmei.common.log.annotation.Log;
 import com.xunmei.common.log.enums.BusinessType;
 import com.xunmei.common.security.annotation.RequiresPermissions;
 import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
 import com.xunmei.system.api.domain.SysDept;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.domain.SysUser;
@@ -161,4 +162,9 @@ public class SysDeptController extends BaseController {
     public R<List<Long>> findListByOrgType(Integer execOrgType) {
         return R.ok(orgService.findListByOrgType(execOrgType));
     }
+
+    @PostMapping("/findListByOrgTypes")
+    public R<List<SysOrg>> listByTypes(OrgListByTypesConditionEto eto){
+        return R.ok(orgService.listByTypes(eto.getOrgId(),eto.getOrgTypes()));
+    }
 }

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

@@ -1,6 +1,7 @@
 package com.xunmei.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.domain.R;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.system.api.domain.SysOrg;
 
@@ -22,6 +23,9 @@ public interface ISysOrgService extends IService<SysOrg> {
     SysOrg selectSysOrgById(Long id);
     List<Long> selectCheckSubOrgIdList(Long orgId);
     public List<Long> findListByOrgType(Integer execOrgType);
+
+    List<SysOrg> listByTypes(Long topId,List<String> types);
+
     /**
      * 查询【请填写功能名称】列表
      *

+ 19 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -1,7 +1,9 @@
 package com.xunmei.system.service.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.utils.StringUtils;
@@ -83,10 +85,26 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
     public SysOrg selectSysOrgById(Long id) {
         return sysOrgMapper.selectById(id);
     }
+
     @Override
-    public List<Long> findListByOrgType(Integer execOrgType){
+    public List<Long> findListByOrgType(Integer execOrgType) {
         return sysOrgMapper.findListByOrgType(execOrgType);
     }
+
+    @Override
+    public List<SysOrg> listByTypes(Long topId,List<String> types) {
+        SysOrg top= sysOrgMapper.selectById(topId);
+        if(ObjectUtil.isNull(top)){
+            return  new ArrayList<>();
+        }
+
+        LambdaQueryWrapper<SysOrg> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SysOrg::getDeleted, 0);
+        wrapper.in(SysOrg::getType, types);
+        wrapper.likeLeft(SysOrg::getPath,top.getPath());
+        return sysOrgMapper.selectList(wrapper);
+    }
+
     /**
      * 查询【请填写功能名称】列表
      *