|
@@ -1,14 +1,24 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.dto.DeptBaseDTO;
|
|
|
+import com.diagbot.dto.DeptNumDTO;
|
|
|
+import com.diagbot.dto.NumDTO;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.SysUserUtils;
|
|
|
import com.diagbot.vo.FilterByDeptVO;
|
|
|
+import com.diagbot.vo.HPFilterByDeptVO;
|
|
|
+import com.diagbot.vo.QcresultFilterByDeptVO;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.text.DecimalFormat;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description:主任医生相关首页
|
|
@@ -23,7 +33,396 @@ public class ConsoleByDeptFacade {
|
|
|
private QcresultInfoFacade qcresultInfoFacade;
|
|
|
@Autowired
|
|
|
private BasDeptInfoFacade basDeptInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private FilterFacade filterFacade;
|
|
|
+ @Autowired
|
|
|
+ private QcCasesFacade qcCasesFacade;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出院人数统计-按科室
|
|
|
+ *
|
|
|
+ * @param filterByDeptVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> leaveHosCountByDept(FilterByDeptVO filterByDeptVO) {
|
|
|
+ Map<String, Object> retMap = new LinkedHashMap<>();
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ String userId = SysUserUtils.getCurrentPrincipleID();
|
|
|
+ String startDate = filterFacade.getStartDateStr(filterByDeptVO.getType(), null);
|
|
|
+ String endDate = filterFacade.getEndDateStr(filterByDeptVO.getType(), null);
|
|
|
+ filterByDeptVO.setHospitalId(hospitalId);
|
|
|
+ filterByDeptVO.setUserId(Long.valueOf(userId));
|
|
|
+ filterByDeptVO.setStartDate(startDate);
|
|
|
+ filterByDeptVO.setEndDate(endDate);
|
|
|
+ HPFilterByDeptVO hpFilterByDeptVO = new HPFilterByDeptVO();
|
|
|
+ BeanUtil.copyProperties(filterByDeptVO, hpFilterByDeptVO);
|
|
|
+ //关联科室
|
|
|
+ Map<String, Object> deptMap = getDeptByUser(filterByDeptVO);
|
|
|
+ if (deptMap == null) {
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+ //出院总人数
|
|
|
+ List<NumDTO> totleNumList = behospitalInfoFacade.homePageCountByDept(hpFilterByDeptVO);
|
|
|
+ Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityMap(totleNumList, "name");
|
|
|
+ //死亡人数
|
|
|
+ hpFilterByDeptVO.setDeath(1);
|
|
|
+ List<NumDTO> deathNumList = behospitalInfoFacade.homePageCountByDept(hpFilterByDeptVO);
|
|
|
+ Map<String, NumDTO> deathMap = ListUtil.isEmpty(deathNumList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityMap(deathNumList, "name");
|
|
|
+ //手术人数
|
|
|
+ List<NumDTO> operationNumList = behospitalInfoFacade.homePageCountForOperationByDept(filterByDeptVO);
|
|
|
+ Map<String, NumDTO> operationMap = ListUtil.isEmpty(operationNumList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityMap(operationNumList, "name");
|
|
|
+ for (String deptName : deptMap.keySet()) {
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
+ map.put("总人数", 0);
|
|
|
+ map.put("死亡人数", 0);
|
|
|
+ map.put("手术病人数", 0);
|
|
|
+
|
|
|
+ if (totleMap.containsKey(deptName)) {
|
|
|
+ map.put("总人数", totleMap.get(deptName).getNum());
|
|
|
+ }
|
|
|
+ if (deathMap.containsKey(deptName)) {
|
|
|
+ map.put("死亡人数", deathMap.get(deptName).getNum());
|
|
|
+ }
|
|
|
+ if (operationMap.containsKey(deptName)) {
|
|
|
+ map.put("手术病人数", operationMap.get(deptName).getNum());
|
|
|
+ }
|
|
|
+ retMap.put(deptName, map);
|
|
|
+ }
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 病历数统计-按科室
|
|
|
+ *
|
|
|
+ * @param filterByDeptVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> mrCountByDept(FilterByDeptVO filterByDeptVO) {
|
|
|
+ DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
+ Map<String, Object> retMap = new LinkedHashMap<>();
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ String userId = SysUserUtils.getCurrentPrincipleID();
|
|
|
+ String startDate = filterFacade.getStartDateStr(filterByDeptVO.getType(), null);
|
|
|
+ String endDate = filterFacade.getEndDateStr(filterByDeptVO.getType(), null);
|
|
|
+ filterByDeptVO.setHospitalId(hospitalId);
|
|
|
+ filterByDeptVO.setUserId(Long.valueOf(userId));
|
|
|
+ filterByDeptVO.setStartDate(startDate);
|
|
|
+ filterByDeptVO.setEndDate(endDate);
|
|
|
+ QcresultFilterByDeptVO qcresultFilterByDeptVO = new QcresultFilterByDeptVO();
|
|
|
+ BeanUtil.copyProperties(filterByDeptVO, qcresultFilterByDeptVO);
|
|
|
+ //关联科室
|
|
|
+ Map<String, Object> deptMap = getDeptByUser(filterByDeptVO);
|
|
|
+ if (deptMap == null) {
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+ //质控病历总数
|
|
|
+ List<NumDTO> totleNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterByDeptVO);
|
|
|
+ Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityMap(totleNumList, "name");
|
|
|
+ //甲级病历
|
|
|
+ qcresultFilterByDeptVO.setLevel("甲");
|
|
|
+ List<NumDTO> firstNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterByDeptVO);
|
|
|
+ Map<String, NumDTO> firstMap = ListUtil.isEmpty(firstNumList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityMap(firstNumList, "name");
|
|
|
+ //乙级病历
|
|
|
+ qcresultFilterByDeptVO.setLevel("乙");
|
|
|
+ List<NumDTO> secondNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterByDeptVO);
|
|
|
+ Map<String, NumDTO> secondMap = ListUtil.isEmpty(secondNumList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityMap(secondNumList, "name");
|
|
|
+ //丙级病历
|
|
|
+ qcresultFilterByDeptVO.setLevel("丙");
|
|
|
+ List<NumDTO> thirdNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterByDeptVO);
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ NumDTO totleNumDTO = new NumDTO();
|
|
|
+ totleNumDTO.setName("累计质控病历数");
|
|
|
+ totleNumDTO.setTotleNum(totleNum);
|
|
|
+ totleNumDTO.setNum(totleNum);
|
|
|
+ NumDTO firstLevelNumDTO = new NumDTO();
|
|
|
+ firstLevelNumDTO.setName("甲级病历");
|
|
|
+ firstLevelNumDTO.setNum(firstLevelNum);
|
|
|
+ firstLevelNumDTO.setTotleNum(totleNum);
|
|
|
+ Double firstPercent = BigDecimal.valueOf(firstLevelNum)
|
|
|
+ .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
|
|
|
+ .doubleValue();
|
|
|
+ String firstPercentStr = df.format(BigDecimal.valueOf(firstPercent).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
+ firstLevelNumDTO.setPercent(firstPercent);
|
|
|
+ firstLevelNumDTO.setPercentStr(firstPercentStr);
|
|
|
+ NumDTO secondLevelNumDTO = new NumDTO();
|
|
|
+ secondLevelNumDTO.setName("乙级病历");
|
|
|
+ secondLevelNumDTO.setNum(secondLevelNum);
|
|
|
+ secondLevelNumDTO.setTotleNum(totleNum);
|
|
|
+ Double secondPercent = BigDecimal.valueOf(secondLevelNum)
|
|
|
+ .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
|
|
|
+ .doubleValue();
|
|
|
+ String secondPercentStr = df.format(BigDecimal.valueOf(secondPercent).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
+ secondLevelNumDTO.setPercent(secondPercent);
|
|
|
+ secondLevelNumDTO.setPercentStr(secondPercentStr);
|
|
|
+ NumDTO thirdLevelNumDTO = new NumDTO();
|
|
|
+ thirdLevelNumDTO.setName("丙级病历");
|
|
|
+ thirdLevelNumDTO.setNum(thirdLevelNum);
|
|
|
+ thirdLevelNumDTO.setTotleNum(totleNum);
|
|
|
+ Double thirdPercent = BigDecimal.valueOf(1)
|
|
|
+ .subtract(BigDecimal.valueOf(firstPercent))
|
|
|
+ .subtract(BigDecimal.valueOf(secondPercent))
|
|
|
+ .doubleValue();
|
|
|
+ String thirdPercentStr = df.format(BigDecimal.valueOf(thirdPercent).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
+ thirdLevelNumDTO.setPercent(thirdPercent);
|
|
|
+ thirdLevelNumDTO.setPercentStr(thirdPercentStr);
|
|
|
+ retList.add(totleNumDTO);
|
|
|
+ retList.add(firstLevelNumDTO);
|
|
|
+ retList.add(secondLevelNumDTO);
|
|
|
+ retList.add(thirdLevelNumDTO);
|
|
|
+ retMap.put(deptName, retList);
|
|
|
+ }
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 各模块缺陷占比排名-按科室
|
|
|
+ *
|
|
|
+ * @param filterByDeptVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> entryCountGroupByCaseAndDept(FilterByDeptVO filterByDeptVO) {
|
|
|
+ DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
+ Map<String, Object> retMap = new LinkedHashMap<>();
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ String userId = SysUserUtils.getCurrentPrincipleID();
|
|
|
+ String startDate = filterFacade.getStartDateStr(filterByDeptVO.getType(), null);
|
|
|
+ String endDate = filterFacade.getEndDateStr(filterByDeptVO.getType(), null);
|
|
|
+ filterByDeptVO.setHospitalId(hospitalId);
|
|
|
+ filterByDeptVO.setUserId(Long.valueOf(userId));
|
|
|
+ filterByDeptVO.setStartDate(startDate);
|
|
|
+ filterByDeptVO.setEndDate(endDate);
|
|
|
+ if (filterByDeptVO.getLimitCount() == null || filterByDeptVO.getLimitCount().equals(0)) {
|
|
|
+ filterByDeptVO.setLimitCount(10);
|
|
|
+ }
|
|
|
+ Integer limitCount = filterByDeptVO.getLimitCount();
|
|
|
+ QcresultFilterByDeptVO qcresultFilterByDeptVO = new QcresultFilterByDeptVO();
|
|
|
+ BeanUtil.copyProperties(filterByDeptVO, qcresultFilterByDeptVO);
|
|
|
+ //关联科室
|
|
|
+ Map<String, Object> deptMap = getDeptByUser(filterByDeptVO);
|
|
|
+ if (deptMap == null) {
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+ List<NumDTO> mrNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterByDeptVO);
|
|
|
+ Map<String, NumDTO> mrMap = ListUtil.isEmpty(mrNumList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityMap(mrNumList, "name");
|
|
|
+ List<DeptNumDTO> qcEntryNumList = qcresultInfoFacade.entryCountGroupByCaseAndDept(filterByDeptVO);
|
|
|
+ Map<String, List<DeptNumDTO>> qcEntryMap = ListUtil.isEmpty(qcEntryNumList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityListMap(qcEntryNumList, "deptName");
|
|
|
+ List<NumDTO> standardEntryNumList = qcCasesFacade.entryGroupByCase();
|
|
|
+ for (String deptName : deptMap.keySet()) {
|
|
|
+ //没有质控病历
|
|
|
+ if (!mrMap.containsKey(deptName)) {
|
|
|
+ retMap.put(deptName, Lists.newLinkedList());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //病历数
|
|
|
+ Integer mrNum = mrMap.get(deptName).getNum();
|
|
|
+ //没有缺陷
|
|
|
+ if (!qcEntryMap.containsKey(deptName)) {
|
|
|
+ retMap.put(deptName, Lists.newLinkedList());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //模块缺陷
|
|
|
+ List<DeptNumDTO> qcEntryNumByDeptList = qcEntryMap.get(deptName);
|
|
|
+ List<NumDTO> retList = Lists.newLinkedList();
|
|
|
+ retList = BeanUtil.listCopyTo(standardEntryNumList, NumDTO.class);
|
|
|
+ if (ListUtil.isEmpty(qcEntryNumByDeptList)) {
|
|
|
+ for (NumDTO entryNum : retList) {
|
|
|
+ Integer totleNum = entryNum.getNum() * mrNum;
|
|
|
+ entryNum.setNum(0);
|
|
|
+ entryNum.setPercent(0d);
|
|
|
+ entryNum.setPercentStr("0%");
|
|
|
+ entryNum.setTotleNum(totleNum);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Map<Long, Integer> qcEntryNumMap
|
|
|
+ = EntityUtil.makeMapWithKeyValue(qcEntryNumByDeptList, "id", "num");
|
|
|
+ if (ListUtil.isNotEmpty(standardEntryNumList)) {
|
|
|
+ for (NumDTO entryNum : retList) {
|
|
|
+ Integer totleNum = entryNum.getNum() * mrNum;
|
|
|
+ if (qcEntryNumMap.containsKey(entryNum.getId())) {
|
|
|
+ entryNum.setNum(qcEntryNumMap.get(entryNum.getId()));
|
|
|
+ Double percent = BigDecimal.valueOf(entryNum.getNum())
|
|
|
+ .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
|
|
|
+ .doubleValue();
|
|
|
+ String percentStr
|
|
|
+ = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
+ entryNum.setTotleNum(totleNum);
|
|
|
+ entryNum.setPercent(percent);
|
|
|
+ entryNum.setPercentStr(percentStr);
|
|
|
+ } else {
|
|
|
+ entryNum.setNum(0);
|
|
|
+ entryNum.setPercent(0d);
|
|
|
+ entryNum.setPercentStr("0%");
|
|
|
+ entryNum.setTotleNum(totleNum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //降序排序
|
|
|
+ Collections.sort(retList, new Comparator<NumDTO>() {
|
|
|
+ @Override
|
|
|
+ public int compare(NumDTO o1, NumDTO o2) {
|
|
|
+ return o2.getPercent().compareTo(o1.getPercent());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //取top10
|
|
|
+ retList = retList
|
|
|
+ .stream()
|
|
|
+ .limit(limitCount)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ retMap.put(deptName, retList);
|
|
|
+
|
|
|
+ }
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 条目缺陷占比-按科室
|
|
|
+ *
|
|
|
+ * @param filterByDeptVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> entryCountGroupByEntryAndDept(FilterByDeptVO filterByDeptVO) {
|
|
|
+ DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
+ Map<String, Object> retMap = new LinkedHashMap<>();
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ String userId = SysUserUtils.getCurrentPrincipleID();
|
|
|
+ String startDate = filterFacade.getStartDateStr(filterByDeptVO.getType(), null);
|
|
|
+ String endDate = filterFacade.getEndDateStr(filterByDeptVO.getType(), null);
|
|
|
+ filterByDeptVO.setHospitalId(hospitalId);
|
|
|
+ filterByDeptVO.setUserId(Long.valueOf(userId));
|
|
|
+ filterByDeptVO.setStartDate(startDate);
|
|
|
+ filterByDeptVO.setEndDate(endDate);
|
|
|
+ if (filterByDeptVO.getLimitCount() == null || filterByDeptVO.getLimitCount().equals(0)) {
|
|
|
+ filterByDeptVO.setLimitCount(10);
|
|
|
+ }
|
|
|
+ Integer limitCount = filterByDeptVO.getLimitCount();
|
|
|
+ //关联科室
|
|
|
+ Map<String, Object> deptMap = getDeptByUser(filterByDeptVO);
|
|
|
+ if (deptMap == null) {
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+ List<DeptNumDTO> entryList = qcresultInfoFacade.entryCountGroupByEntryAndDept(filterByDeptVO);
|
|
|
+ Map<String, List<DeptNumDTO>> numListMap = ListUtil.isEmpty(entryList)
|
|
|
+ ? new HashMap<>()
|
|
|
+ : EntityUtil.makeEntityListMap(entryList, "deptName");
|
|
|
+ for (String deptName : deptMap.keySet()) {
|
|
|
+ if (!numListMap.containsKey(deptName)) {
|
|
|
+ retMap.put(deptName, Lists.newLinkedList());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ List<DeptNumDTO> listByDept = numListMap.get(deptName);
|
|
|
+ if (ListUtil.isNotEmpty(listByDept)) {
|
|
|
+ List<NumDTO> entryByDeptList = BeanUtil.listCopyTo(listByDept, NumDTO.class);
|
|
|
+ int totle = entryByDeptList
|
|
|
+ .stream()
|
|
|
+ .map(NumDTO::getNum)
|
|
|
+ .reduce(0, Integer::sum);
|
|
|
+ List<NumDTO> retList = Lists.newLinkedList();
|
|
|
+ entryByDeptList.forEach(numDTO -> {
|
|
|
+ numDTO.setTotleNum(totle);
|
|
|
+ Double percent = BigDecimal.valueOf(numDTO.getNum())
|
|
|
+ .divide(BigDecimal.valueOf(totle), 4, RoundingMode.HALF_UP)
|
|
|
+ .doubleValue();
|
|
|
+ numDTO.setPercent(percent);
|
|
|
+ String percentStr
|
|
|
+ = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
+ numDTO.setPercentStr(percentStr);
|
|
|
+ });
|
|
|
+
|
|
|
+ //降序排序
|
|
|
+ Collections.sort(entryByDeptList, new Comparator<NumDTO>() {
|
|
|
+ @Override
|
|
|
+ public int compare(NumDTO o1, NumDTO o2) {
|
|
|
+ return o2.getPercent().compareTo(o1.getPercent());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //top9+其他
|
|
|
+ if (entryByDeptList.size() <= limitCount) {
|
|
|
+ retList.addAll(entryByDeptList);
|
|
|
+ } else {
|
|
|
+ int count = 0;
|
|
|
+ double sumPercent = 0d;
|
|
|
+ for (NumDTO numDTO : entryByDeptList) {
|
|
|
+ if (retList.size() < limitCount - 1) {
|
|
|
+ retList.add(numDTO);
|
|
|
+ count += numDTO.getNum();
|
|
|
+ sumPercent = BigDecimal.valueOf(sumPercent)
|
|
|
+ .add(BigDecimal.valueOf(numDTO.getPercent()))
|
|
|
+ .doubleValue();
|
|
|
+ } else {
|
|
|
+ NumDTO otherNumDTO = new NumDTO();
|
|
|
+ int num = totle - count;
|
|
|
+ otherNumDTO.setName("其他");
|
|
|
+ otherNumDTO.setNum(num);
|
|
|
+ otherNumDTO.setTotleNum(totle);
|
|
|
+ Double percent = BigDecimal.valueOf(1)
|
|
|
+ .subtract(BigDecimal.valueOf(sumPercent))
|
|
|
+ .doubleValue();
|
|
|
+ otherNumDTO.setPercent(percent);
|
|
|
+ String percentStr
|
|
|
+ = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
|
|
|
+ otherNumDTO.setPercentStr(percentStr);
|
|
|
+ retList.add(otherNumDTO);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ retMap.put(deptName, retList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户关联科室
|
|
|
+ *
|
|
|
+ * @param filterByDeptVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public Map<String, Object> getDeptByUser(FilterByDeptVO filterByDeptVO) {
|
|
|
List<DeptBaseDTO> deptList = basDeptInfoFacade.getDeptByUser(filterByDeptVO);
|
|
|
if (ListUtil.isNotEmpty(deptList)) {
|