瀏覽代碼

Merge branch 'develop' into dev/presscache_20211225

# Conflicts:
#	src/main/java/com/diagbot/facade/KlRuleFacade.java
#	src/main/java/com/diagbot/service/impl/KlRuleServiceImpl.java
gaodm 3 年之前
父節點
當前提交
46a967b10a

+ 60 - 0
src/main/java/com/diagbot/dto/DefaultExportDTO.java

@@ -0,0 +1,60 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 导出通用类
+ * @author: zhoutg
+ * @date: 2021/8/2 13:40
+ */
+@Data
+public class DefaultExportDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    // ruleId
+    private Long ruleId;
+    // 规则组
+    private String ruleGroup;
+    // 规则分类
+    private String ruleType;
+    // 组号
+    private String groupType;
+    // 提示语
+    private String msg;
+    // conceptId
+    private Long conceptId;
+    // libType
+    private Integer libType;
+    // libTypeCn
+    private String libTypeCn;
+    // libName
+    private String libName;
+    // baseConcept
+    private Long baseConcept;
+    // baseType
+    private Integer baseType;
+
+    @Excel(name="术语名称", width = 25, orderNum = "30")
+    private String baseName = "";
+    @Excel(name="术语类型", width = 17, orderNum = "35")
+    private String baseTypeCn;
+    @Excel(name="术语子元素", width = 35, orderNum = "38")
+    private String sonName;
+    @Excel(name="匹配条件", width = 17, orderNum = "40")
+    private String tabooType;
+    @Excel(name="最小值", width = 10, orderNum = "60")
+    private String minValue;
+    @Excel(name="最小值符号", width = 10, orderNum = "50")
+    private String minOperator;
+    @Excel(name="最大值", width = 10, orderNum = "80")
+    private String maxValue;
+    @Excel(name="最大值符号", width = 10, orderNum = "70")
+    private String maxOperator;
+    @Excel(name="等于", width = 10, orderNum = "90")
+    private String eqValue;
+    // @Excel(name="condId", width = 10, orderNum = "110")
+    // private Long condId;
+}

+ 18 - 0
src/main/java/com/diagbot/dto/GatherDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2021/6/7 10:27
+ */
+@Data
+public class GatherDTO {
+    // 集合标准名
+    private String parName;
+    // 集合类型
+    private String parLibType;
+    // 元素标准名
+    private String sonName;
+}

+ 33 - 0
src/main/java/com/diagbot/dto/IndicationNewExportDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 开单导出
+ * @author: zhoutg
+ * @date: 2021/8/2 13:40
+ */
+@Data
+public class IndicationNewExportDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(needMerge = true, name="规则名称", width = 25, orderNum = "10")
+    private String ruleGroup = "";
+    @Excel(needMerge = true, name="开单名称", width = 25, orderNum = "11")
+    private String libName;
+    @Excel(needMerge = true, name="开单类型", width = 17, orderNum = "12")
+    private String libTypeCn;
+    @Excel(needMerge = true, name="开单子名称", width = 25, orderNum = "13")
+    private String sonLibName;
+    @ExcelCollection(name="组内明细", orderNum = "20")
+    private List<DefaultExportDTO> defaultExportDTOList= new ArrayList<>();
+    @Excel(needMerge = true, name="提示语", width = 25, orderNum = "30")
+    private String msg;
+}

+ 29 - 0
src/main/java/com/diagbot/dto/OtherExportDTO.java

@@ -0,0 +1,29 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 开单导出
+ * @author: zhoutg
+ * @date: 2021/8/2 13:40
+ */
+@Data
+public class OtherExportDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(needMerge = true, name="规则名称", width = 25, orderNum = "10")
+    private String ruleGroup = "";
+
+    @ExcelCollection(name="组内明细", orderNum = "20")
+    private List<DefaultExportDTO> defaultExportDTOList= new ArrayList<>();
+
+    @Excel(needMerge = true, name="提示语", width = 25, orderNum = "30")
+    private String msg;
+}

+ 14 - 0
src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.GatherDTO;
 import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.KllisDetailDTO;
@@ -10,6 +11,7 @@ import com.diagbot.entity.KlLibraryInfo;
 import com.diagbot.entity.KlOperation;
 import com.diagbot.entity.TcmDisease;
 import com.diagbot.entity.TcmSyndrome;
+import com.diagbot.enums.CommonEnum;
 import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.LexiconEnum;
@@ -17,10 +19,12 @@ import com.diagbot.enums.MatchSourceEnum;
 import com.diagbot.enums.StatusEnum;
 import com.diagbot.service.impl.KlConceptServiceImpl;
 import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExtUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ConceptVO;
 import com.diagbot.vo.FilterVO;
+import com.diagbot.vo.GatherVO;
 import com.diagbot.vo.IndexByApprovalVO;
 import com.diagbot.vo.KllisDetailVO;
 import com.diagbot.vo.SearchCollectionConceptVO;
@@ -33,6 +37,7 @@ import org.springframework.stereotype.Component;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -528,4 +533,13 @@ public class KlConceptFacade extends KlConceptServiceImpl {
         List<GetAllForRelationDTO> getAllForRelationDTOS = this.searchCollectionConcept(searchCollectionConceptVO);
         return getAllForRelationDTOS;
     }
+
+    public Map<String, List<GatherDTO>> getGatherFac(GatherVO gatherVO) {
+        if (gatherVO == null || ListUtil.isEmpty(gatherVO.getGatherNameList())) {
+            return new LinkedHashMap<>();
+        }
+        List<GatherDTO> gatherList = getGather(gatherVO);
+        Map<String, List<GatherDTO>> map = ExtUtil.getMultiKeyList(gatherList, CommonEnum.splitSymbol.getName(), "parName", "parLibType");
+        return map;
+    }
 }

+ 188 - 3
src/main/java/com/diagbot/facade/KlRuleFacade.java

@@ -3,16 +3,20 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.IndicationExportDTO;
+import com.diagbot.dto.DefaultExportDTO;
+import com.diagbot.dto.GatherDTO;
+import com.diagbot.dto.IndicationNewExportDTO;
 import com.diagbot.dto.KlRuleByIdDTO;
 import com.diagbot.dto.KlRuleByIdParDTO;
 import com.diagbot.dto.KlRuleByIdSubDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
 import com.diagbot.dto.RuleDTO;
 import com.diagbot.dto.RuleQueryDTO;
+import com.diagbot.dto.OtherExportDTO;
 import com.diagbot.entity.KlRule;
 import com.diagbot.entity.KlRuleBase;
 import com.diagbot.entity.KlRuleCondition;
+import com.diagbot.enums.CommonEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.RedisEnum;
 import com.diagbot.exception.CommonErrorCode;
@@ -21,9 +25,12 @@ import com.diagbot.service.impl.KlRuleServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ExtUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.RedisUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.ExportDafaultVO;
+import com.diagbot.vo.GatherVO;
 import com.diagbot.vo.KlRuleByIdVO;
 import com.diagbot.vo.KlRuleInfoClearVO;
 import com.diagbot.vo.KlRuleInfoSaveSubVO;
@@ -32,6 +39,8 @@ import com.diagbot.vo.KlRuleInfoVO;
 import com.diagbot.vo.KlRuleSatartOrdisaVO;
 import com.diagbot.vo.RuleQueryKeyVO;
 import com.diagbot.vo.RuleQueryVO;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -39,6 +48,8 @@ import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description:
@@ -53,6 +64,8 @@ public class KlRuleFacade extends KlRuleServiceImpl {
     KlRuleBaseFacade klRuleBaseFacade;
     @Autowired
     private RedisUtil redisUtil;
+    @Autowired
+    KlConceptFacade klConceptFacade;
 
     /**
      * @param klRuleInfoVO
@@ -254,11 +267,183 @@ public class KlRuleFacade extends KlRuleServiceImpl {
      * @return
      */
     public void exportIndicationFac(HttpServletResponse response) {
-        List<IndicationExportDTO> indicationExportDTOS = exportIndication();
-        ExcelUtils.exportExcel(indicationExportDTOS, null, "开单合理性", IndicationExportDTO.class, "indication.xlsx",
+        ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
+        exportDafaultVO.setRuleType(1);
+        List<IndicationNewExportDTO> res = Lists.newArrayList();
+        List<DefaultExportDTO> defaultExportDTOS = exportOther(exportDafaultVO);
+        GatherVO gatherVO = new GatherVO();
+        List<String> gatherNameList = Lists.newArrayList();
+        for (DefaultExportDTO defaultExportDTO : defaultExportDTOS) {
+            // 开单名称集合
+            if (isGatherType(defaultExportDTO.getLibType())) {
+                gatherNameList.add(defaultExportDTO.getLibName() + CommonEnum.splitSymbol.getName() + defaultExportDTO.getLibType());
+            }
+            // 规则集合
+            if (isGatherType(defaultExportDTO.getBaseType())) {
+                gatherNameList.add(defaultExportDTO.getBaseName() + CommonEnum.splitSymbol.getName() + defaultExportDTO.getBaseType());
+            }
+        }
+        gatherVO.setGatherNameList(gatherNameList);
+        Map<String, List<GatherDTO>> gatherMap = klConceptFacade.getGatherFac(gatherVO);
+        Map<String, List<DefaultExportDTO>> multiKeyList = ExtUtil.getMultiKeyList(defaultExportDTOS, CommonEnum.splitSymbol.getName(), "ruleId", "groupType");
+        for (String key : multiKeyList.keySet()) {
+            List<DefaultExportDTO> defaultList = multiKeyList.get(key);
+            for (DefaultExportDTO defaultExportDTO : defaultList) {
+                // 集合类型对集合元素赋值
+                if (isGatherType(defaultExportDTO.getBaseType())) {
+                    List<GatherDTO> gatherDTOS = gatherMap.get(defaultExportDTO.getBaseName() + CommonEnum.splitSymbol.getName() + defaultExportDTO.getBaseType());
+                    List<String> sonNameList = gatherDTOS.stream().map(r -> r.getSonName()).collect(Collectors.toList());
+                    // 子元素赋值
+                    defaultExportDTO.setSonName(StringUtils.join(sonNameList, CommonEnum.splitSymbol.getName()));
+                }
+            }
+            DefaultExportDTO defaultExportDTO = defaultList.get(0);
+            IndicationNewExportDTO indicationNewExportDTO = new IndicationNewExportDTO();
+            indicationNewExportDTO.setRuleGroup(defaultExportDTO.getRuleGroup());
+            indicationNewExportDTO.setLibName(defaultExportDTO.getLibName());
+            indicationNewExportDTO.setLibTypeCn(defaultExportDTO.getLibTypeCn());
+            indicationNewExportDTO.setMsg(defaultExportDTO.getMsg());
+            indicationNewExportDTO.setDefaultExportDTOList(defaultList);
+            // 集合类型对集合元素赋值
+            if (isGatherType(defaultExportDTO.getLibType())) {
+                List<GatherDTO> gatherDTOS = gatherMap.get(defaultExportDTO.getLibName() + CommonEnum.splitSymbol.getName() + defaultExportDTO.getLibType());
+                List<String> sonNameList = gatherDTOS.stream().map(r -> r.getSonName()).collect(Collectors.toList());
+                // 子元素赋值
+                indicationNewExportDTO.setSonLibName(StringUtils.join(sonNameList, CommonEnum.splitSymbol.getName()));
+            }
+            res.add(indicationNewExportDTO);
+        }
+        ExcelUtils.exportExcel(res, null, "开单合理性", IndicationNewExportDTO.class, "indication.xlsx",
                 response, 12.8f);
     }
 
+    /**
+     * 是否集合类型
+     *
+     * @param type
+     * @return
+     */
+    public Boolean isGatherType(Integer type) {
+        if (type == null) {
+            return false;
+        }
+        if ((type >= 308 && type <= 329) || (type >= 301 && type <= 304)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 其他值提醒化验导出
+     *
+     * @return
+     */
+    public void exportOtherLis(HttpServletResponse response) {
+        ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
+        exportDafaultVO.setRuleType(4);
+        exportDafaultVO.setLibTypeList(Lists.newArrayList(108L));
+        List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
+        ExcelUtils.exportExcel(otherExportDTOList, null, "其他值提醒化验", OtherExportDTO.class, "otherLis.xlsx",
+                response, 12.8F);
+    }
+
+    /**
+     * 其他值提醒辅检导出
+     *
+     * @return
+     */
+    public void exportOtherPacs(HttpServletResponse response) {
+        ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
+        exportDafaultVO.setRuleType(4);
+        exportDafaultVO.setLibTypeList(Lists.newArrayList(112L));
+        List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
+        ExcelUtils.exportExcel(otherExportDTOList, null, "其他值提醒辅检", OtherExportDTO.class, "otherPacs.xlsx",
+                response, 12.8F);
+    }
+
+    /**
+     * 其他值提醒输血导出
+     *
+     * @return
+     */
+    public void exportOtherTransfusion(HttpServletResponse response) {
+        ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
+        exportDafaultVO.setRuleType(5);
+        exportDafaultVO.setLibTypeList(Lists.newArrayList(108L));
+        List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
+        ExcelUtils.exportExcel(otherExportDTOList, null, "其他值提醒输血", OtherExportDTO.class, "otherTransfusion.xlsx",
+                response, 12.8F);
+    }
+
+    /**
+     * 危急值化验导出
+     *
+     * @return
+     */
+    public void exportCriticalLis(HttpServletResponse response) {
+        ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
+        exportDafaultVO.setRuleType(3);
+        exportDafaultVO.setLibTypeList(Lists.newArrayList(108L));
+        List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
+        ExcelUtils.exportExcel(otherExportDTOList, null, "危急值化验", OtherExportDTO.class, "criticalLis.xlsx",
+                response, 12.8F);
+    }
+
+    /**
+     * 危急值辅检导出
+     *
+     * @return
+     */
+    public void exportCriticalPacs(HttpServletResponse response) {
+        ExportDafaultVO exportDafaultVO = new ExportDafaultVO();
+        exportDafaultVO.setRuleType(3);
+        exportDafaultVO.setLibTypeList(Lists.newArrayList(112L));
+        List<OtherExportDTO> otherExportDTOList = generateExport(exportDafaultVO);
+        ExcelUtils.exportExcel(otherExportDTOList, null, "危急值辅检", OtherExportDTO.class, "criticalPacs.xlsx",
+                response, 12.8F);
+    }
+
+    /**
+     * 生成导出类
+     *
+     * @param exportDafaultVO
+     * @return
+     */
+    public List<OtherExportDTO> generateExport(ExportDafaultVO exportDafaultVO) {
+        // 导出类
+        List<OtherExportDTO> otherExportDTOList = new ArrayList<>();
+        List<DefaultExportDTO> defaultExportDTOS = exportOther(exportDafaultVO);
+        Map<String, List<DefaultExportDTO>> multiKeyList = ExtUtil.getMultiKeyList(defaultExportDTOS, CommonEnum.splitSymbol.getName(), "ruleId", "groupType");
+        for (String key : multiKeyList.keySet()) {
+            List<DefaultExportDTO> defaultList = multiKeyList.get(key);
+            DefaultExportDTO defaultExportDTO = defaultList.get(0);
+            // rule中conceptId也是规则匹配的一部分,手动添加,判断依据是conceptId和baseConcept如果不一样的,就添加一条
+            if (!defaultExportDTO.getConceptId().equals(defaultExportDTO.getBaseConcept())) {
+                DefaultExportDTO addDefault = new DefaultExportDTO();
+                BeanUtil.copyProperties(defaultExportDTO, addDefault);
+                addDefault.setBaseConcept(defaultExportDTO.getConceptId());
+                addDefault.setBaseName(defaultExportDTO.getLibName());
+                addDefault.setBaseTypeCn(defaultExportDTO.getLibTypeCn());
+                addDefault.setMinValue("");
+                addDefault.setMinOperator("");
+                addDefault.setMaxValue("");
+                addDefault.setMaxOperator("");
+                addDefault.setEqValue("");
+                List<DefaultExportDTO> newDefaultList = Lists.newArrayList();
+                newDefaultList.add(addDefault);
+                newDefaultList.addAll(defaultList);
+                multiKeyList.put(key, newDefaultList);
+                defaultList = newDefaultList;
+            }
+            OtherExportDTO otherExportDTO = new OtherExportDTO();
+            otherExportDTO.setRuleGroup(defaultExportDTO.getRuleGroup());
+            otherExportDTO.setMsg(defaultExportDTO.getMsg());
+            otherExportDTO.setDefaultExportDTOList(defaultList);
+            otherExportDTOList.add(otherExportDTO);
+        }
+        return otherExportDTOList;
+    }
+
     /**
      * 查询所有有效的规则
      *

+ 3 - 0
src/main/java/com/diagbot/mapper/KlConceptMapper.java

@@ -1,6 +1,7 @@
 package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.GatherDTO;
 import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.IndexDTO;
@@ -34,4 +35,6 @@ public interface KlConceptMapper extends BaseMapper<KlConcept> {
     List<GetAllForRelationDTO> searchByTypeAndNameAdd(SearchConceptVO searchConceptVO);
 
     List<GetAllForRelationDTO> searchCollectionConcept(SearchCollectionConceptVO searchCollectionConceptVO);
+
+    List<GatherDTO> getGather(GatherVO gatherVO);
 }

+ 5 - 1
src/main/java/com/diagbot/mapper/KlRuleMapper.java

@@ -1,6 +1,8 @@
 package com.diagbot.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.DefaultExportDTO;
 import com.diagbot.dto.IndicationExportDTO;
 import com.diagbot.dto.KlRuleByIdDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
@@ -10,7 +12,7 @@ import com.diagbot.dto.RuleDTO;
 import com.diagbot.dto.RuleInitDTO;
 import com.diagbot.dto.RuleQueryDTO;
 import com.diagbot.entity.KlRule;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.ExportDafaultVO;
 import com.diagbot.vo.KlRuleByIdVO;
 import com.diagbot.vo.KlRuleInfoVO;
 import com.diagbot.vo.RuleQueryVO;
@@ -35,6 +37,8 @@ public interface KlRuleMapper extends BaseMapper<KlRule> {
 
     List<IndicationExportDTO> exportIndication();
 
+    List<DefaultExportDTO> exportOther(ExportDafaultVO exportDafaultVO);
+
     List<RuleInitDTO> getRuleInitDTO();
 
     List<RuleConditionInitDTO> getRuleConditionInitDTO();

+ 9 - 1
src/main/java/com/diagbot/service/KlConceptService.java

@@ -1,13 +1,20 @@
 package com.diagbot.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.GatherDTO;
 import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.IndexDTO;
 import com.diagbot.dto.KllisDetailDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
 import com.diagbot.entity.KlConcept;
-import com.diagbot.vo.*;
+import com.diagbot.vo.GatherVO;
+import com.diagbot.vo.IndexByApprovalVO;
+import com.diagbot.vo.KllisDetailVO;
+import com.diagbot.vo.MedRetrievalVO;
+import com.diagbot.vo.SearchCollectionConceptVO;
+import com.diagbot.vo.SearchConceptVO;
+import com.diagbot.vo.StaticKnowledgeIndexVO;
 
 import java.util.List;
 
@@ -38,4 +45,5 @@ public interface KlConceptService extends IService<KlConcept> {
     //查找(集合模块术语)
     List<GetAllForRelationDTO> searchCollectionConcept(SearchCollectionConceptVO searchCollectionConceptVO);
 
+    List<GatherDTO> getGather(GatherVO gatherVO);
 }

+ 4 - 0
src/main/java/com/diagbot/service/KlRuleService.java

@@ -2,6 +2,7 @@ package com.diagbot.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.DefaultExportDTO;
 import com.diagbot.dto.IndicationExportDTO;
 import com.diagbot.dto.KlRuleByIdDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
@@ -11,6 +12,7 @@ import com.diagbot.dto.RuleDTO;
 import com.diagbot.dto.RuleInitDTO;
 import com.diagbot.dto.RuleQueryDTO;
 import com.diagbot.entity.KlRule;
+import com.diagbot.vo.ExportDafaultVO;
 import com.diagbot.vo.KlRuleByIdVO;
 import com.diagbot.vo.KlRuleInfoVO;
 import com.diagbot.vo.RuleQueryVO;
@@ -31,6 +33,8 @@ public interface KlRuleService extends IService<KlRule> {
     List<KlRuleByIdDTO> getByIdRuleInfo(KlRuleByIdVO klRuleByIdVO);
     List<IndicationExportDTO> exportIndication();
 
+    List<DefaultExportDTO> exportOther(ExportDafaultVO exportDafaultVO);
+
     List<RuleInitDTO> getRuleInitDTO();
 
     List<RuleConditionInitDTO> getRuleConditionInitDTO();

+ 6 - 0
src/main/java/com/diagbot/service/impl/KlConceptServiceImpl.java

@@ -2,6 +2,7 @@ package com.diagbot.service.impl;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.GatherDTO;
 import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.IndexDTO;
@@ -62,4 +63,9 @@ public class KlConceptServiceImpl extends ServiceImpl<KlConceptMapper, KlConcept
         return baseMapper.searchCollectionConcept(searchCollectionConceptVO);
     }
 
+    @Override
+    public List<GatherDTO> getGather(GatherVO gatherVO) {
+        return baseMapper.getGather(gatherVO);
+    }
+
 }

+ 7 - 0
src/main/java/com/diagbot/service/impl/KlRuleServiceImpl.java

@@ -2,6 +2,7 @@ package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.DefaultExportDTO;
 import com.diagbot.dto.IndicationExportDTO;
 import com.diagbot.dto.KlRuleByIdDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
@@ -13,6 +14,7 @@ import com.diagbot.dto.RuleQueryDTO;
 import com.diagbot.entity.KlRule;
 import com.diagbot.mapper.KlRuleMapper;
 import com.diagbot.service.KlRuleService;
+import com.diagbot.vo.ExportDafaultVO;
 import com.diagbot.vo.KlRuleByIdVO;
 import com.diagbot.vo.KlRuleInfoVO;
 import com.diagbot.vo.RuleQueryVO;
@@ -49,6 +51,11 @@ public class KlRuleServiceImpl extends ServiceImpl<KlRuleMapper, KlRule> impleme
         return baseMapper.exportIndication();
     }
 
+    @Override
+    public List<DefaultExportDTO> exportOther(ExportDafaultVO exportDafaultVO) {
+        return baseMapper.exportOther(exportDafaultVO);
+    }
+
     @Override
     public List<RuleInitDTO> getRuleInitDTO() {
         return baseMapper.getRuleInitDTO();

+ 19 - 0
src/main/java/com/diagbot/vo/ExportDafaultVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: zhoutg
+ * @time: 2021/10/15 17:17
+ */
+@Data
+public class ExportDafaultVO {
+    // libType过滤
+    private List<Long> libTypeList = new ArrayList<>();
+    // 规则分类
+    private Integer ruleType;
+}

+ 19 - 0
src/main/java/com/diagbot/vo/GatherVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author zhoutg
+ * @Description:
+ * @date 2020-03-13 16:11
+ */
+@Setter
+@Getter
+public class GatherVO {
+
+    // 集合列表
+    private List<String> gatherNameList;
+}

+ 30 - 0
src/main/java/com/diagbot/web/KlIndicationImportController.java

@@ -30,4 +30,34 @@ public class KlIndicationImportController {
         klRuleFacade.exportIndicationFac(response);
     }
 
+    @ApiOperation(value = "其他值提醒化验导出API[zhoutg]")
+    @PostMapping("/exportOtherLis")
+    public void exportOtherLis(HttpServletResponse response) {
+        klRuleFacade.exportOtherLis(response);
+    }
+
+    @ApiOperation(value = "其他值提醒辅检导出API[zhoutg]")
+    @PostMapping("/exportOtherPacs")
+    public void exportOtherPacs(HttpServletResponse response) {
+        klRuleFacade.exportOtherPacs(response);
+    }
+
+    @ApiOperation(value = "其他值提醒输血导出API[zhoutg]")
+    @PostMapping("/exportOtherTransfusion")
+    public void exportOtherTransfusion(HttpServletResponse response) {
+        klRuleFacade.exportOtherTransfusion(response);
+    }
+
+    @ApiOperation(value = "危急值化验导出API[zhoutg]")
+    @PostMapping("/exportCriticalLis")
+    public void exportCriticalLis(HttpServletResponse response) {
+        klRuleFacade.exportCriticalLis(response);
+    }
+
+    @ApiOperation(value = "危急值辅检导出API[zhoutg]")
+    @PostMapping("/exportCriticalPacs")
+    public void exportCriticalPacs(HttpServletResponse response) {
+        klRuleFacade.exportCriticalPacs(response);
+    }
+
 }

+ 25 - 0
src/main/resources/mapper/KlConceptMapper.xml

@@ -979,4 +979,29 @@
         t1.approval-->
     </select>
 
+    <select id="getGather" resultType="com.diagbot.dto.GatherDTO">
+        SELECT
+            a.lib_name par_name,
+            a.lib_type par_lib_type,
+            c.lib_name son_name
+        FROM
+            `kl_concept` a,
+            kl_relation b,
+            kl_concept c
+        WHERE
+            a.is_deleted = 'N'
+          AND b.is_deleted = 'N'
+          AND c.is_deleted = 'N'
+          AND a.`status` = 1
+          AND c.`status` = 1
+          AND a.id = b.start_id
+          AND b.end_id = c.id
+          AND b.relation_id = 600
+          AND CONCAT(a.lib_name, '#', a.lib_type) IN
+          <foreach collection="gatherNameList" item="item" open="(" close=")" separator=",">
+                #{item}
+          </foreach>
+    </select>
+
+
 </mapper>

+ 75 - 0
src/main/resources/mapper/KlRuleMapper.xml

@@ -301,6 +301,81 @@
         ORDER BY par_name, rule_id
     </select>
 
+    <select id="exportOther" resultType="com.diagbot.dto.DefaultExportDTO">
+        SELECT
+            a.id rule_id,
+            a.concept_id,
+            f.lib_type,
+            f.lib_name,
+            g.name lib_type_cn,
+            a.description rule_group,
+            a.rule_type,
+            a.has_sub_cond,
+            b.group_type,
+            b.msg,
+            c.concept_id base_concept,
+            d.lib_name baseName,
+            d.lib_type baseType,
+            e. NAME baseTypeCn,
+            CASE
+                WHEN c.type = '1' THEN
+                    '等于术语'
+                WHEN c.type = '2' THEN
+                    '比较'
+                WHEN c.type = '3' THEN
+                    '不等于术语'
+                WHEN c.type = '4' THEN
+                    '过敏'
+                WHEN c.type = '5' THEN
+                    '开单项互斥'
+                WHEN c.type = '6' THEN
+                    '正则'
+                ELSE
+                    '错误类型'
+                END taboo_type,
+            c.min_operator,
+            c.min_value,
+            c.max_operator,
+            c.max_value,
+            c.eq_value
+        FROM
+            kl_rule a,
+            kl_rule_condition b,
+            kl_rule_base c,
+            kl_concept d,
+            kl_lexicon e,
+            kl_concept f,
+            kl_lexicon g
+        WHERE
+            a.is_deleted = 'N'
+          AND b.is_deleted = 'N'
+          AND c.is_deleted = 'N'
+          AND d.is_deleted = 'N'
+          AND e.is_deleted = 'N'
+          AND f.is_deleted = 'N'
+          AND g.is_deleted = 'N'
+          AND a.`status` = 1
+          AND d.`status` = 1
+          AND f.`status` = 1
+          AND a.id = b.rule_id
+          AND b.rule_base_id = c.id
+          AND c.concept_id = d.id
+          AND d.lib_type = e.`code`
+          AND a.concept_id = f.id
+          AND f.lib_type = g.`code`
+          <if test="ruleType != null">
+              AND a.rule_type = #{ruleType}
+          </if>
+          <if test="libTypeList != null and libTypeList.size() > 0">
+                and f.lib_type in
+              <foreach collection="libTypeList" item="item" separator="," open="(" close=")">
+                  #{item}
+              </foreach>
+          </if>
+        ORDER BY
+            a.gmt_modified DESC, b.id,c.id asc
+    </select>
+
     <select id="getRuleInitDTO" resultType="com.diagbot.dto.RuleInitDTO">
         SELECT
             *