zhoutg 4 rokov pred
rodič
commit
4cb713c4f4

+ 27 - 0
src/main/java/com/diagbot/dto/RegulationIndexDTO.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2020/8/17 11:28
+ */
+@Data
+public class RegulationIndexDTO {
+
+    /**
+     * 规则名称
+     */
+    private String name;
+
+    /**
+     * 规则编码
+     */
+    private Long code;
+
+    /**
+     * 规则类型:(1:量表)
+     */
+    private Integer type;
+}

+ 21 - 0
src/main/java/com/diagbot/facade/KlRegulationFacade.java

@@ -1,8 +1,18 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RegulationIndexDTO;
+import com.diagbot.entity.KlRegulation;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.StatusEnum;
 import com.diagbot.service.impl.KlRegulationServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.vo.RegulationIndexVO;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 /**
  * @Description:
  * @author: zhoutg
@@ -11,4 +21,15 @@ import org.springframework.stereotype.Component;
 @Component
 public class KlRegulationFacade extends KlRegulationServiceImpl {
 
+    public List<RegulationIndexDTO> index(RegulationIndexVO regulationIndexVO) {
+        List<KlRegulation> klRegulationList = this.list(new QueryWrapper<KlRegulation>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("status", StatusEnum.Enable.getKey())
+                .eq(regulationIndexVO.getType() != null, "type", regulationIndexVO.getType())
+                .like("name", regulationIndexVO.getName())
+                .notIn(ListUtil.isNotEmpty(regulationIndexVO.getNotCodeList()), "code", regulationIndexVO.getNotCodeList())
+        );
+        List<RegulationIndexDTO> regulationIndexDTOList = BeanUtil.listCopyTo(klRegulationList, RegulationIndexDTO.class);
+        return regulationIndexDTOList;
+    }
 }

+ 21 - 0
src/main/java/com/diagbot/vo/RegulationIndexVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description: 规则搜索
+ * @Author:zhoutg
+ * @time: 2020/7/29 15:34
+ */
+@Data
+public class RegulationIndexVO {
+
+    // 内容
+    private String name;
+    // 规则类型:(1:量表)
+    private Integer type;
+    // 过滤编码
+    private List<String> notCodeList;
+}

+ 17 - 0
src/main/java/com/diagbot/web/KlRegulationController.java

@@ -1,9 +1,12 @@
 package com.diagbot.web;
 
 
+import com.diagbot.dto.RegulationIndexDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.ScaleDTO;
 import com.diagbot.facade.KlRegulationBaseFacade;
+import com.diagbot.facade.KlRegulationFacade;
+import com.diagbot.vo.RegulationIndexVO;
 import com.diagbot.vo.ScaleVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -13,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * <p>
  * 通用规则表 前端控制器
@@ -28,6 +33,8 @@ public class KlRegulationController {
 
     @Autowired
     KlRegulationBaseFacade klRegulationBaseFacade;
+    @Autowired
+    KlRegulationFacade klRegulationFacade;
 
     @ApiOperation(value = "量表规则匹配[zhoutg]", notes = "")
     @PostMapping("/scaleRule")
@@ -35,4 +42,14 @@ public class KlRegulationController {
         ScaleDTO scaleDTO = klRegulationBaseFacade.process(scaleVO);
         return RespDTO.onSuc(scaleDTO);
     }
+
+    @ApiOperation(value = "规则搜索[zhoutg]", notes =
+            "name:内容\n" +
+            "type:规则类型:(1:量表)\n" +
+            " notCodeList:过滤编码")
+    @PostMapping("/index")
+    public RespDTO<RegulationIndexDTO> index(@RequestBody RegulationIndexVO regulationIndexVO) {
+        List<RegulationIndexDTO> regulationIndexDTOList = klRegulationFacade.index(regulationIndexVO);
+        return RespDTO.onSuc(regulationIndexDTOList);
+    }
 }