소스 검색

Merge branch 'dev/20211117_2.1.4' into debug

chengyao 3 년 전
부모
커밋
5c31626d23

+ 94 - 0
src/main/java/com/diagbot/dto/BehospitalAnalysisDTO.java

@@ -0,0 +1,94 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 住院病历信息
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+@Data
+public class BehospitalAnalysisDTO implements Serializable {
+
+    /**
+     * 病历等级
+     */
+    @Excel(name = "病历等级")
+    private String level;
+
+    /**
+     * 最后得分
+     */
+    @Excel(name = "病历得分")
+    private Double scoreRes;
+
+    /**
+     * 病人住院ID
+     */
+    @Excel(name = "病人住院序号",width = 12d)
+    private String behospitalCode;
+
+    /**
+     * 档案号
+     */
+    @Excel(name = "病案号")
+    private String fileCode;
+
+    /**
+     * 姓名
+     */
+    @Excel(name = "病人姓名")
+    private String name;
+
+
+    /**
+     * 年龄
+     */
+    @Excel(name = "年龄")
+    private String age = "";
+
+
+    /**
+     * 入院时间
+     */
+    @Excel(name = "入院日期", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    @Excel(name = "出院日期", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+
+    /**
+     * 医生姓名
+     */
+    @Excel(name = "主管医生",width = 12d)
+    private String doctorName;
+
+    /**
+     * 住院科室名称
+     */
+    @Excel(name = "科室")
+    private String behDeptName;
+
+    private String behDoctorName;
+
+
+    /**
+     * 评分时间
+     */
+    @Excel(name = "评分时间", exportFormat = "yyyy/MM/dd")
+  //  @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date gradeTime;
+}

+ 1 - 1
src/main/java/com/diagbot/dto/GetEntryDefectImproveDeptDTO.java

@@ -80,6 +80,6 @@ public class GetEntryDefectImproveDeptDTO {
      * 改善率
      */
     @Excel(name = "改善率", width = 10d, orderNum = "9")
-    private String handleStr;
+    private String handleStr= "0.00%";
 
 }

+ 15 - 1
src/main/java/com/diagbot/facade/BasDeptInfoFacade.java

@@ -4,6 +4,7 @@ import com.diagbot.dto.BasDeptInfoDTO;
 import com.diagbot.service.impl.BasDeptInfoServiceImpl;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.BasDeptInfoVO;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -24,10 +25,23 @@ public class BasDeptInfoFacade extends BasDeptInfoServiceImpl {
      */
     public List<BasDeptInfoDTO> listForUser(BasDeptInfoVO basDeptInfoVO) {
         basDeptInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        listForUserSet(basDeptInfoVO);
         List<BasDeptInfoDTO> basDeptInfoDTOList = this.getList(basDeptInfoVO);
         return basDeptInfoDTOList;
     }
-
+    private void listForUserSet(BasDeptInfoVO basDeptInfoVO) {
+        if (StringUtils.isNotBlank(basDeptInfoVO.getInputStr())) {
+            String tranStr = basDeptInfoVO.getInputStr();
+            if( tranStr.contains("%")){
+                tranStr = tranStr.replace("%", "\\%");
+                basDeptInfoVO.setInputStr(tranStr);
+            }
+            if( tranStr.contains("_")){
+                tranStr = tranStr.replace("_","\\_");
+                basDeptInfoVO.setInputStr(tranStr);
+            }
+        }
+    }
 
     /**
      * 获取医院用户下拉列表信息

+ 9 - 0
src/main/java/com/diagbot/facade/DataAnalysisDeptFacade.java

@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 import javax.servlet.http.HttpServletResponse;
+import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -49,6 +50,7 @@ public class DataAnalysisDeptFacade {
         entryDefectDeptSet(getEntryDefectImproveDeptVO);
         IPage<GetEntryDefectImproveDeptDTO> page = new Page<>();
         List<GetEntryDefectImproveDeptDTO> getEntryDefectImproveDeptDTOList = new ArrayList<>();
+        DecimalFormat df = new DecimalFormat("#.00");
         //获取标准缺陷信息
         List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
         //查询基础数据源
@@ -77,6 +79,12 @@ public class DataAnalysisDeptFacade {
                         getEntryDefectImproveDeptDTO.setImproveleNum(improveleMap.get(stringLongEntry.getKey()));
                     }
                     getEntryDefectImproveDeptDTO.setHandleNum(getEntryDefectImproveDeptDTO.getTotalNum() - getEntryDefectImproveDeptDTO.getImproveleNum());
+                    double handleRatio = 0d;
+                    if(getEntryDefectImproveDeptDTO.getTotalNum()!=0 && getEntryDefectImproveDeptDTO.getHandleNum()!=0){
+                        handleRatio = getEntryDefectImproveDeptDTO.getHandleNum().doubleValue()*100/getEntryDefectImproveDeptDTO.getTotalNum().doubleValue();
+                        String handleStr = df.format(handleRatio)+"%";
+                        getEntryDefectImproveDeptDTO.setHandleStr(handleStr);
+                    }
                     getEntryDefectImproveDeptDTOList.add(getEntryDefectImproveDeptDTO);
                 }
             }
@@ -127,6 +135,7 @@ public class DataAnalysisDeptFacade {
         getEntryDefectImproveDeptVO.setCurrent(1L);
         getEntryDefectImproveDeptVO.setSize(Long.MAX_VALUE);
         getEntryDefectImproveDeptVO.setSearchCount(false);
+        getEntryDefectImproveDeptVO.setExportType(1L);
         IPage<GetEntryDefectImproveDeptDTO> page = getEntryDefectImproveDept(getEntryDefectImproveDeptVO);
         String fileName = "条目缺陷改善统计(科室).xls";
         ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", GetEntryDefectImproveDeptDTO.class, fileName, response, 12.8f);

+ 86 - 40
src/main/java/com/diagbot/facade/DataAnalysisFacade.java

@@ -2,9 +2,9 @@ package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.dto.BehospitalAnalysisDTO;
 import com.diagbot.dto.BehospitalCodeDetail;
 import com.diagbot.dto.BehospitalCodeInfo;
-import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.DeptBaseDTO;
 import com.diagbot.dto.EntryDefectImprove;
 import com.diagbot.dto.EntryDefectImproveInner;
@@ -35,12 +35,14 @@ import com.diagbot.vo.GetEntryDefectImproveVO;
 import com.diagbot.vo.GetQcClickInnerPageVO;
 import com.diagbot.vo.GetQcClickVO;
 import com.diagbot.vo.MedClickInfoVO;
+import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
+import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -120,7 +122,7 @@ public class DataAnalysisFacade {
             StringBuilder sbFir = new StringBuilder();
             for (QcresultDetail qcresultDetail : list) {
                 if (1 == qcresultDetail.getGradeType()) {
-                    if (null != qcresultDetail.getCasesEntryId()) {
+                    if (null != qcresultDetail.getCasesEntryId() && 0L != qcresultDetail.getCasesEntryId()) {
                         sbFir.append(qcresultDetail.getCasesEntryId() + "、");
                     }
                 }
@@ -206,6 +208,7 @@ public class DataAnalysisFacade {
         int size = (int) getEntryDefectImproveVO.getSize();
         IPage<GetEntryDefectImproveDTO> page = new Page<>();
         entryDefectSet(getEntryDefectImproveVO);
+        DecimalFormat df = new DecimalFormat("#.00");
         List<GetEntryDefectImproveDTO> getEntryDefectImproveDTO = new ArrayList<>();
         //获取标准缺陷信息
         List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
@@ -231,6 +234,12 @@ public class DataAnalysisFacade {
                     getEntryDefectImprove.setImproveleNum(improveleMap.get(stringLongEntry.getKey()));
                 }
                 getEntryDefectImprove.setHandleNum(getEntryDefectImprove.getTotalNum() - getEntryDefectImprove.getImproveleNum());
+                double handleRatio = 0d;
+                if(getEntryDefectImprove.getTotalNum()!=0 && getEntryDefectImprove.getHandleNum()!=0){
+                    handleRatio = getEntryDefectImprove.getHandleNum().doubleValue()*100/getEntryDefectImprove.getTotalNum().doubleValue();
+                    String handleStr = df.format(handleRatio)+"%";
+                    getEntryDefectImprove.setHandleStr(handleStr);
+                }
                 getEntryDefectImproveDTO.add(getEntryDefectImprove);
             }
         }
@@ -290,11 +299,13 @@ public class DataAnalysisFacade {
         for (BehospitalCodeInfo behospitalCodeInfo : behospitalCodeInfoList) {
             //病历下
             List<QcResultDetailInfo> qcResultDetailInfos = behospitalCodeInfo.getQcResultDetailInfos();
-            //获取多病历多质控质控缺陷总量
-            totalMap = getEntryTotalMap(qcResultDetailInfos, totalMap);
-            //获取多病历多质控质控缺陷待改善总量
-            QcResultDetailInfo qcResultDetailInfo = qcResultDetailInfos.get(qcResultDetailInfos.size() - 1);
-            improveleMap = getEntryImproveleMap(qcResultDetailInfo, improveleMap);
+                //获取多病历多质控质控缺陷总量
+                totalMap = getEntryTotalMap(qcResultDetailInfos, totalMap);
+                if (MapUtils.isNotEmpty(totalMap)) {
+                    //获取多病历多质控质控缺陷待改善总量
+                    QcResultDetailInfo qcResultDetailInfo = qcResultDetailInfos.get(qcResultDetailInfos.size() - 1);
+                    improveleMap = getEntryImproveleMap(qcResultDetailInfo, improveleMap);
+                }
         }
     }
 
@@ -335,71 +346,71 @@ public class DataAnalysisFacade {
         return currentPageList;
     }
 
-    public  List<BehospitalInfoDTO>  getEntryDefectImproveInnerDTOS( List<BehospitalInfoDTO> behospitalInfoDTOList ,GetEntryDefectImproveInnerVO
+    public  List<BehospitalAnalysisDTO>  getEntryDefectImproveInnerDTOS( List<BehospitalAnalysisDTO> behospitalInfoDTOList ,GetEntryDefectImproveInnerVO
             getEntryDefectImproveInnerVO) {
         if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getAsc())){
             if("behDeptName".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getBehDeptName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehDeptName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
             }
             if("behDoctorName".equals(getEntryDefectImproveInnerVO.getAsc()) || "doctorName".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getDoctorName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getDoctorName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
             }
             if("name".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
             }
             if("fileCode".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getFileCode, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getFileCode, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
             }
             if("age".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getAge, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getAge, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
             }
             if("behospitalDate".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getBehospitalDate, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehospitalDate, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
             }
             if("leaveHospitalDate".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getLeaveHospitalDate, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getLeaveHospitalDate, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
             }
             if("scoreRes".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getScoreRes, Comparator.nullsLast(Double::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getScoreRes, Comparator.nullsLast(Double::compareTo))).collect(Collectors.toList());
             }
             if("level".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getLevel, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getLevel, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
             }
             if("gradeTime".equals(getEntryDefectImproveInnerVO.getAsc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getGradeTime, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getGradeTime, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
             }
         }
 
         if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getDesc())){
             if("behDeptName".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getBehDeptName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehDeptName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("behDoctorName".equals(getEntryDefectImproveInnerVO.getDesc()) || "doctorName".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getDoctorName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getDoctorName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("name".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("fileCode".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getFileCode, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getFileCode, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("age".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getAge, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getAge, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("behospitalDate".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getBehospitalDate, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehospitalDate, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("leaveHospitalDate".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getLeaveHospitalDate, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getLeaveHospitalDate, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("scoreRes".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getScoreRes, Comparator.nullsLast(Double::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getScoreRes, Comparator.nullsLast(Double::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("level".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getLevel, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getLevel, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
             }
             if("gradeTime".equals(getEntryDefectImproveInnerVO.getDesc())){
-                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalInfoDTO::getGradeTime, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getGradeTime, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
             }
         }
         return behospitalInfoDTOList;
@@ -438,9 +449,12 @@ public class DataAnalysisFacade {
     public static Map getEntryTotalMap(List<QcResultDetailInfo> qcResultDetailInfos, Map<String, Long> totalMap) {
         Set<String> totalSet = new HashSet<String>();
         for (QcResultDetailInfo qcResultDetailInfo : qcResultDetailInfos) {
-            //质控下获取科室下总缺陷
-            String casesEntryIds = qcResultDetailInfo.getCasesEntryIds();
-            totalSet = getSetEntry(casesEntryIds, totalSet);
+                //质控下获取科室下总缺陷
+                String casesEntryIds = qcResultDetailInfo.getCasesEntryIds();
+                totalSet = getSetEntry(casesEntryIds, totalSet);
+        }
+        if (null == totalSet && totalSet.size() == 0) {
+            return totalMap;
         }
         totalMap = getSetEntryCount(totalMap, totalSet);
         return totalMap;
@@ -469,12 +483,14 @@ public class DataAnalysisFacade {
     }
 
     public static Map getSetEntryCount(Map<String, Long> map, Set<String> sets) {
+        if (null != sets && sets.size() > 0) {
         for (String set : sets) {
             if (map.containsKey(set)) {
                 long count = map.get(set) + 1l;
                 map.put(set, count);
             } else {
                 map.put(set, 1L);
+                }
             }
         }
         return map;
@@ -492,12 +508,12 @@ public class DataAnalysisFacade {
     }
 
 
-    public IPage<BehospitalInfoDTO> getEntryDefectImproveInner(GetEntryDefectImproveInnerVO
+    public IPage<BehospitalAnalysisDTO> getEntryDefectImproveInner(GetEntryDefectImproveInnerVO
                                                                        getEntryDefectImproveInnerVO) {
         int current = (int) getEntryDefectImproveInnerVO.getCurrent();
         int size = (int) getEntryDefectImproveInnerVO.getSize();
-        IPage<BehospitalInfoDTO> page = new Page<>();
-        List<BehospitalInfoDTO> behospitalInfoDTOS = new ArrayList<>();
+        IPage<BehospitalAnalysisDTO> page = new Page<>();
+        List<BehospitalAnalysisDTO> behospitalInfoDTOS = new ArrayList<>();
         entryDefectInnerSet(getEntryDefectImproveInnerVO);
         // List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
         List<EntryDefectImproveInner> records = medClickInfoService.getBaseMapper().getEntryDefectImproveInner(getEntryDefectImproveInnerVO);
@@ -541,7 +557,7 @@ public class DataAnalysisFacade {
             behospitalInfoDTOS =  getEntryDefectImproveInnerDTOS( behospitalInfoDTOS ,getEntryDefectImproveInnerVO);
         }
         //分页操作
-        List<BehospitalInfoDTO> behospitalInfoDTOList = page(behospitalInfoDTOS, size, current);
+        List<BehospitalAnalysisDTO> behospitalInfoDTOList = page(behospitalInfoDTOS, size, current);
         page.setRecords(behospitalInfoDTOList);
         return page;
     }
@@ -553,9 +569,9 @@ public class DataAnalysisFacade {
      * @Author: cy
      * @Date: 2021/12/3
      */
-    public List<BehospitalInfoDTO> getBehospitalInfoDTO(EntryDefectImproveInner entryDefectImproveInner, BehospitalCodeDetail behospitalCodeDetail,
-                                                        List<BehospitalInfoDTO> behospitalInfoDTOS) {
-        BehospitalInfoDTO behospitalInfoDTO = new BehospitalInfoDTO();
+    public List<BehospitalAnalysisDTO> getBehospitalInfoDTO(EntryDefectImproveInner entryDefectImproveInner, BehospitalCodeDetail behospitalCodeDetail,
+                                                        List<BehospitalAnalysisDTO> behospitalInfoDTOS) {
+        BehospitalAnalysisDTO behospitalInfoDTO = new BehospitalAnalysisDTO();
         behospitalInfoDTO.setLevel(behospitalCodeDetail.getLevel());
         behospitalInfoDTO.setScoreRes(behospitalCodeDetail.getScoreRes());
         behospitalInfoDTO.setFileCode(behospitalCodeDetail.getFileCode());
@@ -579,8 +595,8 @@ public class DataAnalysisFacade {
         getEntryDefectImproveInnerVO.setSize(Long.MAX_VALUE);
         getEntryDefectImproveInnerVO.setSearchCount(false);
         String fileName = "条目缺陷改善统计病历列表.xls";
-        IPage<BehospitalInfoDTO> page = this.getEntryDefectImproveInner(getEntryDefectImproveInnerVO);
-        ExcelUtils.exportExcelUser(page.getRecords(), null, "sheet1", BehospitalInfoDTO.class, fileName, response);
+        IPage<BehospitalAnalysisDTO> page = this.getEntryDefectImproveInner(getEntryDefectImproveInnerVO);
+        ExcelUtils.exportExcelUser(page.getRecords(), null, "sheet1", BehospitalAnalysisDTO.class, fileName, response);
     }
 
     /**
@@ -617,6 +633,9 @@ public class DataAnalysisFacade {
     }
 
     private void clickPageSet(GetQcClickVO getQcClickVO) {
+        if(StringUtils.isNotBlank(getQcClickVO.getDeptName())){
+            getQcClickVO.setDeptName(transferredMeaning(getQcClickVO.getDeptName()));
+        }
         //入参验证
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
         Date startDate = null;
@@ -634,6 +653,12 @@ public class DataAnalysisFacade {
     }
 
     private void clickInnerPageSet(GetQcClickInnerPageVO getQcClickInnerPageVO) {
+        if(StringUtils.isNotBlank(getQcClickInnerPageVO.getDoctorId())){
+            getQcClickInnerPageVO.setDoctorId(transferredMeaning(getQcClickInnerPageVO.getDoctorId()));
+        }
+        if(StringUtils.isNotBlank(getQcClickInnerPageVO.getDoctorName())){
+            getQcClickInnerPageVO.setDoctorName(transferredMeaning(getQcClickInnerPageVO.getDoctorName()));
+        }
         //入参验证
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
         Date startDate = null;
@@ -650,7 +675,19 @@ public class DataAnalysisFacade {
         getQcClickInnerPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
     }
 
+   public String transferredMeaning(String tranStr){
+          if( tranStr.contains("%")){
+              tranStr = tranStr.replace("%", "\\%");
+          }
+           if( tranStr.contains("_")){
+              tranStr = tranStr.replace("_","\\_");
+           }
+       return tranStr;
+    };
     private void entryDefectSet(GetEntryDefectImproveVO getEntryDefectImproveVO) {
+        if(StringUtils.isNotBlank(getEntryDefectImproveVO.getDeptName())){
+            getEntryDefectImproveVO.setDeptName(transferredMeaning(getEntryDefectImproveVO.getDeptName()));
+        }
         getEntryDefectImproveVO.setCurrent(1L);
         getEntryDefectImproveVO.setSize(Long.MAX_VALUE);
         //入参验证
@@ -670,6 +707,15 @@ public class DataAnalysisFacade {
     }
 
     private void entryDefectInnerSet(GetEntryDefectImproveInnerVO getEntryDefectImproveInnerVO) {
+        if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getPatName())){
+            getEntryDefectImproveInnerVO.setPatName(transferredMeaning(getEntryDefectImproveInnerVO.getPatName()));
+        }
+        if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getDoctorId())){
+            getEntryDefectImproveInnerVO.setDoctorId(transferredMeaning(getEntryDefectImproveInnerVO.getDoctorId()));
+        }
+        if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getDoctorName())){
+            getEntryDefectImproveInnerVO.setDoctorName(transferredMeaning(getEntryDefectImproveInnerVO.getDoctorName()));
+        }
         getEntryDefectImproveInnerVO.setCurrent(1L);
         getEntryDefectImproveInnerVO.setSize(Long.MAX_VALUE);
         //入参验证

+ 1 - 1
src/main/resources/application-test.yml

@@ -164,7 +164,7 @@ oath.self.address: http://${myhost}:${server.port}
 
 # 加解密开关
 encrypt:
-  enable: true
+  enable: false
 
 swagger:
   enable: true

+ 29 - 31
src/main/resources/mapper/MedClickInfoMapper.xml

@@ -109,9 +109,6 @@
         <if test="deptName != null and deptName != ''">
             and a.dept_name like CONCAT('%',#{deptName},'%')
         </if>
-        <if test="deptId != null and deptId != ''">
-            and a.dept_id= #{deptId}
-        </if>
         <if test="startDate != null">
             <![CDATA[ and a.gmt_create >= #{startDate}]]>
         </if>
@@ -194,23 +191,24 @@
 
     <select id="getEntryDefectImprove" resultMap="entryDefectImproveMap">
         SELECT
-        a.hospital_id as hospitalId,
-        a.dept_id as deptId,
-        a.dept_name as deptName,
-        a.behospital_code as behospitalCode,
-        a.cases_entry_ids as casesEntryIds
+        b.hospital_id as hospitalId,
+        b.beh_dept_id as deptId,
+        b.beh_dept_name as deptName,
+        b.behospital_code as behospitalCode,
+        ifnull(a.cases_entry_ids,0) as casesEntryIds
         FROM
-        med_qcresult_click a
+        med_qcresult_click a,
+        med_behospital_info b
         WHERE
         a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.hospital_id =b.hospital_id
+        AND a.behospital_code =b.behospital_code
         <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
-        </if>
-        <if test="deptId != null and deptId != ''">
-            and a.dept_id = #{deptId}
+            AND b.hospital_id = #{hospitalId}
         </if>
         <if test="deptName != null and deptName != ''">
-            and a.dept_name like CONCAT('%',#{deptName},'%')
+            and b.beh_dept_name like CONCAT('%',#{deptName},'%')
         </if>
         <if test="startDate != null and startDate != ''">
             <![CDATA[ AND a.gmt_create >= #{startDate}]]>
@@ -218,7 +216,7 @@
         <if test="endDate != null and endDate != ''">
             <![CDATA[ AND a.gmt_create <= #{endDate}]]>
         </if>
-        order by gmt_create
+        order by a.gmt_create
     </select>
 
     <select id="getEntryDefectImproveInner" resultMap="entryDefectImproveInnerMap">
@@ -227,11 +225,11 @@
         IF( n.age IS NULL,NULL,CONCAT(ifnull(n.age, ''),ifnull(n.age_unit, ''))) AS age
         from (
         SELECT
-        a.hospital_id as hospitalId,
-        a.dept_id as deptId,
-        a.dept_name as behDeptName,
+        b.hospital_id as hospitalId,
+        b.beh_dept_id as deptId,
+        b.beh_dept_name as behDeptName,
         b.file_code AS fileCode,
-        a.behospital_code as behospitalCode,
+        b.behospital_code as behospitalCode,
         b.name,
         b.behospital_date AS behospitalDate,
         b.leave_hospital_date AS leaveHospitalDate,
@@ -240,7 +238,7 @@
         ifnull(c. level, '未评分') AS `level`,
         c.score_res AS scoreRes,
         c.gmt_create AS gradeTime,
-        a.cases_entry_ids as casesEntryIds
+        ifnull(a.cases_entry_ids,0) as casesEntryIds
         FROM
         med_qcresult_click a,
         med_behospital_info b,
@@ -254,13 +252,13 @@
         AND a.behospital_code =b.behospital_code
         AND a.behospital_code =c.behospital_code
         <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
+            AND b.hospital_id = #{hospitalId}
         </if>
         <if test="deptId != null and deptId != ''">
-            and a.dept_id = #{deptId}
+            and b.beh_dept_id = #{deptId}
         </if>
         <if test="deptName != null and deptName != ''">
-            and a.dept_name = #{deptName}
+            and b.beh_dept_name = #{deptName}
         </if>
         <if test="patName != null and patName != ''">
             and b.name like CONCAT('%',#{patName},'%')
@@ -292,13 +290,13 @@
 
     <select id="getEntryDefectImproveDept" resultMap="entryDefectImproveInnerExportMap">
         SELECT
-        a.hospital_id as hospitalId,
-        a.dept_id as deptId,
-        a.dept_name as deptName,
-        a.behospital_code as behospitalCode,
+        b.hospital_id as hospitalId,
+        b.beh_dept_id as deptId,
+        b.beh_dept_name as deptName,
+        b.behospital_code as behospitalCode,
         b.doctor_id AS doctorId,
         b.doctor_name AS doctorName,
-        a.cases_entry_ids as casesEntryIds
+        ifnull(a.cases_entry_ids,0) as casesEntryIds
         FROM
         med_qcresult_click a,
         med_behospital_info b
@@ -308,13 +306,13 @@
         AND a.hospital_id =b.hospital_id
         AND a.behospital_code =b.behospital_code
         <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
+            AND b.hospital_id = #{hospitalId}
         </if>
         <if test="deptId != null and deptId != ''">
-            and a.dept_id = #{deptId}
+            and b.beh_dept_id = #{deptId}
         </if>
         <if test="deptName != null and deptName != ''">
-            and a.dept_name = #{deptName}
+            and b.beh_dept_name = #{deptName}
         </if>
         <if test="doctorId != null and doctorId != ''">
             and b.doctor_id like CONCAT('%',#{doctorId},'%')