Bladeren bron

1、术语检索默认展示全部内容

zhaops 3 jaren geleden
bovenliggende
commit
8d7b3a65f1

+ 6 - 0
src/main/java/com/diagbot/facade/MedRetrievalFacade.java

@@ -7,6 +7,8 @@ import com.diagbot.dto.RetrievalConceptDTO;
 import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
 import com.diagbot.enums.LexiconEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
@@ -46,6 +48,10 @@ public class MedRetrievalFacade {
         if (retrievalVO.getSize() == null) {
             retrievalVO.setSize(100);
         }
+        if (retrievalVO.getDefaultList().equals(0)
+                && StringUtil.isBlank(retrievalVO.getInputStr())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入检索内容");
+        }
         RetrievalDTO retrievalDTO = new RetrievalDTO();
         MedRetrievalVO medRetrievalVO = new MedRetrievalVO();
         BeanUtil.copyProperties(retrievalVO, medRetrievalVO);

+ 6 - 1
src/main/java/com/diagbot/vo/RetrievalVO.java

@@ -23,7 +23,7 @@ public class RetrievalVO {
     /**
      * 检索内容
      */
-    @NotBlank(message = "请输入检索内容")
+    //@NotBlank(message = "请输入检索内容")
     private String inputStr;
     //    /**
     //     * 性别:1-男、2-女、3-通用
@@ -38,4 +38,9 @@ public class RetrievalVO {
      */
     @ApiModelProperty(hidden = true)
     private Integer size;
+
+    /**
+     * 默认展示 0:不展示,1:展示全部
+     */
+    private Integer defaultList = 0;
 }

+ 1 - 0
src/main/java/com/diagbot/web/RetrievalController.java

@@ -44,6 +44,7 @@ public class RetrievalController {
     @ApiOperation(value = "术语检索[zhaops]",
             notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、15-药品剂型、16-给药途径 <br>" +
                     "inputStr: 检索内容<br>" +
+                    "defaultList: 默认展示 0:不展示,1:展示全部<br>" +
                     "sex: 性别:1-男、2-女、3-通用 <br>" +
                     "age: 年龄<br>")
     @PostMapping("/index")