소스 검색

问题修正

gaodm 5 년 전
부모
커밋
3e92e1d041

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

@@ -18,9 +18,9 @@ public class AverageStatisticsDTO {
     private Integer num;
     @Excel(name = "本年平均住院天数(天)", width = 15, orderNum = "2")
     private Double averageValue = 0d;
-    @Excel(name = "去年平均住院天数(天)", width = 15, orderNum = "3")
     private Double totleValue = 0d;
     //环比平均值
+    @Excel(name = "去年平均住院天数(天)", width = 15, orderNum = "3")
     private Double lastAverageValue = 0d;
     //同比平均值
     private Double lastYearAverageValue = 0d;

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

@@ -18,9 +18,9 @@ public class AverageStatisticsFeeDTO {
     private Integer num;
     @Excel(name = "本年平均住院花费(元)", width = 15, orderNum = "2")
     private Double averageValue = 0d;
-    @Excel(name = "去年平均住院花费(元)", width = 15, orderNum = "3")
     private Double totleValue = 0d;
     //环比平均值
+    @Excel(name = "去年平均住院花费(元)", width = 15, orderNum = "3")
     private Double lastAverageValue = 0d;
     //同比平均值
     private Double lastYearAverageValue = 0d;

+ 30 - 0
src/main/java/com/diagbot/dto/AverageStatisticsFeeMonthDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/15 19:44
+ */
+@Getter
+@Setter
+public class AverageStatisticsFeeMonthDTO {
+    private String id;
+    @Excel(name = "科室名称", width = 30, orderNum = "1")
+    private String name;
+    private Integer num;
+    @Excel(name = "本月平均住院花费(元)", width = 15, orderNum = "2")
+    private Double averageValue = 0d;
+    private Double totleValue = 0d;
+    //环比平均值
+    @Excel(name = "上月平均住院花费(元)", width = 15, orderNum = "3")
+    private Double lastAverageValue = 0d;
+    //同比平均值
+    @Excel(name = "去年本月平均住院花费(元)", width = 15, orderNum = "4")
+    private Double lastYearAverageValue = 0d;
+    //科室分类
+    private String deptClass;
+}

+ 30 - 0
src/main/java/com/diagbot/dto/AverageStatisticsMonthDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/15 19:44
+ */
+@Getter
+@Setter
+public class AverageStatisticsMonthDTO {
+    private String id;
+    @Excel(name = "科室名称", width = 30, orderNum = "1")
+    private String name;
+    private Integer num;
+    @Excel(name = "本月平均住院天数(天)", width = 15, orderNum = "2")
+    private Double averageValue = 0d;
+    private Double totleValue = 0d;
+    //环比平均值
+    @Excel(name = "上月平均住院天数(天)", width = 15, orderNum = "3")
+    private Double lastAverageValue = 0d;
+    //同比平均值
+    @Excel(name = "去年本月平均住院天数(天)", width = 15, orderNum = "4")
+    private Double lastYearAverageValue = 0d;
+    //科室分类
+    private String deptClass;
+}

+ 20 - 2
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -3,6 +3,8 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.AverageStatisticsDTO;
 import com.diagbot.dto.AverageStatisticsFeeDTO;
+import com.diagbot.dto.AverageStatisticsFeeMonthDTO;
+import com.diagbot.dto.AverageStatisticsMonthDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.EntryNumGroupDTO;
 import com.diagbot.dto.EntryStatisticsDTO;
@@ -12,6 +14,7 @@ import com.diagbot.dto.LevelStatisticsTZDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.dto.QcResultShortDTO;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.util.ExcelUtils;
 import com.diagbot.vo.EntryStatisticsVO;
 import com.diagbot.vo.FilterOrderVO;
@@ -100,7 +103,15 @@ public class ConsoleExportFacade {
         filterPageByAverageVO.setSearchCount(false);
         IPage<AverageStatisticsDTO> page = consoleFacade.getAverageDayNumPage(filterPageByAverageVO);
         String fileName = " 按科室统计平均住院天数.xls";
-        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", AverageStatisticsDTO.class, fileName, response, 12.8f);
+
+        if (filterPageByAverageVO.getType() == 2) {
+            ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", AverageStatisticsDTO.class, fileName, response, 12.8f);
+        }
+        if (filterPageByAverageVO.getType() == 1) {
+            List<AverageStatisticsMonthDTO> list = BeanUtil.listCopyTo(page.getRecords(), AverageStatisticsMonthDTO.class);
+            ExcelUtils.exportExcel(list, null, "sheet1", AverageStatisticsMonthDTO.class, fileName, response, 12.8f);
+        }
+
     }
 
     /**
@@ -115,7 +126,14 @@ public class ConsoleExportFacade {
         filterPageByAverageVO.setSearchCount(false);
         IPage<AverageStatisticsFeeDTO> page = consoleFacade.getAverageFeePage(filterPageByAverageVO);
         String fileName = " 按科室统计平均住院费用.xls";
-        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", AverageStatisticsFeeDTO.class, fileName, response, 12.8f);
+
+        if (filterPageByAverageVO.getType() == 2) {
+            ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", AverageStatisticsFeeDTO.class, fileName, response, 12.8f);
+        }
+        if (filterPageByAverageVO.getType() == 1) {
+            List<AverageStatisticsFeeMonthDTO> list = BeanUtil.listCopyTo(page.getRecords(), AverageStatisticsFeeMonthDTO.class);
+            ExcelUtils.exportExcel(list, null, "sheet1", AverageStatisticsFeeMonthDTO.class, fileName, response, 12.8f);
+        }
     }
 
     /**