|
@@ -160,14 +160,81 @@ public class ConsoleFacade {
|
|
|
*/
|
|
|
public Map<String, Object> getAverageScore(FilterVO filterVO) {
|
|
|
Map<String, Object> retMap = new HashMap<>();
|
|
|
- filterFacade.filterVOSet(filterVO);
|
|
|
+ filterFacade.filterVOSame(filterVO);
|
|
|
List<AverageStatisticsDTO> averageScoreList = averageStatisticsAggregate.getAverageScore(filterVO);
|
|
|
+
|
|
|
+ AverageStatisticsDTO item = getGlobleAverageTitle(averageScoreList);
|
|
|
+ if (item != null) {
|
|
|
+ averageScoreList.add(0, item);
|
|
|
+ }
|
|
|
+
|
|
|
if (ListUtil.isNotEmpty(averageScoreList)) {
|
|
|
retMap.put("各科室质控平均分", averageScoreList);
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 增加全院记录
|
|
|
+ *
|
|
|
+ * @param records
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AverageStatisticsDTO getGlobleAverageTitle(List<AverageStatisticsDTO> records) {
|
|
|
+ DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
+ AverageStatisticsDTO item = new AverageStatisticsDTO();
|
|
|
+ if (ListUtil.isEmpty(records)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ //数量
|
|
|
+ Integer num = records
|
|
|
+ .stream()
|
|
|
+ .map(AverageStatisticsDTO::getNum)
|
|
|
+ .reduce(0, Integer::sum);
|
|
|
+
|
|
|
+ //同期数量
|
|
|
+ Integer sameNum = records
|
|
|
+ .stream()
|
|
|
+ .map(AverageStatisticsDTO::getSameNum)
|
|
|
+ .reduce(0, Integer::sum);
|
|
|
+
|
|
|
+ Double totleValue = records
|
|
|
+ .stream()
|
|
|
+ .map(i -> BigDecimal.valueOf(i.getTotleValue()))
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .doubleValue();
|
|
|
+
|
|
|
+ Double sameTotleValue = records
|
|
|
+ .stream()
|
|
|
+ .map(i -> BigDecimal.valueOf(i.getSameTotleValue()))
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .doubleValue();
|
|
|
+
|
|
|
+ Double averageValue = 0d;
|
|
|
+ if(0 != num){
|
|
|
+ averageValue = BigDecimal.valueOf(totleValue)
|
|
|
+ .divide(BigDecimal.valueOf(num), 2, RoundingMode.HALF_UP)
|
|
|
+ .doubleValue();
|
|
|
+ }
|
|
|
+ Double lastYearAverageValue = 0d;
|
|
|
+ if(0 != sameNum) {
|
|
|
+ lastYearAverageValue = BigDecimal.valueOf(sameTotleValue)
|
|
|
+ .divide(BigDecimal.valueOf(sameNum), 2, RoundingMode.HALF_UP)
|
|
|
+ .doubleValue();
|
|
|
+ }
|
|
|
+
|
|
|
+ item.setName("全院");
|
|
|
+ item.setNum(num);
|
|
|
+ item.setSameNum(sameNum);
|
|
|
+ item.setAverageValue(averageValue);
|
|
|
+ item.setTotleValue(totleValue);
|
|
|
+ item.setSameTotleValue(sameTotleValue);
|
|
|
+ item.setLastYearAverageValue(lastYearAverageValue);
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 各科室质控平均分(首页)-根据内外科系统统计
|
|
|
*
|
|
@@ -175,7 +242,7 @@ public class ConsoleFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<AverageStatisticsDTO> getAverageScoreByDeptClass(FilterVO filterVO) {
|
|
|
- filterFacade.filterVOSet(filterVO);
|
|
|
+ filterFacade.filterVOSame(filterVO);
|
|
|
List<AverageStatisticsDTO> retAverageScoreList = Lists.newLinkedList();
|
|
|
List<AverageStatisticsDTO> averageScoreList = qcresultInfoFacade.getAverageScoreByDeptClass(filterVO);
|
|
|
Integer limitCount = filterVO.getLimitCount();
|
|
@@ -183,9 +250,77 @@ public class ConsoleFacade {
|
|
|
if (ListUtil.isNotEmpty(averageScoreList)) {
|
|
|
retAverageScoreList = averageStatisticsAggregate.getLimitAverageList(averageScoreList, limitCount);
|
|
|
}
|
|
|
+ AverageStatisticsDTO item = getGlobleInOutTitle(retAverageScoreList,filterVO);
|
|
|
+ if (item != null) {
|
|
|
+ retAverageScoreList.add(0, item);
|
|
|
+ }
|
|
|
return retAverageScoreList;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 增加内外科记录
|
|
|
+ *
|
|
|
+ * @param records
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AverageStatisticsDTO getGlobleInOutTitle(List<AverageStatisticsDTO> records,FilterVO filterVO) {
|
|
|
+ DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
+ AverageStatisticsDTO item = new AverageStatisticsDTO();
|
|
|
+ if (ListUtil.isEmpty(records)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ //数量
|
|
|
+ Integer num = records
|
|
|
+ .stream()
|
|
|
+ .map(AverageStatisticsDTO::getNum)
|
|
|
+ .reduce(0, Integer::sum);
|
|
|
+
|
|
|
+ //同期数量
|
|
|
+ Integer sameNum = records
|
|
|
+ .stream()
|
|
|
+ .map(AverageStatisticsDTO::getSameNum)
|
|
|
+ .reduce(0, Integer::sum);
|
|
|
+
|
|
|
+ Double totleValue = records
|
|
|
+ .stream()
|
|
|
+ .map(i -> BigDecimal.valueOf(i.getTotleValue()))
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .doubleValue();
|
|
|
+
|
|
|
+ Double sameTotleValue = records
|
|
|
+ .stream()
|
|
|
+ .map(i -> BigDecimal.valueOf(i.getSameTotleValue()))
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
|
+ .doubleValue();
|
|
|
+
|
|
|
+ Double averageValue = 0d;
|
|
|
+ if(0 != num){
|
|
|
+ averageValue = BigDecimal.valueOf(totleValue)
|
|
|
+ .divide(BigDecimal.valueOf(num), 2, RoundingMode.HALF_UP)
|
|
|
+ .doubleValue();
|
|
|
+ }
|
|
|
+ Double lastYearAverageValue = 0d;
|
|
|
+ if(0 != sameNum) {
|
|
|
+ lastYearAverageValue = BigDecimal.valueOf(sameTotleValue)
|
|
|
+ .divide(BigDecimal.valueOf(sameNum), 2, RoundingMode.HALF_UP)
|
|
|
+ .doubleValue();
|
|
|
+ }
|
|
|
+
|
|
|
+ if("内科".equals(filterVO.getDeptClass())){
|
|
|
+ item.setName("内科系统");
|
|
|
+ }else{
|
|
|
+ item.setName("外科系统");
|
|
|
+ }
|
|
|
+ item.setNum(num);
|
|
|
+ item.setSameNum(sameNum);
|
|
|
+ item.setAverageValue(averageValue);
|
|
|
+ item.setTotleValue(totleValue);
|
|
|
+ item.setSameTotleValue(sameTotleValue);
|
|
|
+ item.setLastYearAverageValue(lastYearAverageValue);
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 各科室甲级病历占比
|
|
|
*
|