瀏覽代碼

各科室同比字段添加

chengyao 4 年之前
父節點
當前提交
bd5ab441f1

+ 95 - 8
src/main/java/com/diagbot/dto/LevelStatisticsDTO.java

@@ -35,60 +35,147 @@ public class LevelStatisticsDTO {
      */
     @Excel(name = "缺陷总数", orderNum = "3")
     private Integer entryNum;
+
+    /**
+     * 同比总数
+     */
+    @Excel(name = "同比总数", orderNum = "4")
+    private Integer sameNum;
+
+    /**
+     * 现有数据与同期数据对比(0-降 -1-升)
+     */
+    private Integer entrySameNum;
+
     /**
      * 质控病历数
      */
-    @Excel(name = "质控病历数", orderNum = "5")
+    @Excel(name = "质控病历数", orderNum = "7")
     private Integer mrNum;
+
+    /**
+     * 同比病历数
+     */
+    @Excel(name = "同比质控数", orderNum = "8")
+    private Integer sameMrNum;
+
     /**
      * 质控评分(总分)
      */
     private Double totleValue;
+
     /**
      * 质控评分(平均分)
      */
-    @Excel(name = "质控平均分", orderNum = "4")
+    @Excel(name = "质控平均分", orderNum = "5")
     private Double averageValue;
+
+    /**
+     * 同比评分(平均分)
+     */
+    @Excel(name = "同比平均分", orderNum = "6")
+    private Double sameAvgValue;
+
     /**
      * 甲级病历数/病案首页合格病历数
      */
-    @Excel(name = "甲级病历数", orderNum = "6")
+    @Excel(name = "甲级病历数", orderNum = "9")
     private Integer firstLevelNum;
+
+    /**
+     * 同比甲级病历数/病案首页合格病历数
+     */
+    @Excel(name = "同比甲级数", orderNum = "10")
+    private Integer sameFirstLevelNum;
+
     /**
      * 乙级病历数/病案首页不合格病历数
      */
-    @Excel(name = "乙级病历数", orderNum = "7")
+    @Excel(name = "乙级病历数", orderNum = "11")
     private Integer secondLevelNum;
+
+    /**
+     * 同比乙级病历数/病案首页不合格病历数
+     */
+    @Excel(name = "同比乙级数", orderNum = "12")
+    private Integer sameSecondLevelNum;
+
     /**
      * 丙级病历数
      */
-    @Excel(name = "丙级病历数", orderNum = "8")
+    @Excel(name = "丙级病历数", orderNum = "13")
     private Integer thirdLevelNum;
+
+    /**
+     * 同比丙级病历数
+     */
+    @Excel(name = "同比丙级数", orderNum = "14")
+    private Integer sameThirdLevelNum;
+
     /**
      * 甲级病历占比/病案首页合格病历占比
      */
     private Double firstLevelPercent;
+
+    /**
+     * 同比甲级病历占比/病案首页合格病历占比
+     */
+    private Double sameFirstLevelPercent;
+
     /**
      * 乙级病历占比/病案首页不合格病历占比
      */
     private Double secondLevelPercent;
+
+    /**
+     * 同比乙级病历占比/病案首页不合格病历占比
+     */
+    private Double sameSecondLevelPercent;
+
     /**
      * 丙级病历占比
      */
     private Double thirdLevelPercent;
+
+    /**
+     * 同比丙级病历占比
+     */
+    private Double sameThirdLevelPercent;
+
     /**
      * 甲级病历占比(百分比)/病案首页合格病历占比(百分比)
      */
-    @Excel(name = "甲级率", orderNum = "9")
+    @Excel(name = "甲级率", orderNum = "15")
     private String firstLevelPercentStr;
+
+    /**
+     * 同比甲级病历占比(百分比)/病案首页合格病历占比(百分比)
+     */
+    @Excel(name = "同比甲级率", orderNum = "16")
+    private String sameFirstLevelPercentStr;
+
     /**
      * 乙级病历占比(百分比)/病案首页不合格病历占比(百分比)
      */
-    @Excel(name = "乙级率", orderNum = "10")
+    @Excel(name = "乙级率", orderNum = "17")
     private String secondLevelPercentStr;
+
+    /**
+     * 同比乙级病历占比(百分比)/病案首页不合格病历占比(百分比)
+     */
+    @Excel(name = "同比乙级率", orderNum = "18")
+    private String sameSecondLevelPercentStr;
+
     /**
      * 丙级病历占比(百分比)
      */
-    @Excel(name = "丙级率", orderNum = "11")
+    @Excel(name = "丙级率", orderNum = "19")
     private String thirdLevelPercentStr;
+
+    /**
+     * 同比丙级病历占比(百分比)
+     */
+    @Excel(name = "同比丙级率", orderNum = "20")
+    private String sameThirdLevelPercentStr;
+
 }

+ 31 - 20
src/main/java/com/diagbot/facade/FilterFacade.java

@@ -8,6 +8,9 @@ import com.diagbot.vo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 
 /**
@@ -89,25 +92,24 @@ public class FilterFacade {
     /**
      * 获取上一年同期开始结束时间
      *
-     * @param type
+     * @param date
      * @return
      */
-//    public String getLastStartDateStr(Integer type) {
-//        Date date = new Date();
-//        String dateStr = "";
-//        String year = DateUtil.getYear(date);
-//        int month = DateUtil.getMonth(date);
-//        if (type.equals(1)) {
-//            if (month == 1) {
-//                dateStr = (Integer.valueOf(year) - 1) + "-12-1";
-//            } else {
-//                dateStr = year + "-" + (month - 1) + "-1";
-//            }
-//        } else if (type.equals(2)) {
-//            dateStr = (Integer.valueOf(year) - 1) + "-1-1";
-//        }
-//        return dateStr;
-//    }
+    public String getLastStartEndDate(String date) {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date dateStart = new Date();
+        try {
+             dateStart = formatter.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        Calendar c = Calendar.getInstance();
+        c.setTime(dateStart);
+        c.add(Calendar.YEAR, -1);
+        Date y = c.getTime();
+        String newDate = formatter.format(y);
+        return newDate;
+    }
 
     /**
      * 获取上一统计周期(上月/去年)的起始时间
@@ -135,12 +137,21 @@ public class FilterFacade {
         }
         if (StringUtil.isBlank(filterVO.getStartDate())) {
             String startDate = getStartDateStr(filterVO.getType(), null);
-
             filterVO.setStartDate(startDate);
+            String lastStartDate = getLastStartEndDate(startDate);
+            filterVO.setLastStartDate(lastStartDate);
+        }else{
+            String lastStartDate = getLastStartEndDate(filterVO.getStartDate());
+            filterVO.setLastStartDate(lastStartDate);
         }
         if (StringUtil.isBlank(filterVO.getEndDate())) {
             String endDate = getEndDateStr(filterVO.getType(), null);
             filterVO.setEndDate(endDate);
+            String lastEndDate = getLastStartEndDate(endDate);
+            filterVO.setLastEndDate(lastEndDate);
+        }else{
+            String lastEndDate = getLastStartEndDate(filterVO.getEndDate());
+            filterVO.setLastEndDate(lastEndDate);
         }
     }
 
@@ -246,12 +257,12 @@ public class FilterFacade {
         FilterVO filterVO = new FilterVO();
         BeanUtil.copyProperties(filterOrderVO, filterVO);
         filterVOSetSame(filterVO);
-//        filterOrderVO.setLastStartDate();
-//        filterOrderVO.setLastEndDate();
         filterOrderVO.setHospitalId(filterVO.getHospitalId());
         filterOrderVO.setUserId(filterVO.getUserId());
         filterOrderVO.setStartDate(filterVO.getStartDate());
         filterOrderVO.setEndDate(filterVO.getEndDate());
+        filterOrderVO.setLastStartDate(filterVO.getLastStartDate());
+        filterOrderVO.setLastEndDate(filterVO.getLastEndDate());
         filterOrderVO.setLimitCount(filterVO.getLimitCount());
     }
 

+ 11 - 1
src/main/java/com/diagbot/vo/FilterVO.java

@@ -29,6 +29,16 @@ public class FilterVO {
      */
     @NotBlank(message = "请输入结束时间")
     private String endDate;
+
+    /**
+     * 去年同期起始时间
+     */
+    private String lastStartDate;
+    /**
+     * 去年同期结束时间
+     */
+    private String lastEndDate;
+
     /**
      * 医院id
      */
@@ -54,4 +64,4 @@ public class FilterVO {
      * 是否归档(0:未归档,1:已归档)
      */
     private String isPlacefile = "1";
-}
+}