Browse Source

Merge branch 'develop' into innerDevelop

gaodm 3 years ago
parent
commit
cfb627ebde

+ 10 - 18
src/main/java/com/diagbot/client/CdssCoreClient.java

@@ -1,25 +1,9 @@
 package com.diagbot.client;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.hystrix.CdssCoreHystrix;
-import com.diagbot.dto.ConceptDetailDTO;
-import com.diagbot.dto.ConceptScaleDTO;
-import com.diagbot.dto.DictionaryInfoDTO;
-import com.diagbot.dto.GetAllForRelationDTO;
-import com.diagbot.dto.IndexBatchDTO;
-import com.diagbot.dto.IndicationDTO;
-import com.diagbot.dto.KlConceptStaticDTO;
-import com.diagbot.dto.KlRuleByIdParDTO;
-import com.diagbot.dto.KlRuleInfoDTO;
-import com.diagbot.dto.KllisDetailDTO;
-import com.diagbot.dto.PushDTO;
-import com.diagbot.dto.PushPlanDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.RetrievalDTO;
-import com.diagbot.dto.StaticKnowledgeDTO;
-import com.diagbot.dto.StaticKnowledgeIndexDTO;
-import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
-import com.diagbot.dto.TermConceptDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.KlRuleMenuWrapper;
 import com.diagbot.vo.*;
 import org.springframework.cloud.openfeign.FeignClient;
@@ -267,4 +251,12 @@ public interface CdssCoreClient {
 
     @PostMapping("/term/termMatching")
     public RespDTO<List<TermConceptDTO>> getTermMatching(@Valid @RequestBody TermMatchingVO termMatchingVO);
+
+    //查询所有有效的规则
+    @PostMapping("/klRule/getRulePage")
+    RespDTO<Page<RuleQueryDTO>> getRulePage(@RequestBody RuleQueryVO ruleQueryVO);
+
+    //根据录入内容查询有效规则的明细
+    @PostMapping("/klRule/getRuleDetail")
+    RespDTO<RuleDTO> getRuleDetail(@RequestBody @Valid RuleQueryKeyVO ruleQueryKeyVO);
 }

+ 14 - 18
src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java

@@ -1,25 +1,9 @@
 package com.diagbot.client.hystrix;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.CdssCoreClient;
-import com.diagbot.dto.ConceptDetailDTO;
-import com.diagbot.dto.ConceptScaleDTO;
-import com.diagbot.dto.DictionaryInfoDTO;
-import com.diagbot.dto.GetAllForRelationDTO;
-import com.diagbot.dto.IndexBatchDTO;
-import com.diagbot.dto.IndicationDTO;
-import com.diagbot.dto.KlConceptStaticDTO;
-import com.diagbot.dto.KlRuleByIdParDTO;
-import com.diagbot.dto.KlRuleInfoDTO;
-import com.diagbot.dto.KllisDetailDTO;
-import com.diagbot.dto.PushDTO;
-import com.diagbot.dto.PushPlanDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.RetrievalDTO;
-import com.diagbot.dto.StaticKnowledgeDTO;
-import com.diagbot.dto.StaticKnowledgeIndexDTO;
-import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
-import com.diagbot.dto.TermConceptDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.KlRuleMenuWrapper;
 import com.diagbot.vo.*;
 import lombok.extern.slf4j.Slf4j;
@@ -354,4 +338,16 @@ public class CdssCoreHystrix implements CdssCoreClient {
         log.error("【hystrix】调用{}异常", "getTermMatching");
         return null;
     }
+
+    @Override
+    public RespDTO<Page<RuleQueryDTO>> getRulePage(@RequestBody RuleQueryVO ruleQueryVO) {
+        log.error("【hystrix】调用{}异常", "getRulePage");
+        return null;
+    }
+
+    @Override
+    public RespDTO<RuleDTO> getRuleDetail(@RequestBody @Valid RuleQueryKeyVO ruleQueryKeyVO) {
+        log.error("【hystrix】调用{}异常", "getRuleDetail");
+        return null;
+    }
 }

+ 2 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -137,6 +137,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/term/termMatching").permitAll()
                 .antMatchers("/sys/mr/testIndication").permitAll()
                 .antMatchers("/test/logTest").permitAll()
+                .antMatchers("/klRule/getRulePage").permitAll()
+                .antMatchers("/klRule/getRuleDetail").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

+ 2 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -179,6 +179,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/term/termMatching", request)
                 || matchers("/sys/mr/testIndication", request)
                 || matchers("/test/logTest", request)
+                || matchers("/klRule/getRulePage", request)
+                || matchers("/klRule/getRuleDetail", request)
                 || matchers("/", request)) {
             return true;
         }

+ 28 - 0
src/main/java/com/diagbot/dto/RuleBaseDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:25
+ */
+@Getter
+@Setter
+@ToString(includeFieldNames = false)
+public class RuleBaseDTO {
+    private String baseLibName = "";
+    private Integer baseLibType = 0;
+    private Integer baseType = 0;
+    private String baseMinOperator = "";
+    private String baseMinValue = "";
+    private String baseMinUnit = "";
+    private String baseMaxOperator = "";
+    private String baseMaxValue = "";
+    private String baseMaxUnit = "";
+    private String baseEqOperator = "";
+    private String baseEqValue = "";
+    private String baseEqUnit = "";
+}

+ 24 - 0
src/main/java/com/diagbot/dto/RuleConditionDTO.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:32
+ */
+@Getter
+@Setter
+@ToString(exclude = { "ruleGroup", "msg", "description" }, includeFieldNames = false)
+public class RuleConditionDTO {
+    private Integer hasSubCond;
+    private String ruleGroup;
+    private String msg;
+    private String description;
+    private List<RuleBaseDTO> ruleBaseDTOList = new ArrayList<>();
+}

+ 21 - 0
src/main/java/com/diagbot/dto/RuleDTO.java

@@ -0,0 +1,21 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:34
+ */
+@Getter
+@Setter
+public class RuleDTO {
+    private String libName;
+    private Integer libType;
+    private Integer ruleType;
+    private List<RuleConditionDTO> ruleConditionDTOList = new ArrayList<>();
+}

+ 19 - 0
src/main/java/com/diagbot/dto/RuleQueryDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/12/30 13:21
+ */
+@Getter
+@Setter
+public class RuleQueryDTO {
+    private String libName;
+    private Integer libType;
+    private String libTypeName;
+    private Integer ruleType;
+    private String ruleTypeName;
+}

+ 17 - 0
src/main/java/com/diagbot/facade/KlRuleFacade.java

@@ -1,16 +1,21 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.KlRuleByIdParDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RuleDTO;
+import com.diagbot.dto.RuleQueryDTO;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.KlRuleByIdVO;
 import com.diagbot.vo.KlRuleInfoClearVO;
 import com.diagbot.vo.KlRuleInfoSaveVO;
 import com.diagbot.vo.KlRuleInfoVO;
 import com.diagbot.vo.KlRuleSatartOrdisaVO;
+import com.diagbot.vo.RuleQueryKeyVO;
+import com.diagbot.vo.RuleQueryVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -62,4 +67,16 @@ public class KlRuleFacade {
         RespDTOUtil.respNGDeal(booleanRespDTO, "启用规则失败");
         return booleanRespDTO.data;
     }
+
+    public Page<RuleQueryDTO> getRulePage(RuleQueryVO ruleQueryVO) {
+        RespDTO<Page<RuleQueryDTO>> rulepageRespDTO = cdssCoreClient.getRulePage(ruleQueryVO);
+        RespDTOUtil.respNGDeal(rulepageRespDTO, "查询所有有效的规则失败");
+        return rulepageRespDTO.data;
+    }
+
+    public RuleDTO getRuleDetail(RuleQueryKeyVO ruleQueryKeyVO) {
+        RespDTO<RuleDTO> ruleDTORespDTO = cdssCoreClient.getRuleDetail(ruleQueryKeyVO);
+        RespDTOUtil.respNGDeal(ruleDTORespDTO, "查询规则明细失败");
+        return ruleDTORespDTO.data;
+    }
 }

+ 29 - 0
src/main/java/com/diagbot/vo/RuleQueryKeyVO.java

@@ -0,0 +1,29 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/12/30 13:21
+ */
+@Getter
+@Setter
+public class RuleQueryKeyVO {
+    @NotBlank(message = "医学标准术语不可为空")
+    private String libName;
+    @NotNull(message = "术语类型不可为空")
+    private Integer libType;
+    @NotNull(message = "规则类型不可为空")
+    private Integer ruleType;
+    //规则名称
+    private String description;
+    //基础医学标准术语
+    private String baseLibName;
+    //基础规则术语类型
+    private Integer baseLibType;
+}

+ 27 - 0
src/main/java/com/diagbot/vo/RuleQueryVO.java

@@ -0,0 +1,27 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/12/30 13:21
+ */
+@Getter
+@Setter
+public class RuleQueryVO extends Page {
+    //医学标准术语
+    private String libName;
+    //术语类型
+    private Integer libType;
+    //规则类型
+    private Integer ruleType;
+    //规则名称
+    private String description;
+    //基础医学标准术语
+    private String baseLibName;
+    //基础规则术语类型
+    private Integer baseLibType;
+}

+ 1 - 1
src/main/java/com/diagbot/web/KlDictionaryConller.java

@@ -16,7 +16,7 @@ import java.util.Map;
 
 /**
  * @author wangfeng
- * @Description:
+ * @Description: 远程调用获取med_2021字典信息
  * @date 2021-03-17 13:14
  */
 @RestController

+ 29 - 0
src/main/java/com/diagbot/web/KlRuleController.java

@@ -6,12 +6,16 @@ import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.KlRuleByIdParDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RuleDTO;
+import com.diagbot.dto.RuleQueryDTO;
 import com.diagbot.facade.KlRuleFacade;
 import com.diagbot.vo.KlRuleByIdVO;
 import com.diagbot.vo.KlRuleInfoClearVO;
 import com.diagbot.vo.KlRuleInfoSaveVO;
 import com.diagbot.vo.KlRuleInfoVO;
 import com.diagbot.vo.KlRuleSatartOrdisaVO;
+import com.diagbot.vo.RuleQueryKeyVO;
+import com.diagbot.vo.RuleQueryVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -84,4 +88,29 @@ public class KlRuleController {
         return RespDTO.onSuc(klRuleFacade.startRuleInfos(klRuleSatartOrdisaVO));
     }
 
+    @ApiOperation(value = "查询所有有效的规则[by:gaodm]",
+            notes = "libName: 医学标准术语<br>" +
+                    "libType: 术语类型<br>" +
+                    "ruleType: 规则类型<br>" +
+                    "description: 规则名称<br>" +
+                    "baseLibName: 基础医学标准术语<br>" +
+                    "baseLibType: 基础规则术语类型")
+    @PostMapping("/getRulePage")
+    @SysLogger("getRulePage")
+    public RespDTO<Page<RuleQueryDTO>> getRulePage(@RequestBody RuleQueryVO ruleQueryVO) {
+        return RespDTO.onSuc(klRuleFacade.getRulePage(ruleQueryVO));
+    }
+
+    @ApiOperation(value = "根据录入内容查询有效规则的明细[by:zhoutg]",
+            notes = "libName: 医学标准术语<br>" +
+                    "libType: 术语类型<br>" +
+                    "ruleType: 规则类型<br>" +
+                    "description: 规则名称<br>" +
+                    "baseLibName: 基础医学标准术语<br>" +
+                    "baseLibType: 基础规则术语类型")
+    @PostMapping("/getRuleDetail")
+    @SysLogger("getRuleDetail")
+    public RespDTO<RuleDTO> getRuleDetail(@RequestBody @Valid RuleQueryKeyVO ruleQueryKeyVO) {
+        return RespDTO.onSuc(klRuleFacade.getRuleDetail(ruleQueryKeyVO));
+    }
 }