瀏覽代碼

全院条目改善导出调整

chengyao 3 年之前
父節點
當前提交
57448e5f15

+ 55 - 36
src/main/java/com/diagbot/dto/BehospitalInfoDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
@@ -20,82 +21,105 @@ public class BehospitalInfoDTO implements Serializable {
     private static final long serialVersionUID = 1L;
 
     /**
-     * 病人住院ID
+     * 住院科室名称
      */
-    private String behospitalCode;
+    @Excel(name = "科室", mergeVertical = true, width = 25d, orderNum = "1")
+    private String behDeptName;
+
+
+    /**
+     * 医生姓名
+     */
+    @Excel(name = "主管医生", orderNum = "2")
+    private String doctorName;
 
     /**
      * 姓名
      */
+    @Excel(name = "患者姓名", orderNum = "3")
     private String name;
 
     /**
-     * 性别
+     * 档案号
      */
-    private String sex;
+    @Excel(name = "病案号", orderNum = "4")
+    private String fileCode;
 
     /**
-     * 出生日期
+     * 年龄
      */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date birthday;
+    @Excel(name = "年龄", orderNum = "5")
+    private String age;
+
 
     /**
-     * 档案号
+     * 入院时间
      */
-    private String fileCode;
+    @Excel(name = "入院时间", orderNum = "6", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
 
     /**
-     * 病区名称
+     * 出院时间
      */
-    private String wardName;
+    @Excel(name = "出院时间", orderNum = "7", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+
 
     /**
-     * 住院科室名称
+     * 最后得分
      */
-    private String behDeptName;
+    @Excel(name = "病历得分", orderNum = "8")
+    private Double scoreRes;
 
     /**
-     * 床位号
+     * 病历等级
      */
-    private String bedCode;
+    @Excel(name = "病历等级", orderNum = "9")
+    private String level;
 
     /**
-     * 入院时间
+     * 评分时间
      */
+    @Excel(name = "评分时间", orderNum = "10", exportFormat = "yyyy/MM/dd")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date behospitalDate;
+    private Date gradeTime;
+
 
     /**
-     * 出院时间
+     * 病人住院ID
      */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date leaveHospitalDate;
+    private String behospitalCode;
+
 
     /**
-     * 疾病名称
+     * 性别
      */
-    private String diagnose;
+    private String sex;
 
     /**
-     * 医生姓名
+     * 出生日期
      */
-    private String doctorName;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date birthday;
 
     /**
-     * 年龄
+     * 病区名称
      */
-    private String age;
+    private String wardName;
 
     /**
-     * 病历等级
+     * 床位号
      */
-    private String level;
+    private String bedCode;
+
 
     /**
-     * 最后得分
+     * 疾病名称
      */
-    private Double scoreRes;
+    private String diagnose;
+
 
     /**
      * 病案首页得分
@@ -107,13 +131,8 @@ public class BehospitalInfoDTO implements Serializable {
      */
     private String gradeType;
 
-    /**
-     * 评分时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date gradeTime;
 
-    private String directorDoctorName ;
+    private String directorDoctorName;
 
     private String behDoctorName;
 

+ 21 - 18
src/main/java/com/diagbot/facade/DataAnalysisFacade.java

@@ -246,8 +246,10 @@ public class DataAnalysisFacade {
         page.setCurrent(current);
         //分页操作
         List<GetEntryDefectImproveDTO> getEntryDefectImproveDTOS = page(getEntryDefectImproveDTO, size, current);
-        //排序操作
-        getEntryDefectImproveDTOS = sortList(getEntryDefectImproveDTOS, getEntryDefectImproveVO.getAsc() != null ? getEntryDefectImproveVO.getAsc() : getEntryDefectImproveVO.getDesc() + " desc");
+        if(ListUtil.isNotEmpty(getEntryDefectImproveDTOS)) {
+            //排序操作
+            getEntryDefectImproveDTOS = sortList(getEntryDefectImproveDTOS, getEntryDefectImproveVO.getAsc() != null ? getEntryDefectImproveVO.getAsc() : getEntryDefectImproveVO.getDesc() + " desc");
+        };
         page.setRecords(getEntryDefectImproveDTOS);
         return page;
     }
@@ -398,7 +400,7 @@ public class DataAnalysisFacade {
         IPage<BehospitalInfoDTO> page = new Page<>();
         List<BehospitalInfoDTO> behospitalInfoDTOS = new ArrayList<>();
         entryDefectInnerSet(getEntryDefectImproveInnerVO);
-        List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
+       // List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
         List<EntryDefectImproveInner> records = medClickInfoService.getBaseMapper().getEntryDefectImproveInner(getEntryDefectImproveInnerVO);
         if (ListUtil.isNotEmpty(records) && records.size() == 1) {
             EntryDefectImproveInner entryDefectImproveInner = records.get(0);
@@ -418,22 +420,30 @@ public class DataAnalysisFacade {
                 if ("0".equals(getEntryDefectImproveInnerVO.getTypeMark()) && totalSet.contains(getEntryDefectImproveInnerVO.getEntryId())) {
                     behospitalInfoDTOS = getBehospitalInfoDTO(entryDefectImproveInner, behospitalCodeDetail, behospitalInfoDTOS);
                 }
-                if ("1".equals(getEntryDefectImproveInnerVO.getTypeMark()) && !improveleSet.contains(getEntryDefectImproveInnerVO.getEntryId())) {
+                if ("1".equals(getEntryDefectImproveInnerVO.getTypeMark()) && totalSet.contains(getEntryDefectImproveInnerVO.getEntryId())
+                        && !improveleSet.contains(getEntryDefectImproveInnerVO.getEntryId())) {
                     behospitalInfoDTOS = getBehospitalInfoDTO(entryDefectImproveInner, behospitalCodeDetail, behospitalInfoDTOS);
                 }
-                if ("2".equals(getEntryDefectImproveInnerVO.getTypeMark()) && improveleSet.contains(getEntryDefectImproveInnerVO.getEntryId())) {
+                if ("2".equals(getEntryDefectImproveInnerVO.getTypeMark()) && totalSet.contains(getEntryDefectImproveInnerVO.getEntryId())
+                        && improveleSet.contains(getEntryDefectImproveInnerVO.getEntryId())) {
                     behospitalInfoDTOS = getBehospitalInfoDTO(entryDefectImproveInner, behospitalCodeDetail, behospitalInfoDTOS);
                 }
             }
         }
+        //导出操作
+        if (getEntryDefectImproveInnerVO.getExportType() == 1L) {
+            size = behospitalInfoDTOS.size();
+        }
         page.setSize(size);
         page.setTotal(behospitalInfoDTOS.size());
         page.setCurrent(current);
         //分页操作
         List<BehospitalInfoDTO> behospitalInfoDTOList = page(behospitalInfoDTOS, size, current);
-        //排序操作
-        behospitalInfoDTOList = sortList(behospitalInfoDTOList, getEntryDefectImproveInnerVO.getAsc() != null ? getEntryDefectImproveInnerVO.getAsc() : getEntryDefectImproveInnerVO.getDesc() + " desc");
-        page.setRecords(behospitalInfoDTOList);
+        if(ListUtil.isNotEmpty(behospitalInfoDTOList)){
+            //排序操作
+            behospitalInfoDTOList = sortList(behospitalInfoDTOList, getEntryDefectImproveInnerVO.getAsc() != null ? getEntryDefectImproveInnerVO.getAsc() : getEntryDefectImproveInnerVO.getDesc() + " desc");
+        }
+      page.setRecords(behospitalInfoDTOList);
         return page;
     }
 
@@ -464,18 +474,11 @@ public class DataAnalysisFacade {
 
     public void getDefectImproveInnerByExport(HttpServletResponse response, GetEntryDefectImproveInnerVO
             getEntryDefectImproveInnerVO) {
-        entryDefectInnerSet(getEntryDefectImproveInnerVO);
-        getEntryDefectImproveInnerVO.setCurrent(1L);
-        getEntryDefectImproveInnerVO.setSize(Long.MAX_VALUE);
         getEntryDefectImproveInnerVO.setSearchCount(false);
+        getEntryDefectImproveInnerVO.setExportType(1L);
         String fileName = "条目缺陷改善统计病历列表.xls";
-        List<ExportExcelDTO> record = medClickInfoService.getBaseMapper().getDefectImproveInnerByExport(getEntryDefectImproveInnerVO);
-        record.stream().forEach(kfc -> {
-            List<ExportExcelBehospitalDTO> excelBehospitalDTOS = kfc.getExcelBehospitalDTOS();
-            Double avgScore = excelBehospitalDTOS.stream().parallel().collect(Collectors.averagingDouble(ExportExcelBehospitalDTO::getScore));
-            kfc.setAvgScore(avgScore);
-        });
-        ExcelUtils.exportExcelUser(record, null, "sheet1", ExportExcelDTO.class, fileName, response);
+        IPage<BehospitalInfoDTO> page = this.getEntryDefectImproveInner(getEntryDefectImproveInnerVO);
+        ExcelUtils.exportExcelUser(page.getRecords(), null, "sheet1", BehospitalInfoDTO.class, fileName, response);
     }
 
     /**

+ 5 - 10
src/main/java/com/diagbot/vo/GetEntryDefectImproveInnerVO.java

@@ -43,16 +43,6 @@ public class GetEntryDefectImproveInnerVO extends Page {
      */
     private String diagnose;
 
-    /**
-     * 模块id
-     */
-    private Long casesId;
-
-    /**
-     * 模块名称
-     */
-    private String casesName;
-
     /**
      * 科室id
      */
@@ -117,4 +107,9 @@ public class GetEntryDefectImproveInnerVO extends Page {
      * 排序(降序)
      */
     private String desc;
+
+    /**
+     * 0-不导出 1-导出
+     */
+    private Long exportType = 0L;
 }