|
@@ -2,7 +2,6 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.dto.ResultDetailDTO;
|
|
|
-import com.diagbot.dto.ResultStatisticsDTO;
|
|
|
import com.diagbot.entity.BehospitalInfo;
|
|
|
import com.diagbot.entity.QcresultInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
@@ -11,7 +10,6 @@ import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
|
import com.diagbot.vo.FilterVO;
|
|
|
-import com.fasterxml.jackson.datatype.jsr310.DecimalUtils;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -44,7 +42,7 @@ public class ConsoleFacade {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String, Object> mrStatistics() {
|
|
|
+ public Map<String, Object> mrStatistics(FilterVO filterVO) {
|
|
|
Map<String, Object> retMap = new HashMap<>();
|
|
|
retMap.put("本月病历数", 0);
|
|
|
retMap.put("本月质控数-人工", 0);
|
|
@@ -57,11 +55,10 @@ public class ConsoleFacade {
|
|
|
retMap.put("本月不合格病历-机器", 0);
|
|
|
|
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ String startDate = getStartDateStr(filterVO.getType());
|
|
|
+ filterVO.setStartDate(startDate);
|
|
|
+ filterVO.setHospitalId(hospitalId);
|
|
|
|
|
|
- Date date = new Date();
|
|
|
- String year = DateUtil.getYear(date);
|
|
|
- int month = DateUtil.getMonth(date);
|
|
|
- String startDate = year + "-" + month + "-1";
|
|
|
QueryWrapper<BehospitalInfo> behospitalInfoQueryWrapper = new QueryWrapper<>();
|
|
|
behospitalInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", hospitalId)
|
|
@@ -72,11 +69,7 @@ public class ConsoleFacade {
|
|
|
retMap.put("本月病历数", behospitalInfoList.size());
|
|
|
}
|
|
|
|
|
|
- QueryWrapper<QcresultInfo> qcresultInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- qcresultInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", hospitalId)
|
|
|
- .ge("gmt_create", startDate);
|
|
|
- List<QcresultInfo> qcresultInfoList = qcresultInfoFacade.list(qcresultInfoQueryWrapper);
|
|
|
+ List<QcresultInfo> qcresultInfoList = qcresultInfoFacade.getQcresultSelectively(filterVO);
|
|
|
if (ListUtil.isNotEmpty(qcresultInfoList)) {
|
|
|
retMap.put("本月质控数-人工", qcresultInfoList
|
|
|
.stream()
|
|
@@ -121,7 +114,6 @@ public class ConsoleFacade {
|
|
|
}
|
|
|
|
|
|
return retMap;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -135,17 +127,7 @@ public class ConsoleFacade {
|
|
|
retMap.put("缺陷排行列表", Lists.newLinkedList());
|
|
|
retMap.put("各科室缺陷占比", Lists.newLinkedList());
|
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
- Date date = new Date();
|
|
|
- String startDate = "";
|
|
|
- String year = DateUtil.getYear(date);
|
|
|
- int month = DateUtil.getMonth(date);
|
|
|
- if (filterVO.getType().equals(1)) {
|
|
|
- //本月统计
|
|
|
- startDate = year + "-" + month + "-1";
|
|
|
- } else if (filterVO.getType().equals(2)) {
|
|
|
- //本年统计
|
|
|
- startDate = year + "-1-1";
|
|
|
- }
|
|
|
+ String startDate = getStartDateStr(filterVO.getType());
|
|
|
filterVO.setStartDate(startDate);
|
|
|
filterVO.setHospitalId(hospitalId);
|
|
|
filterVO.setLimitCount(10);
|
|
@@ -197,4 +179,25 @@ public class ConsoleFacade {
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 筛选起始时间
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String getStartDateStr(Integer type) {
|
|
|
+ Date date = new Date();
|
|
|
+ String startDate = "";
|
|
|
+ String year = DateUtil.getYear(date);
|
|
|
+ int month = DateUtil.getMonth(date);
|
|
|
+ if (type.equals(1)) {
|
|
|
+ //本月统计
|
|
|
+ startDate = year + "-" + month + "-1";
|
|
|
+ } else if (type.equals(2)) {
|
|
|
+ //本年统计
|
|
|
+ startDate = year + "-1-1";
|
|
|
+ }
|
|
|
+ return startDate;
|
|
|
+ }
|
|
|
+
|
|
|
}
|