zhaops 5 роки тому
батько
коміт
45195c50bf

+ 13 - 2
src/main/java/com/diagbot/aggregate/AverageStatisticsAggregate.java

@@ -44,6 +44,9 @@ public class AverageStatisticsAggregate {
             @DataConsumer("getAverageFee") List<AverageStatisticsDTO> averageFeeList,
             @DataConsumer("getAverageScore") List<AverageStatisticsDTO> averageScoreList) {
         Map<String, Object> retMap = new LinkedHashMap<>();
+        retMap.put("平均住院日", Lists.newLinkedList());
+        retMap.put("平均住院费用", Lists.newLinkedList());
+        retMap.put("各科室质控平均分", Lists.newLinkedList());
         if (ListUtil.isNotEmpty(averageDayNumList)) {
             retMap.put("平均住院日", averageDayNumList);
         }
@@ -99,7 +102,11 @@ public class AverageStatisticsAggregate {
                 item.setLastYearAverageValue(lastYearMap.get(item.getName()));
             }
         });
-        retAverageDayNumList = averageDayNumList.subList(0, 10);
+        if (averageDayNumList.size() <= 10) {
+            retAverageDayNumList = averageDayNumList;
+        } else {
+            retAverageDayNumList = averageDayNumList.subList(0, 10);
+        }
         return retAverageDayNumList;
     }
 
@@ -145,7 +152,11 @@ public class AverageStatisticsAggregate {
                 item.setLastYearAverageValue(lastYearMap.get(item.getName()));
             }
         });
-        retAverageFeeList = averageFeeList.subList(0, 10);
+        if (averageFeeList.size() <= 10) {
+            retAverageFeeList = averageFeeList;
+        } else {
+            retAverageFeeList = averageFeeList.subList(0, 10);
+        }
         return retAverageFeeList;
     }
 

+ 3 - 0
src/main/java/com/diagbot/aggregate/MrStatisticsAggregate.java

@@ -44,6 +44,9 @@ public class MrStatisticsAggregate {
             @DataConsumer("leaveHosCount") Map<String, Object> leaveHosMap,
             @DataConsumer("mrCount") List<NumDTO> mrCountList) {
         Map<String, Object> retMap = new LinkedHashMap<>();
+        retMap.put("各科室甲级病历占比", Lists.newLinkedList());
+        retMap.put("病历数统计", Lists.newLinkedList());
+        retMap.put("出院人数统计", new LinkedHashMap<>());
         if (ListUtil.isNotEmpty(levelResults)) {
             retMap.put("各科室甲级病历占比", levelResults);
         }

+ 3 - 0
src/main/java/com/diagbot/aggregate/ResultStatisticsAggregate.java

@@ -48,6 +48,9 @@ public class ResultStatisticsAggregate {
             @DataConsumer("entryCountGroupByEntry") List<NumDTO> entryList,
             @DataConsumer("entryCountGroupByCase") List<NumDTO> caseList) {
         Map<String, Object> retMap = new LinkedHashMap<>();
+        retMap.put("各科室缺陷占比", Lists.newLinkedList());
+        retMap.put("各模块缺陷占比排行", Lists.newLinkedList());
+        retMap.put("条目缺陷占比", Lists.newLinkedList());
         if (ListUtil.isNotEmpty(results)) {
             retMap.put("各科室缺陷占比", results);
         }

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

@@ -33,9 +33,6 @@ public class ConsoleFacade {
      */
     public Map<String, Object> mrStatistics(FilterVO filterVO) {
         Map<String, Object> retMap = new LinkedHashMap<>();
-        retMap.put("病历数统计", Lists.newLinkedList());
-        retMap.put("出院人数统计", new LinkedHashMap<>());
-        retMap.put("各科室甲级病历占比", Lists.newLinkedList());
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
         String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
@@ -61,9 +58,6 @@ public class ConsoleFacade {
      */
     public Map<String, Object> resultStatistics(FilterVO filterVO) {
         Map<String, Object> retMap = new LinkedHashMap<>();
-        retMap.put("各科室缺陷占比", Lists.newLinkedList());
-        retMap.put("各模块缺陷占比排行", Lists.newLinkedList());
-        retMap.put("条目缺陷占比", Lists.newLinkedList());
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
         filterVO.setStartDate(startDate);
@@ -87,9 +81,6 @@ public class ConsoleFacade {
      */
     public Map<String, Object> averageStatistics(FilterVO filterVO) {
         Map<String, Object> retMap = new LinkedHashMap<>();
-        retMap.put("平均住院日", Lists.newLinkedList());
-        retMap.put("平均住院费用", Lists.newLinkedList());
-        retMap.put("各科室质控平均分", Lists.newLinkedList());
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         filterVO.setHospitalId(hospitalId);
         String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);

+ 8 - 2
src/main/resources/mapper/HomePageMapper.xml

@@ -158,7 +158,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.behospital_date >= #{startDate}]]>
+            <![CDATA[ and a.behospital_date >= DATE(#{startDate})]]>
+        </if>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -187,7 +190,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.behospital_date >= #{startDate}]]>
+            <![CDATA[ and a.behospital_date >= DATE(#{startDate})]]>
+        </if>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
         </if>
         GROUP BY
         a.beh_dept_id,