|
@@ -1,25 +1,15 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.diagbot.dto.AverageStatisticsDTO;
|
|
import com.diagbot.dto.AverageStatisticsDTO;
|
|
import com.diagbot.dto.NumDTO;
|
|
import com.diagbot.dto.NumDTO;
|
|
-import com.diagbot.dto.QcResultPercentDTO;
|
|
|
|
-import com.diagbot.dto.SysRoleDTO;
|
|
|
|
-import com.diagbot.dto.SysUserRoleDTO;
|
|
|
|
-import com.diagbot.entity.BehospitalInfo;
|
|
|
|
-import com.diagbot.entity.SysRole;
|
|
|
|
-import com.diagbot.enums.IsDeleteEnum;
|
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
-import com.diagbot.util.EntityUtil;
|
|
|
|
-import com.diagbot.util.ListUtil;
|
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
import com.diagbot.util.SysUserUtils;
|
|
import com.diagbot.vo.FilterVO;
|
|
import com.diagbot.vo.FilterVO;
|
|
import com.diagbot.vo.HomePageFilterVO;
|
|
import com.diagbot.vo.HomePageFilterVO;
|
|
import com.diagbot.vo.QcresultFilterVO;
|
|
import com.diagbot.vo.QcresultFilterVO;
|
|
-import com.diagbot.vo.SysUserBaseVO;
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
|
|
import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -33,7 +23,6 @@ import java.util.HashMap;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description:
|
|
* @Description:
|
|
@@ -108,9 +97,11 @@ public class ConsoleFacade {
|
|
qcresultFilterVO.setLevel("丙");
|
|
qcresultFilterVO.setLevel("丙");
|
|
int thirdLevelNum = qcresultInfoFacade.resultCount(qcresultFilterVO);
|
|
int thirdLevelNum = qcresultInfoFacade.resultCount(qcresultFilterVO);
|
|
NumDTO totleNumDTO = new NumDTO();
|
|
NumDTO totleNumDTO = new NumDTO();
|
|
|
|
+ totleNumDTO.setName("累计质控病历数");
|
|
totleNumDTO.setTotleNum(totleNum);
|
|
totleNumDTO.setTotleNum(totleNum);
|
|
totleNumDTO.setNum(totleNum);
|
|
totleNumDTO.setNum(totleNum);
|
|
NumDTO firstLevelNumDTO = new NumDTO();
|
|
NumDTO firstLevelNumDTO = new NumDTO();
|
|
|
|
+ firstLevelNumDTO.setName("甲级病历");
|
|
firstLevelNumDTO.setNum(firstLevelNum);
|
|
firstLevelNumDTO.setNum(firstLevelNum);
|
|
firstLevelNumDTO.setTotleNum(totleNum);
|
|
firstLevelNumDTO.setTotleNum(totleNum);
|
|
Double firstPercent = BigDecimal.valueOf(firstLevelNum)
|
|
Double firstPercent = BigDecimal.valueOf(firstLevelNum)
|
|
@@ -120,6 +111,7 @@ public class ConsoleFacade {
|
|
firstLevelNumDTO.setPercent(firstPercent);
|
|
firstLevelNumDTO.setPercent(firstPercent);
|
|
firstLevelNumDTO.setPercentStr(firstPercentStr);
|
|
firstLevelNumDTO.setPercentStr(firstPercentStr);
|
|
NumDTO secondLevelNumDTO = new NumDTO();
|
|
NumDTO secondLevelNumDTO = new NumDTO();
|
|
|
|
+ secondLevelNumDTO.setName("乙级病历");
|
|
secondLevelNumDTO.setNum(secondLevelNum);
|
|
secondLevelNumDTO.setNum(secondLevelNum);
|
|
secondLevelNumDTO.setTotleNum(totleNum);
|
|
secondLevelNumDTO.setTotleNum(totleNum);
|
|
Double secondPercent = BigDecimal.valueOf(secondLevelNum)
|
|
Double secondPercent = BigDecimal.valueOf(secondLevelNum)
|
|
@@ -129,6 +121,7 @@ public class ConsoleFacade {
|
|
secondLevelNumDTO.setPercent(secondPercent);
|
|
secondLevelNumDTO.setPercent(secondPercent);
|
|
secondLevelNumDTO.setPercentStr(secondPercentStr);
|
|
secondLevelNumDTO.setPercentStr(secondPercentStr);
|
|
NumDTO thirdLevelNumDTO = new NumDTO();
|
|
NumDTO thirdLevelNumDTO = new NumDTO();
|
|
|
|
+ thirdLevelNumDTO.setName("丙级病历");
|
|
thirdLevelNumDTO.setNum(thirdLevelNum);
|
|
thirdLevelNumDTO.setNum(thirdLevelNum);
|
|
thirdLevelNumDTO.setTotleNum(totleNum);
|
|
thirdLevelNumDTO.setTotleNum(totleNum);
|
|
Double thirdPercent = BigDecimal.valueOf(1)
|
|
Double thirdPercent = BigDecimal.valueOf(1)
|
|
@@ -182,59 +175,12 @@ public class ConsoleFacade {
|
|
*/
|
|
*/
|
|
public Map<String, Object> resultStatistics(FilterVO filterVO) {
|
|
public Map<String, Object> resultStatistics(FilterVO filterVO) {
|
|
Map<String, Object> retMap = new LinkedHashMap<>();
|
|
Map<String, Object> retMap = new LinkedHashMap<>();
|
|
- retMap.put("缺陷排行列表", Lists.newLinkedList());
|
|
|
|
- retMap.put("各科室缺陷占比", Lists.newLinkedList());
|
|
|
|
|
|
+ retMap.put("各模块缺陷占比排行", Lists.newLinkedList());
|
|
|
|
+ retMap.put("条目缺陷占比", Lists.newLinkedList());
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
String startDate = getStartDateStr(filterVO.getType());
|
|
String startDate = getStartDateStr(filterVO.getType());
|
|
filterVO.setStartDate(startDate);
|
|
filterVO.setStartDate(startDate);
|
|
filterVO.setHospitalId(hospitalId);
|
|
filterVO.setHospitalId(hospitalId);
|
|
- /*if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
|
|
|
|
- filterVO.setLimitCount(10);
|
|
|
|
- }*/
|
|
|
|
- // List<ResultDetailDTO> results = behospitalInfoFacade.resultStatistics(filterVO);
|
|
|
|
- // if (ListUtil.isNotEmpty(results)) {
|
|
|
|
- // results.forEach(result -> {
|
|
|
|
- // DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
|
- // String percentStr
|
|
|
|
- // = df.format(BigDecimal.valueOf(result.getPercent()).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
|
- // result.setPercentStr(percentStr);
|
|
|
|
- // });
|
|
|
|
- // retMap.put("缺陷排行列表", results);
|
|
|
|
- // }
|
|
|
|
- // List<ResultDetailDTO> results2 = behospitalInfoFacade.resultStatisticsByDept(filterVO);
|
|
|
|
- // if (ListUtil.isNotEmpty(results2)) {
|
|
|
|
- // List<ResultDetailDTO> retResults = Lists.newLinkedList();
|
|
|
|
- // if (results2.size() <= 6) {
|
|
|
|
- // retResults = BeanUtil.listCopyTo(results2, ResultDetailDTO.class);
|
|
|
|
- // } else {
|
|
|
|
- //
|
|
|
|
- // Double rate = 0d;
|
|
|
|
- // Integer num = 0;
|
|
|
|
- // for (ResultDetailDTO result : results2) {
|
|
|
|
- // if (retResults.size() < 5) {
|
|
|
|
- // rate = BigDecimal.valueOf(rate)
|
|
|
|
- // .add(BigDecimal.valueOf(Double.valueOf(result.getPercent())))
|
|
|
|
- // .doubleValue();
|
|
|
|
- // retResults.add(result);
|
|
|
|
- // } else {
|
|
|
|
- // num += result.getNum();
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // ResultDetailDTO retResult = new ResultDetailDTO();
|
|
|
|
- // retResult.setName("其他");
|
|
|
|
- // retResult.setNum(num);
|
|
|
|
- // retResult.setPercent(BigDecimal.valueOf(1).subtract(BigDecimal.valueOf(rate)).doubleValue());
|
|
|
|
- // retResults.add(retResult);
|
|
|
|
- // }
|
|
|
|
- // retResults.forEach(result -> {
|
|
|
|
- // DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
|
- // String percentStr
|
|
|
|
- // = df.format(BigDecimal.valueOf(result.getPercent()).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
|
- // result.setPercentStr(percentStr);
|
|
|
|
- // });
|
|
|
|
- // retMap.put("各科室缺陷占比", retResults);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
try {
|
|
try {
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
invokeParams.put("filterVO", filterVO);
|
|
invokeParams.put("filterVO", filterVO);
|