Jelajahi Sumber

Merge branch '122run'

songxinlu 3 tahun lalu
induk
melakukan
d677ec7829

+ 12 - 0
doc/034.20210804_2.0.5/qc_initv2.0.5.sql

@@ -0,0 +1,12 @@
+use `qc`;
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '数据编辑', '-1', 'YH-SJBJ', '1', '1', '11', '入院记录展示/编辑');
+SET @id =@@identity;
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1',@id, NULL);
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1',@id, NULL);
+
+INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '数据编辑', 'FUNC000151', '/qc/dataEdit/getDataEdit', 'ALL', '数据编辑获取入院记录json数据', NULL);
+SET @it =@@identity;
+INSERT INTO `sys_menu_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @id, @it, NULL, '数据编辑获取入院记录json数据');
+
+
+

+ 2 - 2
pom.xml

@@ -37,8 +37,8 @@
         <okhttp.version>4.2.2</okhttp.version>
         <easypoi.version>4.2.0</easypoi.version>
         <docker-maven-plugin.version>1.2.1</docker-maven-plugin.version>
-        <docker.image.prefix>192.168.2.236:5000/diagbotcloud</docker.image.prefix>
-        <registryUrl>http://192.168.2.236:5000/repository/diagbotcloud/</registryUrl>
+        <docker.image.prefix>192.168.2.122:5000/diagbotcloud</docker.image.prefix>
+        <registryUrl>http://192.168.2.122:5000/repository/diagbotcloud/</registryUrl>
     </properties>
 
     <dependencyManagement>

+ 2 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -243,6 +243,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/saveMedicaIndicator").permitAll()
                 .antMatchers("/qc/medCheckInfo/createMedBeHospitalInfoType").permitAll()
                 .antMatchers("/qc/medCheckInfo/addMedCheckInfo").permitAll()
+                .antMatchers("/qc/medCheckInfo/getDataEdit").permitAll()
+                .antMatchers("/qc/medCheckInfo/saveDataEdit").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

+ 2 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -287,6 +287,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/saveMedicaIndicator", request)
                 || matchers("/qc/medCheckInfo/createMedBeHospitalInfoType", request)
                 || matchers("/qc/medCheckInfo/addMedCheckInfo", request)
+                || matchers("/qc/dataEdit/getDataEdit", request)
+                || matchers("/qc/dataEdit/saveDataEdit", request)
                 || matchers("/", request)) {
             return true;
         }

+ 35 - 0
src/main/java/com/diagbot/dto/StrAdmissionNoteDTO.java

@@ -0,0 +1,35 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 入院记录
+ * </p>
+ *
+ * @author cy
+ * @since 2020-10-09
+ */
+@Data
+public class StrAdmissionNoteDTO implements Serializable {
+
+
+    /**
+     * 记录编号
+     */
+    private String recId;
+
+
+    /**
+     * 结构化数据
+     */
+    private String wholeData;
+
+    /**
+     * modeId
+     */
+    private String modeId;
+
+}

+ 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

@@ -180,7 +180,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(","));
@@ -192,7 +192,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);
@@ -293,7 +293,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获取用户角色
@@ -301,18 +301,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);
@@ -362,7 +371,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)) {
@@ -382,11 +391,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) {
@@ -443,7 +452,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")
         );
 
@@ -592,14 +601,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>()
@@ -663,7 +672,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);
@@ -672,47 +681,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("");
 
@@ -783,30 +791,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)) {
@@ -888,18 +896,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);
         }
 
         //阶段小结
@@ -911,10 +919,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);
         }
 
 
@@ -927,18 +935,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);
         }
 
         //查房记录
@@ -950,10 +958,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         //==============非结构化表拥有,文书单独查出来====================
         specialDataWithKey("手术", recMap, medrecVoList, "手术知情同意书",
-                null,null);
+                null, null);
 
         specialDataWithKey("手术", recMap, medrecVoList, "手术安全核查表",
-                null,null);
+                null, null);
 
 
 //=========================================
@@ -1016,10 +1024,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);
@@ -1041,14 +1049,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, "该病例已经核查无需评分!");
         }
         //  调用质控接口
@@ -1098,9 +1107,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);
             }
@@ -1123,7 +1132,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<>();
@@ -1139,9 +1148,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("转入时间"));
                 }
@@ -1151,9 +1160,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("转入时间"));
                 }
@@ -1276,14 +1285,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);
@@ -1309,14 +1318,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);
@@ -1387,7 +1396,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<>();
 
         //从结构化表中取出应用数据
@@ -1412,7 +1421,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("转入时间"));
                 }
@@ -1534,7 +1543,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)) {
@@ -1713,7 +1722,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");
@@ -1721,15 +1730,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) {
@@ -1756,19 +1765,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);
@@ -1781,13 +1790,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 Map<String, List<MsgApiDTO>> msgMap = EntityUtil.makeEntityListMap(msgApiDTOList, "modelName");
                 resMapData.put("details", msgMap);
             }
-        };
+        }
+        ;
         return resMapData;
     }
 
 
-
-
     /**
      * 获取明细api
      *
@@ -1880,7 +1888,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) {
@@ -1990,38 +1998,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);
             });
         }
@@ -2043,15 +2052,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);
         }
     }
@@ -2071,15 +2080,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);
         }
     }
@@ -2099,17 +2108,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) {
         //入参验证
@@ -2119,7 +2129,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, "截止时间不能小于起始时间");
@@ -2127,7 +2137,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, "截止时间不能小于起始时间");
@@ -2143,7 +2153,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, "截止时间不能小于起始时间");
@@ -2151,7 +2161,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, "截止时间不能小于起始时间");
@@ -2193,8 +2203,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)) {
@@ -2416,40 +2426,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

+ 65 - 0
src/main/java/com/diagbot/facade/DataEditFacade.java

@@ -0,0 +1,65 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.diagbot.dto.StrAdmissionNoteDTO;
+import com.diagbot.entity.*;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.*;
+import com.diagbot.util.*;
+import com.diagbot.vo.DataEditVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:wangsy
+ * @time: 2021/08/14 11:37
+ */
+@Component
+public class DataEditFacade {
+
+    @Autowired
+    @Qualifier("strAdmissionNoteServiceImpl")
+    StrAdmissionNoteService strAdmissionNoteService;
+
+    /**
+     * 数据检索
+     */
+    public StrAdmissionNoteDTO dataSearch() {
+        Long hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
+        StrAdmissionNote strAdmissionNote= strAdmissionNoteService.getBaseMapper().selectOne(new QueryWrapper<StrAdmissionNote>()
+                .eq("hospital_id", hospitalId)
+                .eq("remark", hospitalId + "N")
+                .select("rec_id", "whole_data"));
+        StrAdmissionNoteDTO strAdmissionNoteDTO = new StrAdmissionNoteDTO();
+        BeanUtil.copyProperties(strAdmissionNote,strAdmissionNoteDTO);
+        strAdmissionNoteDTO.setModeId("200");
+        return strAdmissionNoteDTO;
+    }
+
+
+
+    /**
+     * 更新数据
+     *
+     * @param dataEditVO
+     * @return
+     */
+    public Boolean saveDataEditFacade(DataEditVO dataEditVO) {
+        return strAdmissionNoteService.update(new UpdateWrapper<StrAdmissionNote>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                .eq("rec_id", dataEditVO.getRecId())
+                .set("whole_data", dataEditVO.getWholeData())
+                .set("gmt_modified", DateUtil.now())
+                .set("modifier", SysUserUtils.getCurrentPrincipleID())
+        );
+    }
+
+}

+ 2 - 2
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>();

+ 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;
     }
 }

+ 1 - 1
src/main/java/com/diagbot/vo/AnalyzeVO.java

@@ -29,5 +29,5 @@ public class AnalyzeVO {
     private Integer delStatus;
     //已核查不能再次评分校验
     @ApiModelProperty("已核查不能再次评分标志位,false表示核查与评分无关已核查也可以评分")
-    private Boolean checkFlag = false;
+    private Boolean checkFlag = true;
 }

+ 18 - 0
src/main/java/com/diagbot/vo/DataEditVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @author: wangsy
+ * @time: 2021/8/4 9:53
+ */
+@Data
+public class DataEditVO {
+    // 医院ID
+    private Long hospitalId;
+    // id
+    private String recId;
+    // json字符串
+    private String wholeData;
+}

+ 54 - 0
src/main/java/com/diagbot/web/DataEditController.java

@@ -0,0 +1,54 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.StrAdmissionNoteDTO;
+import com.diagbot.facade.DataEditFacade;
+import com.diagbot.vo.DataEditVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * <p>
+ * 数据导入 前端控制器
+ * </p>
+ *
+ * @author wangsy
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/qc/dataEdit")
+@SuppressWarnings("unchecked")
+@Api(value = "数据编辑API", tags = {"数据编辑API"})
+public class DataEditController {
+
+    @Autowired
+    DataEditFacade dateEditFacade;
+
+    @ApiOperation(value = "获取入院记录结构化json数据")
+    @PostMapping("/getDataEdit")
+    @SysLogger("getDataEdit")
+    public RespDTO<StrAdmissionNoteDTO>getDataEdit() {
+        return RespDTO.onSuc(dateEditFacade.dataSearch());
+    }
+
+    @ApiOperation(value = "更新数据", notes = "recId: id\n" +
+            "wholeData: json字符串")
+    @PostMapping("/saveDataEdit")
+    @SysLogger("saveDataEdit")
+    @Transactional
+    public RespDTO<Boolean> saveDataEdit(@RequestBody @Valid DataEditVO dataEditVO) {
+        Boolean data = dateEditFacade.saveDataEditFacade(dataEditVO);
+        return RespDTO.onSuc(data);
+    }
+
+
+}