Forráskód Böngészése

修改当station为质管的科室不存在的bug、修改消息提示,为null时提示联系管理员

songxinlu 3 éve
szülő
commit
dca762c1bb

+ 3 - 0
src/main/java/com/diagbot/exception/CommonExceptionHandler.java

@@ -73,6 +73,9 @@ public class CommonExceptionHandler {
         }
         resp.code = CommonErrorCode.FAIL.getCode();
         resp.msg = e.getMessage();
+        if (resp.msg == null) {
+            resp.msg = "操作异常,请联系管理员!!!";
+        }
         log.error("【系统异常】:{}", e.getMessage());
         e.printStackTrace();
         return new ResponseEntity(resp, HttpStatus.OK);

+ 172 - 155
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -205,7 +205,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (hospitalSet == null || StringUtil.isBlank(hospitalSet.getValue())) {
             return columns;
         }
-       List<String> strings = new ArrayList<>();
+        List<String> strings = new ArrayList<>();
 
         //表头生成
         List<String> columnSet = Arrays.asList(hospitalSet.getValue().split(","));
@@ -217,7 +217,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             }
         }
         for (String str : strings) {
-            if(str.contains(basDeptInfoVO.getInputStr())){
+            if (str.contains(basDeptInfoVO.getInputStr())) {
                 ColumnDTO columnNum = new ColumnDTO();
                 columnNum.setOrderNo(orderNo);
                 columnNum.setColumnName(str);
@@ -308,7 +308,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 //2.1获取核查类型,判断当前用户有没有对应核查类型的角色
                 int jobType = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("behospital_code",  getDetailVO.getBehospitalCode())
+                        .eq("behospital_code", getDetailVO.getBehospitalCode())
                         .eq("hospital_id", hospitalId)
                         .eq("check_id", SysUserUtils.getCurrentPrincipleID())).get(0).getJobType();
                 //2.2获取用户角色
@@ -316,18 +316,27 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("user_id", SysUserUtils.getCurrentPrincipleID())
                 ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
-                switch (jobType){
+                switch (jobType) {
                     case 0:
-                        if(roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey()*1l)){res.put("checkShow", 1);}
-                        else {res.put("checkShow", 0);}
+                        if (roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l)) {
+                            res.put("checkShow", 1);
+                        } else {
+                            res.put("checkShow", 0);
+                        }
                         break;
                     case 1:
-                        if(roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey()*1l)){res.put("checkShow", 1);}
-                        else {res.put("checkShow", 0);}
+                        if (roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l)) {
+                            res.put("checkShow", 1);
+                        } else {
+                            res.put("checkShow", 0);
+                        }
                         break;
                     case 2:
-                        if(roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey()*1l)){res.put("checkShow", 1);}
-                        else {res.put("checkShow", 0);}
+                        if (roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l)) {
+                            res.put("checkShow", 1);
+                        } else {
+                            res.put("checkShow", 0);
+                        }
                         break;
                     default:
                         res.put("checkShow", 0);
@@ -377,7 +386,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param analyzeVO
      * @return
      */
-    public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO)  {
+    public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO) {
         // 获取质控条目
         List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
         if (ListUtil.isEmpty(qcCasesEntryDTOList)) {
@@ -397,11 +406,11 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 EncrypDES encrypDES = new EncrypDES();
                 for (RecordContentDTO recordContentDTO : recordContentDTOList) {
                     recTitle = recordContentDTO.getRecTitle();
-                    if(StringUtils.isNotEmpty(recordContentDTO.getXmlText())){
+                    if (StringUtils.isNotEmpty(recordContentDTO.getXmlText())) {
                         recordContentDTO.setXmlText(encrypDES.decryptor(recordContentDTO.getXmlText()));
                     }
                     try {
-                        if(StringUtils.isNotEmpty(recordContentDTO.getHtmlText())){
+                        if (StringUtils.isNotEmpty(recordContentDTO.getHtmlText())) {
                             recordContentDTO.setHtmlText(encrypDES.decryptor(recordContentDTO.getHtmlText()));
                         }
                     } catch (Exception e) {
@@ -458,7 +467,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 .eq("hospital_id", hospitalId)
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
                 .select("whole_data", "rec_id", "hospital_id")
-                .orderByDesc("behospital_date","rec_id")
+                .orderByDesc("behospital_date", "rec_id")
                 .last("limit 1")
         );
 
@@ -607,14 +616,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 .eq("hospital_id", hospitalId)
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
                 .orderByDesc("id"));
-        if(ListUtil.isNotEmpty(medTransferRecordList)){
+        if (ListUtil.isNotEmpty(medTransferRecordList)) {
             medTransferRecordList.forEach(medTransferRecord -> {
                 transferOutDate.add(medTransferRecord.getTransferOutDate());
                 transferInDate.add(medTransferRecord.getTransferInDate());
             });
         }
-        transferMap.put("转出时间",transferOutDate);
-        transferMap.put("转入时间",transferInDate);
+        transferMap.put("转出时间", transferOutDate);
+        transferMap.put("转入时间", transferInDate);
 
         // 转入记录
         List<StrTransferInNote> strTransferInNoteList = strTransferInNoteFacade.list(new QueryWrapper<StrTransferInNote>()
@@ -678,7 +687,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
                 .eq("hospital_id", hospitalId)
-                .in("mode_id", Arrays.asList(53,16))
+                .in("mode_id", Arrays.asList(53, 16))
                 .orderByAsc("rec_date")
         );
         List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
@@ -687,47 +696,46 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         List<HomeOperationInfo> homeOperationInfoList = new ArrayList<>();
         if (homePage != null) {
             String ageData = homePage.getAge();
-        try {
-            if(StringUtils.isNotEmpty(homePage.getAge())&&"-".equals(homePage.getAge())==false&&"—".equals(homePage.getAge())==false){
-                //兼容数据库出现 .03岁数据 作后期判断处理
-                String ageUnitString = homePage.getAgeUnit() == null ? "" : homePage.getAgeUnit();
-                if(homePage.getAge().contains(".")&&"岁".equals(ageUnitString)){
-                    String ageString = homePage.getAge().split("\\.")[0];
-                    //该年龄作为判断使用
-                    homePage.setAge(StringUtils.isEmpty(ageString)==true? "0"+homePage.getAge():homePage.getAge());
-                }
-                //根据时间单位对模版年龄进行区分
-                if(Double.parseDouble(homePage.getAge())<=1&& "岁".equals(ageUnitString)){
-                    homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());
-                    homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0":homePage.getNewbornDay());
-                }else if("月".equals(ageUnitString)){
-                    if(StringUtils.isEmpty(homePage.getNewbornDay())==true){
-                        homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? homePage.getAge() : homePage.getNewbornMonth());
-                    }else if(StringUtils.isEmpty(homePage.getNewbornMonth())==true&&StringUtils.isEmpty(homePage.getNewbornDay())==false){
-                        homePage.setNewbornMonth("0");
+            try {
+                if (StringUtils.isNotEmpty(homePage.getAge()) && "-".equals(homePage.getAge()) == false && "—".equals(homePage.getAge()) == false) {
+                    //兼容数据库出现 .03岁数据 作后期判断处理
+                    String ageUnitString = homePage.getAgeUnit() == null ? "" : homePage.getAgeUnit();
+                    if (homePage.getAge().contains(".") && "岁".equals(ageUnitString)) {
+                        String ageString = homePage.getAge().split("\\.")[0];
+                        //该年龄作为判断使用
+                        homePage.setAge(StringUtils.isEmpty(ageString) == true ? "0" + homePage.getAge() : homePage.getAge());
                     }
-                    homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0":homePage.getNewbornDay());
-                }else if("天".equals(ageUnitString)||"日".equals(ageUnitString)){
-                    if(StringUtils.isEmpty(homePage.getNewbornMonth())&&StringUtils.isEmpty(homePage.getNewbornDay())){
-                        homePage.setNewbornDay(homePage.getAge());
-                        homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());
-                    }else{
-                        homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());
-                        homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0" : homePage.getNewbornDay());
+                    //根据时间单位对模版年龄进行区分
+                    if (Double.parseDouble(homePage.getAge()) <= 1 && "岁".equals(ageUnitString)) {
+                        homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth()) == true ? "0" : homePage.getNewbornMonth());
+                        homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay()) == true ? "0" : homePage.getNewbornDay());
+                    } else if ("月".equals(ageUnitString)) {
+                        if (StringUtils.isEmpty(homePage.getNewbornDay()) == true) {
+                            homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth()) == true ? homePage.getAge() : homePage.getNewbornMonth());
+                        } else if (StringUtils.isEmpty(homePage.getNewbornMonth()) == true && StringUtils.isEmpty(homePage.getNewbornDay()) == false) {
+                            homePage.setNewbornMonth("0");
+                        }
+                        homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay()) == true ? "0" : homePage.getNewbornDay());
+                    } else if ("天".equals(ageUnitString) || "日".equals(ageUnitString)) {
+                        if (StringUtils.isEmpty(homePage.getNewbornMonth()) && StringUtils.isEmpty(homePage.getNewbornDay())) {
+                            homePage.setNewbornDay(homePage.getAge());
+                            homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth()) == true ? "0" : homePage.getNewbornMonth());
+                        } else {
+                            homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth()) == true ? "0" : homePage.getNewbornMonth());
+                            homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay()) == true ? "0" : homePage.getNewbornDay());
+                        }
+                    } else if ("时".equals(ageUnitString)) {
+                        homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth()) == true ? "0" : homePage.getNewbornMonth());
+                        homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay()) == true ? "0" : homePage.getNewbornDay());
+                    } else if (Double.parseDouble(homePage.getAge()) > 1 && "岁".equals(ageUnitString)) {
+                        homePage.setNewbornMonth("-");
+                        homePage.setNewbornDay("-");
                     }
                 }
-                else if("时".equals(ageUnitString)){
-                    homePage.setNewbornMonth(StringUtils.isEmpty(homePage.getNewbornMonth())==true ? "0":homePage.getNewbornMonth());
-                    homePage.setNewbornDay(StringUtils.isEmpty(homePage.getNewbornDay())==true ? "0":homePage.getNewbornDay());
-                }else if(Double.parseDouble(homePage.getAge())>1&& "岁".equals(ageUnitString)){
-                    homePage.setNewbornMonth("-");
-                    homePage.setNewbornDay("-");
-                }
+            } catch (Exception e) {
+                System.out.println("年龄解析出错" + e);
             }
-        } catch (Exception e) {
-            System.out.println("年龄解析出错" + e);
-        }
-            homePage.setAge(ageData+(StringUtils.isEmpty(homePage.getAgeUnit())==true ? "":homePage.getAgeUnit()));
+            homePage.setAge(ageData + (StringUtils.isEmpty(homePage.getAgeUnit()) == true ? "" : homePage.getAgeUnit()));
             //去掉年龄单位
             homePage.setAgeUnit("");
 
@@ -799,30 +807,30 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         // 会诊记录
         if (ListUtil.isNotEmpty(strConsultationRecordList)) {
-            specialData("会诊", strConsultationRecordList, recMap, medrecVoList, "会诊记录",null);
+            specialData("会诊", strConsultationRecordList, recMap, medrecVoList, "会诊记录", null);
         } else {
             specialDataWithKey("会诊", recMap, medrecVoList, "会诊记录",
-                    Arrays.asList("会诊记录"),null);
+                    Arrays.asList("会诊记录"), null);
         }
 
         //会诊申请单
         if (ListUtil.isNotEmpty(strConsultationApplyList)) {
-            specialData("会诊", strConsultationApplyList, recMap, medrecVoList, "会诊申请单",null);
+            specialData("会诊", strConsultationApplyList, recMap, medrecVoList, "会诊申请单", null);
         } else {
             specialDataWithKey("会诊", recMap, medrecVoList, "会诊申请单",
-                    Arrays.asList("会诊申请单"),null);
+                    Arrays.asList("会诊申请单"), null);
         }
         //会诊结果单
         if (ListUtil.isNotEmpty(strConsultationResultList)) {
-            specialData("会诊", strConsultationResultList, recMap, medrecVoList, "会诊结果单",null);
+            specialData("会诊", strConsultationResultList, recMap, medrecVoList, "会诊结果单", null);
         } else {
             specialDataWithKey("会诊", recMap, medrecVoList, "会诊结果单",
-                    Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"),null);
+                    Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"), null);
         }
 
         //会诊单(申请和结果)
         if (ListUtil.isNotEmpty(strConsultationNoteList)) {
-            specialData("会诊", strConsultationNoteList, recMap, medrecVoList, "会诊单(申请和结果)",null);
+            specialData("会诊", strConsultationNoteList, recMap, medrecVoList, "会诊单(申请和结果)", null);
         }
         //入院记录
         if (ListUtil.isNotEmpty(strAdmissionNoteList)) {
@@ -904,18 +912,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         //术后首程
         if (ListUtil.isNotEmpty(strOperativeFirstRecordList)) {
-            specialData("手术", strOperativeFirstRecordList, recMap, medrecVoList, "术后首次病程及谈话记录",null);
+            specialData("手术", strOperativeFirstRecordList, recMap, medrecVoList, "术后首次病程及谈话记录", null);
         } else {
             specialDataWithKey("手术", recMap, medrecVoList, "术后首次病程及谈话记录",
-                    null,null);
+                    null, null);
         }
 
         //手术记录
         if (ListUtil.isNotEmpty(strOperativeNoteList)) {
-            specialData("手术", strOperativeNoteList, recMap, medrecVoList, "手术记录",null);
+            specialData("手术", strOperativeNoteList, recMap, medrecVoList, "手术记录", null);
         } else {
             specialDataWithKey("手术", recMap, medrecVoList, "手术记录",
-                    null,null);
+                    null, null);
         }
 
         //阶段小结
@@ -927,10 +935,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         //术前讨论小结
         if (ListUtil.isNotEmpty(strPreoperativeDiscussionList)) {
-            specialData("手术", strPreoperativeDiscussionList, recMap, medrecVoList, "术前讨论、术前小结",null);
+            specialData("手术", strPreoperativeDiscussionList, recMap, medrecVoList, "术前讨论、术前小结", null);
         } else {
             specialDataWithKey("手术", recMap, medrecVoList, "术前讨论、术前小结",
-                    null,null);
+                    null, null);
         }
 
 
@@ -943,18 +951,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         //转入记录
         if (ListUtil.isNotEmpty(strTransferInNoteList)) {
-            specialData("转科", strTransferInNoteList, recMap, medrecVoList, "转入记录",transferMap);
+            specialData("转科", strTransferInNoteList, recMap, medrecVoList, "转入记录", transferMap);
         } else {
             specialDataWithKey("转科", recMap, medrecVoList, "转入记录",
-                    null,transferMap);
+                    null, transferMap);
         }
 
         //转出记录
         if (ListUtil.isNotEmpty(strTransferOutNoteList)) {
-            specialData("转科", strTransferOutNoteList, recMap, medrecVoList, "转出记录",transferMap);
+            specialData("转科", strTransferOutNoteList, recMap, medrecVoList, "转出记录", transferMap);
         } else {
             specialDataWithKey("转科", recMap, medrecVoList, "转出记录",
-                    null,transferMap);
+                    null, transferMap);
         }
 
         //查房记录
@@ -966,10 +974,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         //==============非结构化表拥有,文书单独查出来====================
         specialDataWithKey("手术", recMap, medrecVoList, "手术知情同意书",
-                null,null);
+                null, null);
 
         specialDataWithKey("手术", recMap, medrecVoList, "手术安全核查表",
-                null,null);
+                null, null);
 
 
 //=========================================
@@ -1032,10 +1040,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 //        if(analyzeVO.getHospitalId()==5 && ListUtil.isNotEmpty(recMap.get("病案首页"))){
 //            addDataWithInnerKey("病案首页", recMap, medrecVoList);
 //        }else {
-            if(homePage != null){
+        if (homePage != null) {
             addDataWithFirstPage("病案首页", homePage, medrecVoList, dicMap,
                     homePageList, homeOperationInfoList);
-             }
+        }
 //        }
 
         queryVo.setMedrec(medrecVoList);
@@ -1058,14 +1066,15 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         analyzeVO.setHospitalId(hospitalId);
 
         // 处理公共数据
-        QueryVo  queryVo = dealCommonData(hospitalId, analyzeVO);
+        QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
         queryVo.setUseCrfCache(analyzeVO.isUseCrfCache());
         //已核查抛出以评分
         List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", analyzeVO.getHospitalId())
                 .eq("behospital_code", analyzeVO.getBehospitalCode()));
-        if (medCheckInfos.size() == 1 && medCheckInfos.get(0).getStatus()==CheckStatusEnum.Enable.getKey() && analyzeVO.getCheckFlag()) {
+        Set<Integer> status = medCheckInfos.stream().map(MedCheckInfo::getStatus).collect(Collectors.toSet());
+        if (medCheckInfos.size() >= 1 && status.contains(CheckStatusEnum.Enable.getKey()) && analyzeVO.getCheckFlag()) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病例已经核查无需评分!");
         }
         //  调用质控接口
@@ -1115,9 +1124,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param recMap
      * @param medrecVoList
      */
-    public void addData(String key, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList)  {
+    public void addData(String key, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList) {
         List<RecordContentDTO> list = recMap.get(key);
-        if(ListUtil.isNotEmpty(list)){
+        if (ListUtil.isNotEmpty(list)) {
             for (RecordContentDTO recordContentDTO : list) {
                 recordContentDTO.setIsParsed(0);
             }
@@ -1140,7 +1149,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param medrecVoList
      */
     public void specialDataWithKey(String key, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList,
-                                   String keyTagert, List<String> keyList,Map<String, List<LocalDateTime>> transferMap) {
+                                   String keyTagert, List<String> keyList, Map<String, List<LocalDateTime>> transferMap) {
         MedrecVo medrecVo = new MedrecVo();
         Map<String, List<RecordContentDTO>> specialContent = new HashMap<String, List<RecordContentDTO>>();
         Map<String, Object> content = new HashMap<>();
@@ -1156,9 +1165,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
         //设置特殊属性
         List<RecordContentDTO> recordContentDTOS = recMap.get(keyTagert);
-        if(ListUtil.isNotEmpty(recordContentDTOS)){
+        if (ListUtil.isNotEmpty(recordContentDTOS)) {
             for (RecordContentDTO recordContentDTO : recordContentDTOS) {
-                if(null != transferMap){
+                if (null != transferMap) {
                     recordContentDTO.setTransferOutDate(transferMap.get("转出时间"));
                     recordContentDTO.setTransferInDate(transferMap.get("转入时间"));
                 }
@@ -1168,9 +1177,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         //用来复制申请单
         List<RecordContentDTO> recordContentList = recMap.get("会诊申请单");
-        if(ListUtil.isNotEmpty(recordContentList)){
+        if (ListUtil.isNotEmpty(recordContentList)) {
             for (RecordContentDTO recordContentDTO : recordContentList) {
-                if(null != transferMap){
+                if (null != transferMap) {
                     recordContentDTO.setTransferOutDate(transferMap.get("转出时间"));
                     recordContentDTO.setTransferInDate(transferMap.get("转入时间"));
                 }
@@ -1293,14 +1302,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             Set<String> keyList = keyMap.keySet();
             for (String k : keyList) {
                 List<RecordContentDTO> recordContentDTOS = keyMap.get(k);
-                if(ListUtil.isNotEmpty(recordContentDTOS)){
+                if (ListUtil.isNotEmpty(recordContentDTOS)) {
                     for (RecordContentDTO recordContentDTO : recordContentDTOS) {
                         recordContentDTO.setIsParsed(0);
                     }
                 }
 
                 if (ListUtil.isNotEmpty(recordContentDTOS)) {
-                    listMap.put(k,recordContentDTOS);
+                    listMap.put(k, recordContentDTOS);
                 }
             }
             content.put("content", listMap);
@@ -1326,14 +1335,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             Set<String> keyList = keyMap.keySet();
             for (String k : keyList) {
                 List<MedicalRecordDTO> recordContentDTOS = keyMap.get(k);
-                if(ListUtil.isNotEmpty(recordContentDTOS)){
+                if (ListUtil.isNotEmpty(recordContentDTOS)) {
                     for (MedicalRecordDTO recordContentDTO : recordContentDTOS) {
                         recordContentDTO.setIsParsed(0);
                     }
                 }
 
                 if (ListUtil.isNotEmpty(recordContentDTOS)) {
-                    listMap.put(k,recordContentDTOS);
+                    listMap.put(k, recordContentDTOS);
                 }
             }
             medrecVo.setContent(listMap);
@@ -1404,7 +1413,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                                 Map<String, List<LocalDateTime>> transferMap) {
         MedrecVo medrecVo = new MedrecVo();
         Map<String, Object> content = new HashMap<String, Object>();
-        Map<String,  List<RecordContentDTO>> specialContent = new HashMap<>();
+        Map<String, List<RecordContentDTO>> specialContent = new HashMap<>();
         List<RePlaceData> contents = new ArrayList<>();
 
         //从结构化表中取出应用数据
@@ -1429,7 +1438,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             Boolean flag = true;
             List<RecordContentDTO> recordContentDTOS = recMap.get(keyTagert);
             for (RecordContentDTO recordContentDTO : recordContentDTOS) {
-                if(null != transferMap){
+                if (null != transferMap) {
                     recordContentDTO.setTransferOutDate(transferMap.get("转出时间"));
                     recordContentDTO.setTransferInDate(transferMap.get("转入时间"));
                 }
@@ -1551,7 +1560,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         Map<String, Object> content = new HashMap<>();
         try {
             Map<String, Object> objectMap = MapUtil.objectToMap(homePage);
-            List<String> firstPageDate = Arrays.asList("birthday", "behospitalDate", "leaveHospitalDate", "qcDate","gmtCreate");
+            List<String> firstPageDate = Arrays.asList("birthday", "behospitalDate", "leaveHospitalDate", "qcDate", "gmtCreate");
             for (String objKey : objectMap.keySet()) {
                 if (map.containsKey(objKey)) {
                     if (firstPageDate.contains(objKey)) {
@@ -1730,7 +1739,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if ("0".equals(analyzeRunVO.getIsPlacefile())) {
             Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
             algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
-        }else{
+        } else {
             //终末质控不保存数据
             Map<String, Object> resMap = calScore(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
             algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
@@ -1738,15 +1747,15 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         List<MsgDTO> msgDTOList = getMsg(analyzeVO);
         if (ListUtil.isNotEmpty(msgDTOList)) {
-            msgDTOList.forEach(msgDTO ->{
-                if(StringUtils.isNotEmpty(msgDTO.getInfo()) && StringUtils.isNotEmpty(msgDTO.getInfo().trim()) &&
-                        StringUtils.isNotEmpty(msgDTO.getMsg())){
-                    msgDTO.setMsg(msgDTO.getMsg()+"("+msgDTO.getInfo().trim()+")");
+            msgDTOList.forEach(msgDTO -> {
+                if (StringUtils.isNotEmpty(msgDTO.getInfo()) && StringUtils.isNotEmpty(msgDTO.getInfo().trim()) &&
+                        StringUtils.isNotEmpty(msgDTO.getMsg())) {
+                    msgDTO.setMsg(msgDTO.getMsg() + "(" + msgDTO.getInfo().trim() + ")");
                 }
             });
             // 从qc_question_info的cases_entry_ids获取
             Map<String, Object> paramMap = new HashMap<>();
-            paramMap.put("hospitalId",  analyzeRunVO.getHospitalId());
+            paramMap.put("hospitalId", analyzeRunVO.getHospitalId());
             paramMap.put("casesEntryIds", msgDTOList.stream().map(r -> r.getCasesEntryId()).collect(Collectors.toList()));
             Map<Long, List<QuestionEntryDTO>> quesEntryMap = qcQuestionFacade.getByCaseEntryIdsFac(paramMap);
             for (MsgDTO msgDTO : msgDTOList) {
@@ -1773,19 +1782,19 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             reNum = "1";
         }
         QcResultApiDTO qcResultApiDTO = new QcResultApiDTO();
-        if(StringUtils.isNotEmpty(algorithmDTO.getLevel()) && algorithmDTO.getScore()!=null && msgDTOList != null){
-            if("1".equals(reNum)) {
+        if (StringUtils.isNotEmpty(algorithmDTO.getLevel()) && algorithmDTO.getScore() != null && msgDTOList != null) {
+            if ("1".equals(reNum)) {
                 bigDecimal = resPr.subtract(algorithmDTO.getScore());
-            }else if("0".equals(reNum)){
+            } else if ("0".equals(reNum)) {
                 bigDecimal = res.subtract(algorithmDTO.getScore().multiply(new BigDecimal(120))
                         .divide(new BigDecimal(100), 1, RoundingMode.HALF_UP));
             }
 
-        //缺陷总数
-        Long num = msgDTOList
-                .stream()
-                .filter(Objects::nonNull)
-                .count();
+            //缺陷总数
+            Long num = msgDTOList
+                    .stream()
+                    .filter(Objects::nonNull)
+                    .count();
             qcResultApiDTO.setScoreRes(algorithmDTO.getScore());
             qcResultApiDTO.setLevel(algorithmDTO.getLevel());
             qcResultApiDTO.setNum(num);
@@ -1798,13 +1807,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 Map<String, List<MsgApiDTO>> msgMap = EntityUtil.makeEntityListMap(msgApiDTOList, "modelName");
                 resMapData.put("details", msgMap);
             }
-        };
+        }
+        ;
         return resMapData;
     }
 
 
-
-
     /**
      * 获取明细api
      *
@@ -1897,7 +1905,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         Long hospitalId = analyzeVO.getHospitalId();
 
         // 处理公共数据
-            QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
+        QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
         //  调用质控接口
         Response<OutputInfo> response = qcServiceClient.extract(queryVo);
         if (response == null || response.getData() == null) {
@@ -2007,38 +2015,39 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         exportQcresultVOSet(exportQcresultVO);
         List<ExportExcelDTO> res = this.exportQcresult(exportQcresultVO);
         List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
-        if("2".equals(exportQcresultVO.getRadioCheck())){
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
             resWide = transList(res, resWide);
         }
         String fileName = "抽查住院病历质量情况.xls";
         response.setContentType("text/html;charset=UTF-8");
-        if("1".equals(exportQcresultVO.getRadioCheck())){
+        if ("1".equals(exportQcresultVO.getRadioCheck())) {
             ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
         }
-        if("2".equals(exportQcresultVO.getRadioCheck())){
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
             ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
         }
     }
-    public List<ExportWideExcelDTO> transList(List<ExportExcelDTO>res, List<ExportWideExcelDTO>resWide){
-        if(ListUtil.isNotEmpty(res)){
-            res.forEach(exportExcelDTO->{
+
+    public List<ExportWideExcelDTO> transList(List<ExportExcelDTO> res, List<ExportWideExcelDTO> resWide) {
+        if (ListUtil.isNotEmpty(res)) {
+            res.forEach(exportExcelDTO -> {
                 ExportWideExcelDTO exportWideExcelDTO = new ExportWideExcelDTO();
-                    exportWideExcelDTO.setAvgScore(exportExcelDTO.getAvgScore());
-                    exportWideExcelDTO.setBehDeptName(exportExcelDTO.getBehDeptName());
-                    List<ExportExcelBehospitalDTO> excelBehospitalDTOS = exportExcelDTO.getExcelBehospitalDTOS();
-                    List<ExportExcelWideBehospitalDTO> exportExcelWideBehospitalDTOs = new ArrayList<>();
-                        excelBehospitalDTOS.forEach(exportExcelBehospitalDTO->{
-                        ExportExcelWideBehospitalDTO exportExcelWideBehospitalDTO = new ExportExcelWideBehospitalDTO();
-                            exportExcelWideBehospitalDTO.setDoctorName(exportExcelBehospitalDTO.getDoctorName());
-                            exportExcelWideBehospitalDTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
-                            exportExcelWideBehospitalDTO.setBehospitalDate(exportExcelBehospitalDTO.getBehospitalDate());
-                            exportExcelWideBehospitalDTO.setLeaveHospitalDate(exportExcelBehospitalDTO.getLeaveHospitalDate());
-                            exportExcelWideBehospitalDTO.setPatName(exportExcelBehospitalDTO.getPatName());
-                            exportExcelWideBehospitalDTO.setScore(exportExcelBehospitalDTO.getScore());
-                            exportExcelWideBehospitalDTO.setScoreBn(exportExcelBehospitalDTO.getScoreBn());
-                            exportExcelWideBehospitalDTOs.add(exportExcelWideBehospitalDTO);
-                        });
-                           exportWideExcelDTO.setExcelBehospitalDTOS(exportExcelWideBehospitalDTOs);
+                exportWideExcelDTO.setAvgScore(exportExcelDTO.getAvgScore());
+                exportWideExcelDTO.setBehDeptName(exportExcelDTO.getBehDeptName());
+                List<ExportExcelBehospitalDTO> excelBehospitalDTOS = exportExcelDTO.getExcelBehospitalDTOS();
+                List<ExportExcelWideBehospitalDTO> exportExcelWideBehospitalDTOs = new ArrayList<>();
+                excelBehospitalDTOS.forEach(exportExcelBehospitalDTO -> {
+                    ExportExcelWideBehospitalDTO exportExcelWideBehospitalDTO = new ExportExcelWideBehospitalDTO();
+                    exportExcelWideBehospitalDTO.setDoctorName(exportExcelBehospitalDTO.getDoctorName());
+                    exportExcelWideBehospitalDTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
+                    exportExcelWideBehospitalDTO.setBehospitalDate(exportExcelBehospitalDTO.getBehospitalDate());
+                    exportExcelWideBehospitalDTO.setLeaveHospitalDate(exportExcelBehospitalDTO.getLeaveHospitalDate());
+                    exportExcelWideBehospitalDTO.setPatName(exportExcelBehospitalDTO.getPatName());
+                    exportExcelWideBehospitalDTO.setScore(exportExcelBehospitalDTO.getScore());
+                    exportExcelWideBehospitalDTO.setScoreBn(exportExcelBehospitalDTO.getScoreBn());
+                    exportExcelWideBehospitalDTOs.add(exportExcelWideBehospitalDTO);
+                });
+                exportWideExcelDTO.setExcelBehospitalDTOS(exportExcelWideBehospitalDTOs);
                 resWide.add(exportWideExcelDTO);
             });
         }
@@ -2060,15 +2069,15 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         exportQcresultVOSet(exportQcresultVO);
         List<ExportExcelDTO> res = this.exportQcresultByPerson(exportQcresultVO);
         List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
-        if("2".equals(exportQcresultVO.getRadioCheck())){
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
             resWide = transList(res, resWide);
         }
         String fileName = "抽查住院病历质量情况.xls";
         response.setContentType("text/html;charset=UTF-8");
-        if("1".equals(exportQcresultVO.getRadioCheck())){
+        if ("1".equals(exportQcresultVO.getRadioCheck())) {
             ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
         }
-        if("2".equals(exportQcresultVO.getRadioCheck())){
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
             ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
         }
     }
@@ -2088,15 +2097,15 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         exportQcresultVOSet(exportQcresultVO);
         List<ExportExcelDTO> res = this.exportQcresultByDept(exportQcresultVO);
         List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
-        if("2".equals(exportQcresultVO.getRadioCheck())){
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
             resWide = transList(res, resWide);
         }
         String fileName = "抽查住院病历质量情况.xls";
         response.setContentType("text/html;charset=UTF-8");
-      if("1".equals(exportQcresultVO.getRadioCheck())){
+        if ("1".equals(exportQcresultVO.getRadioCheck())) {
             ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
         }
-        if("2".equals(exportQcresultVO.getRadioCheck())){
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
             ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
         }
     }
@@ -2116,17 +2125,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         exportQcresultVOSet(exportQcresultVO);
         List<ExportExcelDTO> res = this.exportQcresultByGroup(exportQcresultVO);
         List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
-        if("2".equals(exportQcresultVO.getRadioCheck())){
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
             resWide = transList(res, resWide);
         }
         String fileName = "抽查住院病历质量情况.xls";
         response.setContentType("text/html;charset=UTF-8");
-        if("1".equals(exportQcresultVO.getRadioCheck())){
+        if ("1".equals(exportQcresultVO.getRadioCheck())) {
             ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
         }
-        if("2".equals(exportQcresultVO.getRadioCheck())){
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
             ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
-        } }
+        }
+    }
 
     private void exportQcresultVOSet(ExportQcresultVO exportQcresultVO) {
         //入参验证
@@ -2136,7 +2146,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (null != exportQcresultVO && null != exportQcresultVO.getBehosDateStart() && null != exportQcresultVO.getBehosDateEnd()) {
             Date startDate = exportQcresultVO.getBehosDateStart();
             Date endDate = exportQcresultVO.getBehosDateEnd();
-            if("1".equals(exportQcresultVO.getRadioCheck())){
+            if ("1".equals(exportQcresultVO.getRadioCheck())) {
                 //时间间隔7天
                 if (endDate.getTime() < startDate.getTime()) {
                     throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
@@ -2144,7 +2154,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 if (endDate.getTime() - startDate.getTime() > interval_7) {
                     throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
                 }
-            }else{
+            } else {
                 //时间间隔90天
                 if (endDate.getTime() < startDate.getTime()) {
                     throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
@@ -2160,7 +2170,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (null != exportQcresultVO && null != exportQcresultVO.getLeaveHosDateStart() && null != exportQcresultVO.getLeaveHosDateEnd()) {
             Date startDate = exportQcresultVO.getLeaveHosDateStart();
             Date endDate = exportQcresultVO.getLeaveHosDateEnd();
-            if("1".equals(exportQcresultVO.getRadioCheck())){
+            if ("1".equals(exportQcresultVO.getRadioCheck())) {
                 //时间间隔7天
                 if (endDate.getTime() < startDate.getTime()) {
                     throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
@@ -2168,7 +2178,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 if (endDate.getTime() - startDate.getTime() > interval_7) {
                     throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
                 }
-            }else{
+            } else {
                 //时间间隔90天
                 if (endDate.getTime() < startDate.getTime()) {
                     throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
@@ -2210,8 +2220,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @return
      */
     public Map<String, Object> calScore(OutputInfo outputInfo, List<String> codeList,
-                                               Map<String, String> codeToInfoMap, AnalyzeVO analyzeVO,
-                                               String isPlacefile) {
+                                        Map<String, String> codeToInfoMap, AnalyzeVO analyzeVO,
+                                        String isPlacefile) {
         Long hospitalId = analyzeVO.getHospitalId();
         List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
         if (ListUtil.isNotEmpty(codeList)) {
@@ -2400,40 +2410,47 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
     /**
      * 手术费,抗菌药物,手术和病理费等含有人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String, String>> selectOperationNum( FilterVO filterVO){
-        return   baseMapper.selectOperationNum(filterVO);
+    public List<Map<String, String>> selectOperationNum(FilterVO filterVO) {
+        return baseMapper.selectOperationNum(filterVO);
     }
+
     /**
      * 触发规则人数
+     *
      * @param filterVO
      * @return
      */
-    public Map<String,Long> triggeringRules( FilterVO filterVO){
-        return   baseMapper.triggeringRules(filterVO);
+    public Map<String, Long> triggeringRules(FilterVO filterVO) {
+        return baseMapper.triggeringRules(filterVO);
     }
 
     /**
      * 病案首页关联的出院病历
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO){
+    public List<Map<String, String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO) {
         return baseMapper.getMedicalRecords(filterVO);
     }
+
     /**
      * 首页恶性肿瘤人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> malignancy(@Param("filterVO") FilterVO filterVO){
-        return  baseMapper.malignancy(filterVO);
+    public List<Map<String, String>> malignancy(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.malignancy(filterVO);
     }
 
     /**
      * 获取患者年龄信息(通过出生日期和入院日期重新计算)
+     *
      * @param hospitalId
      * @param behospitalCodes
      * @return

+ 202 - 233
src/main/java/com/diagbot/facade/MedCheckInfoFacade.java

@@ -74,8 +74,8 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
         QueryWrapper<SysUser> userQuer = new QueryWrapper<>();
         userQuer.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id",principleId)
-                .eq("status",1);
+                .eq("id", principleId)
+                .eq("status", 1);
         SysUser user = sysUserFacade.getOne(userQuer);
         String principleName = user.getLinkman();
         Map<String, Object> mapAll = new HashMap<String, Object>();
@@ -141,15 +141,16 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         }
         return res;
     }
+
     /**
      * @Author songxl
      * @Description 获取操作用户的核查科室以及人员
-     * @Date  2021/5/14
+     * @Date 2021/5/14
      * @Param []
-     * @Return java.util.Map<java.lang.String,java.util.List<com.diagbot.dto.CheckDeptDTO>>
+     * @Return java.util.Map<java.lang.String, java.util.List < com.diagbot.dto.CheckDeptDTO>>
      * @MethodName getCheckUserMap
      */
-    public IPage<CheckJobDTO> getUserCheckList(CheckJobPageVO  checkJobVO) {
+    public IPage<CheckJobDTO> getUserCheckList(CheckJobPageVO checkJobVO) {
         //校验
         userCheckPageSet(checkJobVO);
         //质控管理员要判断该角色是否是质控科
@@ -160,7 +161,7 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         //获取核查监管相关角色id
         List<Long> checkRoleIds = sysRoleFacade.list(new QueryWrapper<SysRole>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .like("name","监管人员")
+                .like("name", "监管人员")
         ).stream().map(SysRole::getId).collect(Collectors.toList());
         //查询该角色的所有角色id
         List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
@@ -169,35 +170,30 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
         List<Long> searchRoleIds = new ArrayList<>();
         //当前用户是监管人员或者是超级管理员
-        if(roleIds.contains(-1L))
-        {
+        if (roleIds.contains(-1L)) {
             searchRoleIds.addAll(checkRoleIds);
+        } else {
+            searchRoleIds.addAll(containsRole(checkRoleIds, roleIds));
         }
-        else{
-            searchRoleIds.addAll(containsRole(checkRoleIds,roleIds));
-        }
-        if(searchRoleIds.isEmpty())
-        {
+        if (searchRoleIds.isEmpty()) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户不是核查监管人员!");
         }
         //质控科监管人员
-        if(searchRoleIds.contains(CheckerRoleEnum.QUAT_SUPERVISOR.getKey()*1l)
-                &&(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey()+"").equals(checkJobVO.getJobType()))
-        {
+        if (searchRoleIds.contains(CheckerRoleEnum.QUAT_SUPERVISOR.getKey() * 1l)
+                && (CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + "").equals(checkJobVO.getJobType())) {
             //用户是不是质管科人员校验
-            String zkkDeptId = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
+            BasDeptInfo deptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id",hospitalId)
-                    .like("dept_name","质管科")).getDeptId();
-            if(StringUtil.isBlank(zkkDeptId))
-            {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在!");
+                    .eq("hospital_id", hospitalId)
+                    .eq("station", "质管"));
+            if (deptInfo == null || deptInfo.getDeptId() == null) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在,请联系管理员!");
             }
             //2.获取监管人员所在科室集合
             List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id",hospitalId)
-                    .eq("user_id",principleId)
+                    .eq("hospital_id", hospitalId)
+                    .eq("user_id", principleId)
             ).stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
             //3.判断这个人是否在质控科
 //            if(deptIds.contains(zkkDeptId))
@@ -208,31 +204,27 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
             return getCheckList(checkJobVO);
         }
         //临床科室监管人员 或 院级监管人员
-        else if(searchRoleIds.contains(CheckerRoleEnum.DEPT_SUPERVISOR.getKey()*1l)
-                ||searchRoleIds.contains(CheckerRoleEnum.HOSP_SUPERVISOR.getKey()*1l))
-        {
+        else if (searchRoleIds.contains(CheckerRoleEnum.DEPT_SUPERVISOR.getKey() * 1l)
+                || searchRoleIds.contains(CheckerRoleEnum.HOSP_SUPERVISOR.getKey() * 1l)) {
             //查询没有指定科室
-            if(checkJobVO.getDeptList()==null||checkJobVO.getDeptList().isEmpty())
-            {
+            if (checkJobVO.getDeptList() == null || checkJobVO.getDeptList().isEmpty()) {
                 //科室获取待分配任务所在科室集合
-                if(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey()==Integer.parseInt(checkJobVO.getJobType())){
+                if (CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() == Integer.parseInt(checkJobVO.getJobType())) {
                     List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
                             .eq("is_deleted", IsDeleteEnum.N.getKey())
-                            .eq("hospital_id",hospitalId)
-                            .eq("user_id",principleId)
+                            .eq("hospital_id", hospitalId)
+                            .eq("user_id", principleId)
                     ).stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
 
-                    if(deptIds!=null&&!deptIds.isEmpty()){
+                    if (deptIds != null && !deptIds.isEmpty()) {
                         checkJobVO.setDeptList(deptIds);
                         return getCheckList(checkJobVO);
-                    }
-                    else
-                    {
-                        return  new CheckJobPageVO();
+                    } else {
+                        return new CheckJobPageVO();
                     }
                 }
                 //院区获取
-                if(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey()==Integer.parseInt(checkJobVO.getJobType())){
+                if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() == Integer.parseInt(checkJobVO.getJobType())) {
 //                    //获取管理员所在科室
 //                    List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
 //                            .eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -256,39 +248,34 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                 }
             }
             return getCheckList(checkJobVO);
-        }
-        else
-        {
+        } else {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户的角色和任务类型不对应!");
         }
     }
+
     /**
      * @Author songxl
      * @Description 待分配列表页面校验
-     * @Date  2021/5/18
+     * @Date 2021/5/18
      * @Param [checkJobVO]
      * @Return void
      * @MethodName userCheckPageSet
      */
-    private void userCheckPageSet(CheckJobPageVO  checkJobVO) {
-        if(StringUtil.isBlank(checkJobVO.getStartTime())&&StringUtil.isBlank(checkJobVO.getEndTime())
-                &&StringUtil.isBlank(checkJobVO.getBehosDateStart())&&StringUtil.isBlank(checkJobVO.getBehosDateEnd()))
-        {
+    private void userCheckPageSet(CheckJobPageVO checkJobVO) {
+        if (StringUtil.isBlank(checkJobVO.getStartTime()) && StringUtil.isBlank(checkJobVO.getEndTime())
+                && StringUtil.isBlank(checkJobVO.getBehosDateStart()) && StringUtil.isBlank(checkJobVO.getBehosDateEnd())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有时间区间!");
         }
-        if(StringUtil.isBlank(checkJobVO.getJobType()))
-        {
+        if (StringUtil.isBlank(checkJobVO.getJobType())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有任务类型!");
         }
-        if(StringUtil.isNotBlank(checkJobVO.getBehosDateStart())&&StringUtil.isNotBlank(checkJobVO.getBehosDateEnd()))
-        {
+        if (StringUtil.isNotBlank(checkJobVO.getBehosDateStart()) && StringUtil.isNotBlank(checkJobVO.getBehosDateEnd())) {
             if (DateUtil.after(DateUtil.parseDate(checkJobVO.getBehosDateStart()),
                     DateUtil.parseDate(checkJobVO.getBehosDateEnd()))) {
                 throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
             }
         }
-        if(StringUtil.isNotBlank(checkJobVO.getStartTime())&&StringUtil.isNotBlank(checkJobVO.getEndTime()))
-        {
+        if (StringUtil.isNotBlank(checkJobVO.getStartTime()) && StringUtil.isNotBlank(checkJobVO.getEndTime())) {
             if (DateUtil.after(DateUtil.parseDate(checkJobVO.getStartTime()),
                     DateUtil.parseDate(checkJobVO.getEndTime()))) {
                 throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "任务生成的开始时间必须小于结束时间!");
@@ -300,9 +287,9 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
     /**
      * @Author songxl
      * @Description 获取操作用户的核查科室以及科室核查人员
-     * @Date  2021/5/14
+     * @Date 2021/5/14
      * @Param []
-     * @Return java.util.Map<java.lang.String,java.util.List<com.diagbot.dto.CheckDeptDTO>>
+     * @Return java.util.Map<java.lang.String, java.util.List < com.diagbot.dto.CheckDeptDTO>>
      * @MethodName getCheckUserMap
      */
     public Map<String, List<CheckDeptDTO>> getCheckUserMap() {
@@ -314,7 +301,7 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         //获取核查监管相关角色id
         List<Long> checkRoleIds = sysRoleFacade.list(new QueryWrapper<SysRole>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .like("name","监管人员")
+                .like("name", "监管人员")
         ).stream().map(SysRole::getId).collect(Collectors.toList());
         //查询该角色的所有角色id
         List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
@@ -323,66 +310,60 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
         List<Long> searchRoleIds = new ArrayList<>();
         //当前用户是监管人员或者是超级管理员
-        if(roleIds.contains(-1L))
-        {
-               searchRoleIds.addAll(checkRoleIds);
-        }
-        else{
-            searchRoleIds.addAll(containsRole(checkRoleIds,roleIds));
+        if (roleIds.contains(-1L)) {
+            searchRoleIds.addAll(checkRoleIds);
+        } else {
+            searchRoleIds.addAll(containsRole(checkRoleIds, roleIds));
         }
-        if(searchRoleIds.isEmpty())
-        {
+        if (searchRoleIds.isEmpty()) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户不是核查监管人员!");
         }
         //2.获取相应角色对应的科室以及核查人员
-        Map<String, List<CheckDeptDTO>> checkUserMap = getCheckRoleMap(searchRoleIds,hospitalId,principleId);
+        Map<String, List<CheckDeptDTO>> checkUserMap = getCheckRoleMap(searchRoleIds, hospitalId, principleId);
         return checkUserMap;
     }
+
     /**
      * @Author songxl
      * @Description 获取相应角色对应的科室以及核查人员
-     * @Date  2021/5/14
+     * @Date 2021/5/14
      * @Param [searchRoleIds]
-     * @Return java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
+     * @Return java.util.Map<java.lang.String, java.util.List < java.util.Map < java.lang.String, java.lang.Object>>>
      * @MethodName getCheckRoleMap
      */
 
-    private Map<String, List<CheckDeptDTO>> getCheckRoleMap(List<Long> searchRoleIds,Long hospitalId,Long principleId) {
+    private Map<String, List<CheckDeptDTO>> getCheckRoleMap(List<Long> searchRoleIds, Long hospitalId, Long principleId) {
         Map<String, List<CheckDeptDTO>> checkRoleMap = new HashMap<>();
-        for(Long id:searchRoleIds)
-        {
-            try
-            {
+        for (Long id : searchRoleIds) {
+            try {
                 //不同角色不同查询方式
-                switch (id.intValue())
-                {
+                switch (id.intValue()) {
                     //临床科室监管人员
                     case 4:
-                        getDeptCheckInfo(checkRoleMap,hospitalId,principleId);
+                        getDeptCheckInfo(checkRoleMap, hospitalId, principleId);
                         break;
                     //质控科监管人员
                     case 5:
-                        getZKKCheckInfo(checkRoleMap,hospitalId,principleId);
+                        getZKKCheckInfo(checkRoleMap, hospitalId, principleId);
                         break;
                     //院级监管人员
                     case 6:
-                        getYQCheckInfo(checkRoleMap,hospitalId,principleId);
+                        getYQCheckInfo(checkRoleMap, hospitalId, principleId);
                         break;
                     default:
                         break;
                 }
-            }
-            catch (Exception e)
-            {
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }
         return checkRoleMap;
     }
+
     /**
      * @Author songxl
      * @Description 院区管理员获取管理的科室以及科室包涵质控人员
-     * @Date  2021/5/17
+     * @Date 2021/5/17
      * @Param [checkRoleMap, hospitalId, principleId]
      * @Return void
      * @MethodName getYQCheckInfo
@@ -391,35 +372,37 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         //1.获取院级质控人员有哪些
         //1.1获取院级质控人员角色id
         CheckUserVO checkUserVOS = new CheckUserVO();
-        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.HOSP_GENERAL.getKey()*1l));
+        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l));
         checkUserVOS.setDeptStations(Lists.newArrayList("住院"));
         checkUserVOS.setHospitalId(hospitalId);
         List<CheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
         //2.用户科室整合
-        margeDept(checkRoleMap,checkUserDTOS,CheckerRoleEnum.HOSP_SUPERVISOR.getKey()+"");
-        if(!ListUtil.isEmpty(checkRoleMap.get(CheckerRoleEnum.HOSP_SUPERVISOR.getKey()+""))){
+        margeDept(checkRoleMap, checkUserDTOS, CheckerRoleEnum.HOSP_SUPERVISOR.getKey() + "");
+        if (!ListUtil.isEmpty(checkRoleMap.get(CheckerRoleEnum.HOSP_SUPERVISOR.getKey() + ""))) {
             //2.3获取所有医生信息的核查数
             CheckUserVO checkUserVO = new CheckUserVO();
             checkUserVO.setJobType(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey());
             //通过核查人员id获取核查人员的核查任务数
             List<DeptCheckUserDTO> userJobs = baseMapper.getDeptJobNumByUserId(checkUserVO);
-            addCheckInfoMaps(checkRoleMap,null,userJobs,checkUserDTOS,CheckerRoleEnum.HOSP_SUPERVISOR.getKey(),CheckJobTypeEnum.HOSP_SUPERVISOR.getKey());
-        }
-        else {
-            checkRoleMap.put(CheckerRoleEnum.HOSP_SUPERVISOR.getKey()+"",new ArrayList<>());
+            addCheckInfoMaps(checkRoleMap, null, userJobs, checkUserDTOS, CheckerRoleEnum.HOSP_SUPERVISOR.getKey(), CheckJobTypeEnum.HOSP_SUPERVISOR.getKey());
+        } else {
+            checkRoleMap.put(CheckerRoleEnum.HOSP_SUPERVISOR.getKey() + "", new ArrayList<>());
         }
 
     }
+
     /**
      * @Author songxl
      * @Description 院区人员用户科室合并
-     * @Date  2021/6/1
+     * @Date 2021/6/1
      * @Param [checkRoleMap, checkUserDTOS, s]
      * @Return void
      * @MethodName margeDept
      */
     private void margeDept(Map<String, List<CheckDeptDTO>> checkRoleMap, List<CheckUserDTO> checkUserDTOS, String roleId) {
-        if(ListUtil.isEmpty(checkUserDTOS)){return;}
+        if (ListUtil.isEmpty(checkUserDTOS)) {
+            return;
+        }
         Set<String> userIds = checkUserDTOS.stream().map(CheckUserDTO::getDoctorId).collect(Collectors.toSet());
         try {
             List<CheckDeptDTO> tempDepts = new ArrayList<>();
@@ -433,13 +416,15 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                 StringBuilder deptNameBuilder = new StringBuilder();
                 StringBuilder userName = new StringBuilder();
                 checkUserDTOS.stream().forEach(checkUserDTO -> {
-                    if(userId.equals(checkUserDTO.getDoctorId())){
+                    if (userId.equals(checkUserDTO.getDoctorId())) {
                         deptIdBuilder.append(checkUserDTO.getDeptId()).append(",");
                         deptNameBuilder.append(checkUserDTO.getDeptName()).append(",");
-                        if(userName.length()==0){userName.append(checkUserDTO.getDoctorName());}
+                        if (userName.length() == 0) {
+                            userName.append(checkUserDTO.getDoctorName());
+                        }
                         //除了全部以外添加科室信息
-                        if(!tempDepts.stream().map(CheckDeptDTO::getDeptId).collect(Collectors.toList())
-                                .contains(checkUserDTO.getDeptId())){
+                        if (!tempDepts.stream().map(CheckDeptDTO::getDeptId).collect(Collectors.toList())
+                                .contains(checkUserDTO.getDeptId())) {
                             CheckDeptDTO oneCheckUser = new CheckDeptDTO();
                             oneCheckUser.setDeptId(checkUserDTO.getDeptId());
                             oneCheckUser.setDeptName(checkUserDTO.getDeptName());
@@ -449,8 +434,8 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                 });
 
                 //合并科室
-                String deptId = deptIdBuilder.substring(0,deptIdBuilder.length()-1);
-                String deptName = deptNameBuilder.substring(0,deptNameBuilder.length()-1);
+                String deptId = deptIdBuilder.substring(0, deptIdBuilder.length() - 1);
+                String deptName = deptNameBuilder.substring(0, deptNameBuilder.length() - 1);
                 //科室用户
                 DeptCheckUserDTO deptCheckUserDTO = new DeptCheckUserDTO();
                 deptCheckUserDTO.setDoctorId(userId);
@@ -459,28 +444,27 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                 deptCheckUserDTO.setDeptName(deptName);
                 AtomicBoolean hasFlag = new AtomicBoolean(false);
                 //全部处理
-                if(ListUtil.isEmpty(allCheckDept.getDeptcheckUsers())){
+                if (ListUtil.isEmpty(allCheckDept.getDeptcheckUsers())) {
                     allCheckDept.getDeptcheckUsers().add(deptCheckUserDTO);
                 }
                 allCheckDept.getDeptcheckUsers().forEach(oneDeptCheckUser -> {
-                    if(!userId.equals(oneDeptCheckUser.getDoctorId()))
-                    {
+                    if (!userId.equals(oneDeptCheckUser.getDoctorId())) {
                         hasFlag.set(true);
                     }
                 });
-                if(hasFlag.get()){
+                if (hasFlag.get()) {
                     allCheckDept.getDeptcheckUsers().add(deptCheckUserDTO);
                 }
 
                 tempDepts.stream().forEach(checkDeptDTO -> {
-                    if(deptId.contains(checkDeptDTO.getDeptId())){
+                    if (deptId.contains(checkDeptDTO.getDeptId())) {
                         checkDeptDTO.getDeptcheckUsers().add(deptCheckUserDTO);
                     }
                 });
             });
-            tempDepts.add(0,allCheckDept);
-            checkRoleMap.put(roleId+"",tempDepts);
-        }catch (Exception e){
+            tempDepts.add(0, allCheckDept);
+            checkRoleMap.put(roleId + "", tempDepts);
+        } catch (Exception e) {
             e.printStackTrace();
         }
 
@@ -489,20 +473,19 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
     /**
      * @Author songxl
      * @Description 质控科管理员获取管理的科室以及科室包涵质控人员
-     * @Date  2021/5/17
+     * @Date 2021/5/17
      * @Param [checkRoleMap, hospitalId, principleId]
      * @Return void
      * @MethodName getZKKCheckInfo
      */
     private void getZKKCheckInfo(Map<String, List<CheckDeptDTO>> checkRoleMap, Long hospitalId, Long principleId) {
         //1.获取质控科id
-        String zkkDeptId = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
+        BasDeptInfo deptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id",hospitalId)
-                .like("dept_name","质管科")).getDeptId();
-        if(StringUtil.isBlank(zkkDeptId))
-        {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在!");
+                .eq("hospital_id", hospitalId)
+                .eq("station", "质管"));
+        if (deptInfo == null || deptInfo.getDeptId() == null) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在,请联系管理员!");
         }
 //        //2.获取监管人员所在科室集合
 //        List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
@@ -518,20 +501,19 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
 //        }
         CheckUserVO checkUserVOS = new CheckUserVO();
         //质管科人员角色
-        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.QUAT_GENERAL.getKey()*1l));
+        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l));
         //质管科
         checkUserVOS.setDeptStations(Lists.newArrayList("质管"));
-        checkUserVOS.setDeptIds(Lists.newArrayList(zkkDeptId));
+        checkUserVOS.setDeptIds(Lists.newArrayList(deptInfo.getDeptId()));
         checkUserVOS.setHospitalId(hospitalId);
         List<CheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
         //2.1获取科室详情
-        Map<String,String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
+        Map<String, String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id",hospitalId)
-                .in("dept_id",Lists.newArrayList(zkkDeptId))).stream()
-                .collect(Collectors.toMap(BasDeptInfo::getDeptId,BasDeptInfo::getDeptName, (v1, v2) -> v2));
-        if(deptMap!=null&&!deptMap.isEmpty())
-        {
+                .eq("hospital_id", hospitalId)
+                .in("dept_id", Lists.newArrayList(deptInfo.getDeptId()))).stream()
+                .collect(Collectors.toMap(BasDeptInfo::getDeptId, BasDeptInfo::getDeptName, (v1, v2) -> v2));
+        if (deptMap != null && !deptMap.isEmpty()) {
             //2.3获取质控科核查人员的核查数
             List<String> doctorIds = checkUserDTOS.stream().map(CheckUserDTO::getDoctorId).collect(Collectors.toList());
             CheckUserVO checkUserVO = new CheckUserVO();
@@ -540,19 +522,19 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
             //通过核查人员id获取核查人员的核查任务数
             List<DeptCheckUserDTO> userJobs = baseMapper.getDeptJobNumByUserId(checkUserVO);
             userJobs.stream().forEach(deptCheckUserDTO -> {
-                deptCheckUserDTO.setDeptId(zkkDeptId);
+                deptCheckUserDTO.setDeptId(deptInfo.getDeptId());
             });
-            addCheckInfoMaps(checkRoleMap,deptMap,userJobs,checkUserDTOS,CheckerRoleEnum.QUAT_SUPERVISOR.getKey(),CheckJobTypeEnum.QUAT_SUPERVISOR.getKey());
-        }
-        else {
-            checkRoleMap.put(CheckerRoleEnum.QUAT_SUPERVISOR.getKey()+"",new ArrayList<>());
+            addCheckInfoMaps(checkRoleMap, deptMap, userJobs, checkUserDTOS, CheckerRoleEnum.QUAT_SUPERVISOR.getKey(), CheckJobTypeEnum.QUAT_SUPERVISOR.getKey());
+        } else {
+            checkRoleMap.put(CheckerRoleEnum.QUAT_SUPERVISOR.getKey() + "", new ArrayList<>());
         }
 
     }
+
     /**
      * @Author songxl
      * @Description 临床科室管理员获取管理的科室以及科室包涵质控人员
-     * @Date  2021/5/17
+     * @Date 2021/5/17
      * @Param [checkRoleMap, hospitalId, principleId]
      * @Return void
      * @MethodName getDeptCheckInfo
@@ -562,31 +544,37 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         //1.获取监管人员所在科室集合
         List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id",hospitalId)
-                .eq("user_id",principleId)
+                .eq("hospital_id", hospitalId)
+                .eq("user_id", principleId)
         ).stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
-        if(deptIds.isEmpty()){return;}
+        if (deptIds.isEmpty()) {
+            return;
+        }
         //1.2去除质管科
-        String zkkDeptId = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
+        BasDeptInfo deptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id",hospitalId)
-                .like("dept_name","质管科")).getDeptId();
-        if(StringUtil.isNotBlank(zkkDeptId)){deptIds.remove(zkkDeptId);}
+                .eq("hospital_id", hospitalId)
+                .eq("station", "质管"));
+        if (deptInfo == null || deptInfo.getDeptId() == null) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在,请联系管理员!");
+        }
+        if (StringUtil.isNotBlank(deptInfo.getDeptId())) {
+            deptIds.remove(deptInfo.getDeptId());
+        }
         CheckUserVO checkUserVOS = new CheckUserVO();
         //科室普通核查人员角色筛选
-        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.DEPT_GENERAL.getKey()*1l));
+        checkUserVOS.setRoleIds(Lists.newArrayList(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l));
         checkUserVOS.setDeptIds(deptIds);
         checkUserVOS.setDeptStations(Lists.newArrayList("住院"));
         checkUserVOS.setHospitalId(hospitalId);
         List<CheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
         //2.1获取科室详情
-        Map<String,String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
+        Map<String, String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id",hospitalId)
-                .in("dept_id",deptIds)).stream()
-                .collect(Collectors.toMap(BasDeptInfo::getDeptId,BasDeptInfo::getDeptName, (v1, v2) -> v2));
-        if(deptMap!=null&&!deptMap.isEmpty())
-        {
+                .eq("hospital_id", hospitalId)
+                .in("dept_id", deptIds)).stream()
+                .collect(Collectors.toMap(BasDeptInfo::getDeptId, BasDeptInfo::getDeptName, (v1, v2) -> v2));
+        if (deptMap != null && !deptMap.isEmpty()) {
             //2.3获取所有医生信息的核查数
             List<String> doctorIds = checkUserDTOS.stream().map(CheckUserDTO::getDoctorId).collect(Collectors.toList());
             CheckUserVO checkUserVO = new CheckUserVO();
@@ -595,44 +583,41 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
             checkUserVO.setDeptIds(deptIds);
             //通过核查人员id获取核查人员的核查任务数
             List<DeptCheckUserDTO> userJobs = baseMapper.getDeptJobNumByUserId(checkUserVO);
-            addCheckInfoMaps(checkRoleMap,deptMap,userJobs,checkUserDTOS,CheckerRoleEnum.DEPT_SUPERVISOR.getKey(),CheckJobTypeEnum.DEPT_SUPERVISOR.getKey());
-        }
-        else {
-            checkRoleMap.put(CheckerRoleEnum.DEPT_SUPERVISOR.getKey()+"",new ArrayList<>());
+            addCheckInfoMaps(checkRoleMap, deptMap, userJobs, checkUserDTOS, CheckerRoleEnum.DEPT_SUPERVISOR.getKey(), CheckJobTypeEnum.DEPT_SUPERVISOR.getKey());
+        } else {
+            checkRoleMap.put(CheckerRoleEnum.DEPT_SUPERVISOR.getKey() + "", new ArrayList<>());
         }
 
 
-
     }
 
     /**
      * @Author songxl
      * @Description 拼装科室、核查人员、任务数对象
-     * @Date  2021/5/17
+     * @Date 2021/5/17
      * @Param [checkRoleMap, doctorInfos, userJobs, deptInfos, roleId]
      * @Return void
      * @MethodName addCheckInfoMap
      */
     private void addCheckInfoMaps(Map<String, List<CheckDeptDTO>> checkRoleMap, Map<String, String> deptMap,
-                                  List<DeptCheckUserDTO> userJobs, List<CheckUserDTO> checkUserDTOS, int roleId,int jobType) {
+                                  List<DeptCheckUserDTO> userJobs, List<CheckUserDTO> checkUserDTOS, int roleId, int jobType) {
         //非院区任务
-        if(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey()!=jobType){
-            if(deptMap.isEmpty()||checkUserDTOS.isEmpty()){return;}
-            checkRoleMap.put(roleId+"",new ArrayList<>());
+        if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() != jobType) {
+            if (deptMap.isEmpty() || checkUserDTOS.isEmpty()) {
+                return;
+            }
+            checkRoleMap.put(roleId + "", new ArrayList<>());
             //遍历科室
-            for(String deptId:deptMap.keySet())
-            {
+            for (String deptId : deptMap.keySet()) {
                 //科室对象
                 CheckDeptDTO checkDeptDTO = new CheckDeptDTO();
                 checkDeptDTO.setDeptId(deptId);
                 checkDeptDTO.setDeptName(deptMap.get(deptId));
                 checkDeptDTO.setDeptcheckUsers(new ArrayList<DeptCheckUserDTO>());
                 //遍历医生
-                for(CheckUserDTO checkUserDTO:checkUserDTOS)
-                {
+                for (CheckUserDTO checkUserDTO : checkUserDTOS) {
                     //同一科室
-                    if(checkDeptDTO.getDeptId().equals(checkUserDTO.getDeptId()))
-                    {
+                    if (checkDeptDTO.getDeptId().equals(checkUserDTO.getDeptId())) {
                         DeptCheckUserDTO deptCheckUserDTO = new DeptCheckUserDTO();
                         deptCheckUserDTO.setDeptId(checkUserDTO.getDeptId());
                         deptCheckUserDTO.setDeptName(checkUserDTO.getDeptName());
@@ -641,20 +626,16 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                         checkDeptDTO.getDeptcheckUsers().add(deptCheckUserDTO);
                     }
                 }
-                for(DeptCheckUserDTO deptCheckUserDTO:checkDeptDTO.getDeptcheckUsers())
-                {
+                for (DeptCheckUserDTO deptCheckUserDTO : checkDeptDTO.getDeptcheckUsers()) {
                     //遍历数量
-                    for(DeptCheckUserDTO jobNumDto:userJobs)
-                    {
+                    for (DeptCheckUserDTO jobNumDto : userJobs) {
                         //这个科室有这个人
-                        if(deptCheckUserDTO.getDeptId().equals(jobNumDto.getDeptId()))
-                        {
-                            if(deptCheckUserDTO.getDoctorId().equals(jobNumDto.getDoctorId()))
-                            {
-                                if(jobNumDto.getStatus()==0){
+                        if (deptCheckUserDTO.getDeptId().equals(jobNumDto.getDeptId())) {
+                            if (deptCheckUserDTO.getDoctorId().equals(jobNumDto.getDoctorId())) {
+                                if (jobNumDto.getStatus() == 0) {
                                     deptCheckUserDTO.setJobNum(jobNumDto.getJobNum());
                                 }
-                                if(jobNumDto.getStatus()==1){
+                                if (jobNumDto.getStatus() == 1) {
 
                                     deptCheckUserDTO.setCheckNum(jobNumDto.getJobNum());
                                 }
@@ -663,21 +644,20 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                         }
                     }
                 }
-                checkRoleMap.get(roleId+"").add(checkDeptDTO);
+                checkRoleMap.get(roleId + "").add(checkDeptDTO);
             }
         }
         //院区任务不是同一科室的人员数量增加
-        else if(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey()==jobType)
-        {
-            checkRoleMap.get(roleId+"").stream().forEach(checkDeptDTO -> {
-                if(!ListUtil.isEmpty(checkDeptDTO.getDeptcheckUsers())){
+        else if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() == jobType) {
+            checkRoleMap.get(roleId + "").stream().forEach(checkDeptDTO -> {
+                if (!ListUtil.isEmpty(checkDeptDTO.getDeptcheckUsers())) {
                     checkDeptDTO.getDeptcheckUsers().stream().forEach(deptCheckUser -> {
                         userJobs.stream().forEach(userJob -> {
-                            if(deptCheckUser.getDoctorId().equals(userJob.getDoctorId())){
-                                if(userJob.getStatus()==0){
+                            if (deptCheckUser.getDoctorId().equals(userJob.getDoctorId())) {
+                                if (userJob.getStatus() == 0) {
                                     deptCheckUser.setJobNum(userJob.getJobNum());
                                 }
-                                if(userJob.getStatus()==1){
+                                if (userJob.getStatus() == 1) {
                                     deptCheckUser.setCheckNum(userJob.getJobNum());
                                 }
                             }
@@ -689,31 +669,29 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
     }
 
 
-
     /**
      * @Author songxl
      * @Description list求交集
-     * @Date  2021/5/14
+     * @Date 2021/5/14
      * @Param [checkRoleIds, roleIds]
      * @Return java.util.List<java.lang.Long>
      * @MethodName containsRole
      */
-    private  List<Long> containsRole(List<Long> checkRoleIds, List<Long> roleIds) {
+    private List<Long> containsRole(List<Long> checkRoleIds, List<Long> roleIds) {
 
         List<Long> searchRoleIds = new ArrayList<>();
-        for(Long id:roleIds)
-        {
-            if(checkRoleIds.contains(id))
-            {
+        for (Long id : roleIds) {
+            if (checkRoleIds.contains(id)) {
                 searchRoleIds.add(id);
             }
         }
         return searchRoleIds;
     }
+
     /**
      * @Author songxl
      * @Description 分配/取消核查任务
-     * @Date  2021/5/17
+     * @Date 2021/5/17
      * @Param [distributionJobVO]
      * @Return boolean
      * @MethodName distributionJobs
@@ -721,30 +699,28 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
     public boolean distributionJobs(DistributionJobVO distributionJobVO) {
 
         //1非空校验
-        if(StringUtil.isBlank(distributionJobVO.getCheckId())||
-                StringUtil.isBlank(distributionJobVO.getCheckName())||
-                StringUtil.isBlank(distributionJobVO.getDistributionType())||
-                distributionJobVO.getBehospitalCodes()==null||
-                distributionJobVO.getBehospitalCodes().isEmpty())
-        {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,"入参为空");
+        if (StringUtil.isBlank(distributionJobVO.getCheckId()) ||
+                StringUtil.isBlank(distributionJobVO.getCheckName()) ||
+                StringUtil.isBlank(distributionJobVO.getDistributionType()) ||
+                distributionJobVO.getBehospitalCodes() == null ||
+                distributionJobVO.getBehospitalCodes().isEmpty()) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "入参为空");
         }
-        if(StringUtil.isBlank(distributionJobVO.getCheckDept())){
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,"核查人科室(checkDept)为空");
+        if (StringUtil.isBlank(distributionJobVO.getCheckDept())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "核查人科室(checkDept)为空");
         }
-        if(distributionJobVO.getBehospitalDepts()==null
-                ||distributionJobVO.getBehospitalDepts().isEmpty()){
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,"核查任务科室集合(behospitalDepts)为空");
+        if (distributionJobVO.getBehospitalDepts() == null
+                || distributionJobVO.getBehospitalDepts().isEmpty()) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "核查任务科室集合(behospitalDepts)为空");
         }
-        if(StringUtil.isEmpty(distributionJobVO.getJobType()))
-        {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,"核查任务类型(jobType)为空");
+        if (StringUtil.isEmpty(distributionJobVO.getJobType())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "核查任务类型(jobType)为空");
         }
         //全院的话要判断院级核查人员和核查病历不是同一科室
-        if(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey()==Integer.parseInt(distributionJobVO.getJobType())){
-            for(String deptId:distributionJobVO.getCheckDept().split(",")){
-                if(distributionJobVO.getBehospitalDepts().contains(deptId)){
-                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,"院级核查人员和核查病历是同一科室");
+        if (CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() == Integer.parseInt(distributionJobVO.getJobType())) {
+            for (String deptId : distributionJobVO.getCheckDept().split(",")) {
+                if (distributionJobVO.getBehospitalDepts().contains(deptId)) {
+                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "院级核查人员和核查病历是同一科室");
                 }
             }
 
@@ -755,32 +731,32 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         //2.获取任务类型 0分配 1取消
         String distributionType = distributionJobVO.getDistributionType();
         //3 分配
-        if(StringUtil.isNotBlank(distributionType)&&"0".equals(distributionType))
-        {
+        if (StringUtil.isNotBlank(distributionType) && "0".equals(distributionType)) {
             //3.1 任务未分配校验
             List<String> distributionNames = this.list(new QueryWrapper<MedCheckInfo>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id",hospitalId)
-                    .in("behospital_code",distributionJobVO.getBehospitalCodes())
-                    ).stream().filter(s-> s.getJobDistributionName() !=null).map(MedCheckInfo::getJobDistributionName)
+                    .eq("hospital_id", hospitalId)
+                    .in("behospital_code", distributionJobVO.getBehospitalCodes())
+            ).stream().filter(s -> s.getJobDistributionName() != null).map(MedCheckInfo::getJobDistributionName)
                     .collect(Collectors.toList());
-            if(distributionNames!=null&&distributionNames.size()>0)
-            {
+            if (distributionNames != null && distributionNames.size() > 0) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "待分配任务列表存在已分配任务!");
             }
 
             //获取分配用户信息
             QueryWrapper<SysUser> userQuer = new QueryWrapper<>();
             userQuer.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("id",principleId)
-                    .eq("status",1);
+                    .eq("id", principleId)
+                    .eq("status", 1);
             SysUser user = sysUserFacade.getOne(userQuer);
             String principleName = user.getLinkman();
             //用户名称如果是null(目的:分配用户名为null表示用户未分配)
-            if(principleName==null){principleName = "";}
+            if (principleName == null) {
+                principleName = "";
+            }
             Date now = DateUtil.now();
             //3.2分配核查任务
-            return  this.update(new UpdateWrapper<MedCheckInfo>()
+            return this.update(new UpdateWrapper<MedCheckInfo>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("hospital_id", hospitalId)
                     .in("behospital_code", distributionJobVO.getBehospitalCodes())
@@ -792,31 +768,27 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
 
         }
         //4 取消分配
-        else if(StringUtil.isNotBlank(distributionType)&&"1".equals(distributionType))
-        {
+        else if (StringUtil.isNotBlank(distributionType) && "1".equals(distributionType)) {
             //4.1 任务已取消校验
             Set<Long> checkIds = this.list(new QueryWrapper<MedCheckInfo>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id",hospitalId)
-                    .in("behospital_code",distributionJobVO.getBehospitalCodes())
+                    .eq("hospital_id", hospitalId)
+                    .in("behospital_code", distributionJobVO.getBehospitalCodes())
             ).stream().map(MedCheckInfo::getCheckId).collect(Collectors.toSet());
             //4.2获取出来的核查用户存在但不是一个
-            if(checkIds==null||checkIds.isEmpty()||
-                    (checkIds.size()!=1&&checkIds.contains(distributionJobVO.getCheckId())))
-            {
+            if (checkIds == null || checkIds.isEmpty() ||
+                    (checkIds.size() != 1 && checkIds.contains(distributionJobVO.getCheckId()))) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "待取消分配任务列表不存在或存在不是该用户的任务!");
-            }
-            else
-            {
+            } else {
                 Date now = DateUtil.now();
                 //4.3取消分配
                 Long a = null;
-                return  this.update(new UpdateWrapper<MedCheckInfo>()
+                return this.update(new UpdateWrapper<MedCheckInfo>()
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("hospital_id", hospitalId)
-                        .eq("check_id",  distributionJobVO.getCheckId())
+                        .eq("check_id", distributionJobVO.getCheckId())
                         .in("behospital_code", distributionJobVO.getBehospitalCodes())
-                        .set("job_distributor",a)
+                        .set("job_distributor", a)
                         .set("job_distribution_name", a)
                         .set("check_id", a)
                         .set("check_name", a)
@@ -826,32 +798,29 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
 
         return false;
     }
+
     /**
      * @Author songxl
      * @Description 获取指定核查人员的核查任务
-     * @Date  2021/5/17
+     * @Date 2021/5/17
      * @Param [checkJobVO]
      * @Return java.util.List<com.diagbot.dto.CheckJobDTO>
      * @MethodName getCheckListByUserId
      */
     public IPage<CheckJobDTO> getCheckListByUserId(CheckJobPageVO checkJobVO) {
         //非空校验
-        if(StringUtil.isBlank(checkJobVO.getCheckId()))
-        {
+        if (StringUtil.isBlank(checkJobVO.getCheckId())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有传核查用户id!");
         }
-        IPage<CheckJobDTO> checkJobDTOS= baseMapper.getCheckListByUserId(checkJobVO);
+        IPage<CheckJobDTO> checkJobDTOS = baseMapper.getCheckListByUserId(checkJobVO);
         //获取当前登录人员
         Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
         List<CheckJobDTO> outCheckJobDTOS = new ArrayList<>();
         //判断分配人员是否是当前人员
-        for(CheckJobDTO checkJobDTO:checkJobDTOS.getRecords())
-        {
-            if (principleId.equals(checkJobDTO.getJobDistributor()))
-            {
+        for (CheckJobDTO checkJobDTO : checkJobDTOS.getRecords()) {
+            if (principleId.equals(checkJobDTO.getJobDistributor())) {
                 checkJobDTO.setDelFlag(true);
-            }
-            else {
+            } else {
                 checkJobDTO.setDelFlag(false);
             }
             outCheckJobDTOS.add(checkJobDTO);

+ 26 - 21
src/main/java/com/diagbot/facade/RecordCheckFacade.java

@@ -21,6 +21,7 @@ import com.diagbot.service.MedQcresultDetailService;
 import com.diagbot.service.impl.MedBehospitalTypeServiceImpl;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.CheckedRecordListVO;
 import com.diagbot.vo.RecordCheckVO;
@@ -73,10 +74,13 @@ public class RecordCheckFacade {
             deptIds.addAll(sysUserDeptDTO.getSelDepts().stream().map(i -> i.getDeptId()).collect(Collectors.toList()));
         }
         //1.2去除质管科
-        String zkkDeptId = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
+        BasDeptInfo deptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id",hospitalId)
-                .eq("station","质管")).getDeptId();
+                .eq("hospital_id", hospitalId)
+                .eq("station", "质管"));
+        if (deptInfo == null || deptInfo.getDeptId() == null) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "科室质管科不存在,请联系管理员!");
+        }
         List<Long> userIds = Lists.newArrayList();
         List<String> JobTypes = Lists.newArrayList();
         roleIds.forEach(roleId -> {
@@ -87,13 +91,13 @@ public class RecordCheckFacade {
             } else if (roleId.intValue() == CheckerRoleEnum.QUAT_SUPERVISOR.getKey()
                     && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + ""))) {
                 //添加质管科人员
-                deptIds.add(zkkDeptId);
+                deptIds.add(deptInfo.getDeptId());
                 userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.QUAT_GENERAL.getKey()));
                 JobTypes.add(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + "");
             } else if (roleId.intValue() == CheckerRoleEnum.DEPT_SUPERVISOR.getKey() && ListUtil.isNotEmpty(deptIds)
                     && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + ""))) {
                 //移除质管科人员
-                deptIds.remove(zkkDeptId);
+                deptIds.remove(deptInfo.getDeptId());
                 JobTypes.add(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "");
                 userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.DEPT_GENERAL.getKey()));
             } else if ((roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey() && ListUtil.isNotEmpty(deptIds))
@@ -103,17 +107,17 @@ public class RecordCheckFacade {
         });
 
         //如果用户是质控科核查人员,在不传入任务类型的时候要添加质控科任务类型进行筛选
-        if(roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey()*1l)){
+        if (roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l)) {
             JobTypes.add(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + "");
         }
-        if(roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey()*1l)){
+        if (roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l)) {
             JobTypes.add(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "");
         }
-        if(roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey()*1l)){
+        if (roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l)) {
             JobTypes.add(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() + "");
         }
 
-        if(ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes())){
+        if (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes())) {
             checkedRecordListVO.setCheckJobTypes(JobTypes);
         }
         if (ListUtil.isEmpty(userIds)) {
@@ -172,30 +176,31 @@ public class RecordCheckFacade {
 
         return true;
     }
+
     /**
      * @Author songxl
      * @Description获取当前用户的任务来源 和筛选分值
-     * @Date  2021/5/28
+     * @Date 2021/5/28
      * @Param []
-     * @Return java.util.Map<java.lang.String,java.lang.String>
+     * @Return java.util.Map<java.lang.String, java.lang.String>
      * @MethodName getCheckType
      */
     public Map<String, Object> getCheckType() {
-        Map<String,Object> out = Maps.newLinkedHashMap();
-        Map<Integer,String> checkTypes = Maps.newLinkedHashMap();
+        Map<String, Object> out = Maps.newLinkedHashMap();
+        Map<Integer, String> checkTypes = Maps.newLinkedHashMap();
         Long userId = Long.parseLong(SysUserUtils.getCurrentPrincipleID());
         SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
         sysUserBaseVO.setUserId(userId);
         List<Long> roleIds = sysUserFacade.getUserRoles(sysUserBaseVO).getSelRoles().stream().map(i -> i.getId()).collect(Collectors.toList());
         roleIds.stream().forEach(roleId -> {
-            if (roleId.intValue() == CheckerRoleEnum.DEPT_SUPERVISOR.getKey()||roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey()){
-                checkTypes.put(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey(),CheckJobTypeEnum.DEPT_SUPERVISOR.getName());
+            if (roleId.intValue() == CheckerRoleEnum.DEPT_SUPERVISOR.getKey() || roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey()) {
+                checkTypes.put(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey(), CheckJobTypeEnum.DEPT_SUPERVISOR.getName());
             }
-            if (roleId.intValue() == CheckerRoleEnum.QUAT_SUPERVISOR.getKey()||roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey()){
-                checkTypes.put(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey(),CheckJobTypeEnum.QUAT_SUPERVISOR.getName());
+            if (roleId.intValue() == CheckerRoleEnum.QUAT_SUPERVISOR.getKey() || roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey()) {
+                checkTypes.put(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey(), CheckJobTypeEnum.QUAT_SUPERVISOR.getName());
             }
-            if (roleId.intValue() == CheckerRoleEnum.HOSP_SUPERVISOR.getKey()||roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()){
-                checkTypes.put(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey(),CheckJobTypeEnum.HOSP_SUPERVISOR.getName());
+            if (roleId.intValue() == CheckerRoleEnum.HOSP_SUPERVISOR.getKey() || roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()) {
+                checkTypes.put(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey(), CheckJobTypeEnum.HOSP_SUPERVISOR.getName());
             }
         });
         Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
@@ -204,8 +209,8 @@ public class RecordCheckFacade {
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .isNotNull("value")
                 .groupBy("value")).stream().map(MedBehospitalType::getValue).collect(Collectors.toList());
-        out.put("source",checkTypes);
-        out.put("value",valus);
+        out.put("source", checkTypes);
+        out.put("value", valus);
         return out;
     }
 }