|
@@ -11,6 +11,7 @@ import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.util.*;
|
|
|
import com.diagbot.vo.*;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -125,57 +126,29 @@ public class ConsoleByDeptFacade {
|
|
|
filterFacade.filterVOSet(filterVO);
|
|
|
QcresultFilterVO qcresultFilterVO = new QcresultFilterVO();
|
|
|
BeanUtil.copyProperties(filterVO, qcresultFilterVO);
|
|
|
- //关联科室
|
|
|
- Map<String, Object> deptMap = getDeptByUser(filterVO);
|
|
|
- if (deptMap == null) {
|
|
|
+ //质控病历数
|
|
|
+ Map<String,Object> maps = qcresultInfoFacade.resultMrCountByDept(qcresultFilterVO);
|
|
|
+ if(MapUtils.isEmpty(maps)){
|
|
|
return retMap;
|
|
|
}
|
|
|
- //质控病历总数
|
|
|
- List<NumDTO> totleNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterVO);
|
|
|
- Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
|
|
|
- ? new HashMap<>()
|
|
|
- : EntityUtil.makeEntityMap(totleNumList, "name");
|
|
|
- //甲级病历
|
|
|
- qcresultFilterVO.setLevel("甲");
|
|
|
- List<NumDTO> firstNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterVO);
|
|
|
- Map<String, NumDTO> firstMap = ListUtil.isEmpty(firstNumList)
|
|
|
- ? new HashMap<>()
|
|
|
- : EntityUtil.makeEntityMap(firstNumList, "name");
|
|
|
- //乙级病历
|
|
|
- qcresultFilterVO.setLevel("乙");
|
|
|
- List<NumDTO> secondNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterVO);
|
|
|
- Map<String, NumDTO> secondMap = ListUtil.isEmpty(secondNumList)
|
|
|
- ? new HashMap<>()
|
|
|
- : EntityUtil.makeEntityMap(secondNumList, "name");
|
|
|
- //丙级病历
|
|
|
- qcresultFilterVO.setLevel("丙");
|
|
|
- List<NumDTO> thirdNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterVO);
|
|
|
- Map<String, NumDTO> thirdMap = ListUtil.isEmpty(thirdNumList)
|
|
|
- ? new HashMap<>()
|
|
|
- : EntityUtil.makeEntityMap(thirdNumList, "name");
|
|
|
- for (String deptName : deptMap.keySet()) {
|
|
|
- List<NumDTO> retList = Lists.newLinkedList();
|
|
|
- int totleNum = 0;
|
|
|
- int firstLevelNum = 0;
|
|
|
- int secondLevelNum = 0;
|
|
|
- int thirdLevelNum = 0;
|
|
|
- if (totleMap.containsKey(deptName)) {
|
|
|
- totleNum = totleMap.get(deptName).getNum();
|
|
|
- }
|
|
|
- if (firstMap.containsKey(deptName)) {
|
|
|
- firstLevelNum = firstMap.get(deptName).getNum();
|
|
|
- }
|
|
|
- if (secondMap.containsKey(deptName)) {
|
|
|
- secondLevelNum = secondMap.get(deptName).getNum();
|
|
|
- }
|
|
|
- if (thirdMap.containsKey(deptName)) {
|
|
|
- thirdLevelNum = thirdMap.get(deptName).getNum();
|
|
|
- }
|
|
|
- //总病历数为0
|
|
|
- if (totleNum == 0) {
|
|
|
- retMap.put(deptName, Lists.newLinkedList());
|
|
|
- continue;
|
|
|
- }
|
|
|
+ List<NumDTO> retList = Lists.newLinkedList();
|
|
|
+ int totleNum = 0;
|
|
|
+ int firstLevelNum = 0;
|
|
|
+ int secondLevelNum = 0;
|
|
|
+ int thirdLevelNum = 0;
|
|
|
+ if(null != maps.get("num")){
|
|
|
+ totleNum = Integer.parseInt(maps.get("num").toString());
|
|
|
+ }
|
|
|
+ if(null != maps.get("firNum")){
|
|
|
+ firstLevelNum = Integer.parseInt(maps.get("firNum").toString());
|
|
|
+ }
|
|
|
+ if(null != maps.get("secNum")){
|
|
|
+ secondLevelNum = Integer.parseInt(maps.get("secNum").toString());
|
|
|
+ }
|
|
|
+ if(null != maps.get("thrNum")){
|
|
|
+ thirdLevelNum = Integer.parseInt(maps.get("thrNum").toString());
|
|
|
+ }
|
|
|
+
|
|
|
NumDTO totleNumDTO = new NumDTO();
|
|
|
totleNumDTO.setName("累计质控病历数");
|
|
|
totleNumDTO.setTotleNum(totleNum);
|
|
@@ -214,8 +187,7 @@ public class ConsoleByDeptFacade {
|
|
|
retList.add(firstLevelNumDTO);
|
|
|
retList.add(secondLevelNumDTO);
|
|
|
retList.add(thirdLevelNumDTO);
|
|
|
- retMap.put(deptName, retList);
|
|
|
- }
|
|
|
+ retMap.put((String)maps.get("NAME"), retList);
|
|
|
return retMap;
|
|
|
}
|
|
|
|