ソースを参照

Merge branch 'dev/20201224_2.0.0' into develop

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
#	src/main/java/com/diagbot/vo/str/StrAdmissionNoteVO.java
#	src/main/java/com/diagbot/vo/str/StrBloodResultVO.java
#	src/main/java/com/diagbot/vo/str/StrBloodTransfusionVO.java
#	src/main/java/com/diagbot/vo/str/StrConsultationApplyVO.java
#	src/main/java/com/diagbot/vo/str/StrConsultationNoteVO.java
#	src/main/java/com/diagbot/vo/str/StrConsultationRecordVO.java
#	src/main/java/com/diagbot/vo/str/StrConsultationResultVO.java
#	src/main/java/com/diagbot/vo/str/StrCrisisNoteVO.java
#	src/main/java/com/diagbot/vo/str/StrDeathDiscussionVO.java
#	src/main/java/com/diagbot/vo/str/StrDeathNoteVO.java
#	src/main/java/com/diagbot/vo/str/StrDifficultCaseVO.java
#	src/main/java/com/diagbot/vo/str/StrFirstRecordVO.java
#	src/main/java/com/diagbot/vo/str/StrIllCriticallyVO.java
#	src/main/java/com/diagbot/vo/str/StrIllSeriouslVO.java
#	src/main/java/com/diagbot/vo/str/StrLeaveHospitalVO.java
#	src/main/java/com/diagbot/vo/str/StrOperativeFirstRecordVO.java
#	src/main/java/com/diagbot/vo/str/StrOperativeNoteVO.java
#	src/main/java/com/diagbot/vo/str/StrPeriodConclusionVO.java
#	src/main/java/com/diagbot/vo/str/StrPreoperativeDiscussionVO.java
#	src/main/java/com/diagbot/vo/str/StrRescueNoteVO.java
#	src/main/java/com/diagbot/vo/str/StrTransferInNoteVO.java
#	src/main/java/com/diagbot/vo/str/StrTransferOutNoteVO.java
#	src/main/java/com/diagbot/vo/str/StrWardRecordVO.java
#	src/main/resources/application-dev.yml
#	src/main/resources/application-local.yml
#	src/main/resources/application-pre.yml
#	src/main/resources/application-pro.yml
#	src/main/resources/application-test.yml
#	src/main/resources/mapper/BehospitalInfoMapper.xml
chengyao 4 年 前
コミット
e705ac9943
100 ファイル変更9300 行追加507 行削除
  1. 334 0
      doc/029.20201224v2.0.0/qc_initv2.0.0.sql
  2. 33 2
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  3. 33 0
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  4. 25 0
      src/main/java/com/diagbot/dto/AdmissionCountDTO.java
  5. 8 0
      src/main/java/com/diagbot/dto/DeptEntryNumDTO.java
  6. 177 0
      src/main/java/com/diagbot/dto/EntryStasByDeptDTO.java
  7. 34 0
      src/main/java/com/diagbot/dto/ExportExcelBehByDeptDTO.java
  8. 1 1
      src/main/java/com/diagbot/dto/ExportExcelBehospitalDTO.java
  9. 28 0
      src/main/java/com/diagbot/dto/ExportExcelByDeptDTO.java
  10. 29 0
      src/main/java/com/diagbot/dto/ExportExcelWideBehByDeptDTO.java
  11. 1 1
      src/main/java/com/diagbot/dto/ExportExcelWideBehospitalDTO.java
  12. 23 0
      src/main/java/com/diagbot/dto/ExportNinetyByDeptDTO.java
  13. 23 0
      src/main/java/com/diagbot/dto/ExportSevenByDeptDTO.java
  14. 28 0
      src/main/java/com/diagbot/dto/ExportWideExcelByDeptDTO.java
  15. 118 0
      src/main/java/com/diagbot/dto/HomePageByDeptDTO.java
  16. 89 0
      src/main/java/com/diagbot/dto/ImproveByDeptDTO.java
  17. 26 0
      src/main/java/com/diagbot/dto/ImproveExportByDeptDTO.java
  18. 289 0
      src/main/java/com/diagbot/dto/LevelStsByDeptDTO.java
  19. 3 0
      src/main/java/com/diagbot/dto/MedicalCheckDTO.java
  20. 25 0
      src/main/java/com/diagbot/dto/MedicalDeptDTO.java
  21. 25 0
      src/main/java/com/diagbot/dto/MedicalDoDeptDTO.java
  22. 100 0
      src/main/java/com/diagbot/dto/MedicalSeeByDeptDTO.java
  23. 43 0
      src/main/java/com/diagbot/dto/ReBeHosByDeptDTO.java
  24. 76 0
      src/main/java/com/diagbot/dto/ReBeHosDetailByDeptDTO.java
  25. 3 0
      src/main/java/com/diagbot/dto/ReBeHosMergeDTO.java
  26. 2 0
      src/main/java/com/diagbot/dto/UnModifyMRDetailDTO.java
  27. 167 0
      src/main/java/com/diagbot/entity/StrInformedConsent.java
  28. 167 0
      src/main/java/com/diagbot/entity/StrTalkInform.java
  29. 100 0
      src/main/java/com/diagbot/facade/BasDoctorInfoFacade.java
  30. 30 2
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java
  31. 660 0
      src/main/java/com/diagbot/facade/ConsoleByDeptExportFacade.java
  32. 696 69
      src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java
  33. 7 7
      src/main/java/com/diagbot/facade/ConsoleExportFacade.java
  34. 2 2
      src/main/java/com/diagbot/facade/ConsoleFacade.java
  35. 12 0
      src/main/java/com/diagbot/facade/FilterFacade.java
  36. 15 8
      src/main/java/com/diagbot/facade/SysUserFacade.java
  37. 208 0
      src/main/java/com/diagbot/facade/str/BStrAdmissionNoteFacade.java
  38. 200 0
      src/main/java/com/diagbot/facade/str/BStrBloodResultFacade.java
  39. 211 0
      src/main/java/com/diagbot/facade/str/BStrBloodTransfusionFacade.java
  40. 206 0
      src/main/java/com/diagbot/facade/str/BStrConsultationApplyFacade.java
  41. 207 0
      src/main/java/com/diagbot/facade/str/BStrConsultationNoteFacade.java
  42. 205 0
      src/main/java/com/diagbot/facade/str/BStrConsultationRecordFacade.java
  43. 211 0
      src/main/java/com/diagbot/facade/str/BStrConsultationResultFacade.java
  44. 197 0
      src/main/java/com/diagbot/facade/str/BStrCrisisNoteFacade.java
  45. 201 0
      src/main/java/com/diagbot/facade/str/BStrDeathDiscussionFacade.java
  46. 199 0
      src/main/java/com/diagbot/facade/str/BStrDeathNoteFacade.java
  47. 196 0
      src/main/java/com/diagbot/facade/str/BStrDifficultCaseFacade.java
  48. 193 0
      src/main/java/com/diagbot/facade/str/BStrFirstRecordFacade.java
  49. 192 0
      src/main/java/com/diagbot/facade/str/BStrIllCriticallyFacade.java
  50. 192 0
      src/main/java/com/diagbot/facade/str/BStrIllSeriouslFacade.java
  51. 167 0
      src/main/java/com/diagbot/facade/str/BStrInformedConsentFacade.java
  52. 202 0
      src/main/java/com/diagbot/facade/str/BStrLeaveHospitalFacade.java
  53. 205 0
      src/main/java/com/diagbot/facade/str/BStrOperativeFirstRecordFacade.java
  54. 206 0
      src/main/java/com/diagbot/facade/str/BStrOperativeNoteFacade.java
  55. 194 0
      src/main/java/com/diagbot/facade/str/BStrPeriodConclusionFacade.java
  56. 198 0
      src/main/java/com/diagbot/facade/str/BStrPreoperativeDiscussionFacade.java
  57. 201 0
      src/main/java/com/diagbot/facade/str/BStrRescueNoteFacade.java
  58. 168 0
      src/main/java/com/diagbot/facade/str/BStrTalkInformFacade.java
  59. 197 0
      src/main/java/com/diagbot/facade/str/BStrTransferInNoteFacade.java
  60. 194 0
      src/main/java/com/diagbot/facade/str/BStrTransferOutNoteFacade.java
  61. 198 0
      src/main/java/com/diagbot/facade/str/BStrWardRecordFacade.java
  62. 175 3
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  63. 2 2
      src/main/java/com/diagbot/mapper/QcresultInfoMapper.java
  64. 21 0
      src/main/java/com/diagbot/mapper/StrInformedConsentMapper.java
  65. 23 0
      src/main/java/com/diagbot/mapper/StrTalkInformMapper.java
  66. 3 2
      src/main/java/com/diagbot/mapper/SysMenuMapper.java
  67. 162 4
      src/main/java/com/diagbot/service/BehospitalInfoService.java
  68. 2 2
      src/main/java/com/diagbot/service/QcresultInfoService.java
  69. 16 0
      src/main/java/com/diagbot/service/StrInformedConsentService.java
  70. 16 0
      src/main/java/com/diagbot/service/StrTalkInformService.java
  71. 3 2
      src/main/java/com/diagbot/service/SysMenuService.java
  72. 318 9
      src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
  73. 2 2
      src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java
  74. 20 0
      src/main/java/com/diagbot/service/impl/StrInformedConsentServiceImpl.java
  75. 20 0
      src/main/java/com/diagbot/service/impl/StrTalkInformServiceImpl.java
  76. 5 4
      src/main/java/com/diagbot/service/impl/SysMenuServiceImpl.java
  77. 12 0
      src/main/java/com/diagbot/util/MapUtil.java
  78. 5 0
      src/main/java/com/diagbot/vo/EntryStatisticsVO.java
  79. 5 0
      src/main/java/com/diagbot/vo/FilterMedicalCheckVO.java
  80. 3 1
      src/main/java/com/diagbot/vo/FilterOrderByDeptVO.java
  81. 10 0
      src/main/java/com/diagbot/vo/FilterOrderVO.java
  82. 1 0
      src/main/java/com/diagbot/vo/FilterUnModifyMRVO.java
  83. 3 2
      src/main/java/com/diagbot/vo/FilterVO.java
  84. 5 0
      src/main/java/com/diagbot/vo/QcResultPageVO.java
  85. 1 0
      src/main/java/com/diagbot/vo/QcResultShortPageVO.java
  86. 2 1
      src/main/java/com/diagbot/vo/ReBeHosPageVO.java
  87. 27 0
      src/main/java/com/diagbot/vo/data/BasDoctorInfoVO.java
  88. 5 31
      src/main/java/com/diagbot/vo/str/StrAdmissionNoteVO.java
  89. 3 30
      src/main/java/com/diagbot/vo/str/StrBloodResultVO.java
  90. 5 31
      src/main/java/com/diagbot/vo/str/StrBloodTransfusionVO.java
  91. 6 33
      src/main/java/com/diagbot/vo/str/StrConsultationApplyVO.java
  92. 6 32
      src/main/java/com/diagbot/vo/str/StrConsultationNoteVO.java
  93. 6 33
      src/main/java/com/diagbot/vo/str/StrConsultationRecordVO.java
  94. 6 33
      src/main/java/com/diagbot/vo/str/StrConsultationResultVO.java
  95. 4 32
      src/main/java/com/diagbot/vo/str/StrCrisisNoteVO.java
  96. 5 33
      src/main/java/com/diagbot/vo/str/StrDeathDiscussionVO.java
  97. 5 32
      src/main/java/com/diagbot/vo/str/StrDeathNoteVO.java
  98. 4 30
      src/main/java/com/diagbot/vo/str/StrDifficultCaseVO.java
  99. 3 31
      src/main/java/com/diagbot/vo/str/StrFirstRecordVO.java
  100. 0 0
      src/main/java/com/diagbot/vo/str/StrIllCriticallyVO.java

ファイルの差分が大きいため隠しています
+ 334 - 0
doc/029.20201224v2.0.0/qc_initv2.0.0.sql


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

@@ -187,6 +187,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/data_str/sendRescueNote").permitAll()
                 .antMatchers("/qc/data_str/sendPeriodConclusion").permitAll()
                 .antMatchers("/qc/data_str/sendPreoperativeDiscussion").permitAll()
+                .antMatchers("/qc/data_str/sendTalkInform").permitAll()
+                .antMatchers("/qc/data_str/sendInformedConsent").permitAll()
                 .antMatchers("/qc/doctoradvice/getPage").permitAll()
                 .antMatchers("/qc/medPacsInfo/getCheckPage").permitAll()
                 .antMatchers("/qc/medLisInfo/getExaminePage").permitAll()
@@ -199,11 +201,40 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/badLevelPage").permitAll()
                 .antMatchers("/console/export/badLevelPagePageExport").permitAll()
                 .antMatchers("/qc/medNurse/getMedNursePage").permitAll()
+                .antMatchers("/qc/behospitalInfo/exportQcresultByPerson").permitAll()
+                .antMatchers("/consoleByDept/beHosCountByDept").permitAll()
+                .antMatchers("/consoleByDept/casesEntryStatisticsByDept").permitAll()
+                .antMatchers("/bas/doctor/getList").permitAll()
+                .antMatchers("/consoleByDept/homePageOrGoodLevelByDept").permitAll()
+                .antMatchers("/print/export/homePageLevelExportByDept").permitAll()
+                .antMatchers("/print/export/homePageOrLevelExportByDept").permitAll()
+                .antMatchers("/print/export/entryGroupExportByDeptPage").permitAll()
+                .antMatchers("/print/export/entryGroupExportByDeptCase").permitAll()
+                .antMatchers("/print/export/entryGroupExportByDeptEntry").permitAll()
+                .antMatchers("/print/export/qcResultShortExportByDeptPage").permitAll()
+                .antMatchers("/print/export/levelExportByDept").permitAll()
+                .antMatchers("/consoleByDept/entryStatisticsByDept").permitAll()
+                .antMatchers("/print/export/entryStatisticsExportByDept").permitAll()
+                .antMatchers("/consoleByDept/leaveHosMRPageByDept").permitAll()
+                .antMatchers("/print/export/leaveHosMrPageExportByDept").permitAll()
+                .antMatchers("/consoleByDept/qcCheckStatisticsByDept").permitAll()
+                .antMatchers("/print/export/qcCheckStaExportByDept").permitAll()
+                .antMatchers("/consoleByDept/qcCheckMRPageByDept").permitAll()
+                .antMatchers("/print/export/qcCheckMRPageExportByDept").permitAll()
+                .antMatchers("/consoleByDept/hmImproveMRPageByDept").permitAll()
+                .antMatchers("/print/export/improveMRExportByDept").permitAll()
+                .antMatchers("/consoleByDept/reHos31DaysPageByDept").permitAll()
+                .antMatchers("/print/export/reHos31DaysPageExportByDept").permitAll()
+                .antMatchers("/consoleByDept/unModifyMRSByDept").permitAll()
+                .antMatchers("/print/export/unModifyMRSExportByDept").permitAll()
+                .antMatchers("/consoleByDept/unModifyMRPageByDept").permitAll()
+                .antMatchers("/print/export/unModifyMRPageExportByDept").permitAll()
+                .antMatchers("/consoleByDept/medicalCheckFormKs").permitAll()
+                .antMatchers("/print/export/medicalCheckExportByDept").permitAll()
+                .antMatchers("/consoleByDept/medicalCheckTitleKs").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }
-
-
     @Override
     public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
         log.info("Configuring ResourceServerSecurityConfigurer");

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

@@ -231,6 +231,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/data_str/sendRescueNote", request)
                 || matchers("/qc/data_str/sendPeriodConclusion", request)
                 || matchers("/qc/data_str/sendPreoperativeDiscussion", request)
+                || matchers("/qc/data_str/sendTalkInform", request)
+                || matchers("/qc/data_str/sendInformedConsent", request)
                 || matchers("/qc/doctoradvice/getPage", request)
                 || matchers("/qc/medPacsInfo/getCheckPage", request)
                 || matchers("/qc/medLisInfo/getExaminePage", request)
@@ -243,6 +245,37 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/badLevelPage", request)
                 || matchers("/console/export/badLevelPagePageExport", request)
                 || matchers("/qc/medNurse/getMedNursePage", request)
+                || matchers("/qc/behospitalInfo/exportQcresultByPerson", request)
+                || matchers("/consoleByDept/beHosCountByDept", request)
+                || matchers("/consoleByDept/casesEntryStatisticsByDept", request)
+                || matchers("/bas/doctor/getList", request)
+                || matchers("/consoleByDept/homePageOrGoodLevelByDept", request)
+                || matchers("/print/export/homePageLevelExportByDept", request)
+                || matchers("/print/export/homePageOrLevelExportByDept", request)
+                || matchers("/print/export/entryGroupExportByDeptPage", request)
+                || matchers("/print/export/entryGroupExportByDeptCase", request)
+                || matchers("/print/export/entryGroupExportByDeptEntry", request)
+                || matchers("/print/export/qcResultShortExportByDeptPage", request)
+                || matchers("/print/export/levelExportByDept", request)
+                || matchers("/consoleByDept/entryStatisticsByDept", request)
+                || matchers("/print/export/entryStatisticsExportByDept", request)
+                || matchers("/consoleByDept/leaveHosMRPageByDept", request)
+                || matchers("/print/export/leaveHosMrPageExportByDept", request)
+                || matchers("/consoleByDept/qcCheckStatisticsByDept", request)
+                || matchers("/print/export/qcCheckStaExportByDept", request)
+                || matchers("/consoleByDept/qcCheckMRPageByDept", request)
+                || matchers("/print/export/qcCheckMRPageExportByDept", request)
+                || matchers("/consoleByDept/hmImproveMRPageByDept", request)
+                || matchers("/print/export/improveMRExportByDept", request)
+                || matchers("/consoleByDept/reHos31DaysPageByDept", request)
+                || matchers("/print/export/reHos31DaysPageExportByDept", request)
+                || matchers("/consoleByDept/unModifyMRSByDept", request)
+                || matchers("/print/export/unModifyMRSExportByDept", request)
+                || matchers("/consoleByDept/unModifyMRPageByDept", request)
+                || matchers("/print/export/unModifyMRPageExportByDept", request)
+                || matchers("/consoleByDept/medicalCheckFormKs", request)
+                || matchers("/print/export/medicalCheckExportByDept", request)
+                || matchers("/consoleByDept/medicalCheckTitleKs", request)
                 || matchers("/", request)) {
             return true;
         }

+ 25 - 0
src/main/java/com/diagbot/dto/AdmissionCountDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/12/24 13:07
+ */
+@Getter
+@Setter
+public class AdmissionCountDTO {
+    //医生id
+    private String doctorId;
+    //主管医生
+    private String doctorName;
+    //科室id
+    private String deptId;
+    //科室名称
+    private String deptName;
+    //总人数
+    private Integer num;
+}

+ 8 - 0
src/main/java/com/diagbot/dto/DeptEntryNumDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -19,6 +20,7 @@ public class DeptEntryNumDTO {
     /**
      * 条目缺陷名称
      */
+    @Excel(name = "缺陷名称", width = 40, orderNum = "2")
     private String name;
     /**
      * 模块id
@@ -27,6 +29,7 @@ public class DeptEntryNumDTO {
     /**
      * 模块名称
      */
+    @Excel(name = "模块名称", width = 20, orderNum = "1")
     private String casesName;
     /**
      * 科室id
@@ -43,22 +46,27 @@ public class DeptEntryNumDTO {
     /**
      * 条目缺陷数
      */
+    @Excel(name = "数量", orderNum = "5")
     private Integer num = 0;
     /**
      * 条目缺陷占比
      */
+
     private Double percent = 0.00d;
     /**
      * 条目缺陷占比(百分比)
      */
+    @Excel(name = "缺陷占比", orderNum = "6")
     private String percentStr = "0.00%";
     /**
      * 条目缺陷分值
      */
+    @Excel(name = "分值", orderNum = "3")
     private Double score = 0d;
     /**
      * 单项否决标识
      */
+    @Excel(name = "单项否决", orderNum = "4", replace = { "否_0", "是_1" })
     private Integer isReject;
     /**
      * 规则类型(0:无,1:空项,2:错误)

+ 177 - 0
src/main/java/com/diagbot/dto/EntryStasByDeptDTO.java

@@ -0,0 +1,177 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/6/18 20:17
+ */
+@Getter
+@Setter
+public class EntryStasByDeptDTO {
+    /**
+     * 科室id(科室编码)
+     */
+    private String deptId;
+    /**
+     * 主治医生
+     */
+    @Excel(name = "主管医生", width = 30, orderNum = "1")
+    private String doctorName;
+    /**
+     * 未在24小时内完成会诊数
+     */
+    @Excel(name = "未在24小时内完成会诊数", width = 15, orderNum = "2")
+    private Integer consultationNum = 0;
+    /**
+     * 未在24小时内完成会诊条目id
+     */
+    private Long consultationEntryId = 2511L;
+    /**
+     * 未在24小时内完成会诊条目名称
+     */
+    private String consultationEntryName = "普通会诊未在24小时内完成";
+    /**
+     * 未在24小时内完成会诊率
+     */
+    private Double consultationPercent = 0.00d;
+    /**
+     * 未在24小时内完成会诊率(百分比)
+     */
+    @Excel(name = "未在24小时内完成会诊率", width = 15, orderNum = "3")
+    private String consultationPercentStr = "0.00%";
+    /**
+     * 会诊病历数
+     */
+    private Integer consultationMRNum = 0;
+    /**
+     * 手术记录名称不匹配条目id
+     */
+    private Long operationNameEntryId = 2594L;
+    /**
+     * 手术记录名称不匹配条目名称
+     */
+    private String operationNameEntryName = "首页手术名称与手术记录不一致";
+    /**
+     * 手术记录名称不匹配数
+     */
+    @Excel(name = "手术记录名称不匹配数", width = 15, orderNum = "4")
+    private Integer operationNameNum = 0;
+    /**
+     * 手术记录名称不匹配率
+     */
+    private Double operationNamePercent = 0.00d;
+    /**
+     * 手术记录名称不匹配率(百分比)
+     */
+    @Excel(name = "手术记录名称不匹配率", width = 15, orderNum = "5")
+    private String operationNamePercentStr = "0.00%";
+    /**
+     * 术后首程未在15分钟内完成条目id
+     */
+    private Long operation15MinuteEntryId = 2930L;
+    /**
+     * 术后首程未在15分钟内完成条目名称
+     */
+    private String operation15MinuteEntryName = "术后首次病程未即刻完成";
+    /**
+     * 术后首程未在15分钟内完成数
+     */
+    @Excel(name = "术后首程未在15分钟内完成数", width = 15, orderNum = "6")
+    private Integer operation15MinuteNum = 0;
+    /**
+     * 术后首程未在15分钟内完成率
+     */
+    private Double operation15MinutePercent = 0.00d;
+    /**
+     * 术后首程未在15分钟内完成率(百分比)
+     */
+    @Excel(name = "术后首程未在15分钟内完成率", width = 15, orderNum = "7")
+    private String operation15MinutePercentStr = "0.00%";
+    /**
+     * 病案首页手术时间不匹配条目id
+     */
+    private Long operationTimeEntryId = 2973L;
+    /**
+     * 病案首页手术时间不匹配条目名称
+     */
+    private String operationTimeEntryName = "手术日期与手术记录中手术日期不一致";
+    /**
+     * 病案首页手术时间不匹配数
+     */
+    @Excel(name = "病案首页手术时间不匹配数", width = 15, orderNum = "8")
+    private Integer operationTimeNum = 0;
+    /**
+     * 病案首页手术时间不匹配率
+     */
+    private Double operationTimePercent = 0.00;
+    /**
+     * 病案首页手术时间不匹配率(百分比)
+     */
+    @Excel(name = "病案首页手术时间不匹配率", width = 15, orderNum = "9")
+    private String operationTimePercentStr = "0.00%";
+    /**
+     * 手术记录病历数
+     */
+    private Integer operationMRNum = 0;
+    /**
+     * 未在6小时内书写危急值条目id
+     */
+    private Long crisisEntryId = 2419L;
+    /**
+     * 未在6小时内书写危急值条目名称
+     */
+    private String crisisEntryName = "危急值记录未在接到危急值报告后6小时内完成";
+    /**
+     * 未在6小时内书写危急值记录数
+     */
+    @Excel(name = "未在6小时内书写危急值记录数", width = 15, orderNum = "10")
+    private Integer crisisNum = 0;
+    /**
+     * 未在6小时内书写危急值记录率
+     */
+    private Double crisisPercent = 0.00d;
+    /**
+     * 未在6小时内书写危急值记录率(百分比)
+     */
+    @Excel(name = "未在6小时内书写危急值记录率", width = 15, orderNum = "11")
+    private String crisisPercentStr = "0.00%";
+    /**
+     * 危急值记录病历数
+     */
+    private Integer crisisMRNum = 0;
+    /**
+     * 住院超过31日病人数
+     */
+    @Excel(name = "住院超过31日病人数", width = 15, orderNum = "12")
+    private Integer beHosGT31DaysMRNum;
+    /**
+     * 阶段小节未书写条目id
+     */
+    private Long stageSummaryEntryId = 2495L;
+    /**
+     * 阶段小节未书写条目名称
+     */
+    private String stageSummaryEntryName = "无阶段小结";
+    /**
+     * 阶段小节未书写数
+     */
+    @Excel(name = "阶段小节未书写数", width = 15, orderNum = "13")
+    private Integer stageSummaryNum = 0;
+    /**
+     * 阶段小节未书写率
+     */
+    private Double stageSummaryPercent = 0.00d;
+    /**
+     * 阶段小节未书写率(百分比)
+     */
+    @Excel(name = "阶段小节未书写率", width = 15, orderNum = "14")
+    private String stageSummaryPercentStr = "0.00%";
+    /**
+     * 病人住院超过30天的病历数
+     */
+    private Integer stageSummaryMRNum = 0;
+}

+ 34 - 0
src/main/java/com/diagbot/dto/ExportExcelBehByDeptDTO.java

@@ -0,0 +1,34 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:35
+ */
+@Getter
+@Setter
+public class ExportExcelBehByDeptDTO {
+    @Excel(name = "患者姓名", needMerge = true)
+    private String patName;
+    @Excel(name = "住院号", needMerge = true)
+    private String behospitalCode;
+    @Excel(name = "入院时间", needMerge = true, exportFormat = "yyyy/MM/dd")
+    private Date behospitalDate;
+    @Excel(name = "出院时间", needMerge = true, exportFormat = "yyyy/MM/dd")
+    private Date leaveHospitalDate;
+    @Excel(name = "分数", needMerge = true)
+    private Double score;
+    @Excel(name = "病案首页分数", needMerge = true)
+    private Double scoreBn;
+    @ExcelCollection(name = "")
+    private List<ExportExcelCaseDTO> exportExcelCaseDTOS;
+
+}

+ 1 - 1
src/main/java/com/diagbot/dto/ExportExcelBehospitalDTO.java

@@ -17,7 +17,7 @@ import java.util.List;
 @Setter
 public class ExportExcelBehospitalDTO {
     @Excel(name = "主管医生", needMerge = true)
-    private String behDoctorName;
+    private String doctorName;
     @Excel(name = "患者姓名", needMerge = true)
     private String patName;
     @Excel(name = "住院号", needMerge = true)

+ 28 - 0
src/main/java/com/diagbot/dto/ExportExcelByDeptDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:00
+ */
+@Getter
+@Setter
+public class ExportExcelByDeptDTO {
+//    @Excel(name = "科室", needMerge = true)
+    private String behDeptName;
+    @Excel(name = "主管医生", needMerge = true)
+    private String doctorName;
+    @Excel(name = "平均分数", needMerge = true)
+    private Double avgScore;
+    @ExcelCollection(name = "")
+    private List<ExportExcelBehByDeptDTO> excelBehospitalDTOS;
+
+
+}

+ 29 - 0
src/main/java/com/diagbot/dto/ExportExcelWideBehByDeptDTO.java

@@ -0,0 +1,29 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:35
+ */
+@Getter
+@Setter
+public class ExportExcelWideBehByDeptDTO {
+    @Excel(name = "患者姓名", needMerge = true)
+    private String patName;
+    @Excel(name = "住院号", needMerge = true)
+    private String behospitalCode;
+    @Excel(name = "入院时间", needMerge = true, exportFormat = "yyyy/MM/dd")
+    private Date behospitalDate;
+    @Excel(name = "出院时间", needMerge = true, exportFormat = "yyyy/MM/dd")
+    private Date leaveHospitalDate;
+    @Excel(name = "分数", needMerge = true)
+    private Double score;
+    @Excel(name = "病案首页分数", needMerge = true)
+    private Double scoreBn;
+}

+ 1 - 1
src/main/java/com/diagbot/dto/ExportExcelWideBehospitalDTO.java

@@ -13,7 +13,7 @@ import java.util.Date;
 @Setter
 public class ExportExcelWideBehospitalDTO {
     @Excel(name = "主管医生", needMerge = true)
-    private String behDoctorName;
+    private String doctorName;
     @Excel(name = "患者姓名", needMerge = true)
     private String patName;
     @Excel(name = "住院号", needMerge = true)

+ 23 - 0
src/main/java/com/diagbot/dto/ExportNinetyByDeptDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:00
+ */
+@Getter
+@Setter
+public class ExportNinetyByDeptDTO {
+    @Excel(name = "科室", needMerge = true)
+    private String behDeptName;
+    @ExcelCollection(name = "")
+    private List<ExportWideExcelByDeptDTO> exportExcelByDeptDTOS;
+
+}

+ 23 - 0
src/main/java/com/diagbot/dto/ExportSevenByDeptDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:00
+ */
+@Getter
+@Setter
+public class ExportSevenByDeptDTO {
+    @Excel(name = "科室", needMerge = true)
+    private String behDeptName;
+    @ExcelCollection(name = "")
+    private List<ExportExcelByDeptDTO> exportExcelByDeptDTOS;
+
+}

+ 28 - 0
src/main/java/com/diagbot/dto/ExportWideExcelByDeptDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:00
+ */
+@Getter
+@Setter
+public class ExportWideExcelByDeptDTO {
+//    @Excel(name = "科室", needMerge = true)
+    private String behDeptName;
+    @Excel(name = "主管医生", needMerge = true)
+    private String doctorName;
+    @Excel(name = "平均分数", needMerge = true)
+    private Double avgScore;
+    @ExcelCollection(name = "" )
+    private List<ExportExcelWideBehByDeptDTO> excelBehospitalDTOS;
+
+
+}

+ 118 - 0
src/main/java/com/diagbot/dto/HomePageByDeptDTO.java

@@ -0,0 +1,118 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:病案首页合格率占比返回结构
+ * @Author:zhaops
+ * @time: 2020/6/5 17:32
+ */
+@Getter
+@Setter
+public class HomePageByDeptDTO {
+    /**
+     * 科室id(科室编码)
+     */
+    private String deptId;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+    /**
+     * 主管医生id
+     */
+    private String doctorId;
+    /**
+     * 主管医生名称
+     */
+    @Excel(name = "主管医生", width = 30, orderNum = "1")
+    private String doctorName;
+    /**
+     * 缺陷条目数
+     */
+    @Excel(name = "缺陷总数", orderNum = "2")
+    private Integer entryNum = 0;
+    /**
+     * 病案首页不合格病历数
+     */
+    @Excel(name = "不合格数", orderNum = "3")
+    private Integer secondLevelNum = 0;
+    /**
+     * 质控病历数
+     */
+    @Excel(name = "质控病历数", orderNum = "11")
+    private Integer mrNum = 0;
+    /**
+     * 质控评分(总分)
+     */
+    private Double totleValue = 0d;
+    /**
+     * 质控评分(平均分)
+     */
+    @Excel(name = "质控平均分", orderNum = "10")
+    private Double averageValue = 0d;
+    /**
+     * 病案首页合格病历数
+     */
+    @Excel(name = "合格数", orderNum = "4")
+    private Integer firstLevelNum = 0;
+    /**
+     * 病案首页合格病历占比
+     */
+    private Double firstLevelPercent = 0.00d;
+    /**
+     * 病案首页不合格病历占比
+     */
+    private Double secondLevelPercent = 0.00d;
+    /**
+     * 病案首页合格病历占比(百分比)
+     */
+    @Excel(name = "合格率", orderNum = "5")
+    private String firstLevelPercentStr = "0.00%";
+    /**
+     * 病案首页不合格病历占比(百分比)
+     */
+    private String secondLevelPercentStr = "0.00%";
+    /**
+     * 上级科室id(上级科室编码)
+     */
+    private String deptClassId;
+    /**
+     * 上级科室名称
+     */
+    private String deptClass;
+    /**
+     * 空项数
+     */
+    @Excel(name = "空项数", orderNum = "6")
+    private Integer emptyNum = 0;
+    /**
+     * 错误数
+     */
+    @Excel(name = "错误数", orderNum = "8")
+    private Integer errorNum = 0;
+    /**
+     * 完整率、完善率分母(质控病历数*病案首页条目数)
+     */
+    private Integer entryTotleNum = 0;
+    /**
+     * 完整率
+     */
+    private Double emptyPercent = 0.00d;
+    /**
+     * 完善率
+     */
+    private Double errorPercent = 0.00d;
+    /**
+     * 完整率(百分比)
+     */
+    @Excel(name = "完整率", orderNum = "7")
+    private String emptyPercentStr = "0.00%";
+    /**
+     * 完善率(百分比)
+     */
+    @Excel(name = "完善率", orderNum = "9")
+    private String errorPercentStr = "0.00%";
+}

+ 89 - 0
src/main/java/com/diagbot/dto/ImproveByDeptDTO.java

@@ -0,0 +1,89 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/6 20:03
+ */
+@Getter
+@Setter
+public class ImproveByDeptDTO {
+    /**
+     * 科室编码
+     */
+    private String deptId;
+
+    /**
+     * 主治医生
+     */
+    @Excel(name = "主治医生", width = 30)
+    private String doctorName;
+    /**
+     * 质控总数(总病历数)
+     */
+    @Excel(name = "质控总数", width = 10)
+    private Integer mrNum = 0;
+    /**
+     * 核查数量
+     */
+    @Excel(name = "核查数量", width = 10)
+    private Integer checkedNum = 0;
+    /**
+     * 核查占比
+     */
+    private Double checkedPercent = 0d;
+    /**
+     * 核查占比(百分比)
+     */
+    private String checkedPercentStr = "0.00%";
+    /**
+     * 有病案首页的病历数
+     */
+    private Integer homePageMRNum = 0;
+    /**
+     * 已改善数量
+     */
+    @Excel(name = "已改善数量", width = 10)
+    private Integer improveNum = 0;
+    /**
+     * 改善率
+     */
+    private Double improvePercent = 0d;
+    /**
+     * 改善率(百分比)
+     */
+    @Excel(name = "改善率", width = 10)
+    private String improvePercentStr = "0.00%";
+    /**
+     * 改善至合格数量
+     */
+    @Excel(name = "改善至合格数量", width = 15)
+    private Integer improveToPassNum = 0;
+    /**
+     * 改善至合格率
+     */
+    private Double improveToPassPercent = 0d;
+    /**
+     * 改善至合格率(百分比)
+     */
+    @Excel(name = "改善至合格率", width = 15)
+    private String improveToPassPercentStr = "0.00%";
+    /**
+     * 改善至满分数量
+     */
+    @Excel(name = "改善至满分数量", width = 15)
+    private Integer improveToFullNum = 0;
+    /**
+     * 改善至满分率
+     */
+    private Double improveToFullPercent = 0d;
+    /**
+     * 改善至满分率(百分比)
+     */
+    @Excel(name = "改善至满分率", width = 15)
+    private String improveToFullPercentStr = "0.00%";
+}

+ 26 - 0
src/main/java/com/diagbot/dto/ImproveExportByDeptDTO.java

@@ -0,0 +1,26 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/6 20:03
+ */
+@Getter
+@Setter
+public class ImproveExportByDeptDTO {
+
+    /**
+     * 科室
+     */
+    @Excel(name = "科室", width = 30,needMerge = true)
+    private String deptName;
+    @ExcelCollection(name = "")
+    private List<ImproveByDeptDTO> improveByDeptDTOS;
+}

+ 289 - 0
src/main/java/com/diagbot/dto/LevelStsByDeptDTO.java

@@ -0,0 +1,289 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:各科室缺陷占比返回结构
+ * @Author:zhaops
+ * @time: 2020/5/19 16:04
+ */
+@Getter
+@Setter
+public class LevelStsByDeptDTO {
+    /**
+     * 科室id(科室编码)
+     */
+//    @Excel(name = "科室编码", orderNum = "0")
+    private String deptId;
+    /**
+     * 科室名称
+     */
+
+    private String deptName;
+    /**
+     * 主管医生id
+     */
+    private String doctorId;
+    /**
+     * 主管医生名称
+     */
+    @Excel(name = "主管医生", width = 30, orderNum = "2")
+    private String doctorName;
+    /**
+     * 缺陷条目数
+     */
+    private Integer entryNum = 0;
+
+    /**
+     * 缺陷条目数-带升降标示
+     */
+    @Excel(name = "缺陷总数", orderNum = "3")
+    private String entryStrNum = "0";
+
+    /**
+     * 同比总数
+     */
+    private Integer sameNum = 0;
+
+    /**
+     * 同比总数-带升降标示
+     */
+    @Excel(name = "同比总数", orderNum = "4")
+    private String sameStrNum = "0";
+
+    /**
+     * 缺陷条目数现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer entrySameNum = 0;
+
+    /**
+     * 质控病历数
+     */
+    private Integer mrNum = 0;
+
+    /**
+     * 质控病历数-带升降标示
+     */
+    @Excel(name = "质控病历数", orderNum = "7")
+    private String mrStrNum = "0";
+
+    /**
+     * 同比病历数
+     */
+    private Integer sameMrNum= 0;
+
+    /**
+     * 同比病历数-带升降标示
+     */
+    @Excel(name = "同比质控数", orderNum = "8")
+    private String sameMrStrNum = "0";
+
+    /**
+     * 质控病历数现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer mrSameNum = 0;
+
+    /**
+     * 质控评分(总分)
+     */
+    private Double totleValue = 0d;
+
+    /**
+     * 同比质控评分(总分)
+     */
+    private Double sameTotleValue= 0d;
+
+
+    /**
+     * 质控评分(平均分)
+     */
+    private Double averageValue = 0d;
+
+    /**
+     * 质控评分(平均分)-带升降标示
+     */
+    @Excel(name = "质控平均分", orderNum = "5")
+    private String averageStrValue = "0";
+
+    /**
+     * 同比评分(平均分)
+     */
+    private Double sameAvgValue = 0d;
+
+    /**
+     * 同比评分(平均分)-带升降标示
+     */
+    @Excel(name = "同比平均分", orderNum = "6")
+    private String sameAvgStrValue = "0";
+
+    /**
+     * 质控评分现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer avSameValue = 0;
+
+    /**
+     * 甲级病历数/病案首页合格病历数
+     */
+    private Integer firstLevelNum = 0;
+
+    /**
+     * 甲级病历数/病案首页合格病历数-带升降标示
+     */
+    @Excel(name = "甲级病历数", orderNum = "9")
+    private String firstLevelStrNum = "0";
+
+    /**
+     * 同比甲级病历数/病案首页合格病历数
+     */
+    private Integer sameFirstLevelNum = 0;
+
+    /**
+     * 同比甲级病历数/病案首页合格病历数-带升降标示
+     */
+    @Excel(name = "同比甲级数", orderNum = "10")
+    private String sameFirstLevelStrNum = "0";
+
+    /**
+     * 甲级病历数现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer firSameLevelNum = 0;
+
+    /**
+     * 乙级病历数/病案首页不合格病历数
+     */
+    private Integer secondLevelNum = 0;
+
+    /**
+     * 乙级病历数/病案首页不合格病历数-带升降标示
+     */
+    @Excel(name = "乙级病历数", orderNum = "11")
+    private String secondLevelStrNum = "0";
+
+    /**
+     * 同比乙级病历数/病案首页不合格病历数
+     */
+    private Integer sameSecondLevelNum = 0;
+
+    /**
+     * 同比乙级病历数/病案首页不合格病历数-带升降标示
+     */
+    @Excel(name = "同比乙级数", orderNum = "12")
+    private String sameSecondLevelStrNum = "0";
+
+
+    /**
+     * 乙级病历数现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer secSameLevelNum = 0;
+
+    /**
+     * 丙级病历数
+     */
+    private Integer thirdLevelNum = 0;
+
+    /**
+     * 丙级病历数-带升降标示
+     */
+    @Excel(name = "丙级病历数", orderNum = "13")
+    private String thirdLevelStrNum = "0";
+
+    /**
+     * 同比丙级病历数
+     */
+    private Integer sameThirdLevelNum = 0;
+
+    /**
+     * 同比丙级病历数-带升降标示
+     */
+    @Excel(name = "同比丙级数", orderNum = "14")
+    private String sameThirdLevelStrNum = "0";
+
+    /**
+     * 丙级病历数现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer thiSameLevelNum = 0;
+
+    /**
+     * 甲级病历占比/病案首页合格病历占比
+     */
+    private Double firstLevelPercent = 0d;
+
+    /**
+     * 同比甲级病历占比/病案首页合格病历占比
+     */
+    private Double sameFirstLevelPercent = 0d;
+
+    /**
+     * 甲级病历占比现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer firSameLevelPercent = 0;
+
+    /**
+     * 乙级病历占比/病案首页不合格病历占比
+     */
+    private Double secondLevelPercent= 0d;
+
+    /**
+     * 同比乙级病历占比/病案首页不合格病历占比
+     */
+    private Double sameSecondLevelPercent = 0d;
+
+    /**
+     * 乙级病历占比现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer secSameLevelPercent = 0;
+
+    /**
+     * 丙级病历占比
+     */
+    private Double thirdLevelPercent= 0d;
+
+    /**
+     * 同比丙级病历占比
+     */
+    private Double sameThirdLevelPercent = 0d;
+
+    /**
+     * 丙级病历占比现有数据与同期数据对比(-1-降 0-持平 1-升)
+     */
+    private Integer thiSameLevelPercent = 0;
+
+    /**
+     * 甲级病历占比(百分比)/病案首页合格病历占比(百分比)
+     */
+    @Excel(name = "甲级率", orderNum = "15")
+    private String firstLevelPercentStr = "0.00%";
+
+    /**
+     * 同比甲级病历占比(百分比)/病案首页合格病历占比(百分比)
+     */
+    @Excel(name = "同比甲级率", orderNum = "16")
+    private String sameFirstLevelPercentStr = "0.00%";
+
+    /**
+     * 乙级病历占比(百分比)/病案首页不合格病历占比(百分比)
+     */
+    @Excel(name = "乙级率", orderNum = "17")
+    private String secondLevelPercentStr = "0.00%";
+
+    /**
+     * 同比乙级病历占比(百分比)/病案首页不合格病历占比(百分比)
+     */
+    @Excel(name = "同比乙级率", orderNum = "18")
+    private String sameSecondLevelPercentStr = "0.00%";
+
+    /**
+     * 丙级病历占比(百分比)
+     */
+    @Excel(name = "丙级率", orderNum = "19")
+    private String thirdLevelPercentStr = "0.00%";
+
+    /**
+     * 同比丙级病历占比(百分比)
+     */
+    @Excel(name = "同比丙级率", orderNum = "20")
+    private String sameThirdLevelPercentStr = "0.00%";
+
+}

+ 3 - 0
src/main/java/com/diagbot/dto/MedicalCheckDTO.java

@@ -27,6 +27,9 @@ public class MedicalCheckDTO{
     //医生
     private String doctorName;
 
+    //医疗组
+    private String doctorGroup;
+
     //入院记录未24小时内_id
     private String entry_2658_id;
 

+ 25 - 0
src/main/java/com/diagbot/dto/MedicalDeptDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:19
+ */
+@Getter
+@Setter
+public class MedicalDeptDTO {
+
+    //科室名称
+    @Excel(name = "科室",width = 18,needMerge = true,orderNum = "1")
+    private String deptName;
+
+    @ExcelCollection(name = "",orderNum = "2")
+    private List<MedicalDoDeptDTO> medicalDoctorExportDTOS;
+}

+ 25 - 0
src/main/java/com/diagbot/dto/MedicalDoDeptDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:19
+ */
+@Getter
+@Setter
+public class MedicalDoDeptDTO {
+
+    //医疗组
+    @Excel(name = "医疗组",needMerge = true,orderNum = "1")
+    private String doctorGroup;
+
+    @ExcelCollection(name = "",orderNum = "2")
+    private List<MedicalSeeByDeptDTO> medicalCheckTitleDTOS;
+}

+ 100 - 0
src/main/java/com/diagbot/dto/MedicalSeeByDeptDTO.java

@@ -0,0 +1,100 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:19
+ */
+@Getter
+@Setter
+public class MedicalSeeByDeptDTO {
+
+    //主管医生
+    @Excel(name = "主管医生",orderNum = "1")
+    private String doctorName ;
+
+    //入院记录未24小时内
+    @Excel(name = "入院记录24小时内",orderNum = "2")
+    private String ryjlw_24 ;
+
+    //首次病程记录未8小时内
+    @Excel(name = "首次病程记录8小时内",orderNum = "3")
+    private String scbcjlw_8h;
+
+    @Excel( name = "副主任/主任医师首次查房72小时内完成",orderNum = "4")
+    //副主任/主任医师首次查房72小时内未完成
+    private String zrsccfw_72h;
+
+    //入院后未连记3天病程
+    @Excel(name = "入院后连记3天病程(不包括术后首程)",orderNum = "5")
+    private String ryhljbcw_3d;
+
+    //每周至少2次副主任/主任医师查房
+    @Excel(name = "每周至少2次副主任/主任医师查房",orderNum = "6")
+    private String zrcfw_2w;
+
+    //每周至少3次主治医师查房记录
+    @Excel(name = "每周至少3次主治医师查房记录",orderNum = "7")
+    private String zzcfw_3w;
+
+    //抢救记录未6小时内完成
+    @Excel(name = "抢救记录6小时内完成",orderNum = "8")
+    private String qjjlw_6h;
+
+    //会诊记录在会诊申请后未24小时完成
+    @Excel(name = "会诊记录在会诊申请后24小时完成",orderNum = "9")
+    private String hzjlw_24h;
+
+    //术前讨论、术前小结未完成
+    @Excel(name = "术前讨论、术前小结完成",orderNum = "10")
+    private String sqtlxjw;
+
+    //手术记录术后24小时内未完成
+    @Excel(name = "手术记录术后24小时内完成",orderNum = "11")
+    private String sxjlsw_24h;
+
+    //术后首程在术后30分钟内未完成
+    @Excel(name = "术后首程在术后30分钟内完成",orderNum = "12")
+    private String xhscw_30m;
+
+    //术后主刀查房24小时内未完成
+    @Excel(name = "术后主刀查房24小时内完成",orderNum = "13")
+    private String shzdcfw_24h;
+
+    //术后未连记3天病程
+    @Excel(name = "术后连记3天病程(包括术后首程)",orderNum = "14")
+    private String shjbcw_3d;
+
+    //转科后未连记3天病程
+    @Excel(name = "转科后连记3天病程(包括专科记录)",orderNum = "15")
+    private String zkjbcw_3d;
+
+    //转接科记录专科后24小时内未完成
+    @Excel(name = "转接科记录专科后24小时内完成",orderNum = "16")
+    private String zkjlw_24;
+
+    //病危/重患者未每日记录病程
+    @Excel(name = "病危/重患者每日记录病程",orderNum = "17")
+    private String bwzhjlbcw_md;
+
+    //输血后未完成输血记录
+    @Excel(name = "输血后完成输血记录",orderNum = "18")
+    private String sxhwjl;
+
+    //24小时未完成输血后评价
+    @Excel(name = "24小时完成输血后评价",orderNum = "19")
+    private String sxpjw_24;
+
+    //危急值未记录
+    @Excel(name = "危急值记录",orderNum = "20")
+    private String wjzwjl;
+
+    //住院30天未阶段小结
+    @Excel(name = "住院30天阶段小结",orderNum = "21")
+    private String wywwcxj;
+
+}

+ 43 - 0
src/main/java/com/diagbot/dto/ReBeHosByDeptDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/16 13:43
+ */
+@Getter
+@Setter
+public class ReBeHosByDeptDTO {
+    /**
+     * 病案号
+     */
+    @Excel(name = "病案号", width = 20, needMerge = true, orderNum = "1")
+    private String fileCode;
+    /**
+     * 性别
+     */
+    @Excel(name = "性别", width = 10, needMerge = true, orderNum = "2")
+    private String sex;
+    /**
+     * 主诊断
+     */
+    @Excel(name = "主诊断", width = 50, needMerge = true, orderNum = "3")
+    private String diagnose;
+    /**
+     * 间隔天数
+     */
+    @Excel(name = "间隔天数", width = 10, needMerge = true, orderNum = "4")
+    private Integer diffDays;
+    /**
+     * 比较病历组
+     */
+    @ExcelCollection(name = "", orderNum = "5")
+    private List<ReBeHosDetailByDeptDTO> details;
+}

+ 76 - 0
src/main/java/com/diagbot/dto/ReBeHosDetailByDeptDTO.java

@@ -0,0 +1,76 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/16 15:17
+ */
+@Getter
+@Setter
+public class ReBeHosDetailByDeptDTO {
+    /**
+     * 病人住院号
+     */
+    @Excel(name = "病人住院号", width = 20, orderNum = "1")
+    private String behospitalCode;
+    /**
+     * 病人姓名
+     */
+    @Excel(name = "病人姓名", width = 20, orderNum = "2")
+    private String name;
+    /**
+     * 病历等级
+     */
+    @Excel(name = "病历等级", width = 10, orderNum = "3")
+    private String level;
+    /**
+     * 病历得分
+     */
+    @Excel(name = "病历得分", width = 10, orderNum = "4")
+    private Double scoreRes;
+    /**
+     * 科室编码
+     */
+    private String behDeptId;
+
+    /**
+     * 科室
+     */
+   // @Excel(name = "科室", width = 50, orderNum = "5")
+    private String behDeptName;
+
+    /**
+     * 主管医生
+     */
+    @Excel(name = "主管医生", width = 50, orderNum = "6")
+    private String doctorName;
+    /**
+     * 出院日期
+     */
+    @Excel(name = "出院日期", format = "yyyy-MM-dd", width = 30, orderNum = "7")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+    /**
+     * 入院日期
+     */
+    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
+    /**
+     * 住院天数
+     */
+    @Excel(name = "住院天数", width = 15, orderNum = "9")
+    private String behospitalDayNum;
+    /**
+     * 住院费用
+     */
+    @Excel(name = "住院费用", width = 15, orderNum = "10")
+    private String totleFee;
+}

+ 3 - 0
src/main/java/com/diagbot/dto/ReBeHosMergeDTO.java

@@ -18,6 +18,8 @@ public class ReBeHosMergeDTO {
     private String diagnose;
     private String name;
     private String sex;
+    private String doctorName;
+    private String doctorId;
     private String behDeptId;
     private String behDeptName;
     private String behospitalCode;
@@ -29,6 +31,7 @@ public class ReBeHosMergeDTO {
     private Date leaveHospitalDate;
     private String lastBehDeptId;
     private String lastBehDeptName;
+    private String lastDoctorName;
     private String lastBehospitalCode;
     private Double lastScoreRes;
     private String lastLevel;

+ 2 - 0
src/main/java/com/diagbot/dto/UnModifyMRDetailDTO.java

@@ -13,6 +13,8 @@ import lombok.Setter;
 public class UnModifyMRDetailDTO {
     private String deptId;
     private String deptName;
+    private String doctorId;
+    private String doctorName;
     private Long casesEntryId;
     private String casesEntryName;
     private Integer casesEntryNum;

+ 167 - 0
src/main/java/com/diagbot/entity/StrInformedConsent.java

@@ -0,0 +1,167 @@
+package com.diagbot.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-01-04
+ */
+public class StrInformedConsent implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 病历ID
+     */
+    private String recId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+
+    /**
+     * 文书内容(blob)
+     */
+    private String content;
+
+    /**
+     * 文书类别
+     */
+    private String recType;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    public String getRecId() {
+        return recId;
+    }
+
+    public void setRecId(String recId) {
+        this.recId = recId;
+    }
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getRecTitle() {
+        return recTitle;
+    }
+
+    public void setRecTitle(String recTitle) {
+        this.recTitle = recTitle;
+    }
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+    public String getRecType() {
+        return recType;
+    }
+
+    public void setRecType(String recType) {
+        this.recType = recType;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    @Override
+    public String toString() {
+        return "StrInformedConsent{" +
+            "recId=" + recId +
+            ", behospitalCode=" + behospitalCode +
+            ", hospitalId=" + hospitalId +
+            ", recTitle=" + recTitle +
+            ", content=" + content +
+            ", recType=" + recType +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+        "}";
+    }
+}

+ 167 - 0
src/main/java/com/diagbot/entity/StrTalkInform.java

@@ -0,0 +1,167 @@
+package com.diagbot.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-01-04
+ */
+public class StrTalkInform implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 病历ID
+     */
+    private String recId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+
+    /**
+     * 文书内容(blob)
+     */
+    private String content;
+
+    /**
+     * 文书类别
+     */
+    private String recType;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    public String getRecId() {
+        return recId;
+    }
+
+    public void setRecId(String recId) {
+        this.recId = recId;
+    }
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getRecTitle() {
+        return recTitle;
+    }
+
+    public void setRecTitle(String recTitle) {
+        this.recTitle = recTitle;
+    }
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+    public String getRecType() {
+        return recType;
+    }
+
+    public void setRecType(String recType) {
+        this.recType = recType;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    @Override
+    public String toString() {
+        return "StrTalkInform{" +
+            "recId=" + recId +
+            ", behospitalCode=" + behospitalCode +
+            ", hospitalId=" + hospitalId +
+            ", recTitle=" + recTitle +
+            ", content=" + content +
+            ", recType=" + recType +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+        "}";
+    }
+}

+ 100 - 0
src/main/java/com/diagbot/facade/BasDoctorInfoFacade.java

@@ -0,0 +1,100 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.BasDeptInfoDTO;
+import com.diagbot.entity.*;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.BasDoctorInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.BasDeptInfoVO;
+import com.diagbot.vo.data.BasDoctorInfoVO;
+import io.swagger.models.auth.In;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/12/24 14:38
+ */
+@Component
+public class BasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
+    @Autowired
+    SysUserDeptFacade sysUserDeptFacade;
+    @Autowired
+    BasDeptInfoFacade basDeptInfoFacade;
+    @Autowired
+    BehospitalInfoFacade behospitalInfoFacade;
+
+    /**
+     * 获取医院医生下拉列表信息
+     *
+     * @param basDoctorInfoVO
+     * @return 医院医生下拉列表信息
+     */
+    public List<BasDoctorInfo> getDoctorByDept(BasDoctorInfoVO basDoctorInfoVO) {
+            basDoctorInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+            basDoctorInfoVO.setUserId(Long.valueOf( SysUserUtils.getCurrentPrincipleID()));
+            QueryWrapper<SysUserDept> userDeptWrapper = new QueryWrapper<>();
+            List<BehospitalInfo> list = new ArrayList<>();
+            List<BasDoctorInfo> doctorData = new ArrayList<>();
+                    userDeptWrapper.eq("hospital_id",basDoctorInfoVO.getHospitalId());
+            userDeptWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+            userDeptWrapper.eq("user_id",basDoctorInfoVO.getUserId());
+            List<SysUserDept> UserDeptlist = sysUserDeptFacade.list(userDeptWrapper);
+            Set<String> deptSet = new HashSet<String>();
+
+        if(ListUtil.isNotEmpty(UserDeptlist)){
+                UserDeptlist.forEach(sysUserDept->{
+                    deptSet.add(sysUserDept.getDeptId());
+                });
+                QueryWrapper<BasDeptInfo> deptInfo = new QueryWrapper<>();
+                deptInfo.eq("hospital_id",basDoctorInfoVO.getHospitalId());
+                deptInfo.eq("is_deleted", IsDeleteEnum.N.getKey());
+                deptInfo.eq("dept_name",basDoctorInfoVO.getDeptName());
+                deptInfo.in("dept_id",deptSet);
+                List<BasDeptInfo> listInfo = basDeptInfoFacade.list(deptInfo);
+                Set<String> deptSetInfo = new HashSet<String>();
+                if(ListUtil.isNotEmpty(listInfo)){
+                    listInfo.forEach(basDeptInfo->{
+                        deptSetInfo.add(basDeptInfo.getDeptId());
+                    });
+                QueryWrapper<BehospitalInfo> QueryWrapper = new QueryWrapper<>();
+                QueryWrapper.eq("hospital_id",basDoctorInfoVO.getHospitalId());
+                QueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+                QueryWrapper.eq("is_placefile", basDoctorInfoVO.getIsPlacefile());
+                QueryWrapper.in("beh_dept_id",deptSetInfo);
+
+                if(StringUtils.isNotEmpty(basDoctorInfoVO.getInputStr())){
+                    QueryWrapper.like("doctor_name",basDoctorInfoVO.getInputStr());
+                }
+                QueryWrapper.groupBy("doctor_name");
+                QueryWrapper.orderByAsc("doctor_name");
+                list = behospitalInfoFacade.list(QueryWrapper);
+                if(ListUtil.isNotEmpty(list)){
+                    list.forEach(behospitalInfo -> {
+                                if(behospitalInfo!= null && StringUtils.isNotEmpty(behospitalInfo.getDoctorName())){
+                                    BasDoctorInfo basDoctorInfo = new BasDoctorInfo();
+                                    basDoctorInfo.setHospitalId(behospitalInfo.getHospitalId());
+                                    basDoctorInfo.setDoctorId(behospitalInfo.getDoctorId());
+                                    basDoctorInfo.setName(behospitalInfo.getDoctorName());
+                                    doctorData.add(basDoctorInfo);
+                                }
+                            }
+                    );
+                }
+
+            }
+        }
+
+            return doctorData;
+    }
+}

+ 30 - 2
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -1865,7 +1865,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                     List<ExportExcelWideBehospitalDTO> exportExcelWideBehospitalDTOs = new ArrayList<>();
                         excelBehospitalDTOS.forEach(exportExcelBehospitalDTO->{
                         ExportExcelWideBehospitalDTO exportExcelWideBehospitalDTO = new ExportExcelWideBehospitalDTO();
-                            exportExcelWideBehospitalDTO.setBehDoctorName(exportExcelBehospitalDTO.getBehDoctorName());
+                            exportExcelWideBehospitalDTO.setDoctorName(exportExcelBehospitalDTO.getDoctorName());
                             exportExcelWideBehospitalDTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
                             exportExcelWideBehospitalDTO.setBehospitalDate(exportExcelBehospitalDTO.getBehospitalDate());
                             exportExcelWideBehospitalDTO.setLeaveHospitalDate(exportExcelBehospitalDTO.getLeaveHospitalDate());
@@ -1881,6 +1881,34 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return resWide;
     }
 
+    /**
+     * 个人质控结果导出
+     *
+     * @param response
+     * @param exportQcresultVO
+     */
+    public void exportQcresultByPerson(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        exportQcresultVO.setHospitalId(hospitalId);
+        exportQcresultVO.setUserId(Long.valueOf(userId));
+        //时间设置
+        exportQcresultVOSet(exportQcresultVO);
+        List<ExportExcelDTO> res = this.exportQcresultByPerson(exportQcresultVO);
+        List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
+        if("2".equals(exportQcresultVO.getRadioCheck())){
+            resWide = transList(res, resWide);
+        }
+        String fileName = "抽查住院病历质量情况.xls";
+        response.setContentType("text/html;charset=UTF-8");
+        if("1".equals(exportQcresultVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
+        }
+        if("2".equals(exportQcresultVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
+        }
+    }
+
     /**
      * 科室质控结果导出
      *
@@ -1939,7 +1967,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     private void exportQcresultVOSet(ExportQcresultVO exportQcresultVO) {
         //入参验证
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90l * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
         //入院时间
         if (null != exportQcresultVO && null != exportQcresultVO.getBehosDateStart() && null != exportQcresultVO.getBehosDateEnd()) {
             Date startDate = exportQcresultVO.getBehosDateStart();

+ 660 - 0
src/main/java/com/diagbot/facade/ConsoleByDeptExportFacade.java

@@ -0,0 +1,660 @@
+package com.diagbot.facade;
+
+import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.*;
+import com.diagbot.entity.SysHospitalSet;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.*;
+import com.diagbot.vo.*;
+import com.google.common.collect.Lists;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description: 报表导出装饰层
+ * @author: gaodm
+ * @time: 2020/6/18 10:41
+ */
+@Component
+public class ConsoleByDeptExportFacade {
+
+    @Autowired
+    private ConsoleByDeptFacade consoleByDeptFacade;
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+    @Autowired
+    private SysHospitalSetFacade sysHospitalSetFacade;
+    @Autowired
+    private FilterFacade filterFacade;
+    @Autowired
+    private QcresultInfoFacade qcresultInfoFacade;
+
+
+    /**
+     * 病案首页合格率占比
+     *
+     * @param filterOrderByDeptVO
+     * @return
+     */
+    public void homePageLevelExportByDept(HttpServletResponse response, FilterOrderByDeptVO filterOrderByDeptVO) {
+        List<HomePageByDeptDTO> res = consoleByDeptFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
+        String fileName = "病案首页合格率占比.xls";
+        ExcelUtils.exportExcel(res, null, "sheet1", HomePageByDeptDTO.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 病案首页不合格/合格数
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void homePageOrLevelExportByDept(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        solveParam(qcResultShortPageVO);
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.homePageOrLevelExportByDept(qcResultShortPageVO);
+        List<ExportSevenByDeptDTO> resDTO = new ArrayList<ExportSevenByDeptDTO>();
+        if(ListUtil.isNotEmpty(records)){
+                ExportSevenByDeptDTO exportByDeptDTO = new ExportSevenByDeptDTO();
+                exportByDeptDTO.setBehDeptName(records.get(0).getBehDeptName());
+                exportByDeptDTO.setExportExcelByDeptDTOS(records);
+            resDTO.add(exportByDeptDTO);
+        }
+
+        List<ExportNinetyByDeptDTO> resWide = new ArrayList<ExportNinetyByDeptDTO>();
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            resWide = transList(records, resWide);
+        }
+        String fileName = null;
+        if("不合格数".equals(qcResultShortPageVO.getTitleName())){
+            fileName = "病案首页不合格数病历详情页.xls";
+        }else{
+            fileName = "病案首页合格数病历详情页.xls";
+        }
+        if("1".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
+        }
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportNinetyByDeptDTO.class, fileName, response);
+        }
+   }
+
+    /**
+     * 缺陷详情-科室(分页)导出
+     *
+     * @param filterPageByDeptVO
+     * @return
+     */
+    public void entryGroupExportByDeptPage(HttpServletResponse response,FilterPageByDeptVO filterPageByDeptVO) {
+        filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
+        filterPageByDeptVO.setCurrent(1L);
+        filterPageByDeptVO.setSize(Long.MAX_VALUE);
+        filterPageByDeptVO.setSearchCount(false);
+        IPage<EntryNumGroupDTO> page = qcresultInfoFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
+        String fileName = "缺陷详情.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", EntryNumGroupDTO.class, fileName, response, 12.8f);
+    }
+
+
+    /**
+     *  各模块缺陷占比导出-科室
+     *
+     * @param filterPageByDeptVO
+     * @return
+     */
+    public void entryGroupExportByDeptCase(HttpServletResponse response,FilterPageByDeptVO filterPageByDeptVO) {
+        filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
+        filterPageByDeptVO.setCurrent(1L);
+        filterPageByDeptVO.setSize(Long.MAX_VALUE);
+        filterPageByDeptVO.setSearchCount(false);
+        IPage<NumDTO> page = qcresultInfoFacade.entryCountGroupByCaseAndDeptPage(filterPageByDeptVO);
+        String fileName = "各模块缺陷详情.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", NumDTO.class, fileName, response, 12.8f);
+    }
+
+    /**
+     *  条目缺陷占比(内页)-科室
+     *
+     * @param filterPageByDeptVO
+     * @return
+     */
+    public void entryGroupByEntryDeptPage(HttpServletResponse response,FilterPageByDeptVO filterPageByDeptVO) {
+        filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
+        filterPageByDeptVO.setCurrent(1L);
+        filterPageByDeptVO.setSize(Long.MAX_VALUE);
+        filterPageByDeptVO.setSearchCount(false);
+        IPage<DeptEntryNumDTO> page = qcresultInfoFacade.entryGroupByEntryAndDeptInnerPage(filterPageByDeptVO);
+        String fileName = "条目缺陷占比详情.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", DeptEntryNumDTO.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 缺陷详情质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void qcResultShortByDeptPageExport(HttpServletResponse response,QcResultShortPageVO qcResultShortPageVO) {
+        filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
+        nineTytime(qcResultShortPageVO);
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.qcResultShortByDeptPageExport(qcResultShortPageVO);
+        //带缺陷
+        List<ExportSevenByDeptDTO> resDTO = new ArrayList<ExportSevenByDeptDTO>();
+        if(ListUtil.isNotEmpty(records)){
+            ExportSevenByDeptDTO exportByDeptDTO = new ExportSevenByDeptDTO();
+            exportByDeptDTO.setBehDeptName(records.get(0).getBehDeptName());
+            exportByDeptDTO.setExportExcelByDeptDTOS(records);
+            resDTO.add(exportByDeptDTO);
+        }
+        String fileName = "缺陷详情质控评分.xls";
+        ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
+
+    }
+         public void nineTytime(QcResultShortPageVO qcResultShortPageVO){
+            Date startDate = qcResultShortPageVO.getStartDate();
+            Date endDate = qcResultShortPageVO.getEndDate();
+            //时间间隔90天
+            long interval = 90 * 24l * 60l * 60l * 1000l;
+            if (endDate.getTime() < startDate.getTime()) {
+                throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+            }
+            if (endDate.getTime() - startDate.getTime() > interval) {
+                throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
+            }
+        };
+
+    /**
+     * 各科室缺陷占比-科室(组合)
+     *
+     * @param  filterOrderVO
+     * @return
+     */
+    public void levelByDeptExport(HttpServletResponse response,FilterOrderVO filterOrderVO) {
+        filterFacade.filterOrderVOSame(filterOrderVO);
+        List<LevelStsByDeptDTO> records = behospitalInfoFacade.levelStatisticsByDept(filterOrderVO);
+        if(ListUtil.isNotEmpty(records)){
+            for (LevelStsByDeptDTO record : records) {
+                BigDecimalStrExport(record);
+            }
+        }
+        String fileName = "各科室缺陷占比-科室.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", LevelStsByDeptDTO.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 关键条目缺陷占比统计导出-科室
+     *
+     * @param  entryStatisticsVO
+     * @return
+     */
+    public void entryStatisticsByDeptExport(HttpServletResponse response,EntryStatisticsVO entryStatisticsVO) {
+        List<EntryStasByDeptDTO> records = behospitalInfoFacade.entryStatisticsByDept(entryStatisticsVO);
+        String fileName = "关键条目缺陷占比统计导出.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", EntryStasByDeptDTO.class, fileName, response, 12.8f);
+    }
+    /**
+     * 出院人数统计导出-科室
+     *
+     * @param  qcResultShortPageVO
+     * @return
+     */
+    public void leaveHosMrPageExportByDept(HttpServletResponse response,QcResultShortPageVO qcResultShortPageVO) {
+        solveParam(qcResultShortPageVO);
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.leaveHosMRPageExportByDept(qcResultShortPageVO);
+        List<ExportSevenByDeptDTO> resDTO = new ArrayList<ExportSevenByDeptDTO>();
+        if(ListUtil.isNotEmpty(records)){
+            ExportSevenByDeptDTO exportByDeptDTO = new ExportSevenByDeptDTO();
+            exportByDeptDTO.setBehDeptName(records.get(0).getBehDeptName());
+            exportByDeptDTO.setExportExcelByDeptDTOS(records);
+            resDTO.add(exportByDeptDTO);
+        }
+
+        List<ExportNinetyByDeptDTO> resWide = new ArrayList<ExportNinetyByDeptDTO>();
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            resWide = transList(records, resWide);
+        }
+        String fileName = "出院人数统计.xls";
+        if("1".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
+        }
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportNinetyByDeptDTO.class, fileName, response);
+        }
+    }
+    /**
+     * 质控核查统计导出-科室
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public void qcCheckStaExportByDept(HttpServletResponse response, FilterOrderVO filterOrderVO) {
+        List<ImproveByDeptDTO> record =consoleByDeptFacade.qcCheckStatisticsByDept(filterOrderVO);
+        ArrayList<ImproveExportByDeptDTO> records = new ArrayList<>();
+        ImproveExportByDeptDTO improveExportByDeptDTO = new ImproveExportByDeptDTO();
+        if(ListUtil.isNotEmpty(record)){
+            improveExportByDeptDTO.setDeptName(filterOrderVO.getDeptName());
+            improveExportByDeptDTO.setImproveByDeptDTOS(record);
+            records.add(improveExportByDeptDTO);
+        }
+
+        String fileName = "质控核查统计.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", ImproveExportByDeptDTO.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 质控核查质控评分页-科室 导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void qcCheckMRPageExportByDept(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        solveParam(qcResultShortPageVO);
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.qcCheckMRPageExportByDept(qcResultShortPageVO);
+        List<ExportSevenByDeptDTO> resDTO = new ArrayList<ExportSevenByDeptDTO>();
+        if(ListUtil.isNotEmpty(records)){
+            ExportSevenByDeptDTO exportByDeptDTO = new ExportSevenByDeptDTO();
+            exportByDeptDTO.setBehDeptName(records.get(0).getBehDeptName());
+            exportByDeptDTO.setExportExcelByDeptDTOS(records);
+            resDTO.add(exportByDeptDTO);
+        }
+
+        List<ExportNinetyByDeptDTO> resWide = new ArrayList<ExportNinetyByDeptDTO>();
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            resWide = transList(records, resWide);
+        }
+        String fileName = "质控核查质控评分详情.xls";
+        if("1".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
+        }
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportNinetyByDeptDTO.class, fileName, response);
+        }
+    }
+
+
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void improveMRExportByDept(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        solveParam(qcResultShortPageVO);
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.improveMRExportByDept(qcResultShortPageVO);
+        List<ExportSevenByDeptDTO> resDTO = new ArrayList<ExportSevenByDeptDTO>();
+        if(ListUtil.isNotEmpty(records)){
+            ExportSevenByDeptDTO exportByDeptDTO = new ExportSevenByDeptDTO();
+            exportByDeptDTO.setBehDeptName(records.get(0).getBehDeptName());
+            exportByDeptDTO.setExportExcelByDeptDTOS(records);
+            resDTO.add(exportByDeptDTO);
+        }
+
+        List<ExportNinetyByDeptDTO> resWide = new ArrayList<ExportNinetyByDeptDTO>();
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            resWide = transList(records, resWide);
+        }
+        String fileName = "病案首页改善率质控评分详情.xls";
+        if("1".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
+        }
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportNinetyByDeptDTO.class, fileName, response);
+        }
+    }
+
+    /**
+     * 31天再入院统计导出-科室
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public void reHos31DaysPageExportByDept(HttpServletResponse response, ReBeHosPageVO reBeHosPageVO) {
+        reBeHosPageVO.setCurrent(1L);
+        reBeHosPageVO.setSize(Long.MAX_VALUE);
+        reBeHosPageVO.setSearchCount(false);
+        IPage<ReBeHosByDeptDTO> page = consoleByDeptFacade.reHos31DaysPageByDept(reBeHosPageVO);
+        List<ReBeHosByDeptDTO> records = page.getRecords();
+        String fileName = "31天再入院统计详情.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", ReBeHosByDeptDTO.class, fileName, response);
+    }
+    /**
+     * 未整改病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void unModifyExportByDept(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        solveParam(qcResultShortPageVO);
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.unModifyExportByDept(qcResultShortPageVO);
+        String fileName = "未整改病历详情页.xls";
+        ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelByDeptDTO.class, fileName, response);
+    }
+
+    /**
+     * 稽查统计导出-科室
+     *
+     * @param filterVO
+     * @return
+     */
+    public void medicalCheckExportByDept(HttpServletResponse response, FilterMedicalCheckVO filterVO) {
+        filterVO.setCurrent(1L);
+        filterVO.setSize(Long.MAX_VALUE);
+        filterVO.setSearchCount(false);
+        String fileName = null;
+        if ( "1".equals(filterVO.getIsPlacefile())) {
+            fileName = "终末病历稽查表.xls";
+        } else {
+            fileName = "运行病历稽查表.xls";
+        }
+        List<MedicalDeptDTO> records = consoleByDeptFacade.medicalCheckExportByDept(filterVO);
+        ExcelUtils.exportExcel(records, null, "sheet1", MedicalDeptDTO.class, fileName, response, 15.8f);
+    }
+
+
+
+    /**
+     * 未整改病历统计导出-科室
+     *
+     * @param response
+     * @param filterUnModifyMRVO
+     */
+    public void unModifyMRSExportByDept(HttpServletResponse response, FilterUnModifyMRVO filterUnModifyMRVO) {
+        filterFacade.filterUnModifyMRVOSet(filterUnModifyMRVO);
+        List<ExcelExportEntity> colList = Lists.newLinkedList();
+        ExcelExportEntity deptNameCol = new ExcelExportEntity("主管医生", "doctorName");
+        deptNameCol.setWidth(50);
+        colList.add(deptNameCol);
+
+        QueryWrapper<SysHospitalSet> hospitalSetQueryWrapper = new QueryWrapper<>();
+        hospitalSetQueryWrapper.eq("is_deleted", 'N')
+                .eq("hospital_id", filterUnModifyMRVO.getHospitalId())
+                .eq("code", "unmodify_mr_entry");
+        SysHospitalSet hospitalSet = sysHospitalSetFacade.getOne(hospitalSetQueryWrapper);
+        //缺陷条目未维护
+        if (hospitalSet == null || StringUtil.isBlank(hospitalSet.getValue())) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "未整改病历条目未设置");
+        }
+
+        List<String> columnSet = Arrays.asList(hospitalSet.getValue().split(","));
+        for (String valueStr : columnSet) {
+            if (StringUtil.isBlank(valueStr)) {
+                continue;
+            }
+            String[] keyValue = valueStr.split("--");
+            if (keyValue != null || keyValue.length > 1) {
+                ExcelExportEntity entryCol = new ExcelExportEntity(keyValue[1], "entry_" + keyValue[0] + "_num");
+                entryCol.setWidth(20);
+                colList.add(entryCol);
+            }
+        }
+        UnModifyMRDTO unModifyMRDTO = consoleByDeptFacade.unModifyMRSByDept(filterUnModifyMRVO);
+        List<Object> data = Lists.newLinkedList();
+        if (unModifyMRDTO != null && ListUtil.isNotEmpty(unModifyMRDTO.getData())) {
+            data = unModifyMRDTO.getData();
+        }
+        String fileName = "未整改病历统计.xls";
+        ExcelUtils.exportExcelDynamicCol(colList, data, null, "sheet1", fileName, response);
+    }
+
+
+
+    public void solveParam(QcResultShortPageVO qcResultShortPageVO){
+       String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+       qcResultShortPageVO.setHospitalId(hospitalId);
+        qcResultShortPageVO.setUserId(Long.valueOf(userId));
+       Date startDate = qcResultShortPageVO.getStartDate();
+       Date endDate = qcResultShortPageVO.getEndDate();
+       //时间间隔7天
+       long interval_7 = 7 * 24 * 60 * 60 * 1000;
+       long interval_90 = 90 * 24 * 60 * 60 * 1000l;
+
+       if("1".equals(qcResultShortPageVO.getRadioCheck())){
+           //时间间隔7天
+           if (endDate.getTime() < startDate.getTime()) {
+               throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+           }
+           if (endDate.getTime() - startDate.getTime() > interval_7) {
+               throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
+           }
+       }else{
+           //时间间隔90天
+           if (endDate.getTime() < startDate.getTime()) {
+               throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+           }
+           if (endDate.getTime() - startDate.getTime() > interval_90) {
+               throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
+           }
+       }
+   }
+
+    public List<ExportNinetyByDeptDTO> transList(List<ExportExcelByDeptDTO>res, List<ExportNinetyByDeptDTO>resWide){
+        if(ListUtil.isNotEmpty(res)){
+            ExportNinetyByDeptDTO exportNinetyByDeptDTO = new ExportNinetyByDeptDTO();
+            List<ExportWideExcelByDeptDTO>exportWideExcelByDeptDTOs  =  new ArrayList<ExportWideExcelByDeptDTO>();
+            res.forEach(exportExcelByDeptDTO->{
+                ExportWideExcelByDeptDTO exportWideExcelByDeptDTO = new ExportWideExcelByDeptDTO();
+                exportWideExcelByDeptDTO.setAvgScore(exportExcelByDeptDTO.getAvgScore());
+                exportNinetyByDeptDTO.setBehDeptName( exportExcelByDeptDTO.getBehDeptName());
+                exportWideExcelByDeptDTO.setDoctorName(exportExcelByDeptDTO.getDoctorName());
+                List<ExportExcelBehByDeptDTO> exportExcelBehByDeptDTOS = exportExcelByDeptDTO.getExcelBehospitalDTOS();
+                List<ExportExcelWideBehByDeptDTO> exportExcelWideBehByDepDTOs = new ArrayList<>();
+
+                exportExcelBehByDeptDTOS.forEach(exportExcelBehByDeptDTO->{
+                    ExportExcelWideBehByDeptDTO exportExcelWideBehByDeptDTO = new ExportExcelWideBehByDeptDTO();
+                    exportExcelWideBehByDeptDTO.setBehospitalCode(exportExcelBehByDeptDTO.getBehospitalCode());
+                    exportExcelWideBehByDeptDTO.setBehospitalDate(exportExcelBehByDeptDTO.getBehospitalDate());
+                    exportExcelWideBehByDeptDTO.setLeaveHospitalDate(exportExcelBehByDeptDTO.getLeaveHospitalDate());
+                    exportExcelWideBehByDeptDTO.setPatName(exportExcelBehByDeptDTO.getPatName());
+                    exportExcelWideBehByDeptDTO.setScore(exportExcelBehByDeptDTO.getScore());
+                    exportExcelWideBehByDeptDTO.setScoreBn(exportExcelBehByDeptDTO.getScoreBn());
+                    exportExcelWideBehByDepDTOs.add(exportExcelWideBehByDeptDTO);
+                });
+                exportWideExcelByDeptDTO.setExcelBehospitalDTOS(exportExcelWideBehByDepDTOs);
+                exportWideExcelByDeptDTOs.add(exportWideExcelByDeptDTO);
+            });
+            exportNinetyByDeptDTO.setExportExcelByDeptDTOS(exportWideExcelByDeptDTOs);
+            resWide.add(exportNinetyByDeptDTO);
+        }
+        return resWide;
+    }
+
+    public void BigDecimalStrExport(LevelStsByDeptDTO record){
+
+        BigDecimal entrySameBigDecimal = getSubtract(new BigDecimal(record.getEntryNum()), new BigDecimal(record.getSameNum()  == null? 0:record.getSameNum()));
+
+        if(entrySameBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setEntryStrNum(record.getEntryNum()+"↑");
+        }else if(entrySameBigDecimal.compareTo(BigDecimal.ZERO) <0){
+            record.setEntryStrNum(record.getEntryNum()+"↓");
+        }
+
+        BigDecimal sameMrNumBigDecimal = getSubtract(new BigDecimal(record.getMrNum()), new BigDecimal(record.getSameMrNum()  == null? 0:record.getSameMrNum()));
+        if(sameMrNumBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setMrStrNum(record.getMrNum()+"↑");
+        }else if(sameMrNumBigDecimal.compareTo(BigDecimal.ZERO) <0){
+            record.setMrStrNum(record.getMrNum()+"↓");
+        }
+
+        BigDecimal sameAvgValueDecimal = getSubtract(new BigDecimal(record.getAverageValue()), new BigDecimal(record.getSameAvgValue() == null? 0:record.getSameAvgValue()));
+        if(sameAvgValueDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setAverageStrValue(record.getAverageValue()+"↑");
+        }else if(sameAvgValueDecimal.compareTo(BigDecimal.ZERO) <0){
+            record.setAverageStrValue(record.getAverageValue()+"↓");
+        }
+
+        BigDecimal SameFirstLevelBigDecimal = getSubtract(new BigDecimal(record.getFirstLevelNum()), new BigDecimal(record.getSameFirstLevelNum() == null? 0:record.getSameFirstLevelNum()));
+        if(SameFirstLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setFirstLevelStrNum(record.getFirstLevelNum()+"↑");
+        }else if(SameFirstLevelBigDecimal.compareTo(BigDecimal.ZERO) <0){
+            record.setFirstLevelStrNum(record.getFirstLevelNum()+"↓");
+        }
+
+        BigDecimal SameSecondLevelBigDecimal = getSubtract(new BigDecimal(record.getSecondLevelNum()), new BigDecimal(record.getSameSecondLevelNum() == null? 0:record.getSameSecondLevelNum()));
+        if(SameSecondLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setSecondLevelStrNum(record.getSecondLevelNum()+"↑");
+        }else if(SameSecondLevelBigDecimal.compareTo(BigDecimal.ZERO) <0){
+            record.setSecondLevelStrNum(record.getSecondLevelNum()+"↓");
+        }
+
+        BigDecimal SameThirdLevelBigDecimal = getSubtract(new BigDecimal(record.getThirdLevelNum()), new BigDecimal(record.getSameThirdLevelNum() == null? 0:record.getSameThirdLevelNum()));
+        if(SameThirdLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setThirdLevelStrNum(record.getThirdLevelNum()+"↑");
+        }else if(SameThirdLevelBigDecimal.compareTo(BigDecimal.ZERO) <0){
+            record.setThirdLevelStrNum(record.getThirdLevelNum()+"↓");
+        }
+
+        BigDecimal SameFirstLevelPeDecimal = getSubtract(new BigDecimal(record.getFirstLevelPercent()), new BigDecimal(record.getSameFirstLevelPercent() == null? 0:record.getSameFirstLevelPercent()));
+        if(SameFirstLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setFirstLevelPercentStr(record.getFirstLevelPercentStr()+"↑");
+        }else if(SameFirstLevelPeDecimal.compareTo(BigDecimal.ZERO) <0){
+            record.setFirstLevelPercentStr(record.getFirstLevelPercentStr()+"↓");
+        }
+
+        BigDecimal SameSecondLevelPeDecimal = getSubtract(new BigDecimal(record.getSecondLevelPercent()), new BigDecimal(record.getSameSecondLevelPercent() == null? 0:record.getSameSecondLevelPercent()));
+        if(SameSecondLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setSecondLevelPercentStr(record.getSecondLevelPercentStr()+"↑");
+        }else if(SameSecondLevelPeDecimal.compareTo(BigDecimal.ZERO)<0){
+            record.setSecondLevelPercentStr(record.getSecondLevelPercentStr()+"↓");
+        }
+
+        BigDecimal SameThirdLevelPeDecimal = getSubtract(new BigDecimal(record.getThirdLevelPercent()), new BigDecimal(record.getSameThirdLevelPercent() == null? 0:record.getSameThirdLevelPercent()));
+        if(SameThirdLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setThirdLevelPercentStr(record.getThirdLevelPercentStr()+"↑");
+        }else if(SameThirdLevelPeDecimal.compareTo(BigDecimal.ZERO) <0){
+            record.setThirdLevelPercentStr(record.getThirdLevelPercentStr()+"↓");
+        }
+    };
+
+    public void BigDecimalMethod(LevelStatisticsDTO record){
+        BigDecimal entrySameBigDecimal = getSubtract(new BigDecimal(record.getEntryNum()), new BigDecimal(record.getSameNum() == null? 0:record.getSameNum()));
+
+        if(entrySameBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setEntrySameNum(1);
+        }else if(entrySameBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setEntrySameNum(0);
+        }else{
+            record.setEntrySameNum(-1);
+        }
+
+        BigDecimal sameMrNumBigDecimal = getSubtract(new BigDecimal(record.getMrNum()), new BigDecimal(record.getSameMrNum()  == null? 0:record.getSameMrNum()));
+        if(sameMrNumBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setMrSameNum(1);
+        }else if(sameMrNumBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setMrSameNum(0);
+        }else{
+            record.setMrSameNum(-1);
+        }
+
+        BigDecimal sameAvgValueDecimal = getSubtract(new BigDecimal(record.getAverageValue()), new BigDecimal(record.getSameAvgValue() == null? 0:record.getSameAvgValue()));
+        if(sameAvgValueDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setAvSameValue(1);
+        }else if(sameAvgValueDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setAvSameValue(0);
+        }else{
+            record.setAvSameValue(-1);
+        }
+
+        BigDecimal SameFirstLevelBigDecimal = getSubtract(new BigDecimal(record.getFirstLevelNum()), new BigDecimal(record.getSameFirstLevelNum() == null? 0:record.getSameFirstLevelNum()));
+        if(SameFirstLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setFirSameLevelNum(1);
+        }else if(SameFirstLevelBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setFirSameLevelNum(0);
+        }else{
+            record.setFirSameLevelNum(-1);
+        }
+
+        BigDecimal SameSecondLevelBigDecimal = getSubtract(new BigDecimal(record.getSecondLevelNum()), new BigDecimal(record.getSameSecondLevelNum() == null? 0:record.getSameSecondLevelNum()));
+        if(SameSecondLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setSecSameLevelNum(1);
+        }else if(SameSecondLevelBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setSecSameLevelNum(0);
+        }else{
+            record.setSecSameLevelNum(-1);
+        }
+
+        BigDecimal SameThirdLevelBigDecimal = getSubtract(new BigDecimal(record.getThirdLevelNum()), new BigDecimal(record.getSameThirdLevelNum() == null? 0:record.getSameThirdLevelNum()));
+        if(SameThirdLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setThiSameLevelNum(1);
+        }else if(SameThirdLevelBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setThiSameLevelNum(0);
+        }else{
+            record.setThiSameLevelNum(-1);
+        }
+
+        BigDecimal SameFirstLevelPeDecimal = getSubtract(new BigDecimal(record.getFirstLevelPercent()), new BigDecimal(record.getSameFirstLevelPercent() == null? 0:record.getSameFirstLevelPercent()));
+        if(SameFirstLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setFirSameLevelPercent(1);
+        }else if(SameFirstLevelPeDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setFirSameLevelPercent(0);
+        }else{
+            record.setFirSameLevelPercent(-1);
+        }
+
+        BigDecimal SameSecondLevelPeDecimal = getSubtract(new BigDecimal(record.getSecondLevelPercent()), new BigDecimal(record.getSameSecondLevelPercent() == null? 0:record.getSameSecondLevelPercent()));
+        if(SameSecondLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setSecSameLevelPercent(1);
+        }else if(SameSecondLevelPeDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setSecSameLevelPercent(0);
+        }else{
+            record.setSecSameLevelPercent(-1);
+        }
+
+        BigDecimal SameThirdLevelPeDecimal = getSubtract(new BigDecimal(record.getThirdLevelPercent()), new BigDecimal(record.getSameThirdLevelPercent() == null? 0:record.getSameThirdLevelPercent()));
+        if(SameThirdLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setThiSameLevelPercent(1);
+        }else if(SameThirdLevelPeDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setThiSameLevelPercent(0);
+        }else{
+            record.setThiSameLevelPercent(-1);
+        }
+    };
+
+    /**
+     * 差值计算
+     *
+     * @param bigDecimalOne
+     * @param bigDecimalTwo
+     * @return
+     */
+    private BigDecimal getSubtract(BigDecimal bigDecimalOne, BigDecimal bigDecimalTwo) {
+        BigDecimal newBigDecimal = new BigDecimal(0);
+        if (null == bigDecimalOne && null != bigDecimalTwo) {
+            newBigDecimal = newBigDecimal.subtract(bigDecimalTwo);
+        } else if (null != bigDecimalOne && null == bigDecimalTwo) {
+            newBigDecimal = bigDecimalOne.subtract(newBigDecimal);
+        } else if (null != bigDecimalOne && null != bigDecimalTwo) {
+            newBigDecimal = bigDecimalOne.subtract(bigDecimalTwo);
+        }
+        return newBigDecimal;
+    }
+
+
+}

+ 696 - 69
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -1,36 +1,22 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.DeptBaseDTO;
-import com.diagbot.dto.DeptEntryNumDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.HomePageNumDTO;
-import com.diagbot.dto.LevelStatisticsDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultShortDTO;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.EntityUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.StringUtil;
-import com.diagbot.util.SysUserUtils;
-import com.diagbot.vo.FilterOrderByDeptVO;
-import com.diagbot.vo.FilterPageByDeptVO;
-import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.QcresultFilterVO;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.dto.*;
+import com.diagbot.entity.QcCasesEntry;
+import com.diagbot.entity.SysHospitalSet;
+import com.diagbot.util.*;
+import com.diagbot.vo.*;
 import com.google.common.collect.Lists;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 
@@ -51,6 +37,11 @@ public class ConsoleByDeptFacade {
     private FilterFacade filterFacade;
     @Autowired
     private QcCasesFacade qcCasesFacade;
+    @Autowired
+    private SysHospitalSetFacade sysHospitalSetFacade;
+    @Autowired
+    private QcCasesEntryFacade qcCasesEntryFacade;
+
 
     /**
      * 出院人数统计-按科室
@@ -71,34 +62,32 @@ public class ConsoleByDeptFacade {
         Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
                 ? new HashMap<>()
                 : EntityUtil.makeEntityMap(totleNumList, "name");
-        //新生儿人数
-        List<NumDTO> newBornNumList = behospitalInfoFacade.newBornCountByDept(filterVO);
-        Map<String, NumDTO> newBornMap = ListUtil.isEmpty(newBornNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(newBornNumList, "name");
-        //死亡人数
-        List<NumDTO> deathNumList = behospitalInfoFacade.deathCountByDept(filterVO);
-        Map<String, NumDTO> deathMap = ListUtil.isEmpty(deathNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(deathNumList, "name");
-        //手术人数
-        List<NumDTO> operationNumList = behospitalInfoFacade.operationCountByDept(filterVO);
-        Map<String, NumDTO> operationMap = ListUtil.isEmpty(operationNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(operationNumList, "name");
+        Map<String, NumDTO> deathMap = new HashMap<>();
+        Map<String, NumDTO> operationMap = new HashMap<>();
+        //终末--死亡人数/手术病人数
+            //死亡人数
+            List<NumDTO> deathNumList = behospitalInfoFacade.deathCountByDept(filterVO);
+             deathMap = ListUtil.isEmpty(deathNumList)
+                    ? new HashMap<>()
+                    : EntityUtil.makeEntityMap(deathNumList, "name");
+            //手术人数
+            List<NumDTO> operationNumList = behospitalInfoFacade.operationCountByDept(filterVO);
+             operationMap = ListUtil.isEmpty(operationNumList)
+                    ? new HashMap<>()
+                    : EntityUtil.makeEntityMap(operationNumList, "name");
+
         for (String deptName : deptMap.keySet()) {
             Map<String, Object> map = new LinkedHashMap<>();
             map.put("总人数", 0);
             map.put("死亡人数", 0);
             map.put("手术病人数", 0);
-
             if (totleMap.containsKey(deptName)) {
                 map.put("总人数", totleMap.get(deptName).getNum());
             }
-            if (deathMap.containsKey(deptName)) {
+            if(deathMap.containsKey(deptName)) {
                 map.put("死亡人数", deathMap.get(deptName).getNum());
             }
-            if (operationMap.containsKey(deptName)) {
+            if(operationMap.containsKey(deptName)) {
                 map.put("手术病人数", operationMap.get(deptName).getNum());
             }
             retMap.put(deptName, map);
@@ -106,6 +95,21 @@ public class ConsoleByDeptFacade {
         return retMap;
     }
 
+
+    /**
+     * 入院人数统计-按科室
+     *
+     * @param filterVO
+     * @return
+     */
+    public Map<String, List<AdmissionCountDTO>> admissionHosCountByDept(FilterVO filterVO) {
+        filterFacade.filterVOSet(filterVO);
+        List<AdmissionCountDTO> totleNumList = behospitalInfoFacade.admissionHosCountByDept(filterVO);
+        Map<String, List<AdmissionCountDTO>> resourceData = mapResource(filterVO, totleNumList);
+        return resourceData;
+    }
+
+
     /**
      * 病历数统计-按科室
      *
@@ -392,7 +396,7 @@ public class ConsoleByDeptFacade {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptNumDTO> entryCountGroupByCaseAndDeptPage(FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<NumDTO> entryCountGroupByCaseAndDeptPage(FilterPageByDeptVO filterPageByDeptVO) {
         if (StringUtil.isBlank(filterPageByDeptVO.getDeptName())) {
             List<DeptBaseDTO> deptList = this.getDept();
             //默认取第一个科室
@@ -401,7 +405,7 @@ public class ConsoleByDeptFacade {
             }
         }
         filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
-        IPage<DeptNumDTO> page = qcresultInfoFacade.entryCountGroupByCaseAndDeptPage(filterPageByDeptVO);
+        IPage<NumDTO> page = qcresultInfoFacade.entryCountGroupByCaseAndDeptPage(filterPageByDeptVO);
         return page;
     }
 
@@ -411,7 +415,7 @@ public class ConsoleByDeptFacade {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<EntryNumGroupDTO> entryCountGroupByEntryAndDeptPage(FilterPageByDeptVO filterPageByDeptVO) {
         if (StringUtil.isBlank(filterPageByDeptVO.getDeptName())) {
             List<DeptBaseDTO> deptList = this.getDept();
             //默认取第一个科室
@@ -423,7 +427,7 @@ public class ConsoleByDeptFacade {
             filterPageByDeptVO.setDoctorName("");
         }
         filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
-        IPage<DeptEntryNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
+        IPage<EntryNumGroupDTO> page = qcresultInfoFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
         return page;
     }
 
@@ -468,29 +472,139 @@ public class ConsoleByDeptFacade {
     /**
      * 各科室缺陷占比(组合)
      *
-     * @param filterOrderByDeptVO
+     * @param filterOrderVO
      * @return
      */
-    public List<LevelStatisticsDTO> levelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
+    public List<LevelStsByDeptDTO> levelStatisticsByDept(FilterOrderVO filterOrderVO) {
         List<DeptBaseDTO> deptList = getDept();
         if (ListUtil.isEmpty(deptList)) {
             return null;
         }
-        if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())) {
-            filterOrderByDeptVO.setDeptName(deptList.get(0).getDeptName());
+        if (StringUtil.isBlank(filterOrderVO.getDeptName())) {
+            filterOrderVO.setDeptName(deptList.get(0).getDeptName());
+        }
+        filterFacade.filterOrderVOSame(filterOrderVO);
+        List<LevelStsByDeptDTO> records = behospitalInfoFacade.levelStatisticsByDept(filterOrderVO);
+        if(ListUtil.isNotEmpty(records)){
+            for (LevelStsByDeptDTO record : records) {
+                BigDecimalMethod(record);
+            }
         }
-        filterFacade.filterOrderByDeptVOSet(filterOrderByDeptVO);
-        List<LevelStatisticsDTO> records = behospitalInfoFacade.levelStatisticsByDept(filterOrderByDeptVO);
         return records;
     }
 
+    public void BigDecimalMethod(LevelStsByDeptDTO record){
+        BigDecimal entrySameBigDecimal = getSubtract(new BigDecimal(record.getEntryNum()), new BigDecimal(record.getSameNum() == null? 0:record.getSameNum()));
+
+        if(entrySameBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setEntrySameNum(1);
+        }else if(entrySameBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setEntrySameNum(0);
+        }else{
+            record.setEntrySameNum(-1);
+        }
+
+        BigDecimal sameMrNumBigDecimal = getSubtract(new BigDecimal(record.getMrNum()), new BigDecimal(record.getSameMrNum()  == null? 0:record.getSameMrNum()));
+        if(sameMrNumBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setMrSameNum(1);
+        }else if(sameMrNumBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setMrSameNum(0);
+        }else{
+            record.setMrSameNum(-1);
+        }
+
+        BigDecimal sameAvgValueDecimal = getSubtract(new BigDecimal(record.getAverageValue()), new BigDecimal(record.getSameAvgValue() == null? 0:record.getSameAvgValue()));
+        if(sameAvgValueDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setAvSameValue(1);
+        }else if(sameAvgValueDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setAvSameValue(0);
+        }else{
+            record.setAvSameValue(-1);
+        }
+
+        BigDecimal SameFirstLevelBigDecimal = getSubtract(new BigDecimal(record.getFirstLevelNum()), new BigDecimal(record.getSameFirstLevelNum() == null? 0:record.getSameFirstLevelNum()));
+        if(SameFirstLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setFirSameLevelNum(1);
+        }else if(SameFirstLevelBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setFirSameLevelNum(0);
+        }else{
+            record.setFirSameLevelNum(-1);
+        }
+
+        BigDecimal SameSecondLevelBigDecimal = getSubtract(new BigDecimal(record.getSecondLevelNum()), new BigDecimal(record.getSameSecondLevelNum() == null? 0:record.getSameSecondLevelNum()));
+        if(SameSecondLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setSecSameLevelNum(1);
+        }else if(SameSecondLevelBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setSecSameLevelNum(0);
+        }else{
+            record.setSecSameLevelNum(-1);
+        }
+
+        BigDecimal SameThirdLevelBigDecimal = getSubtract(new BigDecimal(record.getThirdLevelNum()), new BigDecimal(record.getSameThirdLevelNum() == null? 0:record.getSameThirdLevelNum()));
+        if(SameThirdLevelBigDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setThiSameLevelNum(1);
+        }else if(SameThirdLevelBigDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setThiSameLevelNum(0);
+        }else{
+            record.setThiSameLevelNum(-1);
+        }
+
+        BigDecimal SameFirstLevelPeDecimal = getSubtract(new BigDecimal(record.getFirstLevelPercent()), new BigDecimal(record.getSameFirstLevelPercent() == null? 0:record.getSameFirstLevelPercent()));
+        if(SameFirstLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setFirSameLevelPercent(1);
+        }else if(SameFirstLevelPeDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setFirSameLevelPercent(0);
+        }else{
+            record.setFirSameLevelPercent(-1);
+        }
+
+        BigDecimal SameSecondLevelPeDecimal = getSubtract(new BigDecimal(record.getSecondLevelPercent()), new BigDecimal(record.getSameSecondLevelPercent() == null? 0:record.getSameSecondLevelPercent()));
+        if(SameSecondLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setSecSameLevelPercent(1);
+        }else if(SameSecondLevelPeDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setSecSameLevelPercent(0);
+        }else{
+            record.setSecSameLevelPercent(-1);
+        }
+
+        BigDecimal SameThirdLevelPeDecimal = getSubtract(new BigDecimal(record.getThirdLevelPercent()), new BigDecimal(record.getSameThirdLevelPercent() == null? 0:record.getSameThirdLevelPercent()));
+        if(SameThirdLevelPeDecimal.compareTo(BigDecimal.ZERO)>0){
+            record.setThiSameLevelPercent(1);
+        }else if(SameThirdLevelPeDecimal.compareTo(BigDecimal.ZERO) == 0){
+            record.setThiSameLevelPercent(0);
+        }else{
+            record.setThiSameLevelPercent(-1);
+        }
+    };
+
+
+    /**
+     * 差值计算
+     *
+     * @param bigDecimalOne
+     * @param bigDecimalTwo
+     * @return
+     */
+    private BigDecimal getSubtract(BigDecimal bigDecimalOne, BigDecimal bigDecimalTwo) {
+        BigDecimal newBigDecimal = new BigDecimal(0);
+        if (null == bigDecimalOne && null != bigDecimalTwo) {
+            newBigDecimal = newBigDecimal.subtract(bigDecimalTwo);
+        } else if (null != bigDecimalOne && null == bigDecimalTwo) {
+            newBigDecimal = bigDecimalOne.subtract(newBigDecimal);
+        } else if (null != bigDecimalOne && null != bigDecimalTwo) {
+            newBigDecimal = bigDecimalOne.subtract(bigDecimalTwo);
+        }
+        return newBigDecimal;
+    }
+
+
     /**
      * 病案首页合格率占比
      *
      * @param filterOrderByDeptVO
      * @return
      */
-    public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
+    public List<HomePageByDeptDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
         List<DeptBaseDTO> deptList = getDept();
         if (ListUtil.isEmpty(deptList)) {
             return null;
@@ -499,25 +613,81 @@ public class ConsoleByDeptFacade {
             filterOrderByDeptVO.setDeptName(deptList.get(0).getDeptName());
         }
         filterFacade.filterOrderByDeptVOSet(filterOrderByDeptVO);
-        List<HomePageNumDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
-        //没有医生过滤时增加全科室数据
-        if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())
+        List<HomePageByDeptDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
+        //没有医生过滤时增加全科室数据 --暂时不做汇总处理
+       /* if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())
                 || filterOrderByDeptVO.getDeptName().equals(filterOrderByDeptVO.getDeptName())) {
-            HomePageNumDTO item = getGlobleRecord(records, filterOrderByDeptVO.getDeptName());
+            HomePageByDeptDTO item = getGlobleRecord(records, filterOrderByDeptVO.getDeptName());
             if (item != null) {
                 records.add(0, item);
             }
-        }
+        }*/
         return records;
     }
 
+    /**
+     * 单条条目缺陷统计(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public  Map<String, List<AdmissionCountDTO>>casesEntryStatisticsByDept(FilterVO filterVO) {
+        filterFacade.filterVOSet(filterVO);
+        List<AdmissionCountDTO> totleNumList = behospitalInfoFacade.casesEntryStatisticsByDept(filterVO);
+        Map<String, List<AdmissionCountDTO>> resourceData = mapResource(filterVO, totleNumList);
+        return resourceData;
+    }
+
+    public Map<String, List<AdmissionCountDTO>> mapResource(FilterVO filterVO,List<AdmissionCountDTO>totleNumList){
+        Map<String, Object> deptMap = getDeptByUser(filterVO);
+            Map<String, List<AdmissionCountDTO>> mapSource = new HashMap<>();
+            Map<String, List<AdmissionCountDTO>> returnSource = new HashMap<>();
+            if (deptMap == null) {
+                return mapSource;
+            }
+
+            if(ListUtil.isNotEmpty(totleNumList)) {
+                mapSource = EntityUtil.makeEntityListMap(totleNumList, "deptName");
+                for (String deptName : deptMap.keySet()) {
+                    List<AdmissionCountDTO> admissionCountDTOS = mapSource.get(deptName);
+                if(ListUtil.isNotEmpty(admissionCountDTOS) ){
+//                    if ( admissionCountDTOS.size()> filterVO.getLimitCount()) {
+//                        admissionCountDTOS = admissionCountDTOS.subList(0, 10);
+//                      }
+                    AdmissionCountDTO admissionCount = new AdmissionCountDTO();
+                    Integer tolCount = admissionCountDTOS.stream()
+                            .map(AdmissionCountDTO::getNum)
+                            .reduce(0, Integer::sum);
+                    admissionCount.setDoctorName(deptName);
+                    admissionCount.setNum(tolCount);
+                    admissionCountDTOS.add(0, admissionCount);
+                    returnSource.put(deptName,admissionCountDTOS);
+                    }
+                }
+            }
+            return returnSource;
+        }
+    /**
+     * 不合格/合格数病历号-科室(内页)
+     *
+     * @param qcResultPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> homePageOrGoodLevelByDept(QcResultPageVO qcResultPageVO) {
+        filterFacade.OrGoodLevelPageVOSet(qcResultPageVO);
+        return behospitalInfoFacade.getOrGoodLevelByDept(qcResultPageVO);
+    }
+
+
+
+
     /**
      * 病案首页合格率占比(首页)
      *
      * @param filterOrderByDeptVO
      * @return
      */
-    public List<HomePageNumDTO> homePageLevelByDeptLimit(FilterOrderByDeptVO filterOrderByDeptVO) {
+    public List<HomePageByDeptDTO> homePageLevelByDeptLimit(FilterOrderByDeptVO filterOrderByDeptVO) {
 
         List<DeptBaseDTO> deptList = getDept();
         if (ListUtil.isEmpty(deptList)) {
@@ -530,8 +700,8 @@ public class ConsoleByDeptFacade {
         if (filterOrderByDeptVO.getLimitCount() == null || filterOrderByDeptVO.getLimitCount().equals(0)) {
             filterOrderByDeptVO.setLimitCount(10);
         }
-        List<HomePageNumDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
-        HomePageNumDTO item = getGlobleRecord(records, filterOrderByDeptVO.getDeptName());
+        List<HomePageByDeptDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
+        HomePageByDeptDTO item = getGlobleRecord(records, filterOrderByDeptVO.getDeptName());
         if (item != null) {
             records.add(0, item);
         }
@@ -551,13 +721,13 @@ public class ConsoleByDeptFacade {
      * @param deptName
      * @return
      */
-    public HomePageNumDTO getGlobleRecord(List<HomePageNumDTO> records, String deptName) {
+    public HomePageByDeptDTO getGlobleRecord(List<HomePageByDeptDTO> records, String deptName) {
         DecimalFormat df = new DecimalFormat("#0.00");
-        HomePageNumDTO item = new HomePageNumDTO();
+        HomePageByDeptDTO item = new HomePageByDeptDTO();
         //总病历数
         Integer mrNum = records
                 .stream()
-                .map(HomePageNumDTO::getMrNum)
+                .map(HomePageByDeptDTO::getMrNum)
                 .reduce(0, Integer::sum);
         if (mrNum == null || mrNum == 0) {
             return null;
@@ -565,7 +735,7 @@ public class ConsoleByDeptFacade {
         //总缺陷数
         Integer entryNum = records
                 .stream()
-                .map(HomePageNumDTO::getEntryNum)
+                .map(HomePageByDeptDTO::getEntryNum)
                 .reduce(0, Integer::sum);
         //总分
         Double totleValue = records
@@ -580,7 +750,7 @@ public class ConsoleByDeptFacade {
         //合格病历总数
         Integer firstLevelNum = records
                 .stream()
-                .map(HomePageNumDTO::getFirstLevelNum)
+                .map(HomePageByDeptDTO::getFirstLevelNum)
                 .reduce(0, Integer::sum);
         //合格病历占比
         Double firstLevelPercent = BigDecimal.valueOf(firstLevelNum)
@@ -591,7 +761,7 @@ public class ConsoleByDeptFacade {
         //不合格病历数
         Integer secondLevelNum = records
                 .stream()
-                .map(HomePageNumDTO::getSecondLevelNum)
+                .map(HomePageByDeptDTO::getSecondLevelNum)
                 .reduce(0, Integer::sum);
         //不合格病历占比
         Double secondLevelPercent = BigDecimal.valueOf(secondLevelNum)
@@ -602,12 +772,12 @@ public class ConsoleByDeptFacade {
         //条目缺陷总数(模块下条目*病历数)
         Integer entryTotleNum = records
                 .stream()
-                .map(HomePageNumDTO::getEntryTotleNum)
+                .map(HomePageByDeptDTO::getEntryTotleNum)
                 .reduce(0, Integer::sum);
         //空项总数
         Integer emptyNum = records
                 .stream()
-                .map(HomePageNumDTO::getEmptyNum)
+                .map(HomePageByDeptDTO::getEmptyNum)
                 .reduce(0, Integer::sum);
         Double emptyPercent = BigDecimal.valueOf(entryTotleNum - emptyNum)
                 .divide(BigDecimal.valueOf(entryTotleNum), 4, RoundingMode.HALF_UP)
@@ -617,7 +787,7 @@ public class ConsoleByDeptFacade {
         //错误项总数
         Integer errorNum = records
                 .stream()
-                .map(HomePageNumDTO::getErrorNum)
+                .map(HomePageByDeptDTO::getErrorNum)
                 .reduce(0, Integer::sum);
         Double errorPercent = BigDecimal.valueOf(entryTotleNum - errorNum)
                 .divide(BigDecimal.valueOf(entryTotleNum), 4, RoundingMode.HALF_UP)
@@ -626,6 +796,7 @@ public class ConsoleByDeptFacade {
                 = df.format(BigDecimal.valueOf(errorPercent).multiply(BigDecimal.valueOf(100))) + "%";
 
         item.setDoctorName(deptName);
+//        item.setDeptId(deptId);
         item.setEntryNum(entryNum);
         item.setMrNum(mrNum);
         item.setTotleValue(totleValue);
@@ -657,4 +828,460 @@ public class ConsoleByDeptFacade {
         IPage<QcResultShortDTO> page = behospitalInfoFacade.qcResultShortByDeptPage(qcResultShortPageVO);
         return page;
     }
+
+
+    /**
+     * 关键条目缺陷占比统计-科室
+     *
+     * @param entryStatisticsVO
+     * @return
+     */
+    public List<EntryStasByDeptDTO> entryStatisticsByDept(EntryStatisticsVO entryStatisticsVO) {
+        filterFacade.entryStatisticsVOSet(entryStatisticsVO);
+        if (entryStatisticsVO.getDeptName().equals("全院")) {
+            entryStatisticsVO.setDeptName("");
+        }
+        List<EntryStasByDeptDTO> records = behospitalInfoFacade.entryStatisticsByDept(entryStatisticsVO);
+        return records;
+    }
+
+    /**
+     * 离院病人质控评分详情页-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> leaveHosMRPageByDept(QcResultShortPageVO qcResultShortPageVO) {
+        filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
+        IPage<QcResultShortDTO> page = behospitalInfoFacade.leaveHosMRPageByDept(qcResultShortPageVO);
+        return page;
+    }
+
+    /**
+     * 质控核查统计-科室(内页)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public List<ImproveByDeptDTO> qcCheckStatisticsByDept(FilterOrderVO filterOrderVO) {
+        filterFacade.filterOrderVOSet(filterOrderVO);
+        List<ImproveByDeptDTO> records = behospitalInfoFacade.qcCheckStatisticsByDept(filterOrderVO);
+        return records;
+    }
+    /**
+     * 质控核查质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> qcCheckMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
+        return behospitalInfoFacade.qcCheckMRPageByDept(qcResultShortPageVO);
+    }
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
+        return behospitalInfoFacade.hmImproveMRPageByDept(qcResultShortPageVO);
+    }
+
+    /**
+     * 31天再入院详情页-科室
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public IPage<ReBeHosByDeptDTO> reHos31DaysPageByDept(ReBeHosPageVO reBeHosPageVO) {
+        filterFacade.reBeHosPageVOSet(reBeHosPageVO);
+        IPage<ReBeHosMergeDTO> page = behospitalInfoFacade.reHos31DaysPageByDept(reBeHosPageVO);
+        List<ReBeHosMergeDTO> records = page.getRecords();
+        IPage<ReBeHosByDeptDTO> retPage = new Page<>();
+        BeanUtil.copyProperties(page, retPage);
+        List<ReBeHosByDeptDTO> retRecords = Lists.newLinkedList();
+        if (ListUtil.isNotEmpty(records)) {
+            for (ReBeHosMergeDTO record : records) {
+                ReBeHosByDeptDTO retRecord = new ReBeHosByDeptDTO();
+                BeanUtil.copyProperties(record, retRecord);
+                List<ReBeHosDetailByDeptDTO> details = Lists.newLinkedList();
+                ReBeHosDetailByDeptDTO detailRecord = new ReBeHosDetailByDeptDTO();
+                BeanUtil.copyProperties(record, detailRecord);
+                details.add(detailRecord);
+                ReBeHosDetailByDeptDTO lastDetailRecord = new ReBeHosDetailByDeptDTO();
+                lastDetailRecord.setName(record.getName());
+                lastDetailRecord.setBehDeptId(record.getLastBehDeptId());
+                lastDetailRecord.setBehDeptName(record.getLastBehDeptName());
+                lastDetailRecord.setDoctorName(record.getLastDoctorName());
+                lastDetailRecord.setBehospitalCode(record.getLastBehospitalCode());
+                lastDetailRecord.setBehospitalDate(record.getLastBehospitalDate());
+                lastDetailRecord.setLeaveHospitalDate(record.getLastLeaveHospitalDate());
+                lastDetailRecord.setLevel(record.getLastLevel());
+                lastDetailRecord.setScoreRes(record.getLastScoreRes());
+                lastDetailRecord.setBehospitalDayNum(record.getLastBehospitalDayNum());
+                lastDetailRecord.setTotleFee(record.getLastTotleFee());
+                details.add(lastDetailRecord);
+                retRecord.setDetails(details);
+                retRecords.add(retRecord);
+            }
+        }
+        retPage.setRecords(retRecords);
+        return retPage;
+    }
+    /**
+     * 未整改病历质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> unModifyMRByDept(QcResultShortPageVO qcResultShortPageVO) {
+        filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
+        return behospitalInfoFacade.unModifyMRByDept(qcResultShortPageVO);
+    }
+    /**
+     * 病历稽查表导出-科室
+     *
+     * @param filterVO
+     * @return
+     */
+
+
+    public List<MedicalDeptDTO> medicalCheckExportByDept(@Param("filterVO") FilterMedicalCheckVO filterVO) {
+        filterFacade.getMedicalCheckVOSet(filterVO);
+        List<MedicalDeptDTO> medicalCheck = behospitalInfoFacade.medicalCheckExportByDept(filterVO);
+        return medicalCheck;
+    }
+
+
+
+
+    /**
+     * 病历稽查表(title)-科室
+     *
+     * @param
+     * @return
+     */
+    public List<ColumnDTO> medicalCheckTitleKs() {
+        //病历稽查入参拼接
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        //colums
+        QueryWrapper<SysHospitalSet> hospitalSetQueryWrapper = new QueryWrapper<>();
+        hospitalSetQueryWrapper.eq("is_deleted", 'N')
+                .eq("hospital_id", hospitalId)
+                .eq("code", "medical_check_form_ks");
+        List<ColumnDTO> columns = Lists.newLinkedList();
+        SysHospitalSet hospitalSet = sysHospitalSetFacade.getOne(hospitalSetQueryWrapper);
+        if (hospitalSet == null || StringUtil.isBlank(hospitalSet.getValue())) {
+            return columns;
+        }
+
+        //表头生成
+        List<String> columnSet = Arrays.asList(hospitalSet.getValue().split(","));
+        Integer orderNo = 1;
+        ColumnDTO columnDeptId = new ColumnDTO();
+        columnDeptId.setOrderNo(orderNo);
+        columnDeptId.setFieldName("doctorId");
+        columnDeptId.setColumnName("医生编码");
+        columnDeptId.setIsShow(0);
+        columns.add(columnDeptId);
+        orderNo++;
+        ColumnDTO columnDeptName = new ColumnDTO();
+        columnDeptName.setOrderNo(orderNo);
+        columnDeptName.setFieldName("doctorName");
+        columnDeptName.setColumnName("主管医生");
+        columnDeptName.setIsShow(1);
+        columns.add(columnDeptName);
+        orderNo++;
+        ColumnDTO columnMedicalName = new ColumnDTO();
+        columnMedicalName.setOrderNo(orderNo);
+        columnMedicalName.setFieldName("doctorGroup");
+        columnMedicalName.setColumnName("医疗组");
+        columnMedicalName.setIsShow(1);
+        columns.add(columnMedicalName);
+        orderNo++;
+        for (String valueStr : columnSet) {
+            String[] keyValue = valueStr.split("--");
+            if (keyValue != null || keyValue.length > 1) {
+                ColumnDTO columnNum = new ColumnDTO();
+                columnNum.setOrderNo(orderNo);
+                columnNum.setId(Long.valueOf(keyValue[0]));
+                columnNum.setFieldName("entry_" + keyValue[0] + "_name");
+                columnNum.setColumnName(keyValue[1]);
+                columnNum.setIsShow(1);
+                columns.add(columnNum);
+                orderNo++;
+            }
+        }
+
+        return columns;
+    }
+
+    /**
+     * 病历稽查表-科室
+     *
+     * @param filterVO
+     * @return
+     */
+    public IPage<MedicalCheckDTO> getMedicalChecks(@Param("filterVO") FilterMedicalCheckVO filterVO) {
+        filterFacade.getMedicalCheckVOSet(filterVO);
+        //colums
+        QueryWrapper<SysHospitalSet> hospitalSetQueryWrapper = new QueryWrapper<>();
+        hospitalSetQueryWrapper.eq("is_deleted", 'N')
+                .eq("hospital_id", filterVO.getHospitalId())
+                .eq("code", "medical_check_form_ks");
+        SysHospitalSet hospitalSet = sysHospitalSetFacade.getOne(hospitalSetQueryWrapper);
+
+        //表头生成
+        List<String> columnSet = Arrays.asList(hospitalSet.getValue().split(","));
+
+        //目标条目
+        List<Long> casesEntryIds = Lists.newArrayList();
+        //遍历第一个条目
+        for (String valueStr : columnSet) {
+            if (StringUtil.isBlank(valueStr)) {
+                continue;
+            }
+            String[] keyValue = valueStr.split("--");
+            if (keyValue != null || keyValue.length > 1) {
+                casesEntryIds.add(Long.valueOf(keyValue[0]));
+            }
+        }
+        IPage<MedicalCheckDTO> medicalCheck = behospitalInfoFacade.getMedicalChecks(filterVO,casesEntryIds);
+        return medicalCheck;
+    }
+
+
+    /**
+     * 未整改病历统计-科室
+     *
+     * @param filterUnModifyMRVO
+     * @return
+     */
+    public UnModifyMRDTO unModifyMRSByDept(FilterUnModifyMRVO filterUnModifyMRVO) {
+        UnModifyMRDTO unModifyMRDTO = new UnModifyMRDTO();
+        List<Object> retList = Lists.newLinkedList();
+        filterFacade.filterUnModifyMRVOSet(filterUnModifyMRVO);
+
+        //colums
+        QueryWrapper<SysHospitalSet> hospitalSetQueryWrapper = new QueryWrapper<>();
+        hospitalSetQueryWrapper.eq("is_deleted", 'N')
+                .eq("hospital_id", filterUnModifyMRVO.getHospitalId())
+                .eq("code", "unmodify_mr_entry_ks");
+        SysHospitalSet hospitalSet = sysHospitalSetFacade.getOne(hospitalSetQueryWrapper);
+        if (hospitalSet == null || StringUtil.isBlank(hospitalSet.getValue())) {
+            return unModifyMRDTO;
+        }
+
+        //表头生成
+        List<String> columnSet = Arrays.asList(hospitalSet.getValue().split(","));
+        List<ColumnDTO> columns = Lists.newLinkedList();
+        Integer orderNo = 1;
+        ColumnDTO columnDeptId = new ColumnDTO();
+        columnDeptId.setOrderNo(orderNo);
+        columnDeptId.setFieldName("doctorId");
+        columnDeptId.setColumnName("医生编码");
+        columnDeptId.setIsShow(0);
+        columns.add(columnDeptId);
+        orderNo++;
+        ColumnDTO columnDeptName = new ColumnDTO();
+        columnDeptName.setOrderNo(orderNo);
+        columnDeptName.setFieldName("doctorName");
+        columnDeptName.setColumnName("主管医生");
+        columnDeptName.setIsShow(1);
+        columns.add(columnDeptName);
+        orderNo++;
+        List<Long> casesEntryIds = Lists.newArrayList();
+        for (String valueStr : columnSet) {
+            if (StringUtil.isBlank(valueStr)) {
+                continue;
+            }
+            String[] keyValue = valueStr.split("--");
+            if (keyValue != null || keyValue.length > 1) {
+                casesEntryIds.add(Long.valueOf(keyValue[0]));
+                ColumnDTO columnId = new ColumnDTO();
+                columnId.setOrderNo(orderNo);
+                columnId.setId(Long.valueOf(keyValue[0]));
+                columnId.setFieldName("entry_" + keyValue[0] + "_id");
+                columnId.setColumnName(keyValue[1] + "id");
+                columnId.setIsShow(0);
+                columns.add(columnId);
+                orderNo++;
+                ColumnDTO columnName = new ColumnDTO();
+                columnName.setOrderNo(orderNo);
+                columnName.setId(Long.valueOf(keyValue[0]));
+                columnName.setFieldName("entry_" + keyValue[0] + "_name");
+                columnName.setColumnName(keyValue[1] + "name");
+                columnName.setIsShow(0);
+                columns.add(columnName);
+                orderNo++;
+                ColumnDTO columnNum = new ColumnDTO();
+                columnNum.setOrderNo(orderNo);
+                columnNum.setId(Long.valueOf(keyValue[0]));
+                columnNum.setFieldName("entry_" + keyValue[0] + "_num");
+                columnNum.setColumnName(keyValue[1]);
+                columnNum.setIsShow(1);
+                columns.add(columnNum);
+                orderNo++;
+            }
+        }
+        //条目未维护
+        if (ListUtil.isEmpty(casesEntryIds)) {
+            return unModifyMRDTO;
+        }
+
+        //casesEntryIds
+        filterUnModifyMRVO.setCasesEntryIds(casesEntryIds);
+        QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
+        qcCasesEntryQueryWrapper.eq("is_deleted", "N")
+                .in("id", casesEntryIds);
+        List<QcCasesEntry> casesEntryList = qcCasesEntryFacade.list(qcCasesEntryQueryWrapper);
+        // 实体类中将实体类转化为map形式,其中条目id对应目标条目名称
+        Map<Long, String> basCasesEntryMap = EntityUtil.makeMapWithKeyValue(casesEntryList, "id", "name");
+
+        List<UnModifyMRDetailDTO> records = behospitalInfoFacade.unModifyMRSByDept(filterUnModifyMRVO);
+        //以科室分组,将符合科室的每条数据以map形式存储
+        Map<String, List<UnModifyMRDetailDTO>> deptMap = EntityUtil.makeEntityListMap(records, "doctorName");
+        //科室对应科室id
+        Map<String, String> deptInfoMap = EntityUtil.makeMapWithKeyValue(records, "doctorName", "doctorId");
+        Map<String, Map<Long, UnModifyMRDetailDTO>> deptEntryMap = new LinkedHashMap<>();
+        for (Map.Entry<String, List<UnModifyMRDetailDTO>> entry : deptMap.entrySet()) {
+            Map<Long, UnModifyMRDetailDTO> entryMap = EntityUtil.makeEntityMap(entry.getValue(), "casesEntryId");
+            deptEntryMap.put(entry.getKey(), entryMap);
+        }
+
+        try {
+            for (Map.Entry<String, Map<Long, UnModifyMRDetailDTO>> entry : deptEntryMap.entrySet()) {
+                Object obj = new Object();
+                HashMap addMap = new HashMap();
+                HashMap addValMap = new HashMap();
+
+                addMap.put("doctorName", Class.forName("java.lang.String"));
+                addValMap.put("doctorName", entry.getKey());
+                addMap.put("doctorId", Class.forName("java.lang.String"));
+                addValMap.put("doctorId", deptInfoMap.get(entry.getKey()));
+
+                for (ColumnDTO item : columns) {
+                    if (item.getFieldName().lastIndexOf("_id") > 0) {
+                        addMap.put(item.getFieldName(), Class.forName("java.lang.Long"));
+                        if (item.getId() != null) {
+                            addValMap.put(item.getFieldName(), item.getId());
+                        } else {
+                            addValMap.put(item.getFieldName(), null);
+                        }
+                    } else if (item.getFieldName().lastIndexOf("_name") > 0) {
+                        addMap.put(item.getFieldName(), Class.forName("java.lang.String"));
+                        if (basCasesEntryMap.containsKey(item.getId())) {
+                            addValMap.put(item.getFieldName(), basCasesEntryMap.get(item.getId()));
+                        } else {
+                            addValMap.put(item.getFieldName(), "");
+                        }
+                    } else if (item.getFieldName().lastIndexOf("_num") > 0) {
+                        addMap.put(item.getFieldName(), Class.forName("java.lang.Integer"));
+                        if (entry.getValue().containsKey(item.getId())) {
+                            addValMap.put(item.getFieldName(), entry.getValue().get(item.getId()).getCasesEntryNum());
+                        } else {
+                            addValMap.put(item.getFieldName(), 0);
+                        }
+                    }
+                }
+                obj = new ClassUtil().dynamicClass(obj, addMap, addValMap);
+                retList.add(obj);
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        //排序
+        Collections.sort(retList, new Comparator<Object>() {
+            @Override
+            public int compare(Object o1, Object o2) {
+
+                if (StringUtil.isNotBlank(filterUnModifyMRVO.getAsc())) {
+                    //升序
+                    Object o1Val = ObjectUtil.getValueByKey(o1, filterUnModifyMRVO.getAsc());
+                    Object o2Val = ObjectUtil.getValueByKey(o2, filterUnModifyMRVO.getAsc());
+                    if (filterUnModifyMRVO.getAsc().lastIndexOf("_num") > 1) {
+                        return ((Integer) o1Val).compareTo((Integer) o2Val);
+                    }
+                    if (filterUnModifyMRVO.getAsc().lastIndexOf("_id") > 1) {
+                        return ((Long) o1Val).compareTo((Long) o2Val);
+                    } else {
+                        return ((String) o1Val).compareTo((String) o2Val);
+                    }
+                } else if (StringUtil.isNotBlank(filterUnModifyMRVO.getDesc())) {
+                    //降序
+                    Object o1Val = ObjectUtil.getValueByKey(o1, filterUnModifyMRVO.getDesc());
+                    Object o2Val = ObjectUtil.getValueByKey(o2, filterUnModifyMRVO.getDesc());
+                    if (filterUnModifyMRVO.getDesc().lastIndexOf("_num") > 1) {
+                        return ((Integer) o2Val).compareTo((Integer) o1Val);
+                    }
+                    if (filterUnModifyMRVO.getDesc().lastIndexOf("_id") > 1) {
+                        return ((Long) o2Val).compareTo((Long) o1Val);
+                    } else {
+                        return ((String) o2Val).compareTo((String) o1Val);
+                    }
+                } else {
+                    return 0;
+                }
+            }
+        });
+     /*   //增加全院数据
+        if (ListUtil.isNotEmpty(retList) &&
+                (StringUtil.isBlank(filterUnModifyMRVO.getDeptName())
+                        || filterUnModifyMRVO.getDeptName().equals("全院"))) {
+            try {
+
+                Object globleObj = new Object();
+                HashMap addMap = new HashMap();
+                HashMap addValMap = new HashMap();
+                addMap.put("deptId", Class.forName("java.lang.String"));
+                addValMap.put("deptId", "");
+                addMap.put("deptName", Class.forName("java.lang.String"));
+                addValMap.put("deptName", "全院");
+
+                for (ColumnDTO item : columns) {
+                    if (item.getFieldName().lastIndexOf("_id") > 0) {
+                        addMap.put(item.getFieldName(), Class.forName("java.lang.Long"));
+                        if (item.getId() != null) {
+                            addValMap.put(item.getFieldName(), item.getId());
+                        } else {
+                            addValMap.put(item.getFieldName(), null);
+                        }
+
+                    } else if (item.getFieldName().lastIndexOf("_name") > 0) {
+                        addMap.put(item.getFieldName(), Class.forName("java.lang.String"));
+                        if (basCasesEntryMap.containsKey(item.getId())) {
+                            addValMap.put(item.getFieldName(), basCasesEntryMap.get(item.getId()));
+                        } else {
+                            addValMap.put(item.getFieldName(), "");
+                        }
+
+                    } else if (item.getFieldName().lastIndexOf("_num") > 0) {
+                        addMap.put(item.getFieldName(), Class.forName("java.lang.Integer"));
+                        Integer entryNum = retList
+                                .stream()
+                                .map(i -> ObjectUtil.getValueByKey(i, item.getFieldName()))
+                                .filter(i -> i != null)
+                                .map(i -> (Integer) i)
+                                .reduce(0, Integer::sum);
+                        addValMap.put(item.getFieldName(), entryNum);
+                    }
+                }
+                globleObj = new ClassUtil().dynamicClass(globleObj, addMap, addValMap);
+                retList.add(0, globleObj);
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }*/
+        unModifyMRDTO.setColumns(columns);
+        unModifyMRDTO.setData(retList);
+        return unModifyMRDTO;
+    }
+
+
+
 }

+ 7 - 7
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -230,7 +230,7 @@ public class ConsoleExportFacade {
         Date startDate = qcResultShortPageVO.getStartDate();
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔90天
-        long interval = 90l * 24l * 60l * 60l * 1000l;
+        long interval = 90 * 24l * 60l * 60l * 1000l;
         if (endDate.getTime() < startDate.getTime()) {
             throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
         }
@@ -263,7 +263,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90l * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -310,7 +310,7 @@ public class ConsoleExportFacade {
                 List<ExportExcelWideBehospitalDTO> exportExcelWideBehospitalDTOs = new ArrayList<>();
                 excelBehospitalDTOS.forEach(exportExcelBehospitalDTO->{
                     ExportExcelWideBehospitalDTO exportExcelWideBehospitalDTO = new ExportExcelWideBehospitalDTO();
-                    exportExcelWideBehospitalDTO.setBehDoctorName(exportExcelBehospitalDTO.getBehDoctorName());
+                    exportExcelWideBehospitalDTO.setDoctorName(exportExcelBehospitalDTO.getDoctorName());
                     exportExcelWideBehospitalDTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
                     exportExcelWideBehospitalDTO.setBehospitalDate(exportExcelBehospitalDTO.getBehospitalDate());
                     exportExcelWideBehospitalDTO.setLeaveHospitalDate(exportExcelBehospitalDTO.getLeaveHospitalDate());
@@ -354,7 +354,7 @@ public class ConsoleExportFacade {
         Date startDate = qcResultShortPageVO.getStartDate();
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
-        long interval = 90l * 24l * 60l * 60l * 1000l;
+        long interval = 90 * 24l * 60l * 60l * 1000l;
         if (endDate.getTime() < startDate.getTime()) {
             throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
         }
@@ -387,7 +387,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90l * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -506,7 +506,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90l * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -561,7 +561,7 @@ public class ConsoleExportFacade {
 
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90l * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天

+ 2 - 2
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -1972,7 +1972,7 @@ public class ConsoleFacade {
                 ReBeHosDetailDTO lastDetailRecord = new ReBeHosDetailDTO();
                 lastDetailRecord.setName(record.getName());
                 lastDetailRecord.setBehDeptId(record.getLastBehDeptId());
-                lastDetailRecord.setBehDeptName(record.getBehDeptName());
+                lastDetailRecord.setBehDeptName(record.getLastBehDeptName());
                 lastDetailRecord.setBehospitalCode(record.getLastBehospitalCode());
                 lastDetailRecord.setBehospitalDate(record.getLastBehospitalDate());
                 lastDetailRecord.setLeaveHospitalDate(record.getLastLeaveHospitalDate());
@@ -2082,7 +2082,7 @@ public class ConsoleFacade {
 
 
     /**
-     * 病历稽查表(首页)
+     * 病历稽查表
      *
      * @param filterVO
      * @return

+ 12 - 0
src/main/java/com/diagbot/facade/FilterFacade.java

@@ -393,6 +393,18 @@ public class FilterFacade {
         /*long interval = qcResultShortPageVO.getEndDate().getTime() + 1000;
         qcResultShortPageVO.setEndDate(new Date(Long.valueOf(interval)));*/
     }
+    /**
+     * 合格/不合格数病历号入参拼接-科室
+     *
+     * @param qcResultPageVO
+     */
+    public void OrGoodLevelPageVOSet(QcResultPageVO qcResultPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        qcResultPageVO.setHospitalId(hospitalId);
+        qcResultPageVO.setUserId(Long.valueOf(userId));
+    }
+
 
     /**
      * 关键条目缺陷占比入参拼接

+ 15 - 8
src/main/java/com/diagbot/facade/SysUserFacade.java

@@ -49,11 +49,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -92,6 +88,8 @@ public class SysUserFacade extends SysUserServiceImpl {
 
     @Autowired
     private SysUserHospitalFacade sysUserHospitalFacade;
+    @Autowired
+    private SysUserRoleFacade sysUserRoleFacade;
 
     /**
      * 获取jwt
@@ -275,12 +273,21 @@ public class SysUserFacade extends SysUserServiceImpl {
      */
     public LoginDTO getUserOrgMenu() {
         LoginDTO data = new LoginDTO();
-
+        Set<String> roleSet = new HashSet<>();
         Long userId = Long.parseLong(SysUserUtils.getCurrentPrincipleID());
         SysUser user = this.getOne(new QueryWrapper<SysUser>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("status", StatusEnum.Enable.getKey())
                 .eq("id", userId), false);
+        QueryWrapper<SysUserRole> sysUserRoleQueryWrapper = new QueryWrapper<>();
+        sysUserRoleQueryWrapper.eq("user_id",userId);
+        sysUserRoleQueryWrapper .eq("is_deleted", IsDeleteEnum.N.getKey());
+        List<SysUserRole> sysUserRoleList = sysUserRoleFacade.list(sysUserRoleQueryWrapper);
+        if(ListUtil.isNotEmpty(sysUserRoleList)){
+            sysUserRoleList.forEach(sysUserRole ->{
+                    roleSet.add(sysUserRole.getRoleId()+"");
+            } );
+        }
         if (user == null) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "用户不存在【" + userId + "】");
@@ -302,8 +309,8 @@ public class SysUserFacade extends SysUserServiceImpl {
         }
 
         //添加菜单信息
-        List<SysMenuWrapper> menuList = sysMenuFacade.getByRole(user.getId());
-        List<SysUserPermissionDTO> sysUserPermissionDTOList = sysMenuFacade.getByRolePermission(user.getId());
+        List<SysMenuWrapper> menuList = sysMenuFacade.getByRole(user.getId(),roleSet);
+        List<SysUserPermissionDTO> sysUserPermissionDTOList = sysMenuFacade.getByRolePermission(user.getId(),roleSet);
         Map<Long, List<SysMenuWrapper>> menuMap = EntityUtil.makeEntityListMap(menuList, "parentId");
         Map<Long, List<SysUserPermissionDTO>> menuPermissionMap = EntityUtil.makeEntityListMap(sysUserPermissionDTOList, "menuId");
         List<SysMenuWrapper> menuRes = menuMap.get(-1L);

+ 208 - 0
src/main/java/com/diagbot/facade/str/BStrAdmissionNoteFacade.java

@@ -0,0 +1,208 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrAdmissionNote;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrAdmissionNoteServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrAdmissionNoteVO;
+import com.diagbot.vo.str.StrAdmissionNoteVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrAdmissionNoteFacade extends StrAdmissionNoteServiceImpl {
+
+    @Autowired
+    @Qualifier("strAdmissionNoteServiceImpl")
+    private StrAdmissionNoteServiceImpl strAdmissionNoteService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh() {
+        List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
+        list.forEach(s -> {
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap = EntityUtil.makeMapWithKeyValue(list, "ch", "en");
+        Boolean flag = columnFacade.createColumn(columnMap, "strAdmissionNote");
+
+        //Map<String, String> map=columnFacade.getColumn("strAdmissionNote");
+        if (!flag) {
+            return;
+        }
+    }
+
+    //入院记录
+    public void dealData(String columnMap, Map<String, Object> entityMap, Long hospitalId) {
+        StrAdmissionNote strAdmissionNote = new StrAdmissionNote();
+        try {
+            AStrAdmissionNoteVO strAdmissionNoteVO = (AStrAdmissionNoteVO) MapUtil.mapToObject(entityMap, AStrAdmissionNoteVO.class);
+            BeanUtils.copyProperties(strAdmissionNoteVO, strAdmissionNote);
+            strAdmissionNote.setHospitalId(hospitalId);//医院编码
+
+            strAdmissionNote.setAuditDate(DateUtil.parseDateTime(strAdmissionNoteVO.getAuditDate()));//审核时间
+            strAdmissionNote.setRecDate(DateUtil.parseDateTime(strAdmissionNoteVO.getRecDate()));//记录时间
+            strAdmissionNote.setBehospitalDate(DateUtil.parseDateTime(strAdmissionNoteVO.getBehospitalDate()));//入院日期
+            strAdmissionNote.setBirthday(DateUtil.parseDate(strAdmissionNoteVO.getBirthday()));//出生日期
+            strAdmissionNote.setRecordDate(DateUtil.parseDateTime(strAdmissionNoteVO.getRecordDate()));//病历日期
+
+            strAdmissionNote.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if (isExist(strAdmissionNote)) {
+                strAdmissionNote.setGmtCreate(new Date());//记录创建时间
+                this.save(strAdmissionNote);
+            } else {
+                strAdmissionNote.setGmtModified(new Date());//记录修改时间
+                this.update(strAdmissionNote, new QueryWrapper<StrAdmissionNote>()
+                        .eq("rec_id", strAdmissionNote.getRecId())
+                        .eq("hospital_id", strAdmissionNote.getHospitalId())
+                        .eq("behospital_code", strAdmissionNote.getBehospitalCode()));
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("入院记录", strAdmissionNote.getRecId(), JSON.toJSONString(entityMap), "", e.getMessage());
+        }
+    }
+
+    public Boolean isExist(StrAdmissionNote strAdmissionNote) {
+        Boolean flag = true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrAdmissionNote>()
+                .eq("rec_id", strAdmissionNote.getRecId())
+                .eq("hospital_id", strAdmissionNote.getHospitalId())
+                .eq("behospital_code", strAdmissionNote.getBehospitalCode()));
+        if (count > 0) {
+            flag = false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:入院记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrAdmissionNoteVO> list) {
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrAdmissionNoteVO strAdmissionNoteVO:list) {
+                    if("".equals(strAdmissionNoteVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strAdmissionNoteVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strAdmissionNoteVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrAdmissionNote> strAdmissionNoteList=initData(list);
+                execute(strAdmissionNoteList);
+
+                if(logSwitch){
+                    strAdmissionNoteList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-入院记录-正常", s.getRecId(), JSON.toJSONString(list), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-入院记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+
+    }
+
+    /**
+     * @Description:入库前,初始化数据库
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    private List<StrAdmissionNote> initData(List<StrAdmissionNoteVO> list) throws Exception{
+        List<StrAdmissionNote> strAdmissionNoteList=Lists.newArrayList();
+        for (StrAdmissionNoteVO s:list) {
+            StrAdmissionNote t=new StrAdmissionNote();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getBirthday())){
+                t.setBirthday(DateUtil.parseDate(s.getBirthday()));//出生日期
+            }
+            if(StringUtil.isNotEmpty(s.getBehospitalDate())){
+                t.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));//入院日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.BEHOSPITAL_INFO.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            t.setWholeData(JSON.toJSONString(wholeMap));
+            strAdmissionNoteList.add(t);
+        }
+        return strAdmissionNoteList;
+    }
+
+    public void execute(List<StrAdmissionNote> list) throws Exception{
+        List<StrAdmissionNote> addE = Lists.newLinkedList();
+        List<StrAdmissionNote> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.forEach(s -> {
+                StrAdmissionNote strAdmissionNote = this.getOne(new QueryWrapper<StrAdmissionNote>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strAdmissionNote != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strAdmissionNoteService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+
+}

+ 200 - 0
src/main/java/com/diagbot/facade/str/BStrBloodResultFacade.java

@@ -0,0 +1,200 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrBloodResult;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrBloodResultServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrBloodResultVO;
+import com.diagbot.vo.str.StrBloodResultVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:输血后效果评价-业务类
+ * @Author:liuqq
+ * @time: ${DATE} ${TIME}
+ **/
+@Component
+public class BStrBloodResultFacade extends StrBloodResultServiceImpl {
+
+    @Autowired
+    @Qualifier("strBloodResultServiceImpl")
+    private StrBloodResultServiceImpl strBloodResultService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strBloodResult");
+        if(!flag){
+            return;
+        }
+        //Map<String, String> map=columnFacade.getColumn("strBloodResult");
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrBloodResult strBloodResult=new StrBloodResult();
+        try {
+            AStrBloodResultVO strBloodResultVO=(AStrBloodResultVO) MapUtil.mapToObject(entityMap, AStrBloodResultVO.class);
+            BeanUtils.copyProperties(strBloodResultVO,strBloodResult);
+            strBloodResult.setHospitalId(hospitalId);//医院编码
+            strBloodResult.setAuditDate(DateUtil.parseDateTime(strBloodResultVO.getAuditDate()));//审核时间
+            strBloodResult.setRecDate(DateUtil.parseDateTime(strBloodResultVO.getRecDate()));//记录时间
+            strBloodResult.setRecordDate(DateUtil.parseDateTime(strBloodResultVO.getRecordDate()));//病历日期
+
+            strBloodResult.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strBloodResult)){
+                strBloodResult.setGmtCreate(new Date());//记录创建时间
+                this.save(strBloodResult);
+            }else{
+                strBloodResult.setGmtModified(new Date());//记录修改时间
+                this.update(strBloodResult,new QueryWrapper<StrBloodResult>()
+                        .eq("rec_id", strBloodResult.getRecId())
+                        .eq("hospital_id", strBloodResult.getHospitalId())
+                        .eq("behospital_code", strBloodResult.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("输血效果评价",strBloodResult.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    /**
+     * @Description: 是否存在
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public Boolean isExist(StrBloodResult strBloodResult){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrBloodResult>()
+                .eq("rec_id", strBloodResult.getRecId())
+                .eq("hospital_id", strBloodResult.getHospitalId())
+                .eq("behospital_code", strBloodResult.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:输血后效果评价-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrBloodResultVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrBloodResultVO strBloodResultVO:list) {
+                    if("".equals(strBloodResultVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strBloodResultVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strBloodResultVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrBloodResult> strBloodResultList= initData(list);
+                execute(strBloodResultList);
+
+                if(logSwitch){
+                    strBloodResultList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-输血后效果评价-正常", s.getRecId(), JSON.toJSONString(list), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-输血后效果评价-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrBloodResult> initData(List<StrBloodResultVO> list) throws Exception{
+        List<StrBloodResult> tList=Lists.newArrayList();
+        for (StrBloodResultVO s:list) {
+            StrBloodResult t=new StrBloodResult();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.BLOOD_RESULT.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrBloodResult> list) throws Exception{
+        List<StrBloodResult> addE = Lists.newLinkedList();
+        List<StrBloodResult> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrBloodResult strBloodResult = this.getOne(new QueryWrapper<StrBloodResult>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strBloodResult != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strBloodResultService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 211 - 0
src/main/java/com/diagbot/facade/str/BStrBloodTransfusionFacade.java

@@ -0,0 +1,211 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrBloodTransfusion;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrBloodTransfusionServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrBloodTransfusionVO;
+import com.diagbot.vo.str.StrBloodTransfusionVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:输血/血制品病程记录-业务类
+ * @Author:liuqq
+ * @time: ${DATE} ${TIME}
+ **/
+@Component
+public class BStrBloodTransfusionFacade extends StrBloodTransfusionServiceImpl {
+
+    @Autowired
+    @Qualifier("strBloodTransfusionServiceImpl")
+    private StrBloodTransfusionServiceImpl strBloodTransfusionService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strBloodTransfusion");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrBloodTransfusion strBloodTransfusion=new StrBloodTransfusion();
+        try {
+            AStrBloodTransfusionVO strBloodTransfusionVO=(AStrBloodTransfusionVO) MapUtil.mapToObject(entityMap, AStrBloodTransfusionVO.class);
+            BeanUtils.copyProperties(strBloodTransfusionVO,strBloodTransfusion);
+            strBloodTransfusion.setHospitalId(hospitalId);//医院编码
+            strBloodTransfusion.setStartTime(DateUtil.parseDateTime(strBloodTransfusionVO.getStartTime()));
+            strBloodTransfusion.setEndTime(DateUtil.parseDateTime(strBloodTransfusionVO.getEndTime()));
+            strBloodTransfusion.setAuditDate(DateUtil.parseDateTime(strBloodTransfusionVO.getAuditDate()));//审核时间
+            strBloodTransfusion.setRecDate(DateUtil.parseDateTime(strBloodTransfusionVO.getRecDate()));//记录时间
+            strBloodTransfusion.setRecordDate(DateUtil.parseDateTime(strBloodTransfusionVO.getRecordDate()));//病历日期
+
+            strBloodTransfusion.setWholeData(columnMap);
+
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strBloodTransfusion)){
+                strBloodTransfusion.setGmtCreate(new Date());//记录创建时间
+                this.save(strBloodTransfusion);
+            }else{
+                strBloodTransfusion.setGmtModified(new Date());//记录修改时间
+                this.update(strBloodTransfusion,new QueryWrapper<StrBloodTransfusion>()
+                        .eq("rec_id", strBloodTransfusion.getRecId())
+                        .eq("hospital_id", strBloodTransfusion.getHospitalId())
+                        .eq("behospital_code", strBloodTransfusion.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("输血记录", strBloodTransfusion.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrBloodTransfusion strBloodTransfusion){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrBloodTransfusion>()
+                .eq("rec_id", strBloodTransfusion.getRecId())
+                .eq("hospital_id", strBloodTransfusion.getHospitalId())
+                .eq("behospital_code", strBloodTransfusion.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:输血/血制品病程记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrBloodTransfusionVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrBloodTransfusionVO strBloodTransfusionVO:list) {
+                    if("".equals(strBloodTransfusionVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strBloodTransfusionVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strBloodTransfusionVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrBloodTransfusion> strBloodTransfusionList= initData(list);
+                execute(strBloodTransfusionList);
+
+                if(logSwitch){
+                    strBloodTransfusionList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-输血后效果评价-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-输血后效果评价-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrBloodTransfusion> initData(List<StrBloodTransfusionVO> list) throws Exception{
+        List<StrBloodTransfusion> tList=Lists.newArrayList();
+        for (StrBloodTransfusionVO s:list) {
+            StrBloodTransfusion t=new StrBloodTransfusion();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getStartTime())){
+                t.setStartTime(DateUtil.parseDateTime(s.getStartTime()));//开始日期
+            }
+            if(StringUtil.isNotEmpty(s.getEndTime())){
+                t.setEndTime(DateUtil.parseDateTime(s.getEndTime()));//结束日期
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.BLOOD_TRANSFUSION.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrBloodTransfusion> list){
+        try {
+            List<StrBloodTransfusion> addE = Lists.newLinkedList();
+            List<StrBloodTransfusion> updateE = Lists.newLinkedList();
+            if (list != null && list.size() > 0) {
+                list.stream().forEach(s -> {
+                    StrBloodTransfusion strBloodTransfusion = this.getOne(new QueryWrapper<StrBloodTransfusion>()
+                            .eq("is_deleted", IsDeleteEnum.N.getKey())
+                            .eq("rec_id", s.getRecId())
+                            .eq("hospital_id", s.getHospitalId())
+                            .eq("behospital_code",s.getBehospitalCode()), false);
+                    if (strBloodTransfusion != null) {
+                        s.setGmtModified(new Date());
+                        updateE.add(s);
+                    } else {
+                        s.setGmtCreate(new Date());
+                        addE.add(s);
+                    }
+                });
+            }
+            if(addE.size()>0){
+                strBloodTransfusionService.saveBatch(addE);
+            }
+            if(updateE.size()>0){
+                this.baseMapper.updateBatchByKey(updateE);
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-入院记录","", JSON.toJSONString(list),"",e.getMessage());
+        }
+    }
+}

+ 206 - 0
src/main/java/com/diagbot/facade/str/BStrConsultationApplyFacade.java

@@ -0,0 +1,206 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrConsultationApply;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrConsultationApplyServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrConsultationApplyVO;
+import com.diagbot.vo.str.StrConsultationApplyVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrConsultationApplyFacade extends StrConsultationApplyServiceImpl {
+
+    @Autowired
+    @Qualifier("strConsultationApplyServiceImpl")
+    private StrConsultationApplyServiceImpl strConsultationApplyService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strConsultationApply");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //会诊申请单
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrConsultationApply strConsultationApply=new StrConsultationApply();
+        try {
+            AStrConsultationApplyVO strConsultationApplyVO=(AStrConsultationApplyVO) MapUtil.mapToObject(entityMap, AStrConsultationApplyVO.class);
+            BeanUtils.copyProperties(strConsultationApplyVO,strConsultationApply);
+            strConsultationApply.setHospitalId(hospitalId);//医院编码
+
+            strConsultationApply.setAuditDate(DateUtil.parseDateTime(strConsultationApplyVO.getAuditDate()));//审核时间
+            strConsultationApply.setRecDate(DateUtil.parseDateTime(strConsultationApplyVO.getRecDate()));//记录时间
+            strConsultationApply.setBehospitalDate(DateUtil.parseDateTime(strConsultationApplyVO.getBehospitalDate()));//入院日期
+            strConsultationApply.setRecordDate(DateUtil.parseDateTime(strConsultationApplyVO.getRecordDate()));//病历日期
+            strConsultationApply.setApplyDate(DateUtil.parseDateTime(strConsultationApplyVO.getApplyDate()));//申请日期
+            strConsultationApply.setConsultationDate(DateUtil.parseDateTime(strConsultationApplyVO.getConsultationDate()));//会诊时间
+            strConsultationApply.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strConsultationApply)){
+                strConsultationApply.setGmtCreate(new Date());//记录创建时间
+                this.save(strConsultationApply);
+            }else{
+                strConsultationApply.setGmtModified(new Date());//记录修改时间
+                this.update(strConsultationApply,new QueryWrapper<StrConsultationApply>()
+                        .eq("rec_id", strConsultationApply.getRecId())
+                        .eq("hospital_id", strConsultationApply.getHospitalId())
+                        .eq("behospital_code", strConsultationApply.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单",strConsultationApply.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrConsultationApply strConsultationApply){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrConsultationApply>()
+                .eq("rec_id", strConsultationApply.getRecId())
+                .eq("hospital_id", strConsultationApply.getHospitalId())
+                .eq("behospital_code", strConsultationApply.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:会诊申请单-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrConsultationApplyVO> list){
+        try {
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrConsultationApplyVO strConsultationApplyVO:list) {
+                    if("".equals(strConsultationApplyVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strConsultationApplyVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strConsultationApplyVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrConsultationApply> strConsultationApplyList= initData(list);
+                execute(strConsultationApplyList);
+
+                if(logSwitch){
+                    strConsultationApplyList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊申请单-正常", s.getRecId(), JSON.toJSONString(list), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊申请单-异常", s.getRecId(), JSON.toJSONString(s), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrConsultationApply> initData(List<StrConsultationApplyVO> list) throws Exception{
+        List<StrConsultationApply> tList=Lists.newArrayList();
+        for (StrConsultationApplyVO s:list) {
+            StrConsultationApply t=new StrConsultationApply();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getBehospitalDate())){
+                t.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));//入院日期
+            }
+            if(StringUtil.isNotEmpty(s.getApplyDate())){
+                t.setApplyDate(DateUtil.parseDateTime(s.getApplyDate()));//申请日期
+            }
+            if(StringUtil.isNotEmpty(s.getConsultationDate())){
+                t.setConsultationDate(DateUtil.parseDateTime(s.getConsultationDate()));//会诊时间
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.CONSULTATION_APPLY.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrConsultationApply> list) throws Exception{
+        List<StrConsultationApply> addE = Lists.newLinkedList();
+        List<StrConsultationApply> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrConsultationApply strConsultationApply = this.getOne(new QueryWrapper<StrConsultationApply>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strConsultationApply != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strConsultationApplyService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+
+}

+ 207 - 0
src/main/java/com/diagbot/facade/str/BStrConsultationNoteFacade.java

@@ -0,0 +1,207 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrConsultationNote;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrConsultationNoteServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrConsultationNoteVO;
+import com.diagbot.vo.str.StrConsultationNoteVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrConsultationNoteFacade extends StrConsultationNoteServiceImpl {
+
+    @Autowired
+    @Qualifier("strConsultationNoteServiceImpl")
+    private StrConsultationNoteServiceImpl strConsultationNoteService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap=EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strConsultationNote");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //会诊单(申请和结果)
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrConsultationNote strConsultationNote=new StrConsultationNote();
+        try {
+            AStrConsultationNoteVO strConsultationNoteVO=(AStrConsultationNoteVO) MapUtil.mapToObject(entityMap, AStrConsultationNoteVO.class);
+            BeanUtils.copyProperties(strConsultationNoteVO,strConsultationNote);
+            strConsultationNote.setHospitalId(hospitalId);//医院编码
+
+            strConsultationNote.setAuditDate(DateUtil.parseDateTime(strConsultationNoteVO.getAuditDate()));//审核时间
+            strConsultationNote.setRecDate(DateUtil.parseDateTime(strConsultationNoteVO.getRecDate()));//记录时间
+            strConsultationNote.setBehospitalDate(DateUtil.parseDateTime(strConsultationNoteVO.getBehospitalDate()));//入院日期
+            strConsultationNote.setApplyDate(DateUtil.parseDate(strConsultationNoteVO.getApplyDate()));//申请日期
+            strConsultationNote.setRecordDate(DateUtil.parseDateTime(strConsultationNoteVO.getRecordDate()));//病历日期
+            strConsultationNote.setConsultationDate(DateUtil.parseDateTime(strConsultationNoteVO.getConsultationDate()));//会诊时间
+
+            strConsultationNote.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strConsultationNote)){
+                strConsultationNote.setGmtCreate(new Date());//记录创建时间
+                this.save(strConsultationNote);
+            }else{
+                strConsultationNote.setGmtModified(new Date());//记录修改时间
+                this.update(strConsultationNote,new QueryWrapper<StrConsultationNote>()
+                        .eq("rec_id", strConsultationNote.getRecId())
+                        .eq("hospital_id", strConsultationNote.getHospitalId())
+                        .eq("behospital_code", strConsultationNote.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊单(申请和结果)",strConsultationNote.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrConsultationNote strConsultationNote){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrConsultationNote>()
+                .eq("rec_id", strConsultationNote.getRecId())
+                .eq("hospital_id", strConsultationNote.getHospitalId())
+                .eq("behospital_code", strConsultationNote.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:会诊单(申请和结果)-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrConsultationNoteVO> list){
+        try {
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrConsultationNoteVO strConsultationNoteVO:list) {
+                    if("".equals(strConsultationNoteVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strConsultationNoteVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strConsultationNoteVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrConsultationNote> strConsultationNoteList= initData(list);
+                execute(strConsultationNoteList);
+
+                if(logSwitch){
+                    strConsultationNoteList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊单(申请和结果)-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+            list.forEach(s->{
+            aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊单(申请和结果)-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+            });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrConsultationNote> initData(List<StrConsultationNoteVO> list) throws Exception{
+        List<StrConsultationNote> tList=Lists.newArrayList();
+        for (StrConsultationNoteVO s:list) {
+            StrConsultationNote t=new StrConsultationNote();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getBehospitalDate())){
+                t.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));//入院日期
+            }
+            if(StringUtil.isNotEmpty(s.getApplyDate())){
+                t.setApplyDate(DateUtil.parseDateTime(s.getApplyDate()));//申请日期
+            }
+            if(StringUtil.isNotEmpty(s.getConsultationDate())){
+                t.setConsultationDate(DateUtil.parseDateTime(s.getConsultationDate()));//会诊时间
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.CONSULTATION_NOTE.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrConsultationNote> list) throws Exception{
+        List<StrConsultationNote> addE = Lists.newLinkedList();
+        List<StrConsultationNote> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrConsultationNote strConsultationNote = this.getOne(new QueryWrapper<StrConsultationNote>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strConsultationNote != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strConsultationNoteService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+
+}

+ 205 - 0
src/main/java/com/diagbot/facade/str/BStrConsultationRecordFacade.java

@@ -0,0 +1,205 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrConsultationRecord;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrConsultationRecordServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.AStrConsultationRecordVO;
+import com.diagbot.vo.str.StrConsultationRecordVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+@Component
+public class BStrConsultationRecordFacade extends StrConsultationRecordServiceImpl {
+
+    @Autowired
+    @Qualifier("strConsultationRecordServiceImpl")
+    private StrConsultationRecordServiceImpl strConsultationRecordService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strConsultationRecord");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationRecord");
+        if(!flag){
+            return;
+        }
+    }
+
+    //会诊记录
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrConsultationRecord strConsultationRecord=new StrConsultationRecord();
+        try {
+            AStrConsultationRecordVO AStrConsultationRecordVO=(AStrConsultationRecordVO) MapUtil.mapToObject(entityMap, AStrConsultationRecordVO.class);
+            BeanUtils.copyProperties(AStrConsultationRecordVO,strConsultationRecord);
+            strConsultationRecord.setHospitalId(hospitalId);//医院编码
+
+            strConsultationRecord.setRecordDate(DateUtil.parseDateTime(AStrConsultationRecordVO.getRecordDate()));//病历日期recordDate
+            strConsultationRecord.setBehospitalDate(DateUtil.parseDateTime(AStrConsultationRecordVO.getBehospitalDate()));//入院日期behospital_date
+            strConsultationRecord.setApplyDate(DateUtil.parseDateTime(AStrConsultationRecordVO.getApplyDate()));//申请日期apply_date
+            strConsultationRecord.setConsultationDate(DateUtil.parseDate(AStrConsultationRecordVO.getConsultationArriveDate()));//会诊时间consultation_date
+            strConsultationRecord.setRecDate(DateUtil.parseDateTime(AStrConsultationRecordVO.getRecDate()));//记录时间rec_date
+            strConsultationRecord.setAuditDate(DateUtil.parseDateTime(AStrConsultationRecordVO.getAuditDate()));//审核时间audit_date
+
+            strConsultationRecord.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strConsultationRecord)){
+                strConsultationRecord.setGmtCreate(new Date());//记录创建时间
+                this.save(strConsultationRecord);
+            }else{
+                strConsultationRecord.setGmtModified(new Date());//记录修改时间
+                this.update(strConsultationRecord,new QueryWrapper<StrConsultationRecord>()
+                        .eq("rec_id", strConsultationRecord.getRecId())
+                        .eq("hospital_id", strConsultationRecord.getHospitalId())
+                        .eq("behospital_code", strConsultationRecord.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊记录)",strConsultationRecord.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrConsultationRecord strConsultationRecord){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrConsultationRecord>()
+                .eq("rec_id", strConsultationRecord.getRecId())
+                .eq("hospital_id", strConsultationRecord.getHospitalId())
+                .eq("behospital_code", strConsultationRecord.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:会诊记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrConsultationRecordVO> list){
+        try {
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrConsultationRecordVO strConsultationRecordVO:list) {
+                    if("".equals(strConsultationRecordVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strConsultationRecordVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strConsultationRecordVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrConsultationRecord> strConsultationRecordList= initData(list);
+                execute(strConsultationRecordList);
+
+                if(logSwitch){
+                    strConsultationRecordList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrConsultationRecord> initData(List<StrConsultationRecordVO> list) throws Exception{
+        List<StrConsultationRecord> tList=Lists.newArrayList();
+        for (StrConsultationRecordVO s:list) {
+            StrConsultationRecord t=new StrConsultationRecord();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getBehospitalDate())){
+                t.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));//入院日期
+            }
+            if(StringUtil.isNotEmpty(s.getApplyDate())){
+                t.setApplyDate(DateUtil.parseDateTime(s.getApplyDate()));//申请日期
+            }
+            if(StringUtil.isNotEmpty(s.getConsultationDate())){
+                t.setConsultationDate(DateUtil.parseDateTime(s.getConsultationDate()));//会诊时间
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.CONSULTATION_RECORD.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrConsultationRecord> list){
+        List<StrConsultationRecord> addE = Lists.newLinkedList();
+        List<StrConsultationRecord> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrConsultationRecord strConsultationRecord = this.getOne(new QueryWrapper<StrConsultationRecord>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strConsultationRecord != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strConsultationRecordService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 211 - 0
src/main/java/com/diagbot/facade/str/BStrConsultationResultFacade.java

@@ -0,0 +1,211 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrConsultationResult;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrConsultationResultServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrConsultationResultVO;
+import com.diagbot.vo.str.StrConsultationResultVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:会诊结果单-业务类
+ * @Author:liuqq
+ * @time: ${DATE} ${TIME}
+ **/
+@Component
+public class BStrConsultationResultFacade extends StrConsultationResultServiceImpl {
+
+    @Autowired
+    @Qualifier("strConsultationResultServiceImpl")
+    private StrConsultationResultServiceImpl strConsultationResultService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strConsultationResult");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //会诊结果单
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrConsultationResult strConsultationResult=new StrConsultationResult();
+        try {
+            AStrConsultationResultVO strConsultationResultVO=(AStrConsultationResultVO) MapUtil.mapToObject(entityMap, AStrConsultationResultVO.class);
+            BeanUtils.copyProperties(strConsultationResultVO,strConsultationResult);
+            strConsultationResult.setHospitalId(hospitalId);//医院编码
+
+            strConsultationResult.setAuditDate(DateUtil.parseDateTime(strConsultationResultVO.getAuditDate()));//审核时间
+            strConsultationResult.setRecDate(DateUtil.parseDateTime(strConsultationResultVO.getRecDate()));//记录时间
+            strConsultationResult.setBehospitalDate(DateUtil.parseDateTime(strConsultationResultVO.getBehospitalDate()));//入院日期
+            strConsultationResult.setApplyDate(DateUtil.parseDate(strConsultationResultVO.getApplyDate()));//申请时间
+            strConsultationResult.setRecordDate(DateUtil.parseDateTime(strConsultationResultVO.getRecordDate()));//病历日期
+            strConsultationResult.setConsultationArriveDate(DateUtil.parseDateTime(strConsultationResultVO.getConsultationArriveDate()));//会诊到达时间
+
+            strConsultationResult.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strConsultationResult)){
+                strConsultationResult.setGmtCreate(new Date());//记录创建时间
+                this.save(strConsultationResult);
+            }else{
+                strConsultationResult.setGmtModified(new Date());//记录修改时间
+                this.update(strConsultationResult,new QueryWrapper<StrConsultationResult>()
+                        .eq("rec_id", strConsultationResult.getRecId())
+                        .eq("hospital_id", strConsultationResult.getHospitalId())
+                        .eq("behospital_code", strConsultationResult.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("会诊结果单",strConsultationResult.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrConsultationResult strConsultationResult){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrConsultationResult>()
+                .eq("rec_id", strConsultationResult.getRecId())
+                .eq("hospital_id", strConsultationResult.getHospitalId())
+                .eq("behospital_code", strConsultationResult.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:会诊结果单-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrConsultationResultVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrConsultationResultVO strConsultationResultVO:list) {
+                    if("".equals(strConsultationResultVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strConsultationResultVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strConsultationResultVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrConsultationResult> strConsultationResultList= initData(list);
+                execute(strConsultationResultList);
+
+                if(logSwitch){
+                    strConsultationResultList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊结果单-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊结果单-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrConsultationResult> initData(List<StrConsultationResultVO> list) throws Exception{
+        List<StrConsultationResult> tList=Lists.newArrayList();
+        for (StrConsultationResultVO s:list) {
+            StrConsultationResult t=new StrConsultationResult();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getBehospitalDate())){
+                t.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));//入院日期
+            }
+            if(StringUtil.isNotEmpty(s.getApplyDate())){
+                t.setApplyDate(DateUtil.parseDateTime(s.getApplyDate()));//申请日期
+            }
+            if(StringUtil.isNotEmpty(s.getConsultationArriveDate())){
+                t.setConsultationArriveDate(DateUtil.parseDateTime(s.getConsultationArriveDate()));//会诊到达时间
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.CONSULTATION_RESULT.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrConsultationResult> list){
+        List<StrConsultationResult> addE = Lists.newLinkedList();
+        List<StrConsultationResult> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrConsultationResult strConsultationResult = this.getOne(new QueryWrapper<StrConsultationResult>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strConsultationResult != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strConsultationResultService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 197 - 0
src/main/java/com/diagbot/facade/str/BStrCrisisNoteFacade.java

@@ -0,0 +1,197 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrCrisisNote;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrCrisisNoteServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrCrisisNoteVO;
+import com.diagbot.vo.str.StrCrisisNoteVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrCrisisNoteFacade extends StrCrisisNoteServiceImpl {
+
+    @Autowired
+    @Qualifier("strCrisisNoteServiceImpl")
+    private StrCrisisNoteServiceImpl strCrisisNoteService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strCrisisNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrCrisisNote strCrisisNote=new StrCrisisNote();
+        try {
+            AStrCrisisNoteVO strCrisisNoteVO=(AStrCrisisNoteVO) MapUtil.mapToObject(entityMap, AStrCrisisNoteVO.class);
+            BeanUtils.copyProperties(strCrisisNoteVO,strCrisisNote);
+            strCrisisNote.setHospitalId(hospitalId);//医院编码
+
+            strCrisisNote.setAuditDate(DateUtil.parseDateTime(strCrisisNoteVO.getAuditDate()));//审核时间
+            strCrisisNote.setRecDate(DateUtil.parseDateTime(strCrisisNoteVO.getRecDate()));//记录时间
+            strCrisisNote.setRecieveDate(DateUtil.parseDateTime(strCrisisNoteVO.getRecieveDate()));//开始时间
+            strCrisisNote.setAuditDate(DateUtil.parseDate(strCrisisNoteVO.getAuditDate()));//结束时间
+            strCrisisNote.setRecordDate(DateUtil.parseDateTime(strCrisisNoteVO.getRecordDate()));//病历日期
+
+            strCrisisNote.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strCrisisNote)){
+                strCrisisNote.setGmtCreate(new Date());//记录创建时间
+                this.save(strCrisisNote);
+            }else{
+                strCrisisNote.setGmtModified(new Date());//记录修改时间
+                this.update(strCrisisNote,new QueryWrapper<StrCrisisNote>()
+                        .eq("rec_id", strCrisisNote.getRecId())
+                        .eq("hospital_id", strCrisisNote.getHospitalId())
+                        .eq("behospital_code", strCrisisNote.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("危急值记录",strCrisisNote.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrCrisisNote strCrisisNote){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrCrisisNote>()
+                .eq("rec_id", strCrisisNote.getRecId())
+                .eq("hospital_id", strCrisisNote.getHospitalId())
+                .eq("behospital_code", strCrisisNote.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:危急值记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrCrisisNoteVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrCrisisNoteVO strCrisisNoteVO:list) {
+                    if("".equals(strCrisisNoteVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strCrisisNoteVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strCrisisNoteVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrCrisisNote> strCrisisNoteList= initData(list);
+                execute(strCrisisNoteList);
+
+                if(logSwitch){
+                    strCrisisNoteList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-危急值记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-危急值记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrCrisisNote> initData(List<StrCrisisNoteVO> list) throws Exception{
+        List<StrCrisisNote> tList=Lists.newArrayList();
+        for (StrCrisisNoteVO s:list) {
+            StrCrisisNote t=new StrCrisisNote();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecieveDate())){
+                t.setRecieveDate(DateUtil.parseDateTime(s.getRecieveDate()));//接收日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.CRISIS_NOTE.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrCrisisNote> list){
+        List<StrCrisisNote> addE = Lists.newLinkedList();
+        List<StrCrisisNote> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrCrisisNote strCrisisNote = this.getOne(new QueryWrapper<StrCrisisNote>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strCrisisNote != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strCrisisNoteService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 201 - 0
src/main/java/com/diagbot/facade/str/BStrDeathDiscussionFacade.java

@@ -0,0 +1,201 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrDeathDiscussion;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrDeathDiscussionServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrDeathDiscussionVO;
+import com.diagbot.vo.str.StrDeathDiscussionVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrDeathDiscussionFacade extends StrDeathDiscussionServiceImpl {
+    @Autowired
+    @Qualifier("strDeathDiscussionServiceImpl")
+    private StrDeathDiscussionServiceImpl strDeathDiscussionService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strDeathDiscussion");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //死亡病例讨论记录
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrDeathDiscussion strDeathDiscussion=new StrDeathDiscussion();
+        try {
+            AStrDeathDiscussionVO strDeathDiscussionVO=(AStrDeathDiscussionVO) MapUtil.mapToObject(entityMap, AStrDeathDiscussionVO.class);
+            BeanUtils.copyProperties(strDeathDiscussionVO,strDeathDiscussion);
+            strDeathDiscussion.setHospitalId(hospitalId);//医院编码
+
+            strDeathDiscussion.setAuditDate(DateUtil.parseDateTime(strDeathDiscussionVO.getAuditDate()));//审核时间
+            strDeathDiscussion.setRecDate(DateUtil.parseDateTime(strDeathDiscussionVO.getRecDate()));//记录时间
+            strDeathDiscussion.setDeathDate(DateUtil.parseDateTime(strDeathDiscussionVO.getDeathDate()));//死亡时间
+            strDeathDiscussion.setDiscussDate(DateUtil.parseDate(strDeathDiscussionVO.getDiscussDate()));//讨论时间
+            strDeathDiscussion.setRecordDate(DateUtil.parseDateTime(strDeathDiscussionVO.getRecordDate()));//病历日期
+
+            strDeathDiscussion.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strDeathDiscussion)){
+                strDeathDiscussion.setGmtCreate(new Date());//记录创建时间
+                this.save(strDeathDiscussion);
+            }else{
+                strDeathDiscussion.setGmtModified(new Date());//记录修改时间
+                this.update(strDeathDiscussion,new QueryWrapper<StrDeathDiscussion>()
+                        .eq("rec_id", strDeathDiscussion.getRecId())
+                        .eq("hospital_id", strDeathDiscussion.getHospitalId())
+                        .eq("behospital_code", strDeathDiscussion.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("死亡病例讨论记录",strDeathDiscussion.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrDeathDiscussion strDeathDiscussion){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrDeathDiscussion>()
+                .eq("rec_id", strDeathDiscussion.getRecId())
+                .eq("hospital_id", strDeathDiscussion.getHospitalId())
+                .eq("behospital_code", strDeathDiscussion.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:死亡病例讨论记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrDeathDiscussionVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrDeathDiscussionVO strDeathDiscussionVO:list) {
+                    if("".equals(strDeathDiscussionVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strDeathDiscussionVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strDeathDiscussionVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrDeathDiscussion> strDeathDiscussionList= Lists.newArrayList();
+                execute(strDeathDiscussionList);
+
+                if(logSwitch){
+                    strDeathDiscussionList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-死亡病例讨论记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-死亡病例讨论记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrDeathDiscussion> initData(List<StrDeathDiscussionVO> list) throws Exception{
+        List<StrDeathDiscussion> tList=Lists.newArrayList();
+        for (StrDeathDiscussionVO s:list) {
+            StrDeathDiscussion t=new StrDeathDiscussion();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getDeathDate())){
+                t.setDeathDate(DateUtil.parseDateTime(s.getDeathDate()));//死亡日期
+            }
+            if(StringUtil.isNotEmpty(s.getDiscussDate())){
+                t.setDiscussDate(DateUtil.parseDateTime(s.getDiscussDate()));//讨论时间
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.DEATH_DISCUSSION.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrDeathDiscussion> list){
+        List<StrDeathDiscussion> addE = Lists.newLinkedList();
+        List<StrDeathDiscussion> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrDeathDiscussion strDeathDiscussion = this.getOne(new QueryWrapper<StrDeathDiscussion>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strDeathDiscussion != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strDeathDiscussionService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 199 - 0
src/main/java/com/diagbot/facade/str/BStrDeathNoteFacade.java

@@ -0,0 +1,199 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrDeathNote;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrDeathNoteServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrDeathNoteVO;
+import com.diagbot.vo.str.StrDeathNoteVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrDeathNoteFacade extends StrDeathNoteServiceImpl {
+
+    @Autowired
+    @Qualifier("strDeathNoteServiceImpl")
+    private StrDeathNoteServiceImpl strDeathNoteService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strDeathNote");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //死亡记录
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrDeathNote strDeathNote=new StrDeathNote();
+        try {
+            AStrDeathNoteVO strDeathNoteVO=(AStrDeathNoteVO) MapUtil.mapToObject(entityMap, AStrDeathNoteVO.class);
+            BeanUtils.copyProperties(strDeathNoteVO,strDeathNote);
+            strDeathNote.setHospitalId(hospitalId);//医院编码
+
+            strDeathNote.setAuditDate(DateUtil.parseDateTime(strDeathNoteVO.getAuditDate()));//审核时间
+            strDeathNote.setRecDate(DateUtil.parseDateTime(strDeathNoteVO.getRecDate()));//记录时间
+            strDeathNote.setBehospitalDate(DateUtil.parseDateTime(strDeathNoteVO.getBehospitalDate()));//入院日期
+            strDeathNote.setDeathDate(DateUtil.parseDate(strDeathNoteVO.getDeathDate()));//死亡日期
+            strDeathNote.setRecordDate(DateUtil.parseDateTime(strDeathNoteVO.getRecordDate()));//病历日期
+
+            strDeathNote.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strDeathNote)){
+                strDeathNote.setGmtCreate(new Date());//记录创建时间
+                this.save(strDeathNote);
+            }else{
+                strDeathNote.setGmtModified(new Date());//记录修改时间
+                this.update(strDeathNote,new QueryWrapper<StrDeathNote>()
+                        .eq("rec_id", strDeathNote.getRecId())
+                        .eq("hospital_id", strDeathNote.getHospitalId())
+                        .eq("behospital_code", strDeathNote.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("死亡记录", strDeathNote.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrDeathNote strDeathNote){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrDeathNote>()
+                .eq("rec_id", strDeathNote.getRecId())
+                .eq("hospital_id", strDeathNote.getHospitalId())
+                .eq("behospital_code", strDeathNote.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:死亡记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrDeathNoteVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrDeathNoteVO strDeathNoteVO:list) {
+                    if("".equals(strDeathNoteVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strDeathNoteVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strDeathNoteVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrDeathNote> strDeathNoteList= initData(list);
+                execute(strDeathNoteList);
+
+                if(logSwitch){
+                    strDeathNoteList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-死亡记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-死亡记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrDeathNote> initData(List<StrDeathNoteVO> list) throws Exception{
+        List<StrDeathNote> tList=Lists.newArrayList();
+        for (StrDeathNoteVO s:list) {
+            StrDeathNote t=new StrDeathNote();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getDeathDate())){
+                t.setDeathDate(DateUtil.parseDateTime(s.getDeathDate()));//死亡日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.DEATH_NOTE.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrDeathNote> list){
+        List<StrDeathNote> addE = Lists.newLinkedList();
+        List<StrDeathNote> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrDeathNote strDeathNote = this.getOne(new QueryWrapper<StrDeathNote>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strDeathNote != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strDeathNoteService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 196 - 0
src/main/java/com/diagbot/facade/str/BStrDifficultCaseFacade.java

@@ -0,0 +1,196 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrDifficultCase;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrDifficultCaseServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrDifficultCaseVO;
+import com.diagbot.vo.str.StrDifficultCaseVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrDifficultCaseFacade extends StrDifficultCaseServiceImpl{
+
+    @Autowired
+    @Qualifier("strDifficultCaseServiceImpl")
+    private StrDifficultCaseServiceImpl strDifficultCaseService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strDifficultCase");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrDifficultCase medDifficult=new StrDifficultCase();
+        try {
+            AStrDifficultCaseVO medDifficultVO=(AStrDifficultCaseVO) MapUtil.mapToObject(entityMap, AStrDifficultCaseVO.class);
+            BeanUtils.copyProperties(medDifficultVO,medDifficult);
+            medDifficult.setHospitalId(hospitalId);//医院编码
+            medDifficult.setRecDate(DateUtil.parseDateTime(medDifficultVO.getRecDate()));
+            medDifficult.setAuditDate(DateUtil.parseDateTime(medDifficultVO.getAuditDate()));
+            medDifficult.setDiscussDate(DateUtil.parseDateTime(medDifficultVO.getDiscussDate()));
+            medDifficult.setRecordDate(DateUtil.parseDateTime(medDifficultVO.getRecordDate()));//病历日期
+
+            medDifficult.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(medDifficult)){
+                medDifficult.setGmtCreate(new Date());//记录创建时间
+                this.save(medDifficult);
+            }else{
+                medDifficult.setGmtModified(new Date());//记录修改时间
+                this.update(medDifficult,new QueryWrapper<StrDifficultCase>()
+                        .eq("rec_id", medDifficult.getRecId())
+                        .eq("hospital_id", medDifficult.getHospitalId())
+                        .eq("behospital_code", medDifficult.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("疑难病例讨论记录",medDifficult.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrDifficultCase medDifficult){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrDifficultCase>()
+                .eq("rec_id", medDifficult.getRecId())
+                .eq("hospital_id", medDifficult.getHospitalId())
+                .eq("behospital_code", medDifficult.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:疑难病例讨论记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrDifficultCaseVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrDifficultCaseVO strDifficultCaseVO:list) {
+                    if("".equals(strDifficultCaseVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strDifficultCaseVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strDifficultCaseVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrDifficultCase> strDifficultCaseList= initData(list);
+                execute(strDifficultCaseList);
+
+                if(logSwitch){
+                    strDifficultCaseList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-疑难病例讨论记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-疑难病例讨论记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrDifficultCase> initData(List<StrDifficultCaseVO> list) throws Exception{
+        List<StrDifficultCase> tList=Lists.newArrayList();
+        for (StrDifficultCaseVO s:list) {
+            StrDifficultCase t=new StrDifficultCase();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getDiscussDate())){
+                t.setDiscussDate(DateUtil.parseDateTime(s.getDiscussDate()));//讨论日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.DIFFICULT_CASE.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrDifficultCase> list){
+        List<StrDifficultCase> addE = Lists.newLinkedList();
+        List<StrDifficultCase> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrDifficultCase strDifficultCase = this.getOne(new QueryWrapper<StrDifficultCase>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strDifficultCase != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strDifficultCaseService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 193 - 0
src/main/java/com/diagbot/facade/str/BStrFirstRecordFacade.java

@@ -0,0 +1,193 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrFirstRecord;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrFirstRecordServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrFirstRecordVO;
+import com.diagbot.vo.str.StrFirstRecordVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrFirstRecordFacade extends StrFirstRecordServiceImpl {
+
+    @Autowired
+    @Qualifier("strFirstRecordServiceImpl")
+    private StrFirstRecordServiceImpl strFirstRecordService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strFirstRecord");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrFirstRecord strFirstRecord=new StrFirstRecord();
+        try {
+            AStrFirstRecordVO strFirstRecordVO=(AStrFirstRecordVO) MapUtil.mapToObject(entityMap, AStrFirstRecordVO.class);
+            BeanUtils.copyProperties(strFirstRecordVO,strFirstRecord);
+            strFirstRecord.setHospitalId(hospitalId);//医院编码
+
+            strFirstRecord.setAuditDate(DateUtil.parseDateTime(strFirstRecordVO.getAuditDate()));//审核时间
+            strFirstRecord.setRecDate(DateUtil.parseDateTime(strFirstRecordVO.getRecDate()));//记录时间
+            strFirstRecord.setRecordDate(DateUtil.parseDateTime(strFirstRecordVO.getRecordDate()));//病历日期
+
+            strFirstRecord.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strFirstRecord)){
+                strFirstRecord.setGmtCreate(new Date());//记录创建时间
+                this.save(strFirstRecord);
+            }else{
+                strFirstRecord.setGmtModified(new Date());//记录修改时间
+                this.update(strFirstRecord,new QueryWrapper<StrFirstRecord>()
+                        .eq("rec_id", strFirstRecord.getRecId())
+                        .eq("hospital_id", strFirstRecord.getHospitalId())
+                        .eq("behospital_code", strFirstRecord.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("首次病程录", strFirstRecord.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrFirstRecord strFirstRecord){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrFirstRecord>()
+                .eq("rec_id", strFirstRecord.getRecId())
+                .eq("hospital_id", strFirstRecord.getHospitalId())
+                .eq("behospital_code", strFirstRecord.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:首次病程录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrFirstRecordVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrFirstRecordVO strFirstRecordVO:list) {
+                    if("".equals(strFirstRecordVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strFirstRecordVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strFirstRecordVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrFirstRecord> strFirstRecordList= initData(list);
+                execute(strFirstRecordList);
+
+                if(logSwitch){
+                    strFirstRecordList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-首次病程录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-首次病程录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrFirstRecord> initData(List<StrFirstRecordVO> list) throws Exception{
+        List<StrFirstRecord> tList=Lists.newArrayList();
+        for (StrFirstRecordVO s:list) {
+            StrFirstRecord t=new StrFirstRecord();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.FIRST_RECORD.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrFirstRecord> list){
+        List<StrFirstRecord> addE = Lists.newLinkedList();
+        List<StrFirstRecord> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrFirstRecord strFirstRecord = this.getOne(new QueryWrapper<StrFirstRecord>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strFirstRecord != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strFirstRecordService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 192 - 0
src/main/java/com/diagbot/facade/str/BStrIllCriticallyFacade.java

@@ -0,0 +1,192 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrIllCritically;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrIllCriticallyServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrIllCriticallyVO;
+import com.diagbot.vo.str.StrIllCriticallyVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrIllCriticallyFacade extends StrIllCriticallyServiceImpl {
+
+    @Autowired
+    @Qualifier("strIllCriticallyServiceImpl")
+    private StrIllCriticallyServiceImpl strIllCriticallyService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strIllCritically");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrIllCritically strIllCritically=new StrIllCritically();
+        try {
+            AStrIllCriticallyVO strIllCriticallyVO=(AStrIllCriticallyVO) MapUtil.mapToObject(entityMap, AStrIllCriticallyVO.class);
+            BeanUtils.copyProperties(strIllCriticallyVO,strIllCritically);
+            strIllCritically.setHospitalId(hospitalId);//医院编码
+            strIllCritically.setPatientSignDate(DateUtil.parseDateTime(strIllCriticallyVO.getPatientSignDate()));
+            strIllCritically.setDoctorSignDate(DateUtil.parseDateTime(strIllCriticallyVO.getDoctorSignDate()));//审核时间
+            strIllCritically.setRecordDate(DateUtil.parseDateTime(strIllCriticallyVO.getRecordDate()));//病历日期
+
+            strIllCritically.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strIllCritically)){
+                strIllCritically.setGmtCreate(new Date());//记录创建时间
+                this.save(strIllCritically);
+            }else{
+                strIllCritically.setGmtModified(new Date());//记录修改时间
+                this.update(strIllCritically,new QueryWrapper<StrIllCritically>()
+                        .eq("rec_id", strIllCritically.getRecId())
+                        .eq("hospital_id", strIllCritically.getHospitalId())
+                        .eq("behospital_code", strIllCritically.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("病危通知单",strIllCritically.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrIllCritically strIllCritically){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrIllCritically>()
+                .eq("rec_id", strIllCritically.getRecId())
+                .eq("hospital_id", strIllCritically.getHospitalId())
+                .eq("behospital_code", strIllCritically.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:病危通知单-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrIllCriticallyVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrIllCriticallyVO strIllCriticallyVO:list) {
+                    if("".equals(strIllCriticallyVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strIllCriticallyVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strIllCriticallyVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrIllCritically> strIllCriticallyList= initData(list);
+                execute(strIllCriticallyList);
+
+                if(logSwitch){
+                    strIllCriticallyList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-病危通知单-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-病危通知单-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrIllCritically> initData(List<StrIllCriticallyVO> list) throws Exception{
+        List<StrIllCritically> tList=Lists.newArrayList();
+        for (StrIllCriticallyVO s:list) {
+            StrIllCritically t=new StrIllCritically();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getPatientSignDate())){
+                t.setPatientSignDate(DateUtil.parseDateTime(s.getPatientSignDate()));//病人签名日期
+            }
+            if(StringUtil.isNotEmpty(s.getDoctorSignDate())){
+                t.setDoctorSignDate(DateUtil.parseDateTime(s.getDoctorSignDate()));//医生签名日期
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.ILL_CRITICALLY.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrIllCritically> list){
+        List<StrIllCritically> addE = Lists.newLinkedList();
+        List<StrIllCritically> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrIllCritically strIllCritically = this.getOne(new QueryWrapper<StrIllCritically>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strIllCritically != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strIllCriticallyService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 192 - 0
src/main/java/com/diagbot/facade/str/BStrIllSeriouslFacade.java

@@ -0,0 +1,192 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrIllSeriousl;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrIllSeriouslServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrIllSeriouslVO;
+import com.diagbot.vo.str.StrIllSeriouslVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrIllSeriouslFacade extends StrIllSeriouslServiceImpl {
+
+    @Autowired
+    @Qualifier("strIllSeriouslServiceImpl")
+    private StrIllSeriouslServiceImpl strIllSeriouslService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strIllSeriousl");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrIllSeriousl strIllSeriousl=new StrIllSeriousl();
+        try {
+            AStrIllSeriouslVO strIllSeriouslVO=(AStrIllSeriouslVO) MapUtil.mapToObject(entityMap, AStrIllSeriouslVO.class);
+            BeanUtils.copyProperties(strIllSeriouslVO,strIllSeriousl);
+            strIllSeriousl.setHospitalId(hospitalId);//医院编码
+            strIllSeriousl.setPatientSignDate(DateUtil.parseDateTime(strIllSeriouslVO.getPatientSignDate()));
+            strIllSeriousl.setDoctorSignDate(DateUtil.parseDateTime(strIllSeriouslVO.getDoctorSignDate()));//审核时间
+            strIllSeriousl.setRecordDate(DateUtil.parseDateTime(strIllSeriouslVO.getRecordDate()));//病历日期
+
+            strIllSeriousl.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strIllSeriousl)){
+                strIllSeriousl.setGmtCreate(new Date());//记录创建时间
+                this.save(strIllSeriousl);
+            }else{
+                strIllSeriousl.setGmtModified(new Date());//记录修改时间
+                this.update(strIllSeriousl,new QueryWrapper<StrIllSeriousl>()
+                        .eq("rec_id", strIllSeriousl.getRecId())
+                        .eq("hospital_id", strIllSeriousl.getHospitalId())
+                        .eq("behospital_code", strIllSeriousl.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("病重通知单", strIllSeriousl.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrIllSeriousl strIllSeriousl){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrIllSeriousl>()
+                .eq("rec_id", strIllSeriousl.getRecId())
+                .eq("hospital_id", strIllSeriousl.getHospitalId())
+                .eq("behospital_code", strIllSeriousl.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:病危通知单-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrIllSeriouslVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrIllSeriouslVO strIllSeriouslVO:list) {
+                    if("".equals(strIllSeriouslVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strIllSeriouslVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strIllSeriouslVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrIllSeriousl> strIllSeriouslList= initData(list);
+                execute(strIllSeriouslList);
+
+                if(logSwitch){
+                    strIllSeriouslList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-病危通知单-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-病危通知单-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrIllSeriousl> initData(List<StrIllSeriouslVO> list) throws Exception{
+        List<StrIllSeriousl> tList=Lists.newArrayList();
+        for (StrIllSeriouslVO s:list) {
+            StrIllSeriousl t=new StrIllSeriousl();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getPatientSignDate())){
+                t.setPatientSignDate(DateUtil.parseDateTime(s.getPatientSignDate()));//病人签名日期
+            }
+            if(StringUtil.isNotEmpty(s.getDoctorSignDate())){
+                t.setDoctorSignDate(DateUtil.parseDateTime(s.getDoctorSignDate()));//医生签名日期
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.ILL_SERIOUSL.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrIllSeriousl> list){
+        List<StrIllSeriousl> addE = Lists.newLinkedList();
+        List<StrIllSeriousl> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrIllSeriousl strIllSeriousl = this.getOne(new QueryWrapper<StrIllSeriousl>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strIllSeriousl != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strIllSeriouslService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 167 - 0
src/main/java/com/diagbot/facade/str/BStrInformedConsentFacade.java

@@ -0,0 +1,167 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrInformedConsent;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrInformedConsentServiceImpl;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.vo.str.StrInformedConsentVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrInformedConsentFacade extends StrInformedConsentServiceImpl {
+
+    @Autowired
+    @Qualifier("strInformedConsentServiceImpl")
+    private StrInformedConsentServiceImpl strInformedConsentService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strInformedConsent");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrInformedConsent strInformedConsent=new StrInformedConsent();
+        try {
+            StrInformedConsentVO strInformedConsentVO=(StrInformedConsentVO) MapUtil.mapToObject(entityMap, StrInformedConsentVO.class);
+            BeanUtils.copyProperties(strInformedConsentVO,strInformedConsent);
+            strInformedConsent.setHospitalId(hospitalId);//医院编码
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strInformedConsent)){
+                strInformedConsent.setGmtCreate(new Date());//记录创建时间
+                this.save(strInformedConsent);
+            }else{
+                strInformedConsent.setGmtModified(new Date());//记录修改时间
+                this.update(strInformedConsent,new QueryWrapper<StrInformedConsent>()
+                        .eq("rec_id", strInformedConsent.getRecId())
+                        .eq("hospital_id", strInformedConsent.getHospitalId())
+                        .eq("behospital_code", strInformedConsent.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("病重通知单", strInformedConsent.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrInformedConsent strInformedConsent){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrInformedConsent>()
+                .eq("rec_id", strInformedConsent.getRecId())
+                .eq("hospital_id", strInformedConsent.getHospitalId())
+                .eq("behospital_code", strInformedConsent.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:知情同意书-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrInformedConsentVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrInformedConsentVO strInformedConsentVO:list) {
+                    if("".equals(strInformedConsentVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strInformedConsentVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strInformedConsentVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrInformedConsent> strInformedConsentList= initData(list);
+                execute(strInformedConsentList);
+
+                if(logSwitch){
+                    strInformedConsentList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-知情同意书-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-知情同意书-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrInformedConsent> initData(List<StrInformedConsentVO> list) throws Exception{
+        List<StrInformedConsent> tList= Lists.newArrayList();
+        for (StrInformedConsentVO s:list) {
+            StrInformedConsent t=new StrInformedConsent();
+            BeanUtils.copyProperties(s,t);
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrInformedConsent> list){
+        List<StrInformedConsent> addE = Lists.newLinkedList();
+        List<StrInformedConsent> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrInformedConsent strInformedConsent = this.getOne(new QueryWrapper<StrInformedConsent>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strInformedConsent != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strInformedConsentService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 202 - 0
src/main/java/com/diagbot/facade/str/BStrLeaveHospitalFacade.java

@@ -0,0 +1,202 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrLeaveHospital;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrLeaveHospitalServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrLeaveHospitalVO;
+import com.diagbot.vo.str.StrLeaveHospitalVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrLeaveHospitalFacade extends StrLeaveHospitalServiceImpl {
+
+    @Autowired
+    @Qualifier("strLeaveHospitalServiceImpl")
+    private StrLeaveHospitalServiceImpl strLeaveHospitalService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strLeaveHospital");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //危急值记录
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrLeaveHospital strLeaveHospital=new StrLeaveHospital();
+        try {
+            AStrLeaveHospitalVO strLeaveHospitalVO=(AStrLeaveHospitalVO) MapUtil.mapToObject(entityMap, AStrLeaveHospitalVO.class);
+            BeanUtils.copyProperties(strLeaveHospitalVO,strLeaveHospital);
+            strLeaveHospital.setHospitalId(hospitalId);//医院编码
+
+            strLeaveHospital.setAuditDate(DateUtil.parseDateTime(strLeaveHospitalVO.getAuditDate()));//审核时间
+            strLeaveHospital.setRecDate(DateUtil.parseDateTime(strLeaveHospitalVO.getRecDate()));//记录时间
+            strLeaveHospital.setBehospitalDate(DateUtil.parseDateTime(strLeaveHospitalVO.getBehospitalDate()));//入院日期
+            strLeaveHospital.setLeaveHospitalDate(DateUtil.parseDateTime(strLeaveHospitalVO.getLeaveHospitalDate()));//出院时间
+            strLeaveHospital.setRecordDate(DateUtil.parseDateTime(strLeaveHospitalVO.getRecordDate()));//病历日期
+
+            strLeaveHospital.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strLeaveHospital)){
+                strLeaveHospital.setGmtCreate(new Date());//记录创建时间
+                this.save(strLeaveHospital);
+            }else{
+                strLeaveHospital.setGmtModified(new Date());//记录修改时间
+                this.update(strLeaveHospital,new QueryWrapper<StrLeaveHospital>()
+                        .eq("rec_id", strLeaveHospital.getRecId())
+                        .eq("hospital_id", strLeaveHospital.getHospitalId())
+                        .eq("behospital_code", strLeaveHospital.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("出院小结",strLeaveHospital.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrLeaveHospital strLeaveHospital){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrLeaveHospital>()
+                .eq("rec_id", strLeaveHospital.getRecId())
+                .eq("hospital_id", strLeaveHospital.getHospitalId())
+                .eq("behospital_code", strLeaveHospital.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:出院小结-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrLeaveHospitalVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrLeaveHospitalVO strLeaveHospitalVO:list) {
+                    if("".equals(strLeaveHospitalVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strLeaveHospitalVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strLeaveHospitalVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrLeaveHospital> strLeaveHospitalList= initData(list);
+                execute(strLeaveHospitalList);
+
+                if(logSwitch){
+                    strLeaveHospitalList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-出院小结-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-出院小结-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrLeaveHospital> initData(List<StrLeaveHospitalVO> list) throws Exception{
+        List<StrLeaveHospital> tList=Lists.newArrayList();
+        for (StrLeaveHospitalVO s:list) {
+            StrLeaveHospital t=new StrLeaveHospital();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getBehospitalDate())){
+                t.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));//入院日期
+            }
+            if(StringUtil.isNotEmpty(s.getLeaveHospitalDate())){
+                t.setLeaveHospitalDate(DateUtil.parseDateTime(s.getLeaveHospitalDate()));//出院日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.LEAVE_HOSPITAL.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrLeaveHospital> list){
+        List<StrLeaveHospital> addE = Lists.newLinkedList();
+        List<StrLeaveHospital> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrLeaveHospital strLeaveHospital = this.getOne(new QueryWrapper<StrLeaveHospital>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strLeaveHospital != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strLeaveHospitalService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 205 - 0
src/main/java/com/diagbot/facade/str/BStrOperativeFirstRecordFacade.java

@@ -0,0 +1,205 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrOperativeFirstRecord;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrOperativeFirstRecordServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrOperativeFirstRecordVO;
+import com.diagbot.vo.str.StrOperativeFirstRecordVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrOperativeFirstRecordFacade extends StrOperativeFirstRecordServiceImpl {
+
+    @Autowired
+    @Qualifier("strOperativeFirstRecordServiceImpl")
+    private StrOperativeFirstRecordServiceImpl strOperativeFirstRecordService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strOperativeFirstRecord");
+
+        if(!flag){
+            return;
+        }
+    }
+
+    //术后首程
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrOperativeFirstRecord strOperativeFirstRecord=new StrOperativeFirstRecord();
+        try {
+            AStrOperativeFirstRecordVO strOperativeFirstRecordVO=(AStrOperativeFirstRecordVO) MapUtil.mapToObject(entityMap, AStrOperativeFirstRecordVO.class);
+            BeanUtils.copyProperties(strOperativeFirstRecordVO,strOperativeFirstRecord);
+            strOperativeFirstRecord.setHospitalId(hospitalId);//医院编码
+
+            strOperativeFirstRecord.setAuditDate(DateUtil.parseDateTime(strOperativeFirstRecordVO.getAuditDate()));//审核时间
+            strOperativeFirstRecord.setRecDate(DateUtil.parseDateTime(strOperativeFirstRecordVO.getRecDate()));//记录时间
+            strOperativeFirstRecord.setOperationDate(DateUtil.parseDateTime(strOperativeFirstRecordVO.getOperationDate()));//手术日期
+            strOperativeFirstRecord.setStartTime(DateUtil.parseDate(strOperativeFirstRecordVO.getStartTime()));//开始时间
+            strOperativeFirstRecord.setEndTime(DateUtil.parseDate(strOperativeFirstRecordVO.getEndTime()));//结束时间
+            strOperativeFirstRecord.setRecordDate(DateUtil.parseDateTime(strOperativeFirstRecordVO.getRecordDate()));//病历日期
+
+            strOperativeFirstRecord.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strOperativeFirstRecord)){
+                strOperativeFirstRecord.setGmtCreate(new Date());//记录创建时间
+                this.save(strOperativeFirstRecord);
+            }else{
+                strOperativeFirstRecord.setGmtModified(new Date());//记录修改时间
+                this.update(strOperativeFirstRecord,new QueryWrapper<StrOperativeFirstRecord>()
+                        .eq("rec_id", strOperativeFirstRecord.getRecId())
+                        .eq("hospital_id", strOperativeFirstRecord.getHospitalId())
+                        .eq("behospital_code", strOperativeFirstRecord.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("术后首程",strOperativeFirstRecord.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrOperativeFirstRecord strOperativeFirstRecord){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrOperativeFirstRecord>()
+                .eq("rec_id", strOperativeFirstRecord.getRecId())
+                .eq("hospital_id", strOperativeFirstRecord.getHospitalId())
+                .eq("behospital_code", strOperativeFirstRecord.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:术后首程-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrOperativeFirstRecordVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrOperativeFirstRecordVO strOperativeFirstRecordVO:list) {
+                    if("".equals(strOperativeFirstRecordVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strOperativeFirstRecordVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strOperativeFirstRecordVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrOperativeFirstRecord> strOperativeFirstRecordList= initData(list);
+                execute(strOperativeFirstRecordList);
+
+                if(logSwitch){
+                    strOperativeFirstRecordList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-术后首程-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-术后首程-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrOperativeFirstRecord> initData(List<StrOperativeFirstRecordVO> list) throws Exception{
+        List<StrOperativeFirstRecord> tList=Lists.newArrayList();
+        for (StrOperativeFirstRecordVO s:list) {
+            StrOperativeFirstRecord t=new StrOperativeFirstRecord();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            if(StringUtil.isNotEmpty(s.getOperationDate())){
+                t.setOperationDate(DateUtil.parseDateTime(s.getOperationDate()));//手术日期
+            }
+            if(StringUtil.isNotEmpty(s.getStartTime())){
+                t.setEndTime(DateUtil.parseDateTime(s.getStartTime()));//开始时间
+            }
+            if(StringUtil.isNotEmpty(s.getEndTime())){
+                t.setEndTime(DateUtil.parseDateTime(s.getEndTime()));//结束时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.OPERATIVE_FIRST_RECORD.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrOperativeFirstRecord> list){
+        List<StrOperativeFirstRecord> addE = Lists.newLinkedList();
+        List<StrOperativeFirstRecord> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrOperativeFirstRecord strOperativeFirstRecord = this.getOne(new QueryWrapper<StrOperativeFirstRecord>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strOperativeFirstRecord != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strOperativeFirstRecordService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 206 - 0
src/main/java/com/diagbot/facade/str/BStrOperativeNoteFacade.java

@@ -0,0 +1,206 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrOperativeNote;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrOperativeNoteServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrOperativeNoteVO;
+import com.diagbot.vo.str.StrOperativeNoteVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrOperativeNoteFacade extends StrOperativeNoteServiceImpl {
+
+    @Autowired
+    @Qualifier("strOperativeNoteServiceImpl")
+    private StrOperativeNoteServiceImpl strOperativeNoteService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strOperativeNote");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //手术记录
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrOperativeNote strOperativeNote=new StrOperativeNote();
+        try {
+            AStrOperativeNoteVO strOperativeNoteVO=(AStrOperativeNoteVO) MapUtil.mapToObject(entityMap, AStrOperativeNoteVO.class);
+            BeanUtils.copyProperties(strOperativeNoteVO,strOperativeNote);
+            strOperativeNote.setHospitalId(hospitalId);//医院编码
+
+            strOperativeNote.setAuditDate(DateUtil.parseDateTime(strOperativeNoteVO.getAuditDate()));//审核时间
+            strOperativeNote.setRecDate(DateUtil.parseDateTime(strOperativeNoteVO.getRecDate()));//记录时间
+            strOperativeNote.setOperationDate(DateUtil.parseDateTime(strOperativeNoteVO.getOperationDate()));//手术日期
+            strOperativeNote.setStartTime(DateUtil.parseDate(strOperativeNoteVO.getStartTime()));//开始时间
+            strOperativeNote.setEndTime(DateUtil.parseDate(strOperativeNoteVO.getEndTime()));//结束时间
+            strOperativeNote.setRecordDate(DateUtil.parseDateTime(strOperativeNoteVO.getRecordDate()));//病历日期
+
+            strOperativeNote.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strOperativeNote)){
+                strOperativeNote.setGmtCreate(new Date());//记录创建时间
+                this.save(strOperativeNote);
+            }else{
+                strOperativeNote.setGmtModified(new Date());//记录修改时间
+                this.update(strOperativeNote,new QueryWrapper<StrOperativeNote>()
+                        .eq("rec_id", strOperativeNote.getRecId())
+                        .eq("hospital_id", strOperativeNote.getHospitalId())
+                        .eq("behospital_code", strOperativeNote.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("手术记录", strOperativeNote.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrOperativeNote strOperativeNote){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrOperativeNote>()
+                .eq("rec_id", strOperativeNote.getRecId())
+                .eq("hospital_id", strOperativeNote.getHospitalId())
+                .eq("behospital_code", strOperativeNote.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:手术记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrOperativeNoteVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrOperativeNoteVO strOperativeNoteVO:list) {
+                    if("".equals(strOperativeNoteVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strOperativeNoteVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strOperativeNoteVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrOperativeNote> strOperativeNoteList= initData(list);
+                execute(strOperativeNoteList);
+
+                if(logSwitch){
+                    strOperativeNoteList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-手术记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-手术记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrOperativeNote> initData(List<StrOperativeNoteVO> list) throws Exception{
+        List<StrOperativeNote> tList=Lists.newArrayList();
+        for (StrOperativeNoteVO s:list) {
+            StrOperativeNote t=new StrOperativeNote();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getOperationDate())){
+                t.setOperationDate(DateUtil.parseDateTime(s.getOperationDate()));//手术日期
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            if(StringUtil.isNotEmpty(s.getStartTime())){
+                t.setEndTime(DateUtil.parseDateTime(s.getStartTime()));//开始时间
+            }
+            if(StringUtil.isNotEmpty(s.getEndTime())){
+                t.setEndTime(DateUtil.parseDateTime(s.getEndTime()));//结束时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.OPERATIVE_NOTE.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrOperativeNote> list){
+        List<StrOperativeNote> addE = Lists.newLinkedList();
+        List<StrOperativeNote> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrOperativeNote strOperativeNote = this.getOne(new QueryWrapper<StrOperativeNote>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strOperativeNote != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strOperativeNoteService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 194 - 0
src/main/java/com/diagbot/facade/str/BStrPeriodConclusionFacade.java

@@ -0,0 +1,194 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrPeriodConclusion;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrPeriodConclusionServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrPeriodConclusionVO;
+import com.diagbot.vo.str.StrPeriodConclusionVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrPeriodConclusionFacade extends StrPeriodConclusionServiceImpl {
+
+    @Autowired
+    @Qualifier("strPeriodConclusionServiceImpl")
+    private StrPeriodConclusionServiceImpl strPeriodConclusionService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strPeriodConclusion");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrPeriodConclusion strPeriodConclusion=new StrPeriodConclusion();
+        try {
+            AStrPeriodConclusionVO strPeriodConclusionVO=(AStrPeriodConclusionVO) MapUtil.mapToObject(entityMap, AStrPeriodConclusionVO.class);
+            BeanUtils.copyProperties(strPeriodConclusionVO,strPeriodConclusion);
+            strPeriodConclusion.setHospitalId(hospitalId);//医院编码
+
+            strPeriodConclusion.setAuditDate(DateUtil.parseDateTime(strPeriodConclusionVO.getAuditDate()));//审核时间
+            strPeriodConclusion.setRecDate(DateUtil.parseDateTime(strPeriodConclusionVO.getRecDate()));//记录时间
+            strPeriodConclusion.setRecordDate(DateUtil.parseDateTime(strPeriodConclusionVO.getRecordDate()));//病历日期
+
+            strPeriodConclusion.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strPeriodConclusion)){
+                strPeriodConclusion.setGmtCreate(new Date());//记录创建时间
+                this.save(strPeriodConclusion);
+            }else{
+                strPeriodConclusion.setGmtModified(new Date());//记录修改时间
+                this.update(strPeriodConclusion,new QueryWrapper<StrPeriodConclusion>()
+                        .eq("rec_id", strPeriodConclusion.getRecId())
+                        .eq("hospital_id", strPeriodConclusion.getHospitalId())
+                        .eq("behospital_code", strPeriodConclusion.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("阶段小结",strPeriodConclusion.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrPeriodConclusion strPeriodConclusion){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrPeriodConclusion>()
+                .eq("rec_id", strPeriodConclusion.getRecId())
+                .eq("hospital_id", strPeriodConclusion.getHospitalId())
+                .eq("behospital_code", strPeriodConclusion.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:阶段小结-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrPeriodConclusionVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrPeriodConclusionVO strPeriodConclusionVO:list) {
+                    if("".equals(strPeriodConclusionVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strPeriodConclusionVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strPeriodConclusionVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrPeriodConclusion> strPeriodConclusionList= initData(list);
+                execute(strPeriodConclusionList);
+
+                if(logSwitch){
+                    strPeriodConclusionList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-阶段小结-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-阶段小结-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrPeriodConclusion> initData(List<StrPeriodConclusionVO> list) throws Exception{
+        List<StrPeriodConclusion> tList=Lists.newArrayList();
+        for (StrPeriodConclusionVO s:list) {
+            StrPeriodConclusion t=new StrPeriodConclusion();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.PERIOD_CONCLUSION.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrPeriodConclusion> list){
+        List<StrPeriodConclusion> addE = Lists.newLinkedList();
+        List<StrPeriodConclusion> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrPeriodConclusion strPeriodConclusion = this.getOne(new QueryWrapper<StrPeriodConclusion>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strPeriodConclusion != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strPeriodConclusionService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+
+}

+ 198 - 0
src/main/java/com/diagbot/facade/str/BStrPreoperativeDiscussionFacade.java

@@ -0,0 +1,198 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrPreoperativeDiscussion;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrPreoperativeDiscussionServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrPreoperativeDiscussionVO;
+import com.diagbot.vo.str.StrPreoperativeDiscussionVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrPreoperativeDiscussionFacade extends StrPreoperativeDiscussionServiceImpl {
+
+    @Autowired
+    @Qualifier("strPreoperativeDiscussionServiceImpl")
+    private StrPreoperativeDiscussionServiceImpl strPreoperativeDiscussionService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strPreoperativeDiscussion");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //入院记录
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrPreoperativeDiscussion strPreoperativeDiscussion=new StrPreoperativeDiscussion();
+        try {
+            AStrPreoperativeDiscussionVO strPreoperativeDiscussionVO=(AStrPreoperativeDiscussionVO) MapUtil.mapToObject(entityMap, AStrPreoperativeDiscussionVO.class);
+            BeanUtils.copyProperties(strPreoperativeDiscussionVO,strPreoperativeDiscussion);
+            strPreoperativeDiscussion.setHospitalId(hospitalId);//医院编码
+
+            strPreoperativeDiscussion.setAuditDate(DateUtil.parseDateTime(strPreoperativeDiscussionVO.getAuditDate()));//审核时间
+            strPreoperativeDiscussion.setRecDate(DateUtil.parseDateTime(strPreoperativeDiscussionVO.getRecDate()));//记录时间
+            strPreoperativeDiscussion.setDiscussTime(DateUtil.parseDateTime(strPreoperativeDiscussionVO.getDiscussTime()));//讨论时间
+            strPreoperativeDiscussion.setRecordDate(DateUtil.parseDateTime(strPreoperativeDiscussionVO.getRecordDate()));//病历日期
+
+            strPreoperativeDiscussion.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strPreoperativeDiscussion)){
+                strPreoperativeDiscussion.setGmtCreate(new Date());//记录创建时间
+                this.save(strPreoperativeDiscussion);
+            }else{
+                strPreoperativeDiscussion.setGmtModified(new Date());//记录修改时间
+                this.update(strPreoperativeDiscussion,new QueryWrapper<StrPreoperativeDiscussion>()
+                        .eq("rec_id", strPreoperativeDiscussion.getRecId())
+                        .eq("hospital_id", strPreoperativeDiscussion.getHospitalId())
+                        .eq("behospital_code", strPreoperativeDiscussion.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("术前讨论小结",strPreoperativeDiscussion.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrPreoperativeDiscussion strPreoperativeDiscussion){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrPreoperativeDiscussion>()
+                .eq("rec_id", strPreoperativeDiscussion.getRecId())
+                .eq("hospital_id", strPreoperativeDiscussion.getHospitalId())
+                .eq("behospital_code", strPreoperativeDiscussion.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:术前讨论小结-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrPreoperativeDiscussionVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrPreoperativeDiscussionVO strPreoperativeDiscussionVO:list) {
+                    if("".equals(strPreoperativeDiscussionVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strPreoperativeDiscussionVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strPreoperativeDiscussionVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrPreoperativeDiscussion> strPreoperativeDiscussionList= initData(list);
+                execute(strPreoperativeDiscussionList);
+
+                if(logSwitch){
+                    strPreoperativeDiscussionList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-术前讨论小结-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-术前讨论小结-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrPreoperativeDiscussion> initData(List<StrPreoperativeDiscussionVO> list) throws Exception{
+        List<StrPreoperativeDiscussion> tList=Lists.newArrayList();
+        for (StrPreoperativeDiscussionVO s:list) {
+            StrPreoperativeDiscussion t=new StrPreoperativeDiscussion();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            if(StringUtil.isNotEmpty(s.getDiscussTime())){
+                t.setDiscussTime(DateUtil.parseDateTime(s.getDiscussTime()));//讨论时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.PREOPERATIVE_DISCUSSION.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrPreoperativeDiscussion> list){
+        List<StrPreoperativeDiscussion> addE = Lists.newLinkedList();
+        List<StrPreoperativeDiscussion> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrPreoperativeDiscussion strPreoperativeDiscussion = this.getOne(new QueryWrapper<StrPreoperativeDiscussion>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strPreoperativeDiscussion != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strPreoperativeDiscussionService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 201 - 0
src/main/java/com/diagbot/facade/str/BStrRescueNoteFacade.java

@@ -0,0 +1,201 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrRescueNote;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrRescueNoteServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrRescueNoteVO;
+import com.diagbot.vo.str.StrRescueNoteVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrRescueNoteFacade extends StrRescueNoteServiceImpl {
+
+    @Autowired
+    @Qualifier("strRescueNoteServiceImpl")
+    private StrRescueNoteServiceImpl strRescueNoteService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strRescueNote");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrRescueNote strRescueNote=new StrRescueNote();
+        try {
+            AStrRescueNoteVO strRescueNoteVO=(AStrRescueNoteVO) MapUtil.mapToObject(entityMap, AStrRescueNoteVO.class);
+            BeanUtils.copyProperties(strRescueNoteVO,strRescueNote);
+            strRescueNote.setHospitalId(hospitalId);//医院编码
+
+            strRescueNote.setAuditDate(DateUtil.parseDateTime(strRescueNoteVO.getAuditDate()));//审核时间
+            strRescueNote.setRecDate(DateUtil.parseDateTime(strRescueNoteVO.getRecDate()));//记录时间
+            strRescueNote.setStartTime(DateUtil.parseDateTime(strRescueNoteVO.getStartTime()));//开始时间
+            strRescueNote.setEndTime(DateUtil.parseDate(strRescueNoteVO.getEndTime()));//结束时间
+            strRescueNote.setRecordDate(DateUtil.parseDateTime(strRescueNoteVO.getRecordDate()));//病历日期
+
+            strRescueNote.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strRescueNote)){
+                strRescueNote.setGmtCreate(new Date());//记录创建时间
+                this.save(strRescueNote);
+            }else{
+                strRescueNote.setGmtModified(new Date());//记录修改时间
+                this.update(strRescueNote,new QueryWrapper<StrRescueNote>()
+                        .eq("rec_id", strRescueNote.getRecId())
+                        .eq("hospital_id", strRescueNote.getHospitalId())
+                        .eq("behospital_code", strRescueNote.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("抢救记录", strRescueNote.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrRescueNote strRescueNote){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrRescueNote>()
+                .eq("rec_id", strRescueNote.getRecId())
+                .eq("hospital_id", strRescueNote.getHospitalId())
+                .eq("behospital_code", strRescueNote.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:抢救记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrRescueNoteVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrRescueNoteVO strRescueNoteVO:list) {
+                    if("".equals(strRescueNoteVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strRescueNoteVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strRescueNoteVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrRescueNote> strRescueNoteList= initData(list);
+                execute(strRescueNoteList);
+
+                if(logSwitch){
+                    strRescueNoteList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-抢救记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-抢救记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrRescueNote> initData(List<StrRescueNoteVO> list) throws Exception{
+        List<StrRescueNote> tList=Lists.newArrayList();
+        for (StrRescueNoteVO s:list) {
+            StrRescueNote t=new StrRescueNote();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            if(StringUtil.isNotEmpty(s.getStartTime())){
+                t.setEndTime(DateUtil.parseDateTime(s.getStartTime()));//开始时间
+            }
+            if(StringUtil.isNotEmpty(s.getEndTime())){
+                t.setEndTime(DateUtil.parseDateTime(s.getEndTime()));//结束时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.RESCUE_NOTE.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrRescueNote> list){
+        List<StrRescueNote> addE = Lists.newLinkedList();
+        List<StrRescueNote> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrRescueNote strRescueNote = this.getOne(new QueryWrapper<StrRescueNote>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strRescueNote != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strRescueNoteService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 168 - 0
src/main/java/com/diagbot/facade/str/BStrTalkInformFacade.java

@@ -0,0 +1,168 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrTalkInform;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrTalkInformServiceImpl;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.vo.str.StrTalkInformVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrTalkInformFacade extends StrTalkInformServiceImpl {
+    @Autowired
+    @Qualifier("strTalkInformServiceImpl")
+    private StrTalkInformServiceImpl strTalkInformService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strTalkInform");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrTalkInform strTalkInform=new StrTalkInform();
+        try {
+            StrTalkInformVO strTalkInformVO=(StrTalkInformVO) MapUtil.mapToObject(entityMap, StrTalkInformVO.class);
+            BeanUtils.copyProperties(strTalkInformVO,strTalkInform);
+            strTalkInform.setHospitalId(hospitalId);//医院编码
+
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strTalkInform)){
+                strTalkInform.setGmtCreate(new Date());//记录创建时间
+                this.save(strTalkInform);
+            }else{
+                strTalkInform.setGmtModified(new Date());//记录修改时间
+                this.update(strTalkInform,new QueryWrapper<StrTalkInform>()
+                        .eq("rec_id", strTalkInform.getRecId())
+                        .eq("hospital_id", strTalkInform.getHospitalId())
+                        .eq("behospital_code", strTalkInform.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("病重通知单", strTalkInform.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrTalkInform strTalkInform){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrTalkInform>()
+                .eq("rec_id", strTalkInform.getRecId())
+                .eq("hospital_id", strTalkInform.getHospitalId())
+                .eq("behospital_code", strTalkInform.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:告知书记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrTalkInformVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrTalkInformVO strTalkInformVO:list) {
+                    if("".equals(strTalkInformVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strTalkInformVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strTalkInformVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrTalkInform> strTalkInformList= initData(list);
+                execute(strTalkInformList);
+
+                if(logSwitch){
+                    strTalkInformList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-告知书记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-告知书记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrTalkInform> initData(List<StrTalkInformVO> list) throws Exception{
+        List<StrTalkInform> tList= Lists.newArrayList();
+        for (StrTalkInformVO s:list) {
+            StrTalkInform t=new StrTalkInform();
+            BeanUtils.copyProperties(s,t);
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrTalkInform> list){
+        List<StrTalkInform> addE = Lists.newLinkedList();
+        List<StrTalkInform> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrTalkInform strTalkInform = this.getOne(new QueryWrapper<StrTalkInform>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strTalkInform != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strTalkInformService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 197 - 0
src/main/java/com/diagbot/facade/str/BStrTransferInNoteFacade.java

@@ -0,0 +1,197 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrTransferInNote;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrTransferInNoteServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrTransferInNoteVO;
+import com.diagbot.vo.str.StrTransferInNoteVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrTransferInNoteFacade extends StrTransferInNoteServiceImpl {
+
+    @Autowired
+    @Qualifier("strTransferInNoteServiceImpl")
+    private StrTransferInNoteServiceImpl strTransferInNoteService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strTransferInNote");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrTransferInNote strTransferInNote=new StrTransferInNote();
+        try {
+            AStrTransferInNoteVO strTransferInNoteVO=(AStrTransferInNoteVO) MapUtil.mapToObject(entityMap, AStrTransferInNoteVO.class);
+            BeanUtils.copyProperties(strTransferInNoteVO,strTransferInNote);
+            strTransferInNote.setHospitalId(hospitalId);//医院编码
+            strTransferInNote.setTransferInDate(DateUtil.parseDateTime(strTransferInNoteVO.getTransferInDate()));
+            strTransferInNote.setAuditDate(DateUtil.parseDateTime(strTransferInNoteVO.getAuditDate()));//审核时间
+            strTransferInNote.setRecDate(DateUtil.parseDateTime(strTransferInNoteVO.getRecDate()));//记录时间
+            strTransferInNote.setRecordDate(DateUtil.parseDateTime(strTransferInNoteVO.getRecordDate()));//病历日期
+
+            strTransferInNote.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strTransferInNote)){
+                strTransferInNote.setGmtCreate(new Date());//记录创建时间
+                this.save(strTransferInNote);
+            }else{
+                strTransferInNote.setGmtModified(new Date());//记录修改时间
+                this.update(strTransferInNote,new QueryWrapper<StrTransferInNote>()
+                        .eq("rec_id", strTransferInNote.getRecId())
+                        .eq("hospital_id", strTransferInNote.getHospitalId())
+                        .eq("behospital_code", strTransferInNote.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("转入记录",strTransferInNote.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrTransferInNote strTransferInNote){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrTransferInNote>()
+                .eq("rec_id", strTransferInNote.getRecId())
+                .eq("hospital_id", strTransferInNote.getHospitalId())
+                .eq("behospital_code", strTransferInNote.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:转入记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrTransferInNoteVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrTransferInNoteVO strTransferInNoteVO:list) {
+                    if("".equals(strTransferInNoteVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strTransferInNoteVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strTransferInNoteVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrTransferInNote> strTransferInNoteList= initData(list);
+                execute(strTransferInNoteList);
+
+                if(logSwitch){
+                    strTransferInNoteList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-转入记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-转入记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrTransferInNote> initData(List<StrTransferInNoteVO> list) throws Exception{
+        List<StrTransferInNote> tList=Lists.newArrayList();
+        for (StrTransferInNoteVO s:list) {
+            StrTransferInNote t=new StrTransferInNote();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getTransferInDate())){
+                t.setTransferInDate(DateUtil.parseDateTime(s.getTransferInDate()));//转入日期
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.TRANSFER_IN_NOTE.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrTransferInNote> list){
+        List<StrTransferInNote> addE = Lists.newLinkedList();
+        List<StrTransferInNote> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrTransferInNote strTransferInNote = this.getOne(new QueryWrapper<StrTransferInNote>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strTransferInNote != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strTransferInNoteService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+
+}

+ 194 - 0
src/main/java/com/diagbot/facade/str/BStrTransferOutNoteFacade.java

@@ -0,0 +1,194 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrTransferOutNote;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrTransferOutNoteServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrTransferOutNoteVO;
+import com.diagbot.vo.str.StrTransferOutNoteVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrTransferOutNoteFacade extends StrTransferOutNoteServiceImpl {
+
+    @Autowired
+    @Qualifier("strTransferOutNoteServiceImpl")
+    private StrTransferOutNoteServiceImpl strTransferOutNoteService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strTransferOutNote");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrTransferOutNote strTransferOutNote=new StrTransferOutNote();
+        try {
+            AStrTransferOutNoteVO strTransferOutNoteVO=(AStrTransferOutNoteVO) MapUtil.mapToObject(entityMap, AStrTransferOutNoteVO.class);
+            BeanUtils.copyProperties(strTransferOutNoteVO,strTransferOutNote);
+            strTransferOutNote.setHospitalId(hospitalId);//医院编码
+            strTransferOutNote.setTransferInDate(DateUtil.parseDateTime(strTransferOutNoteVO.getTransferInDate()));
+            strTransferOutNote.setAuditDate(DateUtil.parseDateTime(strTransferOutNoteVO.getAuditDate()));//审核时间
+            strTransferOutNote.setRecDate(DateUtil.parseDateTime(strTransferOutNoteVO.getRecDate()));//记录时间
+            strTransferOutNote.setRecordDate(DateUtil.parseDateTime(strTransferOutNoteVO.getRecordDate()));//病历日期
+
+            strTransferOutNote.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strTransferOutNote)){
+                strTransferOutNote.setGmtCreate(new Date());//记录创建时间
+                this.save(strTransferOutNote);
+            }else{
+                strTransferOutNote.setGmtModified(new Date());//记录修改时间
+                this.update(strTransferOutNote,new QueryWrapper<StrTransferOutNote>()
+                        .eq("rec_id", strTransferOutNote.getRecId())
+                        .eq("hospital_id", strTransferOutNote.getHospitalId())
+                        .eq("behospital_code", strTransferOutNote.getBehospitalCode()));
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("转出记录",strTransferOutNote.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrTransferOutNote strTransferOutNote){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrTransferOutNote>()
+                .eq("rec_id", strTransferOutNote.getRecId())
+                .eq("hospital_id", strTransferOutNote.getHospitalId())
+                .eq("behospital_code", strTransferOutNote.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:转出记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrTransferOutNoteVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrTransferOutNoteVO strTransferOutNoteVO:list) {
+                    if("".equals(strTransferOutNoteVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strTransferOutNoteVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strTransferOutNoteVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrTransferOutNote> strTransferOutNoteList= initData(list);
+                execute(strTransferOutNoteList);
+                if(logSwitch){
+                    strTransferOutNoteList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-转出记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-转出记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrTransferOutNote> initData(List<StrTransferOutNoteVO> list) throws Exception{
+        List<StrTransferOutNote> tList=Lists.newArrayList();
+        for (StrTransferOutNoteVO s:list) {
+            StrTransferOutNote t=new StrTransferOutNote();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getTransferInDate())){
+                t.setTransferInDate(DateUtil.parseDateTime(s.getTransferInDate()));//转入日期
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.TRANSFER_OUT_NOTE.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            //t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrTransferOutNote> list){
+        List<StrTransferOutNote> addE = Lists.newLinkedList();
+        List<StrTransferOutNote> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrTransferOutNote strTransferOutNote = this.getOne(new QueryWrapper<StrTransferOutNote>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strTransferOutNote != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strTransferOutNoteService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 198 - 0
src/main/java/com/diagbot/facade/str/BStrWardRecordFacade.java

@@ -0,0 +1,198 @@
+package com.diagbot.facade.str;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrWardRecord;
+import com.diagbot.enums.CacheKeyEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedAbnormalInfoFacade;
+import com.diagbot.facade.data.ColumnFacade;
+import com.diagbot.service.impl.StrWardRecordServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.AStrWardRecordVO;
+import com.diagbot.vo.str.StrWardRecordVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class BStrWardRecordFacade extends StrWardRecordServiceImpl {
+
+    @Autowired
+    @Qualifier("strWardRecordServiceImpl")
+    private StrWardRecordServiceImpl strWardRecordService;
+    @Autowired
+    private ColumnFacade columnFacade;
+    @Autowired
+    private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Value("${log_switch.enable}")
+    private boolean logSwitch;
+
+    public void getColumnZhAndCh(){
+        List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
+        list.forEach(s->{
+            s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
+        });
+
+        Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
+        Boolean flag=columnFacade.createColumn(columnMap,"strWardRecord");
+
+        //Map<String, String> map=columnFacade.getColumn("strConsultationNote");
+        if(!flag){
+            return;
+        }
+    }
+
+    //查房记录
+    public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
+        StrWardRecord strWardRecord=new StrWardRecord();
+        try {
+            AStrWardRecordVO strWardRecordVO=(AStrWardRecordVO) MapUtil.mapToObject(entityMap, AStrWardRecordVO.class);
+            BeanUtils.copyProperties(strWardRecordVO,strWardRecord);
+            strWardRecord.setHospitalId(hospitalId);//医院编码
+
+            strWardRecord.setAuditDate(DateUtil.parseDateTime(strWardRecordVO.getAuditDate()));//审核时间
+            strWardRecord.setRecDate(DateUtil.parseDateTime(strWardRecordVO.getRecDate()));//记录时间
+            strWardRecord.setWardDate(DateUtil.parseDateTime(strWardRecordVO.getWardDate()));//查房日期
+            strWardRecord.setRecordDate(DateUtil.parseDateTime(strWardRecordVO.getRecordDate()));//病历日期
+
+            strWardRecord.setWholeData(columnMap);
+            //判断数据库中是否存在,不存在insert
+            if(isExist(strWardRecord)){
+                strWardRecord.setGmtCreate(new Date());//记录创建时间
+                this.save(strWardRecord);
+            }else{
+                strWardRecord.setGmtModified(new Date());//记录修改时间
+                this.update(strWardRecord,new QueryWrapper<StrWardRecord>()
+                        .eq("rec_id", strWardRecord.getRecId())
+                        .eq("hospital_id", strWardRecord.getHospitalId())
+                        .eq("behospital_code", strWardRecord.getBehospitalCode()));
+            }
+
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("查房记录", strWardRecord.getRecId(),JSON.toJSONString(entityMap),"",e.getMessage());
+        }
+
+    }
+
+    public Boolean isExist(StrWardRecord strWardRecord){
+        Boolean flag=true;
+        int count = this.baseMapper.selectCount(new QueryWrapper<StrWardRecord>()
+                .eq("rec_id", strWardRecord.getRecId())
+                .eq("hospital_id", strWardRecord.getHospitalId())
+                .eq("behospital_code", strWardRecord.getBehospitalCode()));
+        if(count>0){
+            flag=false;
+        }
+        return flag;
+    }
+
+    /**
+     * @Description:查房记录-结构化-独立入口
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public RespDTO execDealData(List<StrWardRecordVO> list){
+        try{
+            if(list!=null && list.size()>0){
+                //循环验证数据有效性
+                for (StrWardRecordVO strWardRecordVO:list) {
+                    if("".equals(strWardRecordVO.getRecId())) {
+                        return RespDTO.onError("请输入记录编号!");
+                    }else if(strWardRecordVO.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(strWardRecordVO.getBehospitalCode())){
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }
+                }
+                //初始、格式化数据
+                List<StrWardRecord> strWardRecordList= initData(list);
+                execute(strWardRecordList);
+
+                if(logSwitch){
+                    strWardRecordList.forEach(s->{
+                        aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-查房记录-正常", s.getRecId(), JSON.toJSONString(s), "", "");
+                    });
+                }
+                return RespDTO.onSuc("操作正常!");
+            }else{
+                return RespDTO.onError("未接收到数据!");
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            if(list!=null && list.size()>0) {
+                list.forEach(s->{
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-查房记录-异常", s.getRecId(), JSON.toJSONString(list), "", e.getMessage());
+                });
+            }
+            return RespDTO.onError("数据处理异常,详情查看日志表");
+        }
+    }
+
+    private List<StrWardRecord> initData(List<StrWardRecordVO> list) throws Exception{
+        List<StrWardRecord> tList=Lists.newArrayList();
+        for (StrWardRecordVO s:list) {
+            StrWardRecord t=new StrWardRecord();
+            BeanUtils.copyProperties(s,t);
+            if(StringUtil.isNotEmpty(s.getRecordDate())){
+                t.setRecordDate(DateUtil.parseDateTime(s.getRecordDate()));//病历日期
+            }
+            if(StringUtil.isNotEmpty(s.getRecDate())){
+                t.setRecDate(DateUtil.parseDateTime(s.getRecDate()));//记录时间
+            }
+            if(StringUtil.isNotEmpty(s.getWardDate())){
+                t.setWardDate(DateUtil.parseDateTime(s.getWardDate()));//查房日期
+            }
+            if(StringUtil.isNotEmpty(s.getAuditDate())){
+                t.setAuditDate(DateUtil.parseDateTime(s.getAuditDate()));//审核时间
+            }
+            Map<String, String> columnMap=columnFacade.getColumn(CacheKeyEnum.WARD_RECORD.getName());
+            Map<String, Object> entityMap=MapUtil.objectToMap(s);
+            Map<String, Object> wholeMap=MapUtil.objcetKeyConvert(columnMap,entityMap);
+            t.setWholeData(JSON.toJSONString(wholeMap));
+            tList.add(t);
+        }
+        return tList;
+    }
+
+    public void execute(List<StrWardRecord> list){
+        List<StrWardRecord> addE = Lists.newLinkedList();
+        List<StrWardRecord> updateE = Lists.newLinkedList();
+        if (list != null && list.size() > 0) {
+            list.stream().forEach(s -> {
+                StrWardRecord strWardRecord = this.getOne(new QueryWrapper<StrWardRecord>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()), false);
+                if (strWardRecord != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            strWardRecordService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            this.baseMapper.updateBatchByKey(updateE);
+        }
+    }
+}

+ 175 - 3
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -91,6 +91,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<NumDTO> leaveHosCountByDept(FilterVO filterVO);
 
+    /**
+     * 入院总人数统计-科室-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<AdmissionCountDTO> admissionHosCountByDept(FilterVO filterVO);
+
     /**
      * 新生儿出院人数统计-科室-首页
      *
@@ -142,10 +150,10 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     /**
      * 各科室缺陷占比(主任医生)
      *
-     * @param filterOrderByDeptVO
+     * @param filterOrderVO
      * @return
      */
-    public List<LevelStatisticsDTO> levelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
+    public List<LevelStsByDeptDTO> levelStatisticsByDept(FilterOrderVO filterOrderVO);
 
     /**
      * 病案首页合格率占比(主任医生)
@@ -153,7 +161,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param filterOrderByDeptVO
      * @return
      */
-    public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
+    public List<HomePageByDeptDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
+
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<AdmissionCountDTO> casesEntryStatisticsByDept(FilterVO filterVO);
 
     /**
      * 科室缺陷占比-科室(分页)
@@ -163,6 +179,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<DeptNumDTO> resultStatisticsByDeptAndDoctorPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
+
+    /**
+     * 病案首页合格/不合格数
+     *
+     * @param qcResultPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> getIsGoodLevelByDept(QcResultPageVO qcResultPageVO);
+
     /**
      * 各科室缺陷占比(组合)-全院-根据内外科系统统计-关联上级科室
      *
@@ -189,6 +214,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<ExportExcelDTO> exportQcresult(ExportQcresultVO exportQcresultVO);
 
+    /**
+     * 个人质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresultByPerson(ExportQcresultVO exportQcresultVO);
+
     /**
      * 科室质控评分导出到excel
      *
@@ -236,6 +269,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<EntryStatisticsDTO> entryStatistics(EntryStatisticsVO entryStatisticsVO);
 
+
+    /**
+     * 关键条目缺陷占比统计-科室
+     *
+     * @param entryStatisticsVO
+     * @return
+     */
+    public List<EntryStasByDeptDTO> entryStatisticsByDept(EntryStatisticsVO entryStatisticsVO);
+
     /**
      * 非医嘱离院病人记录
      *
@@ -276,6 +318,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> leaveHosMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 离院病人质控评分详情页-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> leaveHosMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
  * 离院病人质控评分年龄单独查询详情页
  *
@@ -298,6 +349,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public List<HomePageImproveDTO> qcCheckStatistics(FilterOrderVO filterOrderVO);
+    /**
+     * 质控核查统计-科室(内页)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public List<ImproveByDeptDTO> qcCheckStatisticsByDept(FilterOrderVO filterOrderVO);
+
+
 
     /**
      * 离院病人质控评分详情页导出到excel
@@ -307,6 +367,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<ExportExcelDTO> leaveHosMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 离院病人质控评分详情-科室 页导出到excel
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> leaveHosMRPageExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 条目缺陷质控评分详情页导出到excel
      *
@@ -323,6 +392,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<UnModifyMRDetailDTO> unModifyMRStatistics(FilterUnModifyMRVO filterUnModifyMRVO);
 
+    /**
+     * 未整改病历统计-科室
+     *
+     * @param filterUnModifyMRVO
+     * @return
+     */
+    public List<UnModifyMRDetailDTO> unModifyMRSByDept(FilterUnModifyMRVO filterUnModifyMRVO);
+
+
     /**
      * 病历稽查表
      *
@@ -331,6 +409,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<MedicalCheckDTO>  getMedicalCheck(@Param("filterVO")FilterMedicalCheckVO filterVO);
 
+    /**
+     * 病历稽查表-科室
+     *
+     * @param filterVO
+     * @return
+     */
+    public IPage<MedicalCheckDTO>  getMedicalCheckByDept(@Param("filterVO")FilterMedicalCheckVO filterVO);
+
     public List<MedicalCheckIdNameDTO>  getMedicalEntryIds(@Param("casesEntryIds")List<Long> casesEntryIds);
 
     /**
@@ -341,6 +427,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<MedicalCheckExportDTO>  getMedicalCheckExport(@Param("filterVO")FilterMedicalCheckVO filterVO);
 
+    /**
+     * 病历稽查表导出-科室
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<MedicalDeptDTO>  medicalCheckExportByDept(@Param("filterVO")FilterMedicalCheckVO filterVO);
+
 
     /**
      * 未整改病历质控评分页(内页)
@@ -350,6 +444,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> unModifyMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 未整改病历质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> unModifyMRByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 不合格/合格数病历号(内页)
      *
@@ -368,6 +470,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
     public List<ExportExcelDTO> unModifyMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 未整改病历缺陷评分详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+
+    public List<ExportExcelByDeptDTO> unModifyExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
 
     /**
      * 病案首页不合格/合格数病历详情页导出
@@ -378,6 +489,24 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页不合格/合格数病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+
+    public List<ExportExcelByDeptDTO> homePageOrLevelExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    /**
+     * 缺陷详情质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+
+    public List<ExportExcelByDeptDTO> qcResultShortByDeptPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
 
     /**
      * 31天再入院详情页
@@ -387,6 +516,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
 
+    /**
+     * 31天再入院详情页-科室
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public IPage<ReBeHosMergeDTO> reHos31DaysPageByDept(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
+
+
     /**
      * 入院人数统计-首页
      *
@@ -412,6 +550,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> hmImproveMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 病案首页改善率质控评分页导出
      *
@@ -428,6 +575,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> qcCheckMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 质控核查质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> qcCheckMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 质控核查质控评分页导出
      *
@@ -435,4 +590,21 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    /**
+     * 质控核查质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
+    /**
+     * 质控核查质控评分页-科室 导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> qcCheckMRPageExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 }

+ 2 - 2
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -142,7 +142,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptNumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<NumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
     /**
      * 缺陷详情-科室(分页)
@@ -150,7 +150,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<EntryNumGroupDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
     /**
      * 条目缺陷占比基础数据(内页)
      *

+ 21 - 0
src/main/java/com/diagbot/mapper/StrInformedConsentMapper.java

@@ -0,0 +1,21 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrInformedConsent;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-01-04
+ */
+public interface StrInformedConsentMapper extends BaseMapper<StrInformedConsent> {
+    void updateBatchByKey(List<StrInformedConsent> list);
+
+    List<ColumnZhAndChDTO> getColumnZhAndCh();
+}

+ 23 - 0
src/main/java/com/diagbot/mapper/StrTalkInformMapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.data.ColumnZhAndChDTO;
+import com.diagbot.entity.StrTalkInform;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-01-04
+ */
+public interface StrTalkInformMapper extends BaseMapper<StrTalkInform> {
+
+    void updateBatchByKey(List<StrTalkInform> list);
+
+    List<ColumnZhAndChDTO> getColumnZhAndCh();
+
+}

+ 3 - 2
src/main/java/com/diagbot/mapper/SysMenuMapper.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.diagbot.entity.wrapper.SysMenuWrapper;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -21,7 +22,7 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
      * @Author: ztg
      * @Date: 2018/9/14 13:57
      */
-    public List<SysMenuWrapper> getByRole(Long userId);
+    public List<SysMenuWrapper> getByRole(Long userId, Set<String> roleSet);
 
 
     /**
@@ -31,5 +32,5 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
      */
     public List<SysMenuWrapper> getSubMenuById(Long id);
 
-    public List<SysUserPermissionDTO> getByRolePermission(Long userId);
+    public List<SysUserPermissionDTO> getByRolePermission(Long userId,Set<String> roleSet);
 }

+ 162 - 4
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -8,7 +8,6 @@ import com.diagbot.vo.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * <p>
@@ -91,6 +90,15 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<NumDTO> leaveHosCountByDept(FilterVO filterVO);
 
+    /**
+     * 入院总人数统计-科室-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<AdmissionCountDTO> admissionHosCountByDept(FilterVO filterVO);
+
+
     /**
      * 新生儿出院人数统计-科室-首页
      *
@@ -142,10 +150,18 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     /**
      * 各科室缺陷占比(主任医生)
      *
-     * @param filterOrderByDeptVO
+     * @param filterOrderVO
+     * @return
+     */
+    public List<LevelStsByDeptDTO> levelStatisticsByDept( FilterOrderVO filterOrderVO);
+
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
      * @return
      */
-    public List<LevelStatisticsDTO> levelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
+    public List<AdmissionCountDTO> casesEntryStatisticsByDept(FilterVO filterVO);
 
     /**
      * 病案首页合格率占比(主任医生)
@@ -153,7 +169,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterOrderByDeptVO
      * @return
      */
-    public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
+    public List<HomePageByDeptDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
 
     /**
      * 缺陷明细-科室(分页)
@@ -189,6 +205,15 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> exportQcresult(ExportQcresultVO exportQcresultVO);
 
+    /**
+     * 个人质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresultByPerson(ExportQcresultVO exportQcresultVO);
+
+
     /**
      * 科室质控评分导出到excel
      *
@@ -229,6 +254,17 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<EntryStatisticsDTO> entryStatistics(EntryStatisticsVO entryStatisticsVO);
 
+    /**
+     * 关键条目缺陷占比统计-科室
+     *
+     * @param entryStatisticsVO
+     * @return
+     */
+    public List<EntryStasByDeptDTO> entryStatisticsByDept(EntryStatisticsVO entryStatisticsVO);
+
+
+
+
     /**
      * 非医嘱离院病人记录
      *
@@ -269,6 +305,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> leaveHosMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 离院病人质控评分详情页-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> leaveHosMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 改善率统计-全院(首页)
      *
@@ -285,6 +329,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<HomePageImproveDTO> qcCheckStatistics(FilterOrderVO filterOrderVO);
 
+    /**
+     * 质控核查统计-科室(内页)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public List<ImproveByDeptDTO> qcCheckStatisticsByDept(FilterOrderVO filterOrderVO);
+
     /**
      * 离院病人质控评分详情页导出到excel
      *
@@ -293,6 +345,15 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> leaveHosMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 离院病人质控评分详情-科室 页导出到excel
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> leaveHosMRPageExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 条目缺陷质控评分详情页导出到excel
      *
@@ -301,6 +362,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> qcResultShortPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 缺陷详情质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> qcResultShortByDeptPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 未整改病历统计
      *
@@ -309,18 +378,39 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<UnModifyMRDetailDTO> unModifyMRStatistics(FilterUnModifyMRVO filterUnModifyMRVO);
 
+    /**
+     * 未整改病历统计-科室
+     *
+     * @param filterUnModifyMRVO
+     * @return
+     */
+    public List<UnModifyMRDetailDTO> unModifyMRSByDept(FilterUnModifyMRVO filterUnModifyMRVO);
+
     /**
      * 病历稽查表
      * @return
      */
     IPage<MedicalCheckDTO>  getMedicalCheck(FilterMedicalCheckVO filterVO,@Param("casesEntryIds")List<Long> casesEntryIds);
 
+    /**
+     * 病历稽查表
+     * @return
+     */
+    IPage<MedicalCheckDTO>  getMedicalChecks(FilterMedicalCheckVO filterVO,@Param("casesEntryIds")List<Long> casesEntryIds);
+
     /**
      * 病历稽查表导出
      * @return
      */
     List<MedicalCheckExportDTO>  getMedicalCheckExport(FilterMedicalCheckVO filterVO);
 
+    /**
+     * 病历稽查表导出-科室
+     * @return
+     */
+    List<MedicalDeptDTO>  medicalCheckExportByDept(FilterMedicalCheckVO filterVO);
+
+
 
     /**
      * 未整改病历质控评分页(内页)
@@ -330,6 +420,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> unModifyMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 未整改病历质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> unModifyMRByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 不合格数病历号(内页)
      * @param qcResultPageVO
@@ -345,6 +443,16 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> unModifyMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+
+    /**
+     * 未整改病历缺陷评分详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> unModifyExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 病案首页不合格/合格数病历详情页导出
      *
@@ -352,6 +460,15 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+    /**
+     * 病案首页不合格/合格数病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> homePageOrLevelExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
 
     /**
      * 31天再入院详情页
@@ -361,6 +478,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
 
+    /**
+     * 31天再入院详情页
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public IPage<ReBeHosMergeDTO> reHos31DaysPageByDept(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
+
     /**
      * 入院人数统计-首页
      *
@@ -384,6 +509,13 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public IPage<QcResultShortDTO> hmImproveMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 病案首页改善率质控评分页导出
@@ -393,6 +525,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> hmImproveMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 质控核查质控评分页(内页)
      *
@@ -401,6 +541,15 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> qcCheckMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+
+    /**
+     * 质控核查质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> qcCheckMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 质控核查质控评分页导出
      *
@@ -408,4 +557,13 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    /**
+     * 质控核查质控评分页-科室 导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> qcCheckMRPageExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
 }

+ 2 - 2
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -140,7 +140,7 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptNumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<NumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
     /**
      * 缺陷详情-科室(分页)
@@ -148,7 +148,7 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @param filterPageByDeptVO
      * @return
      */
-    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<EntryNumGroupDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
     /**
      * 条目缺陷占比(内页)

+ 16 - 0
src/main/java/com/diagbot/service/StrInformedConsentService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.StrInformedConsent;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-01-04
+ */
+public interface StrInformedConsentService extends IService<StrInformedConsent> {
+
+}

+ 16 - 0
src/main/java/com/diagbot/service/StrTalkInformService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.StrTalkInform;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-01-04
+ */
+public interface StrTalkInformService extends IService<StrTalkInform> {
+
+}

+ 3 - 2
src/main/java/com/diagbot/service/SysMenuService.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.entity.wrapper.SysMenuWrapper;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -22,7 +23,7 @@ public interface SysMenuService extends IService<SysMenu> {
      * @Author: ztg
      * @Date: 2018/9/17 15:43
      */
-    public List<SysMenuWrapper> getByRole(Long userId);
+    public List<SysMenuWrapper> getByRole(Long userId,Set<String> roleSet);
 
 
     /**
@@ -32,5 +33,5 @@ public interface SysMenuService extends IService<SysMenu> {
      */
     public List<SysMenuWrapper> getSubMenuById(Long id);
 
-    public List<SysUserPermissionDTO> getByRolePermission(Long userId);
+    public List<SysUserPermissionDTO> getByRolePermission(Long userId, Set<String> roleSet);
 }

+ 318 - 9
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -1,16 +1,12 @@
 package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.*;
 import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.mapper.BehospitalInfoMapper;
 import com.diagbot.service.BehospitalInfoService;
-import com.diagbot.util.BeanUtil;
 import com.diagbot.vo.*;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 
@@ -134,6 +130,16 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.leaveHosCountByDept(filterVO);
     }
 
+    /**
+     * 入院总人数统计-科室-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<AdmissionCountDTO> admissionHosCountByDept(FilterVO filterVO) {
+        return baseMapper.admissionHosCountByDept(filterVO);
+    }
+
     /**
      * 新生儿出院人数统计-科室-首页
      *
@@ -164,6 +170,16 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.operationCountByDept(filterVO);
     }
 
+    /**
+     * 病案首页合格/不合格数-科室
+     *
+     * @param qcResultPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> getOrGoodLevelByDept(QcResultPageVO qcResultPageVO) {
+        return  baseMapper.getIsGoodLevelByDept(qcResultPageVO);
+    }
+
     /**
      * 各科室缺陷占比排行(分页)
      *
@@ -200,12 +216,12 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     /**
      * 各科室缺陷占比(主任医生)
      *
-     * @param filterOrderByDeptVO
+     * @param filterOrderVO
      * @return
      */
     @Override
-    public List<LevelStatisticsDTO> levelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
-        return baseMapper.levelStatisticsByDept(filterOrderByDeptVO);
+    public List<LevelStsByDeptDTO> levelStatisticsByDept(FilterOrderVO filterOrderVO) {
+        return baseMapper.levelStatisticsByDept(filterOrderVO);
     }
 
     /**
@@ -215,10 +231,21 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
+    public List<HomePageByDeptDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
         return baseMapper.homePageLevelStatisticsByDept(filterOrderByDeptVO);
     }
 
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<AdmissionCountDTO> casesEntryStatisticsByDept(FilterVO filterVO) {
+        return baseMapper.casesEntryStatisticsByDept(filterVO);
+    }
+
     /**
      * 缺陷明细-科室(分页)
      *
@@ -267,6 +294,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.exportQcresult(exportQcresultVO);
     }
 
+    /**
+     * 个人质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelDTO> exportQcresultByPerson(ExportQcresultVO exportQcresultVO) {
+        return baseMapper.exportQcresultByPerson(exportQcresultVO);
+    }
+
     /**
      * 科室质控评分导出到excel
      *
@@ -322,6 +360,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.entryStatistics(entryStatisticsVO);
     }
 
+    /**
+     * 关键条目缺陷占比统计-科室
+     *
+     * @param entryStatisticsVO
+     * @return
+     */
+    @Override
+    public List<EntryStasByDeptDTO> entryStatisticsByDept(EntryStatisticsVO entryStatisticsVO) {
+        return baseMapper.entryStatisticsByDept(entryStatisticsVO);
+    }
+
     /**
      * 非医嘱离院病人记录
      *
@@ -376,8 +425,19 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<QcResultShortDTO> leaveHosMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         IPage<QcResultShortDTO> qcResultShortDTOIPage = baseMapper.leaveHosMRPage(qcResultShortPageVO);
         return qcResultShortDTOIPage;
-
     }
+    /**
+     * 离院病人质控评分详情页-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public IPage<QcResultShortDTO> leaveHosMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        IPage<QcResultShortDTO> qcResultShortDTOIPage = baseMapper.leaveHosMRPageByDept(qcResultShortPageVO);
+        return qcResultShortDTOIPage;
+    }
+
 
     /**
      * 改善率统计-全院(首页)
@@ -401,6 +461,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.qcCheckStatistics(filterOrderVO);
     }
 
+    /**
+     * 质控核查统计-科室(内页)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    @Override
+    public List<ImproveByDeptDTO> qcCheckStatisticsByDept(FilterOrderVO filterOrderVO) {
+        return baseMapper.qcCheckStatisticsByDept(filterOrderVO);
+    }
+
     /**
      * 离院病人质控评分详情页导出到excel
      *
@@ -412,6 +483,19 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.leaveHosMRPageExport(qcResultShortPageVO);
     }
 
+    /**
+     * 离院病人质控评分详情页-科室导出到excel
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> leaveHosMRPageExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.leaveHosMRPageExportByDept(qcResultShortPageVO);
+    }
+
+
+
     /**
      * 条目缺陷质控评分详情页导出到excel
      *
@@ -423,6 +507,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.qcResultShortPageExport(qcResultShortPageVO);
     }
 
+    /**
+     * 缺陷详情质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> qcResultShortByDeptPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.qcResultShortByDeptPageExport(qcResultShortPageVO);
+    }
+
     /**
      * 未整改病历统计
      *
@@ -434,6 +529,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.unModifyMRStatistics(filterUnModifyMRVO);
     }
 
+    /**
+     * 未整改病历统计-科室
+     *
+     * @param filterUnModifyMRVO
+     * @return
+     */
+    @Override
+    public List<UnModifyMRDetailDTO> unModifyMRSByDept(FilterUnModifyMRVO filterUnModifyMRVO) {
+        return baseMapper.unModifyMRSByDept(filterUnModifyMRVO);
+    }
+
     /**
      * 病历稽查表
      *
@@ -535,6 +641,107 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
 
     }
 
+    /**
+     * 病历稽查表-科室
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public IPage<MedicalCheckDTO> getMedicalChecks(@Param("filterVO") FilterMedicalCheckVO filterVO, @Param("casesEntryIds") List<Long> casesEntryIds) {
+        IPage<MedicalCheckDTO> medicalCheck = baseMapper.getMedicalCheckByDept(filterVO);
+        List<MedicalCheckIdNameDTO> medicalEntryIds = baseMapper.getMedicalEntryIds(casesEntryIds);
+
+        List<MedicalCheckDTO> records = medicalCheck.getRecords();
+        for (MedicalCheckDTO record : records) {
+            for (MedicalCheckIdNameDTO medicalEntryId : medicalEntryIds) {
+                if ("2170".equals(medicalEntryId.getId())) {
+                    record.setEntry_2170_id(medicalEntryId.getId());
+                    record.setEntry_2170_name(medicalEntryId.getName());
+                }
+                if ("2217".equals(medicalEntryId.getId())) {
+                    record.setEntry_2217_id(medicalEntryId.getId());
+                    record.setEntry_2217_name(medicalEntryId.getName());
+                }
+                if ("2218".equals(medicalEntryId.getId())) {
+                    record.setEntry_2218_id(medicalEntryId.getId());
+                    record.setEntry_2218_name(medicalEntryId.getName());
+                }
+                if ("2220".equals(medicalEntryId.getId())) {
+                    record.setEntry_2220_id(medicalEntryId.getId());
+                    record.setEntry_2220_name(medicalEntryId.getName());
+                }
+                if ("2229".equals(medicalEntryId.getId())) {
+                    record.setEntry_2229_id(medicalEntryId.getId());
+                    record.setEntry_2229_name(medicalEntryId.getName());
+                }
+                if ("2287".equals(medicalEntryId.getId())) {
+                    record.setEntry_2287_id(medicalEntryId.getId());
+                    record.setEntry_2287_name(medicalEntryId.getName());
+                }
+                if ("2486".equals(medicalEntryId.getId())) {
+                    record.setEntry_2486_id(medicalEntryId.getId());
+                    record.setEntry_2486_name(medicalEntryId.getName());
+                }
+                if ("2495".equals(medicalEntryId.getId())) {
+                    record.setEntry_2495_id(medicalEntryId.getId());
+                    record.setEntry_2495_name(medicalEntryId.getName());
+                }
+                if ("2654".equals(medicalEntryId.getId())) {
+                    record.setEntry_2654_id(medicalEntryId.getId());
+                    record.setEntry_2654_name(medicalEntryId.getName());
+                }
+                if ("2655".equals(medicalEntryId.getId())) {
+                    record.setEntry_2655_id(medicalEntryId.getId());
+                    record.setEntry_2655_name(medicalEntryId.getName());
+                }
+                if ("2657".equals(medicalEntryId.getId())) {
+                    record.setEntry_2657_id(medicalEntryId.getId());
+                    record.setEntry_2657_name(medicalEntryId.getName());
+                }
+                if ("2658".equals(medicalEntryId.getId())) {
+                    record.setEntry_2658_id(medicalEntryId.getId());
+                    record.setEntry_2658_name(medicalEntryId.getName());
+                }
+                if ("2686".equals(medicalEntryId.getId())) {
+                    record.setEntry_2686_id(medicalEntryId.getId());
+                    record.setEntry_2686_name(medicalEntryId.getName());
+                }
+                if ("2852".equals(medicalEntryId.getId())) {
+                    record.setEntry_2852_id(medicalEntryId.getId());
+                    record.setEntry_2852_name(medicalEntryId.getName());
+                }
+                if ("2900".equals(medicalEntryId.getId())) {
+                    record.setEntry_2900_id(medicalEntryId.getId());
+                    record.setEntry_2900_name(medicalEntryId.getName());
+                }
+                if ("2930".equals(medicalEntryId.getId())) {
+                    record.setEntry_2930_id(medicalEntryId.getId());
+                    record.setEntry_2930_name(medicalEntryId.getName());
+                }
+                if ("3010".equals(medicalEntryId.getId())) {
+                    record.setEntry_3010_id(medicalEntryId.getId());
+                    record.setEntry_3010_name(medicalEntryId.getName());
+                }
+                if ("3025".equals(medicalEntryId.getId())) {
+                    record.setEntry_3025_id(medicalEntryId.getId());
+                    record.setEntry_3025_name(medicalEntryId.getName());
+                }
+                if ("3062".equals(medicalEntryId.getId())) {
+                    record.setEntry_3062_id(medicalEntryId.getId());
+                    record.setEntry_3062_name(medicalEntryId.getName());
+                }
+                if ("3063".equals(medicalEntryId.getId())) {
+                    record.setEntry_3063_id(medicalEntryId.getId());
+                    record.setEntry_3063_name(medicalEntryId.getName());
+                }
+            }
+        }
+
+        return medicalCheck;
+
+    }
+
     /**
      * 病历稽查表导出
      *
@@ -547,6 +754,18 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return medicalCheckExport;
 
     }
+    /**
+     * 病历稽查表导出-科室
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<MedicalDeptDTO> medicalCheckExportByDept(@Param("filterVO") FilterMedicalCheckVO filterVO) {
+        List<MedicalDeptDTO> medicalCheckExport = baseMapper.medicalCheckExportByDept(filterVO);
+        return medicalCheckExport;
+
+    }
 
 
     /**
@@ -560,6 +779,18 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.unModifyMRPage(qcResultShortPageVO);
     }
 
+    /**
+     * 未整改病历质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public IPage<QcResultShortDTO> unModifyMRByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.unModifyMRByDept(qcResultShortPageVO);
+    }
+
+
     /**
      * 不合格/合格数病历号(内页)
      *
@@ -582,6 +813,18 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.unModifyMRPageExport((qcResultShortPageVO));
     }
 
+    /**
+     * 未整改病历缺陷评分详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> unModifyExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.unModifyExportByDept((qcResultShortPageVO));
+    }
+
+
     /**
      * 病案首页不合格/合格数病历详情页导出
      *
@@ -592,6 +835,18 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.badLevelPagePageExport((qcResultShortPageVO));
     }
+    /**
+     * 病案首页不合格/合格数病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> homePageOrLevelExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.homePageOrLevelExportByDept((qcResultShortPageVO));
+    }
+
+
 
     /**
      * 31天再入院详情页
@@ -603,6 +858,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO) {
         return baseMapper.reHos31DaysPage(reBeHosPageVO);
     }
+    /**
+     * 31天再入院详情页-科室
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    @Override
+    public IPage<ReBeHosMergeDTO> reHos31DaysPageByDept(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO) {
+        return baseMapper.reHos31DaysPageByDept(reBeHosPageVO);
+    }
+
 
     /**
      * 入院人数统计-首页
@@ -637,6 +903,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.hmImproveMRPage(qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.hmImproveMRPageByDept(qcResultShortPageVO);
+    }
+
     /**
      * 病案首页改善率质控评分页导出
      *
@@ -648,6 +925,16 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.hmImproveMRPageExport(qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.improveMRExportByDept(qcResultShortPageVO);
+    }
     /**
      * 质控核查质控评分页(内页)
      *
@@ -658,6 +945,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<QcResultShortDTO> qcCheckMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.qcCheckMRPage(qcResultShortPageVO);
     }
+    /**
+     * 质控核查质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public IPage<QcResultShortDTO> qcCheckMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.qcCheckMRPageByDept(qcResultShortPageVO);
+    }
+
 
     /**
      * 质控核查质控评分页导出
@@ -669,4 +967,15 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.qcCheckMRPageExport(qcResultShortPageVO);
     }
+
+    /**
+     * 质控核查质控评分页-科室 导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> qcCheckMRPageExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.qcCheckMRPageExportByDept(qcResultShortPageVO);
+    }
 }

+ 2 - 2
src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java

@@ -187,7 +187,7 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      * @return
      */
     @Override
-    public IPage<DeptNumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<NumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
         return baseMapper.entryCountGroupByCaseAndDeptPage(filterPageByDeptVO);
     }
 
@@ -198,7 +198,7 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      * @return
      */
     @Override
-    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<EntryNumGroupDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
         return baseMapper.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
     }
 

+ 20 - 0
src/main/java/com/diagbot/service/impl/StrInformedConsentServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.StrInformedConsent;
+import com.diagbot.mapper.StrInformedConsentMapper;
+import com.diagbot.service.StrInformedConsentService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-01-04
+ */
+@Service
+public class StrInformedConsentServiceImpl extends ServiceImpl<StrInformedConsentMapper, StrInformedConsent> implements StrInformedConsentService {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/StrTalkInformServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.StrTalkInform;
+import com.diagbot.mapper.StrTalkInformMapper;
+import com.diagbot.service.StrTalkInformService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-01-04
+ */
+@Service
+public class StrTalkInformServiceImpl extends ServiceImpl<StrTalkInformMapper, StrTalkInform> implements StrTalkInformService {
+
+}

+ 5 - 4
src/main/java/com/diagbot/service/impl/SysMenuServiceImpl.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -28,8 +29,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
      * @return 菜单信息
      */
     @Override
-    public List<SysMenuWrapper> getByRole(Long userId) {
-        return baseMapper.getByRole(userId);
+    public List<SysMenuWrapper> getByRole(Long userId, Set<String> roleSet) {
+        return baseMapper.getByRole(userId,roleSet);
     }
 
 
@@ -45,7 +46,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
     }
 
     @Override
-    public List<SysUserPermissionDTO> getByRolePermission(Long userId){
-        return baseMapper.getByRolePermission(userId);
+    public List<SysUserPermissionDTO> getByRolePermission(Long userId,Set<String> roleSet){
+        return baseMapper.getByRolePermission(userId,roleSet);
     }
 }

+ 12 - 0
src/main/java/com/diagbot/util/MapUtil.java

@@ -104,4 +104,16 @@ public class MapUtil {
         return map;
     }
 
+    /**
+     * 浙江医院用,两MAP合并成一个MAP对象
+     * @return
+     */
+    public static Map<String, Object> objcetKeyConvert(Map<String, String> columnMap, Map<String, Object> entityMap) throws Exception{
+        Map<String, Object> wholeMap = new HashMap<>();
+        for (String objKey : columnMap.keySet()) {
+            wholeMap.put(objKey,entityMap.get(columnMap.get(objKey)));
+        }
+        return wholeMap;
+    }
+
 }

+ 5 - 0
src/main/java/com/diagbot/vo/EntryStatisticsVO.java

@@ -48,6 +48,11 @@ public class EntryStatisticsVO {
      * 科室名称
      */
     private String deptName;
+
+    /**
+     * 主治医生
+     */
+    private String doctorName;
     /**
      * 是否归档(0:未归档,1:已归档)
      */

+ 5 - 0
src/main/java/com/diagbot/vo/FilterMedicalCheckVO.java

@@ -42,6 +42,11 @@ public class FilterMedicalCheckVO extends Page {
      */
     private String deptName;
 
+    /**
+     * 主管医生
+     */
+    private String name;
+
     /**
      * 是否归档(0:未归档,1:已归档)
      */

+ 3 - 1
src/main/java/com/diagbot/vo/FilterOrderByDeptVO.java

@@ -11,5 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class FilterOrderByDeptVO extends FilterOrderVO {
-    private String deptName;
+//    private String deptName;
+    //医生姓名
+    private String name;
 }

+ 10 - 0
src/main/java/com/diagbot/vo/FilterOrderVO.java

@@ -30,6 +30,16 @@ public class FilterOrderVO extends FilterVO {
      * 科室名称
      */
     private String deptName;
+
+    /**
+     * 医生名称
+     */
+    private String doctorName;
+    /**
+     * 医生Id
+     */
+    private String doctorId;
+
     /**
      * 去年同期起始时间
      */

+ 1 - 0
src/main/java/com/diagbot/vo/FilterUnModifyMRVO.java

@@ -62,4 +62,5 @@ public class FilterUnModifyMRVO {
      * 是否归档(0:未归档,1:已归档)
      */
     private String isPlacefile = "1";
+    private String doctorName;
 }

+ 3 - 2
src/main/java/com/diagbot/vo/FilterVO.java

@@ -50,7 +50,7 @@ public class FilterVO {
      * 限制条数
      */
     @ApiModelProperty(hidden = true)
-    private Integer limitCount;
+    private Integer limitCount = 10;
 
     @ApiModelProperty(hidden = true)
     private Long userId;
@@ -59,9 +59,10 @@ public class FilterVO {
      * 科室分类
      */
     private String deptClass;
+    //科室名称
+    private String deptName;
 
     private String level;
-
     /**
      * 是否归档(0:未归档,1:已归档)
      */

+ 5 - 0
src/main/java/com/diagbot/vo/QcResultPageVO.java

@@ -61,6 +61,11 @@ public class QcResultPageVO extends Page {
      * 科室名称
      */
     private String deptName;
+    /**
+     * 科室id
+     */
+    private String deptClass;
+
     /**
      * 医生姓名
      */

+ 1 - 0
src/main/java/com/diagbot/vo/QcResultShortPageVO.java

@@ -35,6 +35,7 @@ public class QcResultShortPageVO extends Page {
     /**
      * (1-导出7天[含缺陷明细项]  2-导出90天[不含缺陷明细项] )
      */
+    @NotNull(message = "导出天数选择不能为空")
     private String radioCheck = "1";
 
     /**

+ 2 - 1
src/main/java/com/diagbot/vo/ReBeHosPageVO.java

@@ -20,6 +20,7 @@ public class ReBeHosPageVO extends Page {
     private Long userId;
     @ApiModelProperty(hidden = true)
     private String hospitalId;
+    private String deptName;
     @NotNull(message = "请输入起始时间")
     private Date startDate;
     @NotNull(message = "请输入截止时间")
@@ -36,4 +37,4 @@ public class ReBeHosPageVO extends Page {
      * 是否归档(0:未归档,1:已归档)
      */
     private String isPlacefile = "1";
-}
+}

+ 27 - 0
src/main/java/com/diagbot/vo/data/BasDoctorInfoVO.java

@@ -0,0 +1,27 @@
+package com.diagbot.vo.data;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/12/24 11:28
+ */
+@Getter
+@Setter
+public class BasDoctorInfoVO {
+    /**
+     * 搜索参数
+     */
+    private String inputStr;
+    private String isPlacefile;
+    private String deptName;
+    @ApiModelProperty(hidden = true)
+    private String deptId;
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+    @ApiModelProperty(hidden = true)
+    private Long userId;
+}

+ 5 - 31
src/main/java/com/diagbot/vo/str/StrAdmissionNoteVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 入院记录
@@ -58,7 +56,7 @@ public class StrAdmissionNoteVO {
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -68,7 +66,7 @@ public class StrAdmissionNoteVO {
     /**
      * 出生日期
      */
-    private Date birthday;
+    private String birthday;
 
     /**
      * 婚姻状况
@@ -123,7 +121,7 @@ public class StrAdmissionNoteVO {
     /**
      * 入院日期
      */
-    private Date behospitalDate;
+    private String behospitalDate;
 
     /**
      * 病史陈述者
@@ -228,7 +226,7 @@ public class StrAdmissionNoteVO {
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -238,7 +236,7 @@ public class StrAdmissionNoteVO {
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 体温
@@ -290,28 +288,4 @@ public class StrAdmissionNoteVO {
      */
     private String remark;
 
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
 }

+ 3 - 30
src/main/java/com/diagbot/vo/str/StrBloodResultVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 输血效果评价
@@ -57,7 +55,7 @@ public class StrBloodResultVO {
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -77,7 +75,7 @@ public class StrBloodResultVO {
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -87,7 +85,7 @@ public class StrBloodResultVO {
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -99,29 +97,4 @@ public class StrBloodResultVO {
      */
     private String remark;
 
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
-
 }

+ 5 - 31
src/main/java/com/diagbot/vo/str/StrBloodTransfusionVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 输血记录
@@ -58,7 +56,7 @@ public class StrBloodTransfusionVO{
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -68,12 +66,12 @@ public class StrBloodTransfusionVO{
     /**
      * 开始时间
      */
-    private Date startTime;
+    private String startTime;
 
     /**
      * 结束时间
      */
-    private Date endTime;
+    private String endTime;
 
     /**
      * 输血原因
@@ -98,7 +96,7 @@ public class StrBloodTransfusionVO{
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -108,7 +106,7 @@ public class StrBloodTransfusionVO{
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -120,28 +118,4 @@ public class StrBloodTransfusionVO{
      */
     private String remark;
 
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
 }

+ 6 - 33
src/main/java/com/diagbot/vo/str/StrConsultationApplyVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 会诊申请单
@@ -57,12 +55,12 @@ public class StrConsultationApplyVO {
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 入院日期
      */
-    private Date behospitalDate;
+    private String behospitalDate;
 
     /**
      * 标题
@@ -82,7 +80,7 @@ public class StrConsultationApplyVO {
     /**
      * 申请日期
      */
-    private Date applyDate;
+    private String applyDate;
 
     /**
      * 会诊类别
@@ -117,7 +115,7 @@ public class StrConsultationApplyVO {
     /**
      * 会诊时间
      */
-    private Date consultationDate;
+    private String consultationDate;
 
     /**
      * 会诊目的
@@ -137,7 +135,7 @@ public class StrConsultationApplyVO {
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -147,7 +145,7 @@ public class StrConsultationApplyVO {
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -159,29 +157,4 @@ public class StrConsultationApplyVO {
      */
     private String remark;
 
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
-
 }

+ 6 - 32
src/main/java/com/diagbot/vo/str/StrConsultationNoteVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 会诊单(申请和结果)
@@ -58,7 +56,7 @@ public class StrConsultationNoteVO {
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -68,7 +66,7 @@ public class StrConsultationNoteVO {
     /**
      * 入院日期
      */
-    private Date behospitalDate;
+    private String behospitalDate;
 
     /**
      * 申请科室
@@ -83,7 +81,7 @@ public class StrConsultationNoteVO {
     /**
      * 申请日期
      */
-    private Date applyDate;
+    private String applyDate;
 
     /**
      * 会诊类别
@@ -118,7 +116,7 @@ public class StrConsultationNoteVO {
     /**
      * 会诊时间
      */
-    private Date consultationDate;
+    private String consultationDate;
 
     /**
      * 会诊目的
@@ -138,7 +136,7 @@ public class StrConsultationNoteVO {
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -148,7 +146,7 @@ public class StrConsultationNoteVO {
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -160,28 +158,4 @@ public class StrConsultationNoteVO {
      */
     private String remark;
 
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
 }

+ 6 - 33
src/main/java/com/diagbot/vo/str/StrConsultationRecordVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 会诊记录
@@ -58,7 +56,7 @@ public class StrConsultationRecordVO {
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -68,7 +66,7 @@ public class StrConsultationRecordVO {
     /**
      * 入院日期
      */
-    private Date behospitalDate;
+    private String behospitalDate;
 
     /**
      * 申请科室
@@ -83,7 +81,7 @@ public class StrConsultationRecordVO {
     /**
      * 申请日期
      */
-    private Date applyDate;
+    private String applyDate;
 
     /**
      * 会诊类别
@@ -118,7 +116,7 @@ public class StrConsultationRecordVO {
     /**
      * 会诊时间
      */
-    private Date consultationDate;
+    private String consultationDate;
 
     /**
      * 会诊目的
@@ -138,7 +136,7 @@ public class StrConsultationRecordVO {
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -148,7 +146,7 @@ public class StrConsultationRecordVO {
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -160,29 +158,4 @@ public class StrConsultationRecordVO {
      */
     private String remark;
 
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
-
 }

+ 6 - 33
src/main/java/com/diagbot/vo/str/StrConsultationResultVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 会诊结果单
@@ -57,7 +55,7 @@ public class StrConsultationResultVO{
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -67,7 +65,7 @@ public class StrConsultationResultVO{
     /**
      * 入院日期
      */
-    private Date behospitalDate;
+    private String behospitalDate;
 
     /**
      * 申请科室
@@ -82,7 +80,7 @@ public class StrConsultationResultVO{
     /**
      * 申请日期
      */
-    private Date applyDate;
+    private String applyDate;
 
     /**
      * 会诊类别
@@ -117,7 +115,7 @@ public class StrConsultationResultVO{
     /**
      * 会诊到达时间
      */
-    private Date consultationArriveDate;
+    private String consultationArriveDate;
 
     /**
      * 记录医生
@@ -127,7 +125,7 @@ public class StrConsultationResultVO{
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -137,7 +135,7 @@ public class StrConsultationResultVO{
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -148,29 +146,4 @@ public class StrConsultationResultVO{
      * 备注
      */
     private String remark;
-
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
 }

+ 4 - 32
src/main/java/com/diagbot/vo/str/StrCrisisNoteVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 危急值记录
@@ -57,7 +55,7 @@ public class StrCrisisNoteVO {
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -77,7 +75,7 @@ public class StrCrisisNoteVO {
     /**
      * 接收时间
      */
-    private Date recieveDate;
+    private String recieveDate;
 
     /**
      * 记录医生
@@ -87,7 +85,7 @@ public class StrCrisisNoteVO {
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -97,7 +95,7 @@ public class StrCrisisNoteVO {
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -108,30 +106,4 @@ public class StrCrisisNoteVO {
      * 备注
      */
     private String remark;
-
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
-
 }

+ 5 - 33
src/main/java/com/diagbot/vo/str/StrDeathDiscussionVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 死亡病例讨论记录
@@ -58,7 +56,7 @@ public class StrDeathDiscussionVO{
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -83,12 +81,12 @@ public class StrDeathDiscussionVO{
     /**
      * 死亡时间
      */
-    private Date deathDate;
+    private String deathDate;
 
     /**
      * 讨论时间
      */
-    private Date discussDate;
+    private String discussDate;
 
     /**
      * 讨论地点
@@ -128,7 +126,7 @@ public class StrDeathDiscussionVO{
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -138,7 +136,7 @@ public class StrDeathDiscussionVO{
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -149,30 +147,4 @@ public class StrDeathDiscussionVO{
      * 备注
      */
     private String remark;
-
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
-
 }

+ 5 - 32
src/main/java/com/diagbot/vo/str/StrDeathNoteVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 死亡记录
@@ -58,7 +56,7 @@ public class StrDeathNoteVO{
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -68,12 +66,12 @@ public class StrDeathNoteVO{
     /**
      * 入院日期
      */
-    private Date behospitalDate;
+    private String behospitalDate;
 
     /**
      * 死亡日期
      */
-    private Date deathDate;
+    private String deathDate;
 
     /**
      * 入院情况
@@ -108,7 +106,7 @@ public class StrDeathNoteVO{
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -118,7 +116,7 @@ public class StrDeathNoteVO{
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -130,29 +128,4 @@ public class StrDeathNoteVO{
      */
     private String remark;
 
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
-
 }

+ 4 - 30
src/main/java/com/diagbot/vo/str/StrDifficultCaseVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 疑难病例讨论记录
@@ -58,7 +56,7 @@ public class StrDifficultCaseVO {
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -68,7 +66,7 @@ public class StrDifficultCaseVO {
     /**
      * 讨论日期
      */
-    private Date discussDate;
+    private String discussDate;
 
     /**
      * 讨论地点
@@ -113,7 +111,7 @@ public class StrDifficultCaseVO {
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -123,7 +121,7 @@ public class StrDifficultCaseVO {
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -135,28 +133,4 @@ public class StrDifficultCaseVO {
      */
     private String remark;
 
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
 }

+ 3 - 31
src/main/java/com/diagbot/vo/str/StrFirstRecordVO.java

@@ -2,8 +2,6 @@ package com.diagbot.vo.str;
 
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * <p>
  * 首次病程录
@@ -57,7 +55,7 @@ public class StrFirstRecordVO  {
     /**
      * 病历日期
      */
-    private Date recordDate;
+    private String recordDate;
 
     /**
      * 标题
@@ -122,7 +120,7 @@ public class StrFirstRecordVO  {
     /**
      * 记录时间
      */
-    private Date recDate;
+    private String recDate;
 
     /**
      * 审核医生
@@ -132,7 +130,7 @@ public class StrFirstRecordVO  {
     /**
      * 审核时间
      */
-    private Date auditDate;
+    private String auditDate;
 
     /**
      * 结构化数据
@@ -143,30 +141,4 @@ public class StrFirstRecordVO  {
      * 备注
      */
     private String remark;
-
-    /**
-     * 是否删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人
-     */
-    private String creator;
-
-    /**
-     * 修改人
-     */
-    private String modifier;
-
 }

+ 0 - 0
src/main/java/com/diagbot/vo/str/StrIllCriticallyVO.java


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません