Pārlūkot izejas kodu

Merge branch 'develop' into dev/20200616_1.3.5

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
#	src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
#	src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
#	src/main/resources/mapper/BehospitalInfoMapper.xml
gaodm 5 gadi atpakaļ
vecāks
revīzija
77a3de2084
100 mainītis faili ar 6896 papildinājumiem un 26 dzēšanām
  1. 59 0
      doc/009.20200612v1.3.4/qc_initv1.3.4.sql
  2. 12 0
      pom.xml
  3. 2 0
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  4. 2 0
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  5. 6 0
      src/main/java/com/diagbot/dto/BehospitalInfoDTO.java
  6. 5 0
      src/main/java/com/diagbot/dto/RecordContentDTO.java
  7. 33 0
      src/main/java/com/diagbot/dto/SysUserPagesetDTO.java
  8. 43 0
      src/main/java/com/diagbot/dto/data/ABasDeptInfoDTO.java
  9. 40 0
      src/main/java/com/diagbot/dto/data/ABasDoctorInfoDTO.java
  10. 111 0
      src/main/java/com/diagbot/dto/data/ABehospitalInfoDTO.java
  11. 136 0
      src/main/java/com/diagbot/dto/data/ADoctorAdviceDTO.java
  12. 43 0
      src/main/java/com/diagbot/dto/data/AHomeDiagnoseDTO.java
  13. 79 0
      src/main/java/com/diagbot/dto/data/AHomeOperationDTO.java
  14. 652 0
      src/main/java/com/diagbot/dto/data/AHomePageDTO.java
  15. 92 0
      src/main/java/com/diagbot/dto/data/AMedCrisisDTO.java
  16. 40 0
      src/main/java/com/diagbot/dto/data/AMedicalRecordContentDTO.java
  17. 48 0
      src/main/java/com/diagbot/dto/data/AMedicalRecordDTO.java
  18. 38 0
      src/main/java/com/diagbot/dto/data/AMedicalRecordTypeDTO.java
  19. 17 0
      src/main/java/com/diagbot/dto/data/AMrContentDTO.java
  20. 7 6
      src/main/java/com/diagbot/entity/BasDeptInfo.java
  21. 171 0
      src/main/java/com/diagbot/entity/BasDoctorInfo.java
  22. 5 0
      src/main/java/com/diagbot/entity/DoctorAdvice.java
  23. 13 12
      src/main/java/com/diagbot/entity/MedCrisisInfo.java
  24. 1 1
      src/main/java/com/diagbot/entity/MedicalRecord.java
  25. 10 0
      src/main/java/com/diagbot/entity/QcCasesEntry.java
  26. 197 0
      src/main/java/com/diagbot/entity/SysUserPageset.java
  27. 99 0
      src/main/java/com/diagbot/facade/SysUserPagesetFacade.java
  28. 101 0
      src/main/java/com/diagbot/facade/data/ABasDeptInfoFacade.java
  29. 96 0
      src/main/java/com/diagbot/facade/data/ABasDoctorInfoFacade.java
  30. 171 0
      src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java
  31. 109 0
      src/main/java/com/diagbot/facade/data/ADoctorAdviceFacade.java
  32. 85 0
      src/main/java/com/diagbot/facade/data/AHomeDiagnoseInfoFacade.java
  33. 88 0
      src/main/java/com/diagbot/facade/data/AHomeOperationInfoFacade.java
  34. 265 0
      src/main/java/com/diagbot/facade/data/AHomePageFacade.java
  35. 84 0
      src/main/java/com/diagbot/facade/data/AMedCrisisFacade.java
  36. 89 0
      src/main/java/com/diagbot/facade/data/AMedRecordTypeFacade.java
  37. 78 0
      src/main/java/com/diagbot/facade/data/AMedicalRecordContentFacade.java
  38. 299 0
      src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java
  39. 2 0
      src/main/java/com/diagbot/mapper/BasDeptInfoMapper.java
  40. 20 0
      src/main/java/com/diagbot/mapper/BasDoctorInfoMapper.java
  41. 6 0
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  42. 3 1
      src/main/java/com/diagbot/mapper/DoctorAdviceMapper.java
  43. 4 0
      src/main/java/com/diagbot/mapper/HomeDiagnoseInfoMapper.java
  44. 4 0
      src/main/java/com/diagbot/mapper/HomeOperationInfoMapper.java
  45. 7 0
      src/main/java/com/diagbot/mapper/HomePageMapper.java
  46. 4 0
      src/main/java/com/diagbot/mapper/MedCrisisInfoMapper.java
  47. 4 0
      src/main/java/com/diagbot/mapper/MedRecordTypeMapper.java
  48. 4 0
      src/main/java/com/diagbot/mapper/MedicalRecordContentMapper.java
  49. 2 0
      src/main/java/com/diagbot/mapper/MedicalRecordMapper.java
  50. 16 0
      src/main/java/com/diagbot/mapper/SysUserPagesetMapper.java
  51. 16 0
      src/main/java/com/diagbot/service/BasDoctorInfoService.java
  52. 16 0
      src/main/java/com/diagbot/service/SysUserPagesetService.java
  53. 9 0
      src/main/java/com/diagbot/service/impl/BasDeptInfoServiceImpl.java
  54. 29 0
      src/main/java/com/diagbot/service/impl/BasDoctorInfoServiceImpl.java
  55. 1 0
      src/main/java/com/diagbot/service/impl/BasHospitalInfoServiceImpl.java
  56. 8 0
      src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
  57. 9 1
      src/main/java/com/diagbot/service/impl/DoctorAdviceServiceImpl.java
  58. 8 1
      src/main/java/com/diagbot/service/impl/HomeDiagnoseInfoServiceImpl.java
  59. 8 1
      src/main/java/com/diagbot/service/impl/HomeOperationInfoServiceImpl.java
  60. 8 0
      src/main/java/com/diagbot/service/impl/HomePageServiceImpl.java
  61. 8 0
      src/main/java/com/diagbot/service/impl/MedCrisisInfoServiceImpl.java
  62. 8 2
      src/main/java/com/diagbot/service/impl/MedRecordTypeServiceImpl.java
  63. 8 1
      src/main/java/com/diagbot/service/impl/MedicalRecordContentServiceImpl.java
  64. 8 0
      src/main/java/com/diagbot/service/impl/MedicalRecordServiceImpl.java
  65. 15 0
      src/main/java/com/diagbot/service/impl/QcTypeServiceImpl.java
  66. 20 0
      src/main/java/com/diagbot/service/impl/SysUserPagesetServiceImpl.java
  67. 69 0
      src/main/java/com/diagbot/task/BasDeptInfoTask.java
  68. 68 0
      src/main/java/com/diagbot/task/BasDoctorInfoTask.java
  69. 68 0
      src/main/java/com/diagbot/task/BehospitalInfoTask.java
  70. 69 0
      src/main/java/com/diagbot/task/DoctorAdviceTask.java
  71. 68 0
      src/main/java/com/diagbot/task/HomeDiagnoseInfoTask.java
  72. 69 0
      src/main/java/com/diagbot/task/HomeOperationInfoTask.java
  73. 68 0
      src/main/java/com/diagbot/task/HomePageTask.java
  74. 69 0
      src/main/java/com/diagbot/task/MedicalRecordContentTask.java
  75. 69 0
      src/main/java/com/diagbot/task/MedicalRecordTask.java
  76. 66 0
      src/main/java/com/diagbot/task/MedicalRecordTypeTask.java
  77. 68 0
      src/main/java/com/diagbot/util/ReadProperties.java
  78. 703 0
      src/main/java/com/diagbot/util/TZDBConn.java
  79. 23 0
      src/main/java/com/diagbot/vo/SysUserPagesetQueryVO.java
  80. 24 0
      src/main/java/com/diagbot/vo/SysUserPagesetSaveVO.java
  81. 40 0
      src/main/java/com/diagbot/vo/SysUserPagesetVO.java
  82. 44 0
      src/main/java/com/diagbot/vo/data/ABasDeptInfoVO.java
  83. 38 0
      src/main/java/com/diagbot/vo/data/ABasDoctorInfoVO.java
  84. 134 0
      src/main/java/com/diagbot/vo/data/ABehospitalInfoVO.java
  85. 133 0
      src/main/java/com/diagbot/vo/data/ADoctorAdviceVO.java
  86. 41 0
      src/main/java/com/diagbot/vo/data/AHomeDiagnoseVO.java
  87. 76 0
      src/main/java/com/diagbot/vo/data/AHomeOperationVO.java
  88. 17 0
      src/main/java/com/diagbot/vo/data/AHomePageIngVO.java
  89. 650 0
      src/main/java/com/diagbot/vo/data/AHomePageVO.java
  90. 93 0
      src/main/java/com/diagbot/vo/data/AMedCrisisVO.java
  91. 37 0
      src/main/java/com/diagbot/vo/data/AMedicalRecordContentVO.java
  92. 36 0
      src/main/java/com/diagbot/vo/data/AMedicalRecordTypeVO.java
  93. 48 0
      src/main/java/com/diagbot/vo/data/AMedicalRecordVO.java
  94. 16 0
      src/main/java/com/diagbot/vo/data/AMrContentVO.java
  95. 151 0
      src/main/java/com/diagbot/web/DataController.java
  96. 59 0
      src/main/java/com/diagbot/web/SysUserPagesetController.java
  97. 24 0
      src/main/resources/jdbc.properties
  98. 30 0
      src/main/resources/mapper/BasDeptInfoMapper.xml
  99. 47 0
      src/main/resources/mapper/BasDoctorInfoMapper.xml
  100. 0 0
      src/main/resources/mapper/BehospitalInfoMapper.xml

+ 59 - 0
doc/009.20200612v1.3.4/qc_initv1.3.4.sql

@@ -0,0 +1,59 @@
+use `qc`;
+
+-- ----------------------------
+-- Table structure for sys_user_pageset
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_user_pageset`;
+CREATE TABLE `sys_user_pageset` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '系统用户表.用户ID',
+  `page_type` bigint(20) NOT NULL DEFAULT '0' COMMENT '页面分组(值自定义)',
+  `name` varchar(100) NOT NULL DEFAULT '' COMMENT '列名',
+  `val` varchar(100) NOT NULL DEFAULT '' COMMENT '列名值',
+  `status` int(11) NOT NULL DEFAULT '1' COMMENT '是否启用(0:停用,1:启用)',
+  `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`),
+  KEY `idx_userId_pageType` (`user_id`,`page_type`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='用户页面设定表';
+
+-- ----------------------------
+-- Records of sys_user_pageset
+-- ----------------------------
+INSERT INTO `sys_user_pageset` VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '病历等级', 'level', '1', '1', null);
+INSERT INTO `sys_user_pageset` VALUES ('2', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '病历得分', 'scoreRes', '1', '2', null);
+INSERT INTO `sys_user_pageset` VALUES ('3', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '病人住院序号', 'behospitalCode', '1', '3', null);
+INSERT INTO `sys_user_pageset` VALUES ('4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '病案号', 'fileCode', '1', '4', null);
+INSERT INTO `sys_user_pageset` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '病人姓名', 'name', '1', '5', null);
+INSERT INTO `sys_user_pageset` VALUES ('6', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '性别', 'sex', '1', '6', null);
+INSERT INTO `sys_user_pageset` VALUES ('7', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '年龄', 'age', '1', '7', null);
+INSERT INTO `sys_user_pageset` VALUES ('8', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '床号', 'bedCode', '1', '8', null);
+INSERT INTO `sys_user_pageset` VALUES ('9', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '入院日期', 'behospitalDate', '1', '9', null);
+INSERT INTO `sys_user_pageset` VALUES ('10', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '出院日期', 'leaveHospitalDate', '1', '10', null);
+INSERT INTO `sys_user_pageset` VALUES ('11', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '归档日期', 'placefileDate', '1', '11', null);
+INSERT INTO `sys_user_pageset` VALUES ('12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '主诊断', 'diagnose', '1', '12', null);
+INSERT INTO `sys_user_pageset` VALUES ('13', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '住院医生', 'behDoctorName', '1', '13', null);
+INSERT INTO `sys_user_pageset` VALUES ('14', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '主管医生', 'doctorName', '1', '14', null);
+INSERT INTO `sys_user_pageset` VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '主任医生', 'directorDoctorName', '1', '15', null);
+INSERT INTO `sys_user_pageset` VALUES ('16', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '科室', 'behDeptName', '1', '16', null);
+INSERT INTO `sys_user_pageset` VALUES ('17', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '评分时间', 'gradeTime', '1', '17', null);
+
+ALTER TABLE `qc`.`med_doctor_advice` ADD COLUMN `medicine_type` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '药品类型(0.普药 1.抗生素 2.激素)' AFTER `da_prescription_type`;
+
+-- 121和122已经执行过下面的脚本
+ALTER TABLE `qc_cases_entry` ADD `dev_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '开发状态标识: 0-未开发  1-已开发' AFTER `rule_type`;
+ALTER TABLE `qc_cases_entry` ADD `accuracy_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '准确率类型:0-极高,1-高,2-中,3-低' AFTER `dev_type`;
+
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('291', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '15', '未开发', '0', '1', '0', '开发状态标识');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('292', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '15', '已开发', '1', '1', '1', '开发状态标识');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('293', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '极高', '0', '1', '0', '准确率类型');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('294', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '高', '1', '1', '1', '准确率类型');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('295', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '中', '2', '1', '2', '准确率类型');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('296', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '低', '3', '1', '3', '准确率类型');
+
+-- alter table med_medical_record modify column `rec_date` datetime DEFAULT NULL COMMENT '病历日期';

+ 12 - 0
pom.xml

@@ -197,6 +197,18 @@
             <version>${easypoi.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.oracle</groupId>
+            <artifactId>ojdbc6</artifactId>
+            <version>11.2.0.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>mssql-jdbc</artifactId>
+            <version>6.2.0.jre8</version>
+            <scope>runtime</scope>
+        </dependency>
 
     </dependencies>
 

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

@@ -108,6 +108,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/consoleByDept/mrCountByDept").permitAll()
                 .antMatchers("/consoleByDept/qcResultShortByDeptPage").permitAll()
                 .antMatchers("/consoleByDept/resultStatisticsByDeptAndDoctorPage").permitAll()
+                .antMatchers("/sys/user/pageset/getPageSet").permitAll()
+                .antMatchers("/sys/user/pageset/savePageSet").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -110,6 +110,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/dataimport/import", request)
                 || matchers("/qc/dataimport/dataimportPrepare", request)
                 || matchers("/qc/dataimport/test", request)
+                || matchers("/sys/user/pageset/getPageSet", request)
+                || matchers("/sys/user/pageset/savePageSet", request)
                 || matchers("/consoleByDept/getDept", request)
                 || matchers("/console/entryRejectPercent", request)
                 || matchers("/console/qcResultLevelPercent", request)

+ 6 - 0
src/main/java/com/diagbot/dto/BehospitalInfoDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -36,6 +37,7 @@ public class BehospitalInfoDTO implements Serializable {
     /**
      * 出生日期
      */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date birthday;
 
     /**
@@ -61,11 +63,13 @@ public class BehospitalInfoDTO implements Serializable {
     /**
      * 入院时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date behospitalDate;
 
     /**
      * 出院时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date leaveHospitalDate;
 
     /**
@@ -101,6 +105,7 @@ public class BehospitalInfoDTO implements Serializable {
     /**
      * 评分时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date gradeTime;
 
     private String directorDoctorName ;
@@ -110,5 +115,6 @@ public class BehospitalInfoDTO implements Serializable {
     /**
      * 归档时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date placefileDate;
 }

+ 5 - 0
src/main/java/com/diagbot/dto/RecordContentDTO.java

@@ -46,6 +46,11 @@ public class RecordContentDTO implements Serializable {
      */
     private String recTitle;
 
+    /**
+     * 医院文书id
+     */
+    private String recId;
+
     /**
      * 病历类别编号
      */

+ 33 - 0
src/main/java/com/diagbot/dto/SysUserPagesetDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/12 10:26
+ */
+@Getter
+@Setter
+public class SysUserPagesetDTO {
+    /**
+     * 列名
+     */
+    private String name;
+
+    /**
+     * 列名值
+     */
+    private String val;
+
+    /**
+     * 是否启用(0:停用,1:启用)
+     */
+    private Integer status;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+}

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

@@ -0,0 +1,43 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Setter
+public class ABasDeptInfoDTO {
+    /**
+     * 科室编码(HIS导入)
+     */
+    private String deptId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    private String parentDeptId;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 科室类别
+     */
+    private String deptType;
+
+    /**
+     * 首字母拼音
+     */
+    private String spell;
+
+    /**
+     * 区域类别(门诊、工作站、住院等)
+     */
+    private String station;
+
+}

+ 40 - 0
src/main/java/com/diagbot/dto/data/ABasDoctorInfoDTO.java

@@ -0,0 +1,40 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Setter
+public class ABasDoctorInfoDTO {
+    /**
+     * HIS导入的医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院导入科室ID
+     */
+    private String deptId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 职称
+     */
+    private String professor;
+    /**
+     * 职业医师资格
+     */
+    private String occup;
+
+}

+ 111 - 0
src/main/java/com/diagbot/dto/data/ABehospitalInfoDTO.java

@@ -0,0 +1,111 @@
+package com.diagbot.dto.data;
+
+import java.util.Date;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class ABehospitalInfoDTO{
+
+	/**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院ID
+     */
+    private String hospitalId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 档案号
+     */
+    private String fileCode;
+
+    /**
+     * 病区编码
+     */
+    private String wardCode;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 住院科室ID
+     */
+    private String behDeptId;
+
+    /**
+     * 住院科室名称
+     */
+    private String behDeptName;
+
+    /**
+     * 床位号
+     */
+    private String bedCode;
+
+    /**
+     * 床位名称
+     */
+    private String bedName;
+
+    /**
+     * 医保类别
+     */
+    private String insuranceName;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 入院时间
+     */
+    private String behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private String leaveHospitalDate;
+
+    /**
+     * 疾病ICD编码
+     */
+    private String diagnoseIcd;
+
+    /**
+     * 疾病名称
+     */
+    private String diagnose;
+
+    /**
+     * 医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+}

+ 136 - 0
src/main/java/com/diagbot/dto/data/ADoctorAdviceDTO.java

@@ -0,0 +1,136 @@
+package com.diagbot.dto.data;
+
+import java.util.Date;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class ADoctorAdviceDTO {
+
+	/**
+     * 病人医嘱ID
+     */
+    private String doctorAdviceId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医生开单判别
+     */
+    private String orderDoctorName;
+
+    /**
+     * 医嘱频率判别
+     */
+    private String frequency;
+
+    /**
+     * 父类医嘱ID
+     */
+    private String parentTypeId;
+
+    /**
+     * 医嘱类型判别(嘱托长嘱、长期医嘱等)
+     */
+    private String doctorAdviceType;
+
+    /**
+     * 一次使用数量
+     */
+    private String usageNum;
+
+    /**
+     * 一次用量单位
+     */
+    private String usageUnit;
+
+    /**
+     * 医嘱单次剂量
+     */
+    private String dose;
+
+    /**
+     * 单次剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 给药方式
+     */
+    private String medModeType;
+
+    /**
+     * 医嘱频率
+     */
+    private String daFrequency;
+
+    /**
+     * 医嘱处理类型
+     */
+    private String daDealType;
+
+    /**
+     * 医嘱开始时间
+     */
+    private String daStartDate;
+
+    /**
+     * 医嘱项目名称
+     */
+    private String daItemName;
+
+    /**
+     * 医嘱状态判别
+     */
+    private String daStatus;
+
+    /**
+     * 医嘱结束时间
+     */
+    private String daStopDate;
+
+    /**
+     * 医嘱同组序号
+     */
+    private String daGroupNo;
+
+    /**
+     * 医嘱处方类型(检验、描述医嘱、膳食、西药、护理等)
+     */
+    private String daPrescriptionType;
+
+    /**
+     * 医嘱领药类型
+     */
+    private String daMedType;
+
+    /**
+     * 医生嘱托
+     */
+    private String doctorNotice;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 药品类型(0.普药 1.抗生素 2.激素)
+     */
+    private String medicineType;
+}

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

@@ -0,0 +1,43 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
+public class AHomeDiagnoseDTO {
+	/**
+     * 病案首页ID
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 诊断序号
+     */
+    private String diagnoseOrderNo;
+
+    /**
+     * 诊断类别(主要诊断、其他诊断)
+     */
+    private String diagnoseType;
+
+    /**
+     * 诊断判别(主、次)
+     */
+    private String diagnoseTypeShort;
+
+    private String diagnoseName;
+
+    private String behospitalType;
+
+    private String leaveHospitalType;
+
+    private String pathologyDiagnose;
+
+    private String icdCode;
+}

+ 79 - 0
src/main/java/com/diagbot/dto/data/AHomeOperationDTO.java

@@ -0,0 +1,79 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
+public class AHomeOperationDTO {
+	/**
+     * 病案首页ID
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 手术序号
+     */
+    private String operationOrderNo;
+
+    /**
+     * 手术日期
+     */
+    private String operationDate;
+
+    /**
+     * 手术编码
+     */
+    private String operationCode;
+
+    /**
+     * 手术医生ID
+     */
+    private String operationDoctorId;
+
+    /**
+     * 一助医生ID
+     */
+    private String firstAssistantId;
+
+    /**
+     * 二助医生ID
+     */
+    private String secondAssistantId;
+
+    /**
+     * 切口等级
+     */
+    private String cutLevel;
+
+    /**
+     * 愈合等级
+     */
+    private String healingLevel;
+
+    /**
+     * 手术名称
+     */
+    private String operationName;
+
+    /**
+     * 手术级别
+     */
+    private String operationLevel;
+
+    /**
+     * 麻醉方式(全麻、局麻、静脉麻醉)
+     */
+    private String anaesthesiaName;
+
+    /**
+     * 拟手术名称
+     */
+    private String shamOperationName;
+
+}

+ 652 - 0
src/main/java/com/diagbot/dto/data/AHomePageDTO.java

@@ -0,0 +1,652 @@
+package com.diagbot.dto.data;
+
+import java.util.List;
+
+import com.diagbot.vo.data.AHomeDiagnoseVO;
+import com.diagbot.vo.data.AHomeOperationVO;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AHomePageDTO {
+	/**
+     * 病案首页编号
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院序号
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构id
+     */
+    private String hospitalCode;
+
+    /**
+     * 医疗机构名称
+     */
+    private String hospitalName;
+
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 医疗付费方式
+     */
+    private String payType;
+
+    /**
+     * 健康卡号
+     */
+    private String healthCard;
+
+    /**
+     * 住院次数
+     */
+    private String behospitalNum;
+
+    /**
+     * 病案号
+     */
+    private String fileCode;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 年龄单位
+     */
+    private String ageUnit;
+
+    /**
+     * 国籍
+     */
+    private String nationality;
+
+    /**
+     * 新生儿出生月数
+     */
+    private String newbornMonth;
+
+    /**
+     * 新生儿出生天数
+     */
+    private String newbornDay;
+
+    /**
+     * 新生儿出生体重
+     */
+    private String newbornWeight;
+
+    /**
+     * 新生儿入院体重
+     */
+    private String newbornBehospitalWeight;
+
+    /**
+     * 出生地
+     */
+    private String bornAddress;
+
+    /**
+     * 籍贯
+     */
+    private String bornPlace;
+
+    /**
+     * 民族
+     */
+    private String nation;
+
+    /**
+     * 身份证号
+     */
+    private String identityCardNo;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 婚姻
+     */
+    private String marriage;
+
+    /**
+     * 现住址
+     */
+    private String curAddress;
+
+    /**
+     * 现住址电话
+     */
+    private String curPhone;
+
+    /**
+     * 现住址邮编
+     */
+    private String curPostCode;
+
+    /**
+     * 户口地址
+     */
+    private String residenceAddress;
+
+    /**
+     * 户口地址邮编
+     */
+    private String residencePostCode;
+
+    /**
+     * 工作单位
+     */
+    private String workAddress;
+
+    /**
+     * 工作单位电话
+     */
+    private String workPhone;
+
+    /**
+     * 工作单位邮编
+     */
+    private String workPostCode;
+
+    /**
+     * 联系人姓名
+     */
+    private String contactName;
+
+    /**
+     * 联系人关系
+     */
+    private String contactRelation;
+
+    /**
+     * 联系人地址
+     */
+    private String contactAddress;
+
+    /**
+     * 联系人电话
+     */
+    private String contactPhone;
+
+    /**
+     * 入院途径
+     */
+    private String behospitalWay;
+
+    /**
+     * 入院时间
+     */
+    private String behospitalDate;
+
+    /**
+     * 入院科别
+     */
+    private String behospitalDept;
+
+    /**
+     * 入院病房
+     */
+    private String behospitalWard;
+
+    /**
+     * 入院床位序号
+     */
+    private String behospitalBedId;
+
+    /**
+     * 入院床位号码
+     */
+    private String behospitalBedCode;
+
+    /**
+     * 转科科别
+     */
+    private String changeDept;
+
+    /**
+     * 出院时间
+     */
+    private String leaveHospitalDate;
+
+    /**
+     * 出院科别
+     */
+    private String leaveHospitalDept;
+
+    /**
+     * 出院病房
+     */
+    private String leaveHospitalWard;
+
+    /**
+     * 出院床位序号
+     */
+    private String leaveHospitalBedId;
+
+    /**
+     * 出院床位号码
+     */
+    private String leaveHospitalBedCode;
+
+    /**
+     * 实际住院天数
+     */
+    private String behospitalDayNum;
+
+    /**
+     * 门急诊诊断
+     */
+    private String outpatientEmrDiagnose;
+
+    /**
+     * 门急诊诊断编码
+     */
+    private String outpatientEmrDiagnoseCode;
+
+    /**
+     * 损伤中毒因素
+     */
+    private String poisonFactor;
+
+    /**
+     * 损伤中毒因素编码
+     */
+    private String poisonFactorCode;
+
+    /**
+     * 病理诊断
+     */
+    private String pathologyDiagnose;
+
+    /**
+     * 病理诊断编码
+     */
+    private String pathologyDiagnoseCode;
+
+    /**
+     * 病理诊断编号
+     */
+    private String pathologyDiagnoseId;
+
+    /**
+     * 药物过敏
+     */
+    private String isMedAllergy;
+
+    /**
+     * 过敏药物
+     */
+    private String medAllergyName;
+
+    /**
+     * 死亡患者尸检
+     */
+    private String autopsy;
+
+    /**
+     * 血型
+     */
+    private String bloodType;
+
+    /**
+     * Rh
+     */
+    private String rh;
+
+    /**
+     * 科主任
+     */
+    private String deptDirector;
+
+    /**
+     * 主任医师
+     */
+    private String directorDoctor;
+
+    /**
+     * 主治医师
+     */
+    private String attendingDoctor;
+
+    /**
+     * 住院医师
+     */
+    private String behospitalDoctor;
+
+    /**
+     * 责任护士
+     */
+    private String responseNurse;
+
+    /**
+     * 进修医师
+     */
+    private String studyDoctor;
+
+    /**
+     * 实习医师
+     */
+    private String practiceDoctor;
+
+    /**
+     * 编码员
+     */
+    private String encodeMan;
+
+    /**
+     * 病案质量
+     */
+    private String homePageQuality;
+
+    /**
+     * 质控医师
+     */
+    private String qcDoctor;
+
+    /**
+     * 质控护士
+     */
+    private String qcNurse;
+
+    /**
+     * 质控日期
+     */
+    private String qcDate;
+
+    /**
+     * 离院方式
+     */
+    private String leaveHospitalType;
+
+    /**
+     * 接收机构名称
+     */
+    private String acceptOrgCode;
+
+    /**
+     * 31天内再住院计划
+     */
+    private String againBehospitalPlan;
+
+    /**
+     * 再住院目的
+     */
+    private String againBehospitalGoal;
+
+    /**
+     * 颅脑损伤患者昏迷前天数
+     */
+    private String tbiBeforeDay;
+
+    /**
+     * 颅脑损伤患者昏迷前小时
+     */
+    private String tbiBeforeHour;
+
+    /**
+     * 颅脑损伤患者昏迷前分钟
+     */
+    private String tbiBeforeMinute;
+
+    /**
+     * 颅脑损伤患者昏迷后天数
+     */
+    private String tbiAfterDay;
+
+    /**
+     * 颅脑损伤患者昏迷后小时
+     */
+    private String tbiAfterHour;
+
+    /**
+     * 颅脑损伤患者昏迷后分钟
+     */
+    private String tbiAfterMinute;
+
+    /**
+     * 总费用
+     */
+    private String totalFee;
+
+    /**
+     * 自付金额
+     */
+    private String ownFee;
+
+    /**
+     * 一般医疗服务费
+     */
+    private String generalFee;
+
+    /**
+     * 一般治疗服务费
+     */
+    private String serviceFee;
+
+    /**
+     * 护理费
+     */
+    private String nurseFee;
+
+    /**
+     * 其他费用
+     */
+    private String otherFee;
+
+    /**
+     * 病理诊断费
+     */
+    private String pathologyFee;
+
+    /**
+     * 实验室诊断费
+     */
+    private String labFee;
+
+    /**
+     * 影像学诊断费
+     */
+    private String pacsFee;
+
+    /**
+     * 临床诊断项目费
+     */
+    private String clinicDiagnoseFee;
+
+    /**
+     * 非手术治疗项目费
+     */
+    private String notOperationFee;
+
+    /**
+     * 临床物理治疗费
+     */
+    private String clinicPhysicFee;
+
+    /**
+     * 手术治疗费
+     */
+    private String operationTreatFee;
+
+    /**
+     * 麻醉费
+     */
+    private String anaesthesiaFee;
+
+    /**
+     * 手术费
+     */
+    private String operationFee;
+
+    /**
+     * 康复类
+     */
+    private String healthTypeFee;
+
+    /**
+     * 中医治疗费
+     */
+    private String chnTreatFee;
+
+    /**
+     * 西药费
+     */
+    private String westernMedFee;
+
+    /**
+     * 抗菌药物费用
+     */
+    private String antibiosisFee;
+
+    /**
+     * 中成药费
+     */
+    private String chnMedFee;
+
+    /**
+     * 中草药费
+     */
+    private String chnHerbFee;
+
+    /**
+     * 血费
+     */
+    private String bloodFee;
+
+    /**
+     * 白蛋白类制品费
+     */
+    private String albumenFee;
+
+    /**
+     * 球蛋白类制品费
+     */
+    private String globulinFee;
+
+    /**
+     * 凝血因子类制品费
+     */
+    private String bloodFactorFee;
+
+    /**
+     * 细胞因子类制品费
+     */
+    private String cellFactorFee;
+
+    /**
+     * 检查用一次性医用材料费
+     */
+    private String checkMaterialFee;
+
+    /**
+     * 治疗用一次性医用材料费
+     */
+    private String treatMaterialFee;
+
+    /**
+     * 手术用一次性医用材料费
+     */
+    private String operationMaterialFee;
+
+    /**
+     * 其他类其他费
+     */
+    private String otherTypeFee;
+
+    /**
+     * 单病种管理
+     */
+    private String singleDiagManage;
+
+    /**
+     * 临床路径管理
+     */
+    private String clinicPathwayManage;
+
+    /**
+     * 门诊与住院
+     */
+    private String isOutpatientBehospital;
+
+    /**
+     * 入院与出院
+     */
+    private String isLeaveBehospital;
+
+    /**
+     * 术前与术后
+     */
+    private String isOperationBeforeAfter;
+
+    /**
+     * 临床与病理
+     */
+    private String isClinicPathology;
+
+    /**
+     * 放射与病理
+     */
+    private String isRadiatePathology;
+
+    /**
+     * 病人抢救次数
+     */
+    private String rescueNum;
+
+    /**
+     * 病人抢救成功次数
+     */
+    private String rescueSuccessNum;
+
+    /**
+     * 是否为自动出院
+     */
+    private String isAutoLeavehospital;
+
+    /**
+     * 转归情况
+     */
+    private String returnToType;
+    /**
+     * 出院诊断
+     */
+    private List<AHomeDiagnoseVO> leaveDiags;
+
+    /**
+     * 手术情况
+     */
+    private List<AHomeOperationVO> operations;
+
+}

+ 92 - 0
src/main/java/com/diagbot/dto/data/AMedCrisisDTO.java

@@ -0,0 +1,92 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+public class AMedCrisisDTO {
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 记录类型
+     */
+    private String recType;
+
+    /**
+     * 危急值ID
+     */
+    private String crisisId;
+
+    /**
+     * 危急值名称
+     */
+    private String crisisName;
+
+    /**
+     * 开单科室ID
+     */
+    private String deptId;
+
+    /**
+     * 开单科室名称
+     */
+    private String deptName;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 危急结果值
+     */
+    private String crisisValue;
+
+    /**
+     * 危急值描述
+     */
+    private String crisisDesc;
+
+    /**
+     * 危急值状态
+     */
+    private String crisisStatus;
+
+    /**
+     * 参考上限
+     */
+    private String crisisTopValue;
+
+    /**
+     * 参考下限
+     */
+    private String crisisLowerValue;
+
+    /**
+     * 送检时间
+     */
+    private String sendDate;
+
+    /**
+     * 报告时间
+     */
+    private String repDate;
+}

+ 40 - 0
src/main/java/com/diagbot/dto/data/AMedicalRecordContentDTO.java

@@ -0,0 +1,40 @@
+package com.diagbot.dto.data;
+
+import java.sql.Blob;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AMedicalRecordContentDTO {
+	/**
+     * 病历ID
+     */
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 文书内容(blob)
+     */
+    private Blob contentBlob;
+
+    /**
+     * 病历文本(文本)
+     */
+    private String contentText;
+
+    /**
+     * html文本信息
+     */
+    private String htmlText;
+
+    /**
+     * xml文本信息
+     */
+    private String xmlText;
+}

+ 48 - 0
src/main/java/com/diagbot/dto/data/AMedicalRecordDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto.data;
+
+import com.diagbot.vo.data.AMedicalRecordContentVO;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+public class AMedicalRecordDTO {
+	private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 病历类别编号
+     */
+    private String recTypeId;
+
+    /**
+     * 病历日期
+     */
+    private String recDate;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+
+    /**
+     * 病历内容
+     */
+    private List<AMedicalRecordContentVO> contents;
+}

+ 38 - 0
src/main/java/com/diagbot/dto/data/AMedicalRecordTypeDTO.java

@@ -0,0 +1,38 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AMedicalRecordTypeDTO {
+	/**
+     * 类别ID
+     */
+    private String typeId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 类别名称
+     */
+    private String typeName;
+
+    /**
+     * 上级类别
+     */
+    private String parentTypeId;
+
+    /**
+     * 服务对象(全院、科室、个人)
+     */
+    private String objName;
+
+    /**
+     * 拼音
+     */
+    private String spell;
+}

+ 17 - 0
src/main/java/com/diagbot/dto/data/AMrContentDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto.data;
+
+import com.diagbot.vo.data.AMedicalRecordVO;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+import java.util.Map;
+
+@Getter
+@Setter
+public class AMrContentDTO {
+
+    private List<AMedicalRecordVO> records;
+
+    private Map<String,Object> map;
+}

+ 7 - 6
src/main/java/com/diagbot/entity/BasDeptInfo.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * <p>
@@ -59,12 +60,12 @@ public class BasDeptInfo implements Serializable {
     /**
      * 记录创建时间
      */
-    private LocalDateTime gmtCreate;
+    private Date gmtCreate;
 
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
-    private LocalDateTime gmtModified;
+    private Date gmtModified;
 
     /**
      * 创建人,0表示无创建人值
@@ -132,18 +133,18 @@ public class BasDeptInfo implements Serializable {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
     }
-    public LocalDateTime getGmtCreate() {
+    public Date getGmtCreate() {
         return gmtCreate;
     }
 
-    public void setGmtCreate(LocalDateTime gmtCreate) {
+    public void setGmtCreate(Date gmtCreate) {
         this.gmtCreate = gmtCreate;
     }
-    public LocalDateTime getGmtModified() {
+    public Date getGmtModified() {
         return gmtModified;
     }
 
-    public void setGmtModified(LocalDateTime gmtModified) {
+    public void setGmtModified(Date gmtModified) {
         this.gmtModified = gmtModified;
     }
     public String getCreator() {

+ 171 - 0
src/main/java/com/diagbot/entity/BasDoctorInfo.java

@@ -0,0 +1,171 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public class BasDoctorInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * HIS导入的医生ID
+     */
+    @TableId(value = "doctor_id",type = IdType.INPUT)
+    private String doctorId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院导入科室ID
+     */
+    private String deptId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 职称
+     */
+    private String professor;
+
+    /**
+     * 职业医师资格
+     */
+    private String occup;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    public String getDoctorId() {
+        return doctorId;
+    }
+
+    public void setDoctorId(String doctorId) {
+        this.doctorId = doctorId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getProfessor() {
+        return professor;
+    }
+
+    public void setProfessor(String professor) {
+        this.professor = professor;
+    }
+    public String getOccup() {
+        return occup;
+    }
+
+    public void setOccup(String occup) {
+        this.occup = occup;
+    }
+    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 "BasDoctorInfo{" +
+                "doctorId=" + doctorId +
+                ", hospitalId=" + hospitalId +
+                ", deptId=" + deptId +
+                ", name=" + name +
+                ", professor=" + professor +
+                ", occup=" + occup +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                "}";
+    }
+}

+ 5 - 0
src/main/java/com/diagbot/entity/DoctorAdvice.java

@@ -123,6 +123,11 @@ public class DoctorAdvice implements Serializable {
      */
     private String daPrescriptionType;
 
+    /**
+     * 药品类型(0.普药 1.抗生素 2.激素)
+     */
+    private String medicineType;
+
     /**
      * 医嘱领药类型
      */

+ 13 - 12
src/main/java/com/diagbot/entity/MedCrisisInfo.java

@@ -3,6 +3,7 @@ package com.diagbot.entity;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * <p>
@@ -91,12 +92,12 @@ public class MedCrisisInfo implements Serializable {
     /**
      * 送检时间
      */
-    private LocalDate sendDate;
+    private Date sendDate;
 
     /**
      * 报告时间
      */
-    private LocalDate repDate;
+    private Date repDate;
 
     /**
      * 是否删除,N:未删除,Y:删除
@@ -106,12 +107,12 @@ public class MedCrisisInfo implements Serializable {
     /**
      * 记录创建时间
      */
-    private LocalDateTime gmtCreate;
+    private Date gmtCreate;
 
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
-    private LocalDateTime gmtModified;
+    private Date gmtModified;
 
     /**
      * 创建人,0表示无创建人值
@@ -228,18 +229,18 @@ public class MedCrisisInfo implements Serializable {
     public void setCrisisLowerValue(String crisisLowerValue) {
         this.crisisLowerValue = crisisLowerValue;
     }
-    public LocalDate getSendDate() {
+    public Date getSendDate() {
         return sendDate;
     }
 
-    public void setSendDate(LocalDate sendDate) {
+    public void setSendDate(Date sendDate) {
         this.sendDate = sendDate;
     }
-    public LocalDate getRepDate() {
+    public Date getRepDate() {
         return repDate;
     }
 
-    public void setRepDate(LocalDate repDate) {
+    public void setRepDate(Date repDate) {
         this.repDate = repDate;
     }
     public String getIsDeleted() {
@@ -249,18 +250,18 @@ public class MedCrisisInfo implements Serializable {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
     }
-    public LocalDateTime getGmtCreate() {
+    public Date getGmtCreate() {
         return gmtCreate;
     }
 
-    public void setGmtCreate(LocalDateTime gmtCreate) {
+    public void setGmtCreate(Date gmtCreate) {
         this.gmtCreate = gmtCreate;
     }
-    public LocalDateTime getGmtModified() {
+    public Date getGmtModified() {
         return gmtModified;
     }
 
-    public void setGmtModified(LocalDateTime gmtModified) {
+    public void setGmtModified(Date gmtModified) {
         this.gmtModified = gmtModified;
     }
     public String getCreator() {

+ 1 - 1
src/main/java/com/diagbot/entity/MedicalRecord.java

@@ -53,7 +53,7 @@ public class MedicalRecord implements Serializable {
     /**
      * 病历日期
      */
-    private String recDate;
+    private Date recDate;
 
     /**
      * 病历标题

+ 10 - 0
src/main/java/com/diagbot/entity/QcCasesEntry.java

@@ -50,6 +50,16 @@ public class QcCasesEntry implements Serializable {
      */
     private Integer ruleType;
 
+    /**
+     * 开发状态标识: 0-未开发  1-已开发
+     */
+    private Integer devType;
+
+    /**
+     * 准确率类型:0-极高,1-高,2-中,3-低
+     */
+    private Integer accuracyType;
+
     private String precond;
 
     /**

+ 197 - 0
src/main/java/com/diagbot/entity/SysUserPageset.java

@@ -0,0 +1,197 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 用户页面设定表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-06-12
+ */
+public class SysUserPageset implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 系统用户表.用户ID
+     */
+    private Long userId;
+
+    /**
+     * 页面分组(值自定义)
+     */
+    private Long pageType;
+
+    /**
+     * 列名
+     */
+    private String name;
+
+    /**
+     * 列名值
+     */
+    private String val;
+
+    /**
+     * 是否启用(0:停用,1:启用)
+     */
+    private Integer status;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    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;
+    }
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+    public Long getPageType() {
+        return pageType;
+    }
+
+    public void setPageType(Long pageType) {
+        this.pageType = pageType;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getVal() {
+        return val;
+    }
+
+    public void setVal(String val) {
+        this.val = val;
+    }
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+    public Integer getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(Integer orderNo) {
+        this.orderNo = orderNo;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "SysUserPageset{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", userId=" + userId +
+            ", pageType=" + pageType +
+            ", name=" + name +
+            ", val=" + val +
+            ", status=" + status +
+            ", orderNo=" + orderNo +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 99 - 0
src/main/java/com/diagbot/facade/SysUserPagesetFacade.java

@@ -0,0 +1,99 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.SysUserPagesetDTO;
+import com.diagbot.entity.SysUserPageset;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.SysUserPagesetServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.SysUserPagesetQueryVO;
+import com.diagbot.vo.SysUserPagesetSaveVO;
+import com.diagbot.vo.SysUserPagesetVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/12 10:25
+ */
+@Component
+public class SysUserPagesetFacade extends SysUserPagesetServiceImpl {
+    @Autowired
+    @Qualifier("sysUserPagesetServiceImpl")
+    private SysUserPagesetServiceImpl sysUserPagesetService;
+
+    /**
+     * 获取用户对应页面设置
+     *
+     * @param sysUserPagesetQueryVO 获取用户对应页面设置参数
+     * @return 对应页面设置列表
+     */
+    public List<SysUserPagesetDTO> getPageSet(SysUserPagesetQueryVO sysUserPagesetQueryVO) {
+        List<SysUserPageset> sysUserPagesetList = sysUserPagesetService.list(
+                new QueryWrapper<SysUserPageset>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("user_id", SysUserUtils.getCurrentPrincipleID())
+                        .eq("page_type", sysUserPagesetQueryVO.getPageType())
+                        .orderByAsc("order_no")
+        );
+
+        List<SysUserPagesetDTO> sysUserPagesetDTOList = new ArrayList<>();
+        if (ListUtil.isEmpty(sysUserPagesetList)) {
+            List<SysUserPageset> sysUserPagesetListDefault = sysUserPagesetService.list(
+                    new QueryWrapper<SysUserPageset>()
+                            .eq("is_deleted", IsDeleteEnum.N.getKey())
+                            .eq("user_id", -1)
+                            .eq("page_type", sysUserPagesetQueryVO.getPageType())
+                            .orderByAsc("order_no")
+            );
+            sysUserPagesetDTOList = BeanUtil.listCopyTo(sysUserPagesetListDefault, SysUserPagesetDTO.class);
+        } else {
+            sysUserPagesetDTOList = BeanUtil.listCopyTo(sysUserPagesetList, SysUserPagesetDTO.class);
+        }
+        return sysUserPagesetDTOList;
+    }
+
+    /**
+     * 保存用户对应页面设置
+     *
+     * @param sysUserPagesetSaveVO 保存用户对应页面设置参数
+     * @return 是否成功
+     */
+    public Boolean savePageSet(SysUserPagesetSaveVO sysUserPagesetSaveVO) {
+        if (ListUtil.isEmpty(sysUserPagesetSaveVO.getSysUserPagesetVOList())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "列名输入列表不能为空");
+        }
+        sysUserPagesetService.remove(
+                new QueryWrapper<SysUserPageset>()
+                        .eq("user_id", SysUserUtils.getCurrentPrincipleID())
+                        .eq("page_type", sysUserPagesetSaveVO.getPageType())
+        );
+        List<SysUserPageset> saveList = new ArrayList<>();
+        Date now = DateUtil.now();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        for (SysUserPagesetVO sysUserPagesetVO : sysUserPagesetSaveVO.getSysUserPagesetVOList()) {
+            SysUserPageset sysUserPageset = new SysUserPageset();
+            BeanUtil.copyProperties(sysUserPagesetVO, sysUserPageset);
+            sysUserPageset.setPageType(sysUserPagesetSaveVO.getPageType());
+            sysUserPageset.setUserId(Long.valueOf(userId));
+            sysUserPageset.setCreator(userId);
+            sysUserPageset.setModifier(userId);
+            sysUserPageset.setGmtCreate(now);
+            sysUserPageset.setGmtModified(now);
+            saveList.add(sysUserPageset);
+        }
+        return sysUserPagesetService.saveBatch(saveList);
+    }
+
+}

+ 101 - 0
src/main/java/com/diagbot/facade/data/ABasDeptInfoFacade.java

@@ -0,0 +1,101 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ABasDeptInfoDTO;
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.service.impl.BasDeptInfoServiceImpl;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.ABasDeptInfoVO;
+import com.diagbot.util.BeanUtil;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class ABasDeptInfoFacade extends BasDeptInfoServiceImpl{
+
+    @Autowired
+    @Qualifier("basDeptInfoServiceImpl")
+    private BasDeptInfoServiceImpl basDeptInfoService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 同步前一天科室的信息
+     */
+    public void executeDept() {
+        String sql="select * from hi_deptinfo where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        List<BasDeptInfo> basDeptInfoList = tzDBConn.getDeptInfo(sql);
+        execute(basDeptInfoList);
+    }
+
+    /**
+     * 同步历史数据
+     */
+    public void executeDeptPast(){
+        String sql="select * from hi_deptinfo where cjcxrq>=dateadd(day,-1,getdate()) and cjcxrq<=getdate()";
+        List<BasDeptInfo> basDeptInfoList = tzDBConn.getDeptInfo(sql);
+        execute(basDeptInfoList);
+    }
+
+    /**
+     * 通过接口同步数据
+     * @param list
+     * @return
+     */
+    public RespDTO<List<ABasDeptInfoDTO>> executeDept(List<ABasDeptInfoVO> list) {
+        if(list!=null && list.size()>0){
+            List<BasDeptInfo> basDeptInfoList=Lists.newArrayList();
+            List<ABasDeptInfoDTO> basDeptInfoDtoList=Lists.newArrayList();
+            basDeptInfoList=BeanUtil.listCopyTo(list,BasDeptInfo.class);
+            basDeptInfoDtoList=BeanUtil.listCopyTo(list,ABasDeptInfoDTO.class);
+
+            //循环验证数据有效性
+            for (BasDeptInfo basDeptInfo:basDeptInfoList) {
+                if("".equals(basDeptInfo.getDeptId())) {
+                    return RespDTO.onError("请输入科室编码!");
+                }else if(basDeptInfo.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(basDeptInfo.getDeptName())){
+                    return RespDTO.onError("请输入科室名称!");
+                }
+            }
+            execute(basDeptInfoList);
+            return RespDTO.onSuc(basDeptInfoDtoList);
+        }else {
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<BasDeptInfo> basDeptInfoList){
+        long startTime=System.currentTimeMillis();
+        List<BasDeptInfo> addE=Lists.newArrayList();
+        List<BasDeptInfo> updateE=Lists.newArrayList();
+        basDeptInfoList.stream().forEach(s -> {
+            BasDeptInfo basDeptInfo =this.getOne(new QueryWrapper<BasDeptInfo>()
+            .eq("dept_id", s.getDeptId())
+            .eq("hospital_id", s.getHospitalId()));
+            if (basDeptInfo != null) {
+                s.setGmtModified(new Date());
+                updateE.add(s);
+            } else {
+                s.setGmtCreate(new Date());
+                addE.add(s);
+            }
+        });
+        if(updateE.size()>0){
+            basDeptInfoService.updateBatchByKey(updateE);
+        }
+        if(addE.size()>0){
+            basDeptInfoService.saveBatch(addE);
+        }
+
+        long endTime=System.currentTimeMillis();
+        System.out.println("程序运行时间: "+(endTime - startTime)+"ms");
+    }
+}

+ 96 - 0
src/main/java/com/diagbot/facade/data/ABasDoctorInfoFacade.java

@@ -0,0 +1,96 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ABasDoctorInfoDTO;
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.service.impl.BasDoctorInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.ABasDoctorInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class ABasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
+    @Autowired
+    @Qualifier("basDoctorInfoServiceImpl")
+    private BasDoctorInfoServiceImpl basDoctorInfoService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 同步历史数据
+     */
+    public void executeDoctorPast() {
+        String sql="select * from gi_userinfo";
+        List<BasDoctorInfo> basDeptInfoList = tzDBConn.getBasDoctorInfo(sql);
+        execute(basDeptInfoList);
+
+    }
+    /**
+     * 同步前一天医生信息
+     */
+    public void executeDoctor() {
+        String sql="select * from gi_userinfo";
+        List<BasDoctorInfo> basDeptInfoList = tzDBConn.getBasDoctorInfo(sql);
+        execute(basDeptInfoList);
+    }
+    /**
+     * 从接口接收医生信息
+     * @param list
+     * @return
+     */
+    public RespDTO<List<ABasDoctorInfoDTO>> executeDoctor(List<ABasDoctorInfoVO> list) {
+        if(list!=null && list.size()>0){
+            List<BasDoctorInfo> basDoctorInfoList=Lists.newArrayList();
+            List<ABasDoctorInfoDTO> basDoctorDtoList=Lists.newArrayList();
+            basDoctorInfoList=BeanUtil.listCopyTo(list,BasDoctorInfo.class);
+            basDoctorDtoList=BeanUtil.listCopyTo(list,ABasDoctorInfoDTO.class);
+            //循环验证数据有效性
+            for (BasDoctorInfo basDoctorInfo:basDoctorInfoList) {
+                if("".equals(basDoctorInfo.getDoctorId())) {
+                    return RespDTO.onError("请输入医生编码!");
+                }else if(basDoctorInfo.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }
+            }
+            execute(basDoctorInfoList);
+            return RespDTO.onSuc(basDoctorDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<BasDoctorInfo> basDoctorInfoList){
+        long startTime=System.currentTimeMillis();
+        List<BasDoctorInfo> addE=Lists.newArrayList();
+        List<BasDoctorInfo> updateE=Lists.newArrayList();
+        basDoctorInfoList.stream().forEach(s -> {
+            BasDoctorInfo basDoctorInfo =this.baseMapper.selectOne(new QueryWrapper<BasDoctorInfo>()
+                    .eq("doctor_id", s.getDoctorId())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (basDoctorInfo != null) {
+                s.setGmtModified(new Date());
+                updateE.add(s);
+            } else {
+                s.setGmtCreate(new Date());
+                addE.add(s);
+            }
+        });
+        if(updateE.size()>0){
+            basDoctorInfoService.updateBatchByKey(updateE);
+        }
+        if(addE.size()>0){
+            basDoctorInfoService.saveBatch(addE);
+        }
+
+        long endTime=System.currentTimeMillis();
+        System.out.println("程序运行时间: "+(endTime - startTime)+"ms");
+    }
+}

+ 171 - 0
src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java

@@ -0,0 +1,171 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ABehospitalInfoDTO;
+import com.diagbot.entity.*;
+import com.diagbot.facade.QcAbnormalFacade;
+import com.diagbot.facade.QcTypeFacade;
+import com.diagbot.service.impl.BehospitalInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
+
+    @Autowired
+    @Qualifier("behospitalInfoServiceImpl")
+    private BehospitalInfoServiceImpl behospitalInfoService;
+
+    @Autowired
+    private QcTypeFacade qcTypeFacade;
+
+    @Autowired
+    private AMedicalRecordFacade aMedicalRecordFacade;
+
+    @Autowired
+    private QcAbnormalFacade qcAbnormalFacade;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天的入院记录
+     */
+    public void executeBehospital() {
+        //String sql="select * from br_inpatientinfo where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        String sql="select * from br_inpatientinfo where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
+        List<BehospitalInfo> behospitalInfoList = tzDBConn.getBehospitalInfo(sql);
+        execute(behospitalInfoList);
+    }
+
+    /**
+     * 同步前一天的入院记录
+     */
+    public void executeBehospitalPast() {
+        String sql="select * from br_inpatientinfo where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        List<BehospitalInfo> behospitalInfoList = tzDBConn.getBehospitalInfo(sql);
+        execute(behospitalInfoList);
+    }
+
+
+    /**
+     * 通过接口更新病人住院记录信息
+     * @param list
+     * @return
+     */
+    public RespDTO<List<ABehospitalInfoDTO>> executeBehospital(List<ABehospitalInfoVO> list) {
+        if(list!=null && list.size()>0) {
+            List<BehospitalInfo> behospitalInfoList = Lists.newArrayList();
+            List<ABehospitalInfoDTO> behospitalInfoDtoList = Lists.newArrayList();
+            list.stream().forEach(s->{
+                BehospitalInfo behospitalInfo=new BehospitalInfo();
+                BeanUtil.copyProperties(s,behospitalInfo);
+                if(StringUtil.isNotBlank(s.getBirthday())) {
+                    behospitalInfo.setBirthday(DateUtil.parseDate(s.getBirthday()));
+                }
+                if(StringUtil.isNotBlank(s.getLeaveHospitalDate())) {
+                    behospitalInfo.setLeaveHospitalDate(DateUtil.parseDateTime(s.getLeaveHospitalDate()));
+                }
+                if(StringUtil.isNotBlank(s.getBehospitalDate())){
+                    behospitalInfo.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));
+                }
+                behospitalInfoList.add(behospitalInfo);
+
+            });
+
+            //循环验证数据有效性
+            for (BehospitalInfo behospitalInfo:behospitalInfoList) {
+                if("".equals(behospitalInfo.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                }else if(behospitalInfo.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(behospitalInfo.getBehDeptId())){
+                    return RespDTO.onError("请输入住院科室编码!");
+                }else if("".equals(behospitalInfo.getBehDeptName())){
+                    return RespDTO.onError("请输入住院科室名称!");
+                }
+            }
+            execute(behospitalInfoList);
+            behospitalInfoDtoList = BeanUtil.listCopyTo(list, ABehospitalInfoDTO.class);
+            return RespDTO.onSuc(behospitalInfoDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<BehospitalInfo> behospitalInfoList){
+        List<BehospitalInfo> addE = Lists.newLinkedList();
+        List<BehospitalInfo> updateE = Lists.newLinkedList();
+        behospitalInfoList.stream().forEach(s -> {
+            BehospitalInfo behospitalInfo = this.getOne(new QueryWrapper<BehospitalInfo>()
+            .eq("behospital_code", s.getBehospitalCode())
+            .eq("hospital_id", s.getHospitalId()));
+            if (behospitalInfo != null) {
+                s.setGmtModified(new Date());
+                s.setQcTypeId(initQcTypeId(s));
+                updateE.add(s);
+            } else {
+                s.setGmtCreate(new Date());
+                s.setQcTypeId(initQcTypeId(s));
+                addE.add(s);
+            }
+        });
+        if(addE.size()>0){
+            behospitalInfoService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            behospitalInfoService.updateBatchByKey(updateE);
+        }
+
+    }
+
+    /**
+     * 初始化QcTypeId
+     * @param s
+     * @return
+     */
+    private Long initQcTypeId(BehospitalInfo s){
+        Long qcTypeId=Long.valueOf("0");
+        MedicalRecord medicalRecord = aMedicalRecordFacade.getOne(new QueryWrapper<MedicalRecord>()
+                .eq("behospital_code", s.getBehospitalCode())
+                .eq("hospital_id", s.getHospitalId())
+                .eq("mode_id", Long.valueOf("1")));
+        if(medicalRecord!=null){
+            QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
+                    .eq("name",medicalRecord.getRecTitle())
+                    .eq("hospital_id", s.getHospitalId()));
+            if(qcType!=null){
+                qcTypeId=qcType.getId();
+            }else{
+                //新增类型到qc_type表中
+                QcType qctype=new QcType();
+                qctype.setHospitalId(s.getHospitalId());
+                qctype.setName(medicalRecord.getRecTitle());
+                qctype.setGmtCreate(new Date());
+
+                Long id=qcTypeFacade.saveT(qctype);
+                qcTypeId=id;
+
+                //新增类型到监测表中
+                QcAbnormal qcAbnormal=new QcAbnormal();
+                qcAbnormal.setHospitalId(s.getHospitalId());
+                qcAbnormal.setBehospitalCode(s.getBehospitalCode());
+                qcAbnormal.setType(2);
+                qcAbnormal.setDescription(medicalRecord.getRecTitle());
+                qcAbnormal.setGmtCreate(new Date());
+                qcAbnormalFacade.getBaseMapper().insert(qcAbnormal);
+            }
+        }
+        return qcTypeId;
+    }
+}

+ 109 - 0
src/main/java/com/diagbot/facade/data/ADoctorAdviceFacade.java

@@ -0,0 +1,109 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ADoctorAdviceDTO;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.service.impl.DoctorAdviceServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.ADoctorAdviceVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
+
+    @Autowired
+    @Qualifier("doctorAdviceServiceImpl")
+    private DoctorAdviceServiceImpl doctorAdviceService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天的入院病人医嘱信息
+     */
+    public void executeDoctorAdvice() {
+        //String sql="select * from br_doctadvice where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        String sql="select * from br_doctadvice where BRZYID in (select BRZYID from br_inpatientinfo where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) and requestflag='1')";
+        List<DoctorAdvice> doctorAdviceList = tzDBConn.getDoctorAdvice(sql);
+        execute(doctorAdviceList);
+    }
+
+    public void executeDoctorAdvicePast() {
+        String sql="select * from br_doctadvice where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        List<DoctorAdvice> doctorAdviceList = tzDBConn.getDoctorAdvice(sql);
+        execute(doctorAdviceList);
+    }
+    /**
+     * 数据引擎-通过接口更新医生医嘱信息
+     * @param list
+     * @return
+     */
+    public RespDTO<List<ADoctorAdviceDTO>> executeDoctorAdvice(List<ADoctorAdviceVO> list) {
+        if(list!=null && list.size()>0){
+            //循环验证数据有效性
+            for (ADoctorAdviceVO doctorAdvice:list) {
+                if("".equals(doctorAdvice.getDoctorAdviceId())) {
+                    return RespDTO.onError("请输入病人医嘱编码!");
+                }else if(doctorAdvice.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(doctorAdvice.getBehospitalCode())){
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+            }
+            //初始、格式化数据
+            List<DoctorAdvice> doctorAdviceList=Lists.newArrayList();
+            List<ADoctorAdviceDTO> doctorAdviceDtoList=Lists.newArrayList();
+            list.stream().forEach(s->{
+                DoctorAdvice doctorAdvice=new DoctorAdvice();
+                BeanUtil.copyProperties(s,doctorAdvice);
+                if(StringUtil.isNotBlank(s.getDaStartDate())){
+                    doctorAdvice.setDaStartDate(DateUtil.parseDateTime(s.getDaStartDate()));
+                }
+                if(StringUtil.isNotBlank(s.getDaStopDate())){
+                    doctorAdvice.setDaStopDate(DateUtil.parseDateTime(s.getDaStopDate()));
+                }
+                doctorAdviceList.add(doctorAdvice);
+            });
+            execute(doctorAdviceList);
+            doctorAdviceDtoList=BeanUtil.listCopyTo(list,ADoctorAdviceDTO.class);
+            return RespDTO.onSuc(doctorAdviceDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<DoctorAdvice> doctorAdviceList){
+        List<DoctorAdvice> addE = Lists.newLinkedList();
+        List<DoctorAdvice> updateE = Lists.newLinkedList();
+        if (doctorAdviceList != null && doctorAdviceList.size() > 0) {
+            doctorAdviceList.stream().forEach(s -> {
+                DoctorAdvice doctorAdvice = this.getOne(new QueryWrapper<DoctorAdvice>()
+                        .eq("doctor_advice_id", s.getDoctorAdviceId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()));
+                if (doctorAdvice != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            doctorAdviceService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            doctorAdviceService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 85 - 0
src/main/java/com/diagbot/facade/data/AHomeDiagnoseInfoFacade.java

@@ -0,0 +1,85 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AHomeDiagnoseDTO;
+import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.service.impl.HomeDiagnoseInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.AHomeDiagnoseVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class AHomeDiagnoseInfoFacade extends HomeDiagnoseInfoServiceImpl{
+
+    @Autowired
+    @Qualifier("homeDiagnoseInfoServiceImpl")
+    private HomeDiagnoseInfoServiceImpl homeDiagnoseInfoService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-定时同步病案首页诊断
+     */
+    public void executeHomeDiagnose() {
+        //String sql="select * from br_recdiagnose where BASYID in (select BASYID from br_rechome where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate())";//今年的数据
+        //前一天的数据
+        String sql="select * from br_recdiagnose where BASYID in (select BASYID from br_rechome where cjcxrq>=(select CONVERT(varchar,GETDATE()-1,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)))";
+        List<HomeDiagnoseInfo> homeDiagnoseList = tzDBConn.getHomeDiagnose(sql);
+        execute(homeDiagnoseList);
+    }
+
+    /**
+     * 数据引擎-通过接口更新病案首页诊断
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AHomeDiagnoseDTO>> executeHomeDiagnose(List<AHomeDiagnoseVO> list) {
+        if(list!=null && list.size()>0){
+            List<HomeDiagnoseInfo> homeDiagnoseList=Lists.newArrayList();
+            List<AHomeDiagnoseDTO> homeDiagnoseDtoList=Lists.newArrayList();
+
+            homeDiagnoseList=BeanUtil.listCopyTo(list,HomeDiagnoseInfo.class);
+            homeDiagnoseDtoList=BeanUtil.listCopyTo(list,AHomeDiagnoseDTO.class);
+            execute(homeDiagnoseList);
+            return RespDTO.onSuc(homeDiagnoseDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<HomeDiagnoseInfo> homeDiagnoseList){
+        List<HomeDiagnoseInfo> addE = Lists.newLinkedList();
+        List<HomeDiagnoseInfo> updateE = Lists.newLinkedList();
+        if (homeDiagnoseList != null && homeDiagnoseList.size() > 0) {
+            homeDiagnoseList.stream().forEach(s -> {
+                if(s.getHomePageId()!=null && !"".equals(s.getDiagnoseOrderNo())){
+                    HomeDiagnoseInfo diagnoseInfo = this.getOne(new QueryWrapper<HomeDiagnoseInfo>()
+                            .eq("home_page_id", s.getHomePageId())
+                            .eq("hospital_id", s.getHospitalId())
+                            .eq("diagnose_order_no", s.getDiagnoseOrderNo()));
+                    if (diagnoseInfo != null) {
+                        s.setGmtModified(new Date());
+                        updateE.add(s);
+                    } else {
+                        s.setGmtCreate(new Date());
+                        addE.add(s);
+                    }
+                }
+            });
+        }
+        if(addE.size()>0){
+            homeDiagnoseInfoService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            homeDiagnoseInfoService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 88 - 0
src/main/java/com/diagbot/facade/data/AHomeOperationInfoFacade.java

@@ -0,0 +1,88 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.data.AHomeOperationDTO;
+import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.service.impl.HomeOperationInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.AHomeOperationVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class AHomeOperationInfoFacade extends HomeOperationInfoServiceImpl{
+
+    @Autowired
+    @Qualifier("homeOperationInfoServiceImpl")
+    private HomeOperationInfoServiceImpl homeOperationInfoService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天数据
+     */
+    public void executeHomeOperation() {
+        //String sql="select * from br_recoperation where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        //前一天数据
+        String sql="select * from br_recoperation where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23))";
+        List<HomeOperationInfo> homeOperationList = tzDBConn.getHomeOperation(sql);
+        execute(homeOperationList);
+    }
+
+    /**
+     * 终末质控-通过接口更新病案首页手术
+     * @param list
+     * @return
+     */
+    public List<AHomeOperationDTO> executeHomeOperation(List<AHomeOperationVO> list) {
+        List<HomeOperationInfo> homeOperationList=Lists.newArrayList();
+        List<AHomeOperationDTO> homeOperationDtoList=Lists.newArrayList();
+        if(list!=null && list.size()>0){
+            list.stream().forEach(s->{
+                HomeOperationInfo homeOperationInfo=new HomeOperationInfo();
+                BeanUtil.copyProperties(s,homeOperationInfo);
+                homeOperationInfo.setOperationDate(DateUtil.parseDateTime(s.getOperationDate()));
+                homeOperationList.add(homeOperationInfo);
+            });
+            homeOperationDtoList=BeanUtil.listCopyTo(list,AHomeOperationDTO.class);
+            execute(homeOperationList);
+        }
+        return homeOperationDtoList;
+    }
+
+    public void execute(List<HomeOperationInfo> homeOperationList){
+        List<HomeOperationInfo> addE = Lists.newLinkedList();
+        List<HomeOperationInfo> updateE = Lists.newLinkedList();
+        if (homeOperationList != null && homeOperationList.size() > 0) {
+            homeOperationList.stream().forEach(s -> {
+                if(s.getHomePageId()!=null && !"".equals(s.getOperationOrderNo())) {
+                    QueryWrapper<HomeOperationInfo> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("home_page_id", s.getHomePageId());
+                    queryWrapper.eq("hospital_id", s.getHospitalId());
+                    queryWrapper.eq("operation_order_no", s.getOperationOrderNo());
+                    HomeOperationInfo operationInfo = this.getOne(queryWrapper);
+                    if (operationInfo != null) {
+                        s.setGmtModified(new Date());
+                        updateE.add(s);
+                    } else {
+                        s.setGmtCreate(new Date());
+                        addE.add(s);
+                    }
+                }
+            });
+        }
+        if(addE.size()>0){
+            homeOperationInfoService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            homeOperationInfoService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 265 - 0
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -0,0 +1,265 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.AnalyzeRunDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AHomePageDTO;
+import com.diagbot.entity.HomePage;
+import com.diagbot.facade.BehospitalInfoFacade;
+import com.diagbot.service.impl.HomePageServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ReadProperties;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.AnalyzeRunVO;
+import com.diagbot.vo.data.AHomeDiagnoseVO;
+import com.diagbot.vo.data.AHomeOperationVO;
+import com.diagbot.vo.data.AHomePageIngVO;
+import com.diagbot.vo.data.AHomePageVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class AHomePageFacade extends HomePageServiceImpl{
+
+    @Autowired
+    @Qualifier("homePageServiceImpl")
+    private HomePageServiceImpl homePageService;
+
+    @Autowired
+    private AHomeDiagnoseInfoFacade aHomeDiagnoseInfoFacade;
+
+    @Autowired
+    private AHomeOperationInfoFacade aHomeOperationInfoFacade;
+
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    @Autowired
+    private ReadProperties readProperties;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /*public static void main(String[] args){
+        int mod=Math.floorMod(5012,500);
+        int div=Math.floorDiv(5012,500);
+        if(mod!=0){
+            div+=1;
+        }
+        System.out.println(mod+"---"+div);
+        for (int i = 0; i < div; i++) {
+            System.out.println((i*500)+"---"+(i+1)*500);
+        }
+    }*/
+
+    /**
+     * 同步前一天病案首页
+     */
+    public void executeHomePage() {
+        //String sql="select * from br_rechome where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        //同步前一天的数据
+        String sql="select * from br_rechome where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23))";
+        List<HomePage> homePageList = tzDBConn.getHomePage(sql);
+        /*
+        int mod=Math.floorMod(homePageList.size(),500);
+        int div=Math.floorDiv(homePageList.size(),500);
+        for (int i = 0; i <= homePageList.size(); i++) {
+            System.out.println((i-1)*500+"---"+(i*500));
+            homePageList=homePageList.subList((i*500),(i+1)*500);
+            execute(homePageList);
+        }
+        */
+        execute(homePageList);
+    }
+
+    /**
+     * 运行质控-验证数据有效性
+     * @param aHomePageIngVO
+     * @return
+     */
+    public RespDTO<Map<String, Object>> executeHomePageIng(AHomePageIngVO aHomePageIngVO){
+        if(aHomePageIngVO.getHomePages()!=null && aHomePageIngVO.getHomePages().size()>0){
+            //验证数据有效性
+            for (AHomePageVO aHomePageVO:aHomePageIngVO.getHomePages()) {
+                if("".equals(aHomePageVO.getHomePageId())) {
+                    return RespDTO.onError("请输入病案首页编号!");
+                }else if(aHomePageVO.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(aHomePageVO.getBehospitalCode())){
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+                //出院诊断
+                if(aHomePageVO.getLeaveDiags()!=null && aHomePageVO.getLeaveDiags().size()>0){
+                    for (AHomeDiagnoseVO aHomeDiagnoseVO:aHomePageVO.getLeaveDiags()){
+                        if("".equals(aHomeDiagnoseVO.getHomePageId())) {
+                            return RespDTO.onError("出院诊断未输入病案首页编号!");
+                        }else if(aHomeDiagnoseVO.getHospitalId()==null){
+                            return RespDTO.onError("出院诊断未输入医院编码!");
+                        }else if("".equals(aHomeDiagnoseVO.getDiagnoseOrderNo())){
+                            return RespDTO.onError("出院诊断未输入顺序号!");
+                        }
+                    }
+                };
+
+                //住院手术
+                if(aHomePageVO.getOperations()!=null && aHomePageVO.getOperations().size()>0){
+                    for (AHomeOperationVO aHomeOperationVO:aHomePageVO.getOperations()){
+                        if("".equals(aHomeOperationVO.getHomePageId())) {
+                            return RespDTO.onError("住院手术未输入病案首页编号!");
+                        }else if(aHomeOperationVO.getHospitalId()==null){
+                            return RespDTO.onError("住院手术未输入医院编码!");
+                        }else if("".equals(aHomeOperationVO.getOperationOrderNo())){
+                            return RespDTO.onError("住院手术未输入顺序号!");
+                        }
+                    }
+                }
+            }
+
+            //装载数据
+            updateHomePageIng(aHomePageIngVO);
+            //评分后返回结构体
+            return homePageIng(aHomePageIngVO);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    /**
+     * 更新数据到数据库
+     * @param aHomePageIngVO
+     */
+    private void updateHomePageIng(AHomePageIngVO aHomePageIngVO){
+        List<HomePage> homePageList=Lists.newArrayList();
+        aHomePageIngVO.getHomePages().stream().forEach(s->{
+            //初始化入参
+            HomePage homePage=new HomePage();
+            BeanUtil.copyProperties(s,homePage);
+            homePage.setBirthday(DateUtil.parseDate(s.getBirthday()));
+            homePageList.add(homePage);
+
+            //初始化诊断和手术,并同步到数据库
+            aHomeDiagnoseInfoFacade.executeHomeDiagnose(s.getLeaveDiags());//首页诊断
+            aHomeOperationInfoFacade.executeHomeOperation(s.getOperations());//首页手术
+        });
+        execute(homePageList);
+    }
+
+    /**
+     * 评分后返回结构体
+     * @param aHomePageIngVO
+     * @return
+     */
+    private RespDTO<Map<String, Object>> homePageIng(AHomePageIngVO aHomePageIngVO){
+        String behospitalCode =aHomePageIngVO.getHomePages().get(0).getBehospitalCode();
+        Long hospitalId=aHomePageIngVO.getHomePages().get(0).getHospitalId();
+        Long modeId=Long.valueOf("6");//病案首页默认为6
+        if(aHomePageIngVO.getDockModeType().equals("1")){
+            //页面模式
+            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+            Map<String,Object> map=new HashMap<String,Object>();
+            map.put("url",url);
+            return RespDTO.onSuc(map);
+        }else if(aHomePageIngVO.getDockModeType().equals("2")){
+            AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            analyzeRunVO.setBehospitalCode(behospitalCode);
+            analyzeRunVO.setHospitalId(hospitalId);
+            analyzeRunVO.setModeId(modeId);
+            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            Map<String,Object> map=new HashMap<String,Object>();
+            if(analyzeRunDTO.getMsgDTOList().size()>0){
+                map.put("analyze",analyzeRunDTO.getMsgDTOList());
+            }
+            return RespDTO.onSuc(map);
+        }else{
+            //页面模式+接口引擎模式
+            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+
+            AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            analyzeRunVO.setBehospitalCode(behospitalCode);
+            analyzeRunVO.setHospitalId(hospitalId);
+            analyzeRunVO.setModeId(modeId);
+            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            Map<String,Object> map=new HashMap<String,Object>();
+            if(analyzeRunDTO.getMsgDTOList().size()>0){
+                map.put("url",url);
+                map.put("analyze",analyzeRunDTO.getMsgDTOList());
+            }
+            return RespDTO.onSuc(map);
+        }
+    }
+
+
+    /**
+     * 终末质控-通过接口更新病案首页
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AHomePageDTO>> executeHomePage(List<AHomePageVO> list) {
+        if(list!=null && list.size()>0){
+            //循环验证数据有效性
+            for (AHomePageVO aHomePageVO:list) {
+                if("".equals(aHomePageVO.getHomePageId())) {
+                    return RespDTO.onError("请输入病案首页编号!");
+                }else if(aHomePageVO.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(aHomePageVO.getBehospitalCode())){
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+            }
+            //装载数据
+            List<HomePage> homePageList=Lists.newArrayList();
+            list.stream().forEach(s->{
+                //初始化入参
+                HomePage homePage=new HomePage();
+                BeanUtil.copyProperties(s,homePage);
+                homePage.setBirthday(DateUtil.parseDate(s.getBirthday()));
+                homePage.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));
+                homePage.setLeaveHospitalDate(DateUtil.parseDateTime(s.getLeaveHospitalDate()));
+                homePage.setQcDate(DateUtil.parseDateTime(s.getQcDate()));
+                homePageList.add(homePage);
+            });
+            execute(homePageList);
+            List<AHomePageDTO> homePageDtoList=BeanUtil.listCopyTo(list,AHomePageDTO.class);
+            return RespDTO.onSuc(homePageDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    /**
+     * 病案首页
+     * @param homePageList
+     */
+    public void execute(List<HomePage> homePageList){
+        List<HomePage> addE = Lists.newLinkedList();
+        List<HomePage> updateE = Lists.newLinkedList();
+        if (homePageList != null && homePageList.size() > 0) {
+            homePageList.stream().forEach(s -> {
+                HomePage homePage = this.getOne(new QueryWrapper<HomePage>()
+                        .eq("home_page_id", s.getHomePageId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code", s.getBehospitalCode()));
+                if (homePage != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            homePageService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            homePageService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 84 - 0
src/main/java/com/diagbot/facade/data/AMedCrisisFacade.java

@@ -0,0 +1,84 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AMedCrisisDTO;
+import com.diagbot.entity.MedCrisisInfo;
+import com.diagbot.service.impl.MedCrisisInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.vo.data.AMedCrisisVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class AMedCrisisFacade extends MedCrisisInfoServiceImpl{
+
+    @Autowired
+    @Qualifier("medCrisisInfoServiceImpl")
+    private MedCrisisInfoServiceImpl medCrisisInfoService;
+
+    public RespDTO<List<AMedCrisisDTO>> executeMedCrisis(List<AMedCrisisVO> list) {
+        if(list!=null && list.size()>0){
+            //循环验证数据有效性
+            for (AMedCrisisVO aMedCrisisVO:list) {
+                if("".equals(aMedCrisisVO.getRecId())){
+                    return RespDTO.onError("请输入文书编码!");
+                }else if("".equals(aMedCrisisVO.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                }else if(aMedCrisisVO.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(aMedCrisisVO.getRecType())){
+                    return RespDTO.onError("请输入危急值类型!");
+                }
+            }
+
+            List<MedCrisisInfo> medCrisisList=Lists.newArrayList();
+            list.stream().forEach(s->{
+                MedCrisisInfo medCrisisInfo=new MedCrisisInfo();
+                BeanUtil.copyProperties(s,medCrisisInfo);
+                medCrisisInfo.setRepDate(DateUtil.parseDateTime(s.getRepDate()));
+                medCrisisInfo.setSendDate(DateUtil.parseDateTime(s.getSendDate()));
+                medCrisisList.add(medCrisisInfo);
+            });
+            execute(medCrisisList);
+
+            List<AMedCrisisDTO> medCrisisDtoList=BeanUtil.listCopyTo(list,AMedCrisisDTO.class);
+            return RespDTO.onSuc(medCrisisDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<MedCrisisInfo> medCrisisList){
+        List<MedCrisisInfo> addE = Lists.newLinkedList();
+        List<MedCrisisInfo> updateE = Lists.newLinkedList();
+        if (medCrisisList != null && medCrisisList.size() > 0) {
+            medCrisisList.stream().forEach(s -> {
+                MedCrisisInfo medCrisisInfo = this.getOne(new QueryWrapper<MedCrisisInfo>()
+                .eq("rec_id", s.getRecId())
+                .eq("hospital_id", s.getHospitalId())
+                .eq("behospital_code", s.getBehospitalCode())
+                .eq("rec_type", s.getRecType()));
+                if (medCrisisInfo != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            medCrisisInfoService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            medCrisisInfoService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 89 - 0
src/main/java/com/diagbot/facade/data/AMedRecordTypeFacade.java

@@ -0,0 +1,89 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AMedicalRecordTypeDTO;
+import com.diagbot.entity.MedRecordType;
+import com.diagbot.service.impl.MedRecordTypeServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.AMedicalRecordTypeVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class AMedRecordTypeFacade extends MedRecordTypeServiceImpl {
+
+    @Autowired
+    @Qualifier("medRecordTypeServiceImpl")
+    private MedRecordTypeServiceImpl medRecordTypeService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天变更的模板类型
+     */
+    public void executeMRType() {
+        //String sql="select * from ar_medirecclass where SFZFPB='1'";
+        String sql="select * from ar_medirecclass where SFZFPB='1' and cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23))";
+        List<MedRecordType> medRecordTypeList = tzDBConn.getMedicalRecordType(sql);
+        execute(medRecordTypeList);
+    }
+    /**
+     * 数据引擎-通过接口更新病人住院记录信息
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AMedicalRecordTypeDTO>> executeMRType(List<AMedicalRecordTypeVO> list) {
+        if(list!=null && list.size()>0){
+            //循环验证数据有效性
+            for (AMedicalRecordTypeVO medRecordType:list) {
+                if("".equals(medRecordType.getTypeId())) {
+                    return RespDTO.onError("请输入文书类型编码!");
+                }else if(medRecordType.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(medRecordType.getTypeName())){
+                    return RespDTO.onError("请文书类型名称!");
+                }
+            }
+            List<MedRecordType> medRecordTypeList=Lists.newArrayList();
+            List<AMedicalRecordTypeDTO> medRecordTypeDtoList=Lists.newArrayList();
+            medRecordTypeList=BeanUtil.listCopyTo(list,MedRecordType.class);
+            medRecordTypeDtoList=BeanUtil.listCopyTo(list,AMedicalRecordTypeDTO.class);
+            execute(medRecordTypeList);
+            return RespDTO.onSuc(medRecordTypeDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<MedRecordType> medRecordTypeList){
+        List<MedRecordType> addE = Lists.newLinkedList();
+        List<MedRecordType> updateE = Lists.newLinkedList();
+        if (medRecordTypeList != null && medRecordTypeList.size() != 0) {
+            medRecordTypeList.stream().forEach(s -> {
+                MedRecordType mrType = this.getOne(new QueryWrapper<MedRecordType>()
+                        .eq("type_id", s.getTypeId())
+                        .eq("hospital_id", s.getHospitalId()));
+                if (mrType != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            medRecordTypeService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            medRecordTypeService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 78 - 0
src/main/java/com/diagbot/facade/data/AMedicalRecordContentFacade.java

@@ -0,0 +1,78 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AMedicalRecordContentDTO;
+import com.diagbot.entity.MedicalRecordContent;
+import com.diagbot.service.impl.MedicalRecordContentServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.AMedicalRecordContentVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+
+@Component
+public class AMedicalRecordContentFacade extends MedicalRecordContentServiceImpl{
+
+    @Qualifier("medicalRecordContentServiceImpl")
+    @Autowired
+    private MedicalRecordContentServiceImpl medicalRecordContentService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天的病历详细记录
+     */
+    public void executeMrRecordContent() {
+        //String sql="select * from mr_mrcontent  where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        String sql="select BLJLID,BLJLNR from mr_mrcontent  where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
+        List<MedicalRecordContent> mrContentList = tzDBConn.getMedicalRecordContent(sql);
+        execute(mrContentList);
+    }
+
+    /**
+     * 数据引擎-通过接口更新病历内容
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AMedicalRecordContentDTO>> executeMrRecordContent(List<AMedicalRecordContentVO> list) {
+        if(list!=null && list.size()>0) {
+            List<MedicalRecordContent> mrContentList=BeanUtil.listCopyTo(list,MedicalRecordContent.class);
+            List<AMedicalRecordContentDTO> mrContentDtoList=BeanUtil.listCopyTo(list,AMedicalRecordContentDTO.class);
+            execute(mrContentList);
+            return RespDTO.onSuc(mrContentDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<MedicalRecordContent> mrContentList){
+        List<MedicalRecordContent> addE = Lists.newLinkedList();
+        List<MedicalRecordContent> updateE = Lists.newLinkedList();
+        if (mrContentList != null && mrContentList.size() > 0) {
+            mrContentList.stream().forEach(s -> {
+                QueryWrapper<MedicalRecordContent> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("rec_id", s.getRecId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                MedicalRecordContent mrContent = this.getOne(queryWrapper);
+                if (mrContent != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            medicalRecordContentService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            medicalRecordContentService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 299 - 0
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -0,0 +1,299 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.AnalyzeRunDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AMedicalRecordDTO;
+import com.diagbot.dto.data.AMrContentDTO;
+import com.diagbot.entity.*;
+import com.diagbot.facade.BehospitalInfoFacade;
+import com.diagbot.facade.ModelHospitalFacade;
+import com.diagbot.facade.QcTypeFacade;
+import com.diagbot.service.impl.MedicalRecordServiceImpl;
+import com.diagbot.service.impl.QcAbnormalServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ReadProperties;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.AnalyzeRunVO;
+import com.diagbot.vo.data.AMedicalRecordVO;
+import com.diagbot.vo.data.AMrContentVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
+
+    @Autowired
+    @Qualifier("medicalRecordServiceImpl")
+    private MedicalRecordServiceImpl medicalRecordService;
+
+    @Autowired
+    private ModelHospitalFacade modelHospitalFacade;
+
+    @Autowired
+    private AMedicalRecordContentFacade aMedicalRecordContentFacade;
+
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    @Autowired
+    @Qualifier("qcAbnormalServiceImpl")
+    private QcAbnormalServiceImpl qcAbnormalService;
+
+    @Autowired
+    private QcTypeFacade qcTypeFacade;
+
+    @Autowired
+    private ReadProperties readProperties;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天的病历记录
+     */
+    public void executeMrRecord() {
+        //String sql="select * from mr_medicalrecords  where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        String sql="select * from mr_medicalrecords  where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
+        List<MedicalRecord> medicalRecordList = tzDBConn.getMedicalRecord(sql);
+        execute(medicalRecordList);
+    }
+
+    /**
+     * 终末质控-通过接口更新病历记录
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AMedicalRecordDTO>> executeMrRecord(List<AMedicalRecordVO> list) {
+        if(list!=null && list.size()>0) {
+            //循环验证数据有效性
+            for (AMedicalRecordVO aMedicalRecordVO : list) {
+                if ("".equals(aMedicalRecordVO.getRecId())) {
+                    return RespDTO.onError("请输入文书序号!");
+                } else if (aMedicalRecordVO.getHospitalId() == null) {
+                    return RespDTO.onError("请输入医院编码!");
+                } else if ("".equals(aMedicalRecordVO.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+            }
+
+            //装载数据
+            List<MedicalRecord> medicalRecordList = Lists.newArrayList();
+            list.stream().forEach(s->{
+                MedicalRecord medicalRecord=new MedicalRecord();
+                BeanUtil.copyProperties(s,medicalRecord);
+                medicalRecord.setRecDate(DateUtil.parseDateTime(s.getRecDate()));
+                medicalRecordList.add(medicalRecord);
+            });
+            execute(medicalRecordList);
+
+            List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(list, AMedicalRecordDTO.class);
+            return RespDTO.onSuc(medicalRecordDTOList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    /**
+     * 运行质控-通过接口更新病历记录
+     * @param aMrContentVO
+     * @return
+     */
+    public RespDTO<Map<String, Object>> executeMrRecordIng(AMrContentVO aMrContentVO) {
+        if(aMrContentVO.getRecords()!=null && aMrContentVO.getRecords().size()>0){
+            AMrContentDTO aMrContentDTO=new AMrContentDTO();
+            //循环验证数据有效性
+            for (AMedicalRecordVO aMedicalRecordVO : aMrContentVO.getRecords()) {
+                if ("".equals(aMedicalRecordVO.getRecId())) {
+                    return RespDTO.onError("请输入文书序号!");
+                } else if (aMedicalRecordVO.getHospitalId() == null) {
+                    return RespDTO.onError("请输入医院编码!");
+                } else if ("".equals(aMedicalRecordVO.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                } else if ("".equals(aMedicalRecordVO.getRecTypeId())) {
+                    return RespDTO.onError("请输入病历类别编号!");
+                } else if ("".equals(aMedicalRecordVO.getRecTitle())) {
+                    return RespDTO.onError("请输入病历标题!");
+                } else if (aMedicalRecordVO.getContents() == null || aMedicalRecordVO.getContents().size() == 0) {
+                    return RespDTO.onError("请输入文书详情!");
+                }
+            }
+            //更新文书信息
+            executeMrRecord(aMrContentVO.getRecords());
+
+            aMrContentVO.getRecords().stream().forEach(s -> {
+                //更新文书详情
+                aMedicalRecordContentFacade.executeMrRecordContent(s.getContents());
+            });
+
+            //评分后返回结构体
+            return mrIng(aMrContentVO);
+
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    /**
+     * 评分后返回结构体
+     * @param aMrContentVO
+     * @return
+     */
+    private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO){
+        String behospitalCode =aMrContentVO.getRecords().get(0).getBehospitalCode();
+        Long hospitalId=aMrContentVO.getRecords().get(0).getHospitalId();
+        MedicalRecord medicalRecord=new MedicalRecord();
+        BeanUtil.copyProperties(aMrContentVO.getRecords().get(0),medicalRecord);
+        Long modeId=initModeId(medicalRecord);
+        if(aMrContentVO.getDockModeType().equals("1")){
+            if(modeId==0 || modeId==null){
+                return RespDTO.onError("无对应的文书类型");
+            }
+            //页面模式
+            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+            Map<String,Object> map=new HashMap<String,Object>();
+            map.put("url",url);
+            return RespDTO.onSuc(map);
+        }else if(aMrContentVO.getDockModeType().equals("2")){
+            AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            analyzeRunVO.setBehospitalCode(behospitalCode);
+            analyzeRunVO.setHospitalId(hospitalId);
+            analyzeRunVO.setModeId(modeId);
+            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            Map<String,Object> map=new HashMap<String,Object>();
+            if(analyzeRunDTO.getMsgDTOList().size()>0){
+                map.put("analyze",analyzeRunDTO.getMsgDTOList());
+            }
+            //接口引擎模式
+            return RespDTO.onSuc(map);
+        }else{
+            if(modeId==0 || modeId==null){
+                return RespDTO.onError("无对应的文书类型");
+            }
+            //页面模式
+            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+
+            AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            analyzeRunVO.setBehospitalCode(behospitalCode);
+            analyzeRunVO.setHospitalId(hospitalId);
+            analyzeRunVO.setModeId(modeId);
+            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            Map<String,Object> map=new HashMap<String,Object>();
+            if(analyzeRunDTO.getMsgDTOList().size()>0){
+                map.put("url",url);
+                map.put("analyze",analyzeRunDTO.getMsgDTOList());
+            }
+            return RespDTO.onSuc(map);
+        }
+    }
+
+    public void execute(List<MedicalRecord> medicalRecordList){
+        List<MedicalRecord> addE = Lists.newLinkedList();
+        List<MedicalRecord> updateE = Lists.newLinkedList();
+        List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
+        List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
+        if (medicalRecordList != null && medicalRecordList.size() > 0) {
+            medicalRecordList.stream().forEach(s -> {
+                //初始化mode_id
+                Long modeId=initModeId(s);
+                if(modeId==Long.valueOf("0")){
+                    //新增类型到监测表中
+                    QcAbnormal qcAbnormal=new QcAbnormal();
+                    qcAbnormal.setHospitalId(s.getHospitalId());
+                    qcAbnormal.setBehospitalCode(s.getBehospitalCode());
+                    qcAbnormal.setType(1);
+                    qcAbnormal.setDescription(s.getRecTitle());
+                    qcAbnormal.setGmtCreate(new Date());
+                    qcAbnormalList.add(qcAbnormal);
+                }else if(modeId==Long.valueOf("1")){
+
+                    BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
+                            .eq("behospital_code", s.getBehospitalCode())
+                            .eq("hospital_id", s.getHospitalId()));
+                    if(behospitalInfo!=null){
+                        //如果病人住院信息存在,更新对应的qc_type_id
+                        Long qcTypeId=Long.valueOf("0");
+                        QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
+                                .eq("name",s.getRecTitle())
+                                .eq("hospital_id", s.getHospitalId()));
+                        if(qcType!=null){
+                            behospitalInfo.setQcTypeId(qcType.getId());
+                        }else{
+                            //新增类型到qc_type表中
+                            QcType qctype=new QcType();
+                            qctype.setHospitalId(s.getHospitalId());
+                            qctype.setName(s.getRecTitle());
+                            qctype.setGmtCreate(new Date());
+
+                            Long id=qcTypeFacade.saveT(qctype);
+                            behospitalInfo.setQcTypeId(id);
+
+                            //新增类型到监测表中
+                            QcAbnormal qcAbnormal=new QcAbnormal();
+                            qcAbnormal.setHospitalId(s.getHospitalId());
+                            qcAbnormal.setBehospitalCode(s.getBehospitalCode());
+                            qcAbnormal.setType(2);
+                            qcAbnormal.setDescription(s.getRecTitle());
+                            qcAbnormal.setGmtCreate(new Date());
+                            qcAbnormalService.getBaseMapper().insert(qcAbnormal);
+                        }
+                        behospitalInfoList.add(behospitalInfo);
+                    }
+                }
+                s.setModeId(modeId);
+                //新增或修改
+                MedicalRecord mRecord = this.getOne(new QueryWrapper<MedicalRecord>()
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code", s.getBehospitalCode()));
+                if (mRecord != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            medicalRecordService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            medicalRecordService.updateBatchByKey(updateE);
+        }
+        if(qcAbnormalList.size()>0){
+            qcAbnormalService.saveBatch(qcAbnormalList);
+        }
+        if(behospitalInfoList.size()>0){
+            behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
+        }
+    }
+
+
+    /**
+     * 初始化模型ID
+     * @param medicalRecord
+     * @return
+     */
+    private Long initModeId(MedicalRecord medicalRecord){
+        Long modeId=Long.valueOf("0");
+        QueryWrapper<ModelHospital> wrapper = new QueryWrapper<>();
+        wrapper.eq("hospital_id",medicalRecord.getHospitalId());
+        wrapper.eq("hospital_model_name",medicalRecord.getRecTitle());
+        ModelHospital mode=modelHospitalFacade.getOne(wrapper);
+        if(mode!=null){
+            modeId=mode.getStandModelId();
+        }else{
+            modeId=Long.valueOf("0");
+        }
+        return modeId;
+    }
+
+}

+ 2 - 0
src/main/java/com/diagbot/mapper/BasDeptInfoMapper.java

@@ -29,4 +29,6 @@ public interface BasDeptInfoMapper extends BaseMapper<BasDeptInfo> {
      * @return
      */
     List<DeptBaseDTO> getDeptByUser(FilterVO filterVO);
+
+    void updateBatchByKey(List<BasDeptInfo> list);
 }

+ 20 - 0
src/main/java/com/diagbot/mapper/BasDoctorInfoMapper.java

@@ -0,0 +1,20 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public interface BasDoctorInfoMapper extends BaseMapper<BasDoctorInfo> {
+
+    public void updateBatchByKey(List<BasDoctorInfo> list);
+
+}

+ 6 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -226,4 +226,10 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public IPage<QcResultShortDTO> qcResultShortByDeptPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    /**
+     * 根据两个主键-批量修改
+     * @param list
+     */
+    public void updateBatchByKey(List<BehospitalInfo> list);
 }

+ 3 - 1
src/main/java/com/diagbot/mapper/DoctorAdviceMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.DoctorAdvice;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  * 病人医嘱 Mapper 接口
@@ -12,5 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @since 2020-04-13
  */
 public interface DoctorAdviceMapper extends BaseMapper<DoctorAdvice> {
-
+    public void updateBatchByKey(List<DoctorAdvice> list);
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/HomeDiagnoseInfoMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.HomeDiagnoseInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface HomeDiagnoseInfoMapper extends BaseMapper<HomeDiagnoseInfo> {
 
+    public void updateBatchByKey(List<HomeDiagnoseInfo> list);
+
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/HomeOperationInfoMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.HomeOperationInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface HomeOperationInfoMapper extends BaseMapper<HomeOperationInfo> {
 
+    public void updateBatchByKey(List<HomeOperationInfo> list);
+
 }

+ 7 - 0
src/main/java/com/diagbot/mapper/HomePageMapper.java

@@ -52,4 +52,11 @@ public interface HomePageMapper extends BaseMapper<HomePage> {
      * @return
      */
     public IPage<AverageStatisticsDTO> getAverageFeePage(@Param("filterPageByAverageVO") FilterPageByAverageVO filterPageByAverageVO);
+
+    /**
+     * 根据病案首页编码、医院编码、病人住院ID-批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<HomePage> list);
+
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/MedCrisisInfoMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.MedCrisisInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  * 危急值信息 Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MedCrisisInfoMapper extends BaseMapper<MedCrisisInfo> {
 
+    public void updateBatchByKey(List<MedCrisisInfo> list);
+
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/MedRecordTypeMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.MedRecordType;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MedRecordTypeMapper extends BaseMapper<MedRecordType> {
 
+    public void updateBatchByKey(List<MedRecordType> list);
+
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/MedicalRecordContentMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.MedicalRecordContent;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MedicalRecordContentMapper extends BaseMapper<MedicalRecordContent> {
 
+    public void updateBatchByKey(List<MedicalRecordContent> list);
+
 }

+ 2 - 0
src/main/java/com/diagbot/mapper/MedicalRecordMapper.java

@@ -18,4 +18,6 @@ import java.util.List;
 public interface MedicalRecordMapper extends BaseMapper<MedicalRecord> {
 
     public List<RecordContentDTO> getRecordContent(RecordContentVO recordContentVO);
+
+    public void updateBatchByKey(List<MedicalRecord> list);
 }

+ 16 - 0
src/main/java/com/diagbot/mapper/SysUserPagesetMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.SysUserPageset;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 用户页面设定表 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-06-12
+ */
+public interface SysUserPagesetMapper extends BaseMapper<SysUserPageset> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public interface BasDoctorInfoService extends IService<BasDoctorInfo> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.SysUserPageset;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 用户页面设定表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-06-12
+ */
+public interface SysUserPagesetService extends IService<SysUserPageset> {
+
+}

+ 9 - 0
src/main/java/com/diagbot/service/impl/BasDeptInfoServiceImpl.java

@@ -43,4 +43,13 @@ public class BasDeptInfoServiceImpl extends ServiceImpl<BasDeptInfoMapper, BasDe
     public List<DeptBaseDTO> getDeptByUser(FilterVO filterVO) {
         return baseMapper.getDeptByUser(filterVO);
     }
+
+
+    /**
+     * 根据科室编码,医院编码,批量修改
+     * @param list
+     */
+    public void updateBatchByKey(List<BasDeptInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 29 - 0
src/main/java/com/diagbot/service/impl/BasDoctorInfoServiceImpl.java

@@ -0,0 +1,29 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.mapper.BasDoctorInfoMapper;
+import com.diagbot.service.BasDoctorInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+@Service
+public class BasDoctorInfoServiceImpl extends ServiceImpl<BasDoctorInfoMapper, BasDoctorInfo> implements BasDoctorInfoService {
+    /**
+     * 根据医生编码和医院编码,批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<BasDoctorInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
+
+}

+ 1 - 0
src/main/java/com/diagbot/service/impl/BasHospitalInfoServiceImpl.java

@@ -17,4 +17,5 @@ import org.springframework.stereotype.Service;
 @Service
 public class BasHospitalInfoServiceImpl extends ServiceImpl<BasHospitalInfoMapper, BasHospitalInfo> implements BasHospitalInfoService {
 
+
 }

+ 8 - 0
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -303,4 +303,12 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<QcResultShortDTO> qcResultShortByDeptPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.qcResultShortByDeptPage(qcResultShortPageVO);
     }
+
+    /**
+     * 根据编码、医院编码批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<BehospitalInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 9 - 1
src/main/java/com/diagbot/service/impl/DoctorAdviceServiceImpl.java

@@ -6,6 +6,8 @@ import com.diagbot.service.DoctorAdviceService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 病人医嘱 服务实现类
@@ -16,5 +18,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class DoctorAdviceServiceImpl extends ServiceImpl<DoctorAdviceMapper, DoctorAdvice> implements DoctorAdviceService {
-
+    /**
+     * 根据医嘱ID和医院编码-批量更新数据
+     * @param list
+     */
+    public void updateBatchByKey(List<DoctorAdvice> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 1
src/main/java/com/diagbot/service/impl/HomeDiagnoseInfoServiceImpl.java

@@ -5,6 +5,7 @@ import com.diagbot.mapper.HomeDiagnoseInfoMapper;
 import com.diagbot.service.HomeDiagnoseInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
+import java.util.List;
 
 /**
  * <p>
@@ -16,5 +17,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class HomeDiagnoseInfoServiceImpl extends ServiceImpl<HomeDiagnoseInfoMapper, HomeDiagnoseInfo> implements HomeDiagnoseInfoService {
-
+    /**
+     * 根据病案首页编码、医院编码、手术序号批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<HomeDiagnoseInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 1
src/main/java/com/diagbot/service/impl/HomeOperationInfoServiceImpl.java

@@ -6,6 +6,7 @@ import com.diagbot.service.HomeOperationInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
 /**
  * <p>
  *  服务实现类
@@ -16,5 +17,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class HomeOperationInfoServiceImpl extends ServiceImpl<HomeOperationInfoMapper, HomeOperationInfo> implements HomeOperationInfoService {
-
+    /**
+     * 根据病案首页编码、医院编码、手术序号批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<HomeOperationInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 0
src/main/java/com/diagbot/service/impl/HomePageServiceImpl.java

@@ -67,4 +67,12 @@ public class HomePageServiceImpl extends ServiceImpl<HomePageMapper, HomePage> i
     public IPage<AverageStatisticsDTO> getAverageFeePage(@Param("filterPageByAverageVO") FilterPageByAverageVO filterPageByAverageVO) {
         return baseMapper.getAverageFeePage(filterPageByAverageVO);
     }
+
+    /**
+     * 根据病案首页编码、医院编码、病人住院ID-批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<HomePage> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 0
src/main/java/com/diagbot/service/impl/MedCrisisInfoServiceImpl.java

@@ -6,6 +6,7 @@ import com.diagbot.service.MedCrisisInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
 /**
  * <p>
  * 危急值信息 服务实现类
@@ -17,4 +18,11 @@ import org.springframework.stereotype.Service;
 @Service
 public class MedCrisisInfoServiceImpl extends ServiceImpl<MedCrisisInfoMapper, MedCrisisInfo> implements MedCrisisInfoService {
 
+    /**
+     * 根据编码、医院编码、病人住院ID-批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<MedCrisisInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

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

@@ -5,7 +5,7 @@ import com.diagbot.mapper.MedRecordTypeMapper;
 import com.diagbot.service.MedRecordTypeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
-
+import java.util.List;
 /**
  * <p>
  *  服务实现类
@@ -16,5 +16,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class MedRecordTypeServiceImpl extends ServiceImpl<MedRecordTypeMapper, MedRecordType> implements MedRecordTypeService {
-
+    /**
+     * 根据医院编码、文书类型编码批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<MedRecordType> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 1
src/main/java/com/diagbot/service/impl/MedicalRecordContentServiceImpl.java

@@ -5,6 +5,7 @@ import com.diagbot.mapper.MedicalRecordContentMapper;
 import com.diagbot.service.MedicalRecordContentService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
+import java.util.List;
 
 /**
  * <p>
@@ -16,5 +17,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class MedicalRecordContentServiceImpl extends ServiceImpl<MedicalRecordContentMapper, MedicalRecordContent> implements MedicalRecordContentService {
-
+    /**
+     * 根据文书编码、医院编码
+     * @param list
+     */
+    public void updateBatchByKey(List<MedicalRecordContent> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 0
src/main/java/com/diagbot/service/impl/MedicalRecordServiceImpl.java

@@ -25,4 +25,12 @@ public class MedicalRecordServiceImpl extends ServiceImpl<MedicalRecordMapper, M
     public List<RecordContentDTO> getRecordContent(RecordContentVO recordContentVO) {
         return baseMapper.getRecordContent(recordContentVO);
     }
+
+    /**
+     * 根据文书编码、医院编码、病人住院编码
+     * @param list
+     */
+    public void updateBatchByKey(List<MedicalRecord> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 15 - 0
src/main/java/com/diagbot/service/impl/QcTypeServiceImpl.java

@@ -1,5 +1,6 @@
 package com.diagbot.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.QcTypePageDTO;
 import com.diagbot.entity.QcType;
@@ -23,4 +24,18 @@ public class QcTypeServiceImpl extends ServiceImpl<QcTypeMapper, QcType> impleme
     public IPage<QcTypePageDTO> getList(QcTypePageVO qcTypePageVO) {
         return baseMapper.getList(qcTypePageVO);
     }
+
+    /**
+     * 保存,并返回ID
+     * @param qcType
+     * @return
+     */
+    public Long saveT(QcType qcType){
+        this.baseMapper.insert(qcType);
+        QueryWrapper<QcType> qWrapper =new QueryWrapper<>();
+        qWrapper.eq("name",qcType.getName());
+        qWrapper.eq("hospital_id", qcType.getHospitalId());
+        QcType entity=this.baseMapper.selectOne(qWrapper);
+        return entity.getId();
+    }
 }

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.SysUserPageset;
+import com.diagbot.mapper.SysUserPagesetMapper;
+import com.diagbot.service.SysUserPagesetService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 用户页面设定表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-06-12
+ */
+@Service
+public class SysUserPagesetServiceImpl extends ServiceImpl<SysUserPagesetMapper, SysUserPageset> implements SysUserPagesetService {
+
+}

+ 69 - 0
src/main/java/com/diagbot/task/BasDeptInfoTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.ABasDeptInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class BasDeptInfoTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+	private ABasDeptInfoFacade aBasDeptInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    //aBasDeptInfoFacade.executeDept();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK011"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/BasDoctorInfoTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.ABasDoctorInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class BasDoctorInfoTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+	private ABasDoctorInfoFacade aBasDoctorInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    //aBasDoctorInfoFacade.executeDoctor();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK010"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/BehospitalInfoTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.ABehospitalInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class BehospitalInfoTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+	private ABehospitalInfoFacade aBehospitalInfoFacade;
+
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aBehospitalInfoFacade.executeBehospital();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK008"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/DoctorAdviceTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.ADoctorAdviceFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class DoctorAdviceTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+	private ADoctorAdviceFacade aDoctorAdviceFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aDoctorAdviceFacade.executeDoctorAdvice();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK009"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/HomeDiagnoseInfoTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.AHomeDiagnoseInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class HomeDiagnoseInfoTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AHomeDiagnoseInfoFacade aHomeDiagnoseInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aHomeDiagnoseInfoFacade.executeHomeDiagnose();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK003"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/HomeOperationInfoTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.*;
+import com.diagbot.facade.data.AHomeOperationInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class HomeOperationInfoTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AHomeOperationInfoFacade aHomeOperationInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aHomeOperationInfoFacade.executeHomeOperation();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK004"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/HomePageTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.AHomePageFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class HomePageTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AHomePageFacade aHomePageFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aHomePageFacade.executeHomePage();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK002"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/MedicalRecordContentTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.AMedicalRecordContentFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class MedicalRecordContentTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AMedicalRecordContentFacade aMedicalRecordContentFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aMedicalRecordContentFacade.executeMrRecordContent();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK007"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/MedicalRecordTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.AMedicalRecordFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class MedicalRecordTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AMedicalRecordFacade aMedicalRecordFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aMedicalRecordFacade.executeMrRecord();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK006"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 66 - 0
src/main/java/com/diagbot/task/MedicalRecordTypeTask.java

@@ -0,0 +1,66 @@
+package com.diagbot.task;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedRecordTypeFacade;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class MedicalRecordTypeTask implements SchedulingConfigurer {
+    @Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+    private AMedRecordTypeFacade aMedRecordTypeFacade;
+
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aMedRecordTypeFacade.executeMRType();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK005"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/util/ReadProperties.java

@@ -0,0 +1,68 @@
+package com.diagbot.util;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.stereotype.Component;
+
+@Component
+@PropertySource(value={"classpath:jdbc.properties"})
+public class ReadProperties {
+
+	@Value(value="${remote.address.ver}")
+	public String remoteAddressVer;
+	
+	@Value(value="${remote.address.hor}")
+	public String remoteAddressHor;
+	
+	@Value(value="${jdbc.driverClassName}")
+	public String jdbcDriverClassName;
+	
+	@Value(value="${jdbc.url}")
+	public String jdbcUrl;
+	
+	@Value(value="${jdbc.username}")
+	public String jdbcUsername;
+	
+	@Value(value="${jdbc.password}")
+	public String jdbcPassword;
+
+	@Value(value="${process.qc.url}")
+	public String processQcUrl;
+
+	public String getRemoteAddressVer() {
+		return remoteAddressVer;
+	}
+
+	public String getRemoteAddressHor() {
+		return remoteAddressHor;
+	}
+
+	@Value(value="${his.patient.url}")
+	public String hisPatientUrl;
+
+
+
+
+	public String getHisPatientUrl() {
+		return hisPatientUrl;
+	}
+
+	public String getJdbcDriverClassName() {
+		return jdbcDriverClassName;
+	}
+
+	public String getJdbcUrl() {
+		return jdbcUrl;
+	}
+
+	public String getJdbcUsername() {
+		return jdbcUsername;
+	}
+
+	public String getJdbcPassword() {
+		return jdbcPassword;
+	}
+	
+	public String getProcessQcUrl(){return processQcUrl;}
+	
+}

+ 703 - 0
src/main/java/com/diagbot/util/TZDBConn.java

@@ -0,0 +1,703 @@
+package com.diagbot.util;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+import java.util.ResourceBundle;
+
+import javax.print.DocFlavor.STRING;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.entity.HomePage;
+import com.diagbot.entity.MedRecordType;
+import com.diagbot.entity.MedicalRecord;
+import com.diagbot.entity.MedicalRecordContent;
+import com.google.common.collect.Lists;
+
+public class TZDBConn {
+	private static final String DRIVER = getValue("jdbc.driverClassName");
+    private static final String URL = getValue("jdbc.url");
+    private static final String USERNAME = getValue("jdbc.username");
+    private static final String PASSWORD = getValue("jdbc.password");
+
+	public static final Long HOSPITAL_ID=Long.valueOf("3");//1:长兴,2:邵逸夫,3:台州市立医院
+    
+    private static Connection connection = null;
+    private static PreparedStatement sta = null;
+	private static ResultSet rs = null;
+	
+	/**
+     * 读取属性文件中的信息
+     *
+     * @param key
+     * @return
+     */
+    private static String getValue(String key) {
+        // 资源包绑定
+        ResourceBundle bundle = ResourceBundle.getBundle("jdbc");
+        return bundle.getString(key);
+    }
+    
+    /**
+	 * 加载驱动程序
+	 */
+	static {
+		try {
+			Class.forName(DRIVER);
+		} catch (ClassNotFoundException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * @return 连接对象
+	 */
+	public Connection getConnection() {
+		try {
+			connection = DriverManager.getConnection(URL,USERNAME,PASSWORD);
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+		return connection;
+	}
+	
+	/**
+	 * @param sql sql语句
+	 * @param obj 参数
+	 * @return 数据集合
+	 */
+	public ResultSet Query(String sql,Object...obj){
+		connection=getConnection();
+		try {
+			sta=connection.prepareStatement(sql);
+			if(obj!=null){
+				for(int i=0;i<obj.length;i++){
+					sta.setObject(i+1, obj[i]);
+				}
+			}
+			rs=sta.executeQuery();
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+		return rs;
+	}
+	
+	/**
+	 * 关闭资源
+	 */
+	public void close() {
+		try {
+			if (rs != null) {
+				rs.close();
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				if (sta != null) {
+					sta.close();
+				}
+			} catch (SQLException e2) {
+				e2.printStackTrace();
+			} finally {
+				if (connection != null) {
+					try {
+						connection.close();
+					} catch (SQLException e) {
+						e.printStackTrace();
+					}
+				}
+			}
+		}
+	}
+	
+	/**
+	 * 医生信息
+	 * @return
+	 */
+	public List<BasDoctorInfo> getBasDoctorInfo(String sql) {
+		List<BasDoctorInfo> basDoctorInfoList=Lists.newLinkedList();
+		TZDBConn dbconn=new TZDBConn();
+		try {
+			rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				BasDoctorInfo basDoctorInfo=new BasDoctorInfo();
+				basDoctorInfo.setDoctorId(rs.getString("YHRYBH"));//医生ID
+				basDoctorInfo.setHospitalId(HOSPITAL_ID);//医院ID
+				//basDoctorInfoVO.setDeptId(rs.getString("ZZKSID"));//科室ID
+				basDoctorInfo.setName(rs.getString("YHRYMC"));//医生姓名
+				basDoctorInfo.setProfessor(rs.getString("YHRYZC"));//职称
+
+				basDoctorInfoList.add(basDoctorInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		
+		return basDoctorInfoList;
+	}
+	
+	/**
+	 * 从视图中获取医院科室数据,根据修改时间同步数据
+	 * @return
+	 */
+	public List<BasDeptInfo> getDeptInfo(String sql) {
+		List<BasDeptInfo> basDeptInfoList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				BasDeptInfo basDeptInfo=new BasDeptInfo();
+				basDeptInfo.setDeptId(rs.getString("ZZKSDM"));//科室编码
+				basDeptInfo.setHospitalId(HOSPITAL_ID);//医院ID
+				basDeptInfo.setDeptName(rs.getString("ZZKSMC"));//科室名称
+				//basDeptInfoVO.setDeptType(rs.getString("ZZKSLB"));//科室类别
+				basDeptInfo.setSpell(rs.getString("HZSRM1"));//首字母拼音
+				//basDeptInfoVO.setStation(rs.getString("FLKSID"));//区域类别
+
+				basDeptInfoList.add(basDeptInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return basDeptInfoList;
+	}
+	
+	/**
+	 * 病案诊断
+	 * @return
+	 */
+	public List<HomeDiagnoseInfo> getHomeDiagnose(String sql){
+		List<HomeDiagnoseInfo> homeDiagnoseVOList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				HomeDiagnoseInfo homeDiagnose=new HomeDiagnoseInfo();
+				homeDiagnose.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homeDiagnose.setHospitalId(HOSPITAL_ID);//医院ID
+				homeDiagnose.setDiagnoseOrderNo(rs.getString("BAZDXH"));//诊断序号
+				homeDiagnose.setDiagnoseName(rs.getString("ZDJBMC"));//诊断名称
+				homeDiagnose.setDiagnoseType(rs.getString("ZDLBDM"));//诊断类别
+				homeDiagnose.setDiagnoseTypeShort(rs.getString("ZCZDPB"));//诊断判别
+				homeDiagnose.setBehospitalType(rs.getString("RYQKBM"));//入院情况
+				//homeDiagnoseVO.setLeaveHospitalType(rs.getString("RYQKBM"));//出院情况
+				//homeDiagnoseVO.setPathologyDiagnose(rs.getString("BASYID"));//病理号
+				homeDiagnose.setIcdCode(rs.getString("ICDM"));//诊断编码
+
+				homeDiagnoseVOList.add(homeDiagnose);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		
+		return homeDiagnoseVOList;
+	}
+	
+	/**
+	 * 病案手术
+	 * @return
+	 */
+	public List<HomeOperationInfo> getHomeOperation(String sql) {
+		List<HomeOperationInfo> homeOperationVOList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				HomeOperationInfo homeOperationVO=new HomeOperationInfo();
+				homeOperationVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homeOperationVO.setHospitalId(HOSPITAL_ID);//医院ID
+				homeOperationVO.setOperationOrderNo(rs.getString("BRSSXH"));//手术序号
+				homeOperationVO.setOperationDate(rs.getDate("BRSSRQ"));//手术日期
+				homeOperationVO.setOperationCode(rs.getString("SSDMID"));//手术编码
+				homeOperationVO.setOperationDoctorId(rs.getString("SSYSID"));//手术医生
+				homeOperationVO.setFirstAssistantId(rs.getString("YZHSID"));//一助医生
+				homeOperationVO.setSecondAssistantId(rs.getString("EZHSID"));//二助医生
+				homeOperationVO.setCutLevel(rs.getString("QKDJDM"));//切口等级
+				homeOperationVO.setHealingLevel(rs.getString("QKDJDM"));//愈合等级
+				homeOperationVO.setOperationName(rs.getString("BRSSMC"));//手术名称
+				homeOperationVO.setOperationLevel(rs.getString("SSJBID"));//手术级别
+				homeOperationVO.setAnaesthesiaName(rs.getString("MZFFMC"));//麻醉方式
+				homeOperationVO.setShamOperationName(rs.getString("NSSMC"));//拟手术名称
+				
+				homeOperationVOList.add(homeOperationVO);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		List<HomeOperationInfo> homeOperationList=BeanUtil.listCopyTo(homeOperationVOList, HomeOperationInfo.class);
+		return homeOperationList;
+	}
+	
+	/**
+	 * 从视图获取病案首页信息
+	 * 获取近几个月的数据
+	 */
+	public List<HomePage> getHomePage(String sql) {
+		List<HomePage> homePageList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				HomePage homePageVO=new HomePage();
+				homePageVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homePageVO.setHospitalId(HOSPITAL_ID);//医院ID
+				homePageVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院序号
+				homePageVO.setHospitalCode(rs.getString("ZZJGID"));//组织机构id
+				homePageVO.setHospitalName(rs.getString("ZZJGMC"));//医疗机构名称
+				homePageVO.setOrgCode(rs.getString("ZZJGBH"));//医疗机构代码
+				homePageVO.setPayType(rs.getString("YLFKLB"));//医疗付费方式
+				homePageVO.setHealthCard(rs.getString("BRJKKH"));//健康卡号
+				homePageVO.setBehospitalNum(rs.getString("BRZYCS"));//住院次数
+				homePageVO.setFileCode(rs.getString("BRBABH"));//病案号
+				homePageVO.setName(rs.getString("BRBAXM"));//姓名
+				homePageVO.setSex(rs.getString("BRBAXB"));//性别
+				homePageVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				homePageVO.setAge(rs.getString("BRDQNL").equals("-")?null:rs.getString("BRDQNL"));//病人年龄
+				homePageVO.setAgeUnit(rs.getString("BRNLDW"));//年龄单位
+				homePageVO.setNationality(rs.getString("BRBAGJ"));//国籍
+				homePageVO.setNewbornMonth(rs.getString("YENLYS"));//新生儿出生月数
+				homePageVO.setNewbornDay(rs.getString("YENLTS"));//新生儿出生天数
+				homePageVO.setNewbornWeight(rs.getString("YECSTZ"));//新生儿出生体重
+				homePageVO.setNewbornBehospitalWeight(rs.getString("YERYTZ"));//新生儿入院体重
+				homePageVO.setBornAddress(rs.getString("BRCSDZ"));//出生地
+				homePageVO.setBornPlace(rs.getString("BRBAJG"));//籍贯
+				homePageVO.setNation(rs.getString("BRBAMZ"));//民族
+				homePageVO.setIdentityCardNo(rs.getString("BRSFZH"));//身份证号
+				homePageVO.setJobType(rs.getString("BRBASF"));//职业
+				homePageVO.setMarriage(rs.getString("BRHYZK"));//婚姻
+				homePageVO.setCurAddress(rs.getString("BRLXDZ"));//现住址
+				homePageVO.setCurPhone(rs.getString("BRLXDH"));//现住址电话
+				homePageVO.setCurPostCode(rs.getString("LXDZYB"));//现住址邮编
+				homePageVO.setResidenceAddress(rs.getString("BRHKDZ"));//户口地址
+				homePageVO.setResidencePostCode(rs.getString("HKDZYB"));//户口地址邮编
+				homePageVO.setWorkAddress(rs.getString("GZDWMC"));//工作单位
+				homePageVO.setWorkPhone(rs.getString("GZDWDH"));//工作单位电话
+				homePageVO.setWorkPostCode(rs.getString("GZDWYB"));//工作单位邮编
+				homePageVO.setContactName(rs.getString("LXRYXM"));//联系人姓名
+				homePageVO.setContactRelation(rs.getString("LXRYGX"));//联系人关系
+				homePageVO.setContactAddress(rs.getString("LXRYDZ"));//联系人地址
+				homePageVO.setContactPhone(rs.getString("LXRYDH"));//联系人电话
+				homePageVO.setBehospitalWay(rs.getString("RYLYDM"));//入院途径
+				homePageVO.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				homePageVO.setBehospitalDept(rs.getString("RYKSID"));//入院科室
+				homePageVO.setBehospitalWard(rs.getString("RYBQID"));//入院病房
+				homePageVO.setBehospitalBedId(rs.getString("RYCWID"));//入院床位序号
+				homePageVO.setBehospitalBedCode(rs.getString("RYCWHM"));//入院床位号码
+				homePageVO.setChangeDept(rs.getString("BRZKKB"));//转科科别
+				homePageVO.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				homePageVO.setLeaveHospitalDept(rs.getString("CYKSID"));//出院科别
+				homePageVO.setLeaveHospitalWard(rs.getString("CYBQID"));//出院病房
+				homePageVO.setLeaveHospitalBedId(rs.getString("CYCWID"));//出院床位序号
+				homePageVO.setLeaveHospitalBedCode(rs.getString("CYCWHM"));//出院床位号码
+				homePageVO.setBehospitalDayNum(rs.getString("SJZYTS"));//实际住院天数
+				homePageVO.setOutpatientEmrDiagnose(rs.getString("BRMZZD"));//门急诊诊断
+				homePageVO.setOutpatientEmrDiagnoseCode(rs.getString("MZZDDM"));//门急诊诊断编码
+				homePageVO.setPoisonFactor(rs.getString("SSZDYSMC"));//损伤中毒因素
+				homePageVO.setPoisonFactorCode(rs.getString("SSZDYSBM"));//损伤中毒因素编码
+				homePageVO.setPathologyDiagnose(rs.getString("BLZDMC"));//病理诊断
+				homePageVO.setPathologyDiagnoseCode(rs.getString("BLZDBM"));//病理诊断编码
+				homePageVO.setPathologyDiagnoseId(rs.getString("BLZDBH"));//病理诊断编号
+				homePageVO.setIsMedAllergy(rs.getString("YWYWGM"));//药物过敏
+				homePageVO.setMedAllergyName(rs.getString("BRGMYW"));//过敏药物
+				homePageVO.setAutopsy(rs.getString("BRSFSJ"));//死亡患者尸检
+				homePageVO.setBloodType(rs.getString("BRBAXX"));//血型
+				homePageVO.setRh(rs.getString("BRBARH"));//Rh
+				homePageVO.setDeptDirector(rs.getString("KZR"));//科主任
+				homePageVO.setDirectorDoctor(rs.getString("ZRYS"));//主任医师
+				homePageVO.setAttendingDoctor(rs.getString("ZZYS"));//主治医师
+				homePageVO.setBehospitalDoctor(rs.getString("ZYYS"));//住院医师
+				homePageVO.setResponseNurse(rs.getString("ZRHS"));//责任护士
+				homePageVO.setStudyDoctor(rs.getString("JXYS"));//进修医师
+				homePageVO.setPracticeDoctor(rs.getString("SXYS"));//实习医师
+				homePageVO.setEncodeMan(rs.getString("BMY"));//编码员
+				homePageVO.setHomePageQuality(rs.getString("BRBAZL"));//病案质量
+				homePageVO.setQcDoctor(rs.getString("BAZKYS"));//质控医师
+				homePageVO.setQcNurse(rs.getString("BAZKHS"));//质控护士
+				if(!"".equals(rs.getString("BAZKRQ"))){
+					homePageVO.setQcDate(DateUtil.parseDate(rs.getString("BAZKRQ"),DateUtil.DATE_TIME_FORMAT));//质控日期
+				}
+				homePageVO.setLeaveHospitalType(rs.getString("BRLYFS"));//离院方式
+				homePageVO.setAcceptOrgCode(rs.getString("ZYJGMC"));//接收机构名称
+				homePageVO.setAgainBehospitalPlan(rs.getString("SSYZZY"));//31天内再住院计划
+				homePageVO.setAgainBehospitalGoal(rs.getString("SSYZZYMD"));//再住院目的
+				homePageVO.setTbiBeforeDay(rs.getString("RYQHMTS"));//颅脑损伤患者昏迷前天数
+				homePageVO.setTbiBeforeHour(rs.getString("RYQHMXS"));//颅脑损伤患者昏迷前小时
+				homePageVO.setTbiBeforeMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷前分钟
+				homePageVO.setTbiAfterDay(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后天数
+				homePageVO.setTbiAfterHour(rs.getString("RYHHMXS"));//颅脑损伤患者昏迷后小时
+				homePageVO.setTbiAfterMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后分钟
+				homePageVO.setTotalFee(rs.getString("ZFY"));//总费用
+				homePageVO.setOwnFee(rs.getString("ZFJE"));//自付金额
+				homePageVO.setGeneralFee(rs.getString("YBYLFWF"));//一般医疗服务费
+				homePageVO.setServiceFee(rs.getString("YBZLCZF"));//一般治疗服务费
+				homePageVO.setNurseFee(rs.getString("HLF"));//护理费
+				//homePageVO.setOtherFee(rs.getString("QTFY"));//其他费用
+				homePageVO.setPathologyFee(rs.getString("BLZDF"));//病理诊断费
+				homePageVO.setLabFee(rs.getString("SYSZDF"));//实验室诊断费
+				homePageVO.setPacsFee(rs.getString("YXXZDF"));//影像学诊断费
+				homePageVO.setClinicDiagnoseFee(rs.getString("LCZDXMF"));//临床诊断项目费
+				homePageVO.setNotOperationFee(rs.getString("FSSZLXMF"));//非手术治疗项目费
+				homePageVO.setClinicPhysicFee(rs.getString("LCWLZLF"));//临床物理治疗费
+				homePageVO.setOperationTreatFee(rs.getString("SSZLF"));//手术治疗费
+				homePageVO.setAnaesthesiaFee(rs.getString("MZF"));//麻醉费
+				homePageVO.setOperationFee(rs.getString("SSF"));//手术费
+				homePageVO.setHealthTypeFee(rs.getString("KFF"));//康复类
+				homePageVO.setChnTreatFee(rs.getString("ZYZLF"));//中医治疗费
+				homePageVO.setWesternMedFee(rs.getString("XYF"));//西药费
+				homePageVO.setAntibiosisFee(rs.getString("KJYWF"));//抗菌药物费用
+				homePageVO.setChnMedFee(rs.getString("ZCYF"));//中成药费
+				homePageVO.setChnHerbFee(rs.getString("CYF"));//中草药费
+				homePageVO.setBloodFee(rs.getString("XF"));//血费
+				homePageVO.setAlbumenFee(rs.getString("BDBLZPF"));//白蛋白类制品费
+				homePageVO.setGlobulinFee(rs.getString("QDBLZPF"));//球蛋白类制品费
+				homePageVO.setBloodFactorFee(rs.getString("NXYZLZPF"));//凝血因子类制品费
+				homePageVO.setCellFactorFee(rs.getString("XBYZLZPF"));//细胞因子类制品费
+				homePageVO.setCheckMaterialFee(rs.getString("JCYYCXYYCLF"));//检查用一次性医用材料费
+				homePageVO.setTreatMaterialFee(rs.getString("ZLYYCXYYCLF"));//治疗用一次性医用材料费
+				homePageVO.setOperationMaterialFee(rs.getString("SSYYCXYYCLF"));//手术用一次性医用材料费
+				homePageVO.setOtherTypeFee(rs.getString("QTF"));//其他类其他费
+				homePageVO.setSingleDiagManage(rs.getString("DBZGL"));//单病种管理
+				homePageVO.setClinicPathwayManage(rs.getString("SSLCLJGL"));//临床路径管理
+				homePageVO.setIsOutpatientBehospital(rs.getString("MZZYFH"));//门诊与住院
+				homePageVO.setIsLeaveBehospital(rs.getString("RYCYFH"));//入院与出院
+				homePageVO.setIsOperationBeforeAfter(rs.getString("SQSHFH"));//术前与术后
+				homePageVO.setIsClinicPathology(rs.getString("LCBLFH"));//临床与病理
+				homePageVO.setIsRadiatePathology(rs.getString("FSBLFH"));//放射与病理
+				homePageVO.setRescueSuccessNum(rs.getString("BRQJCS"));//病人抢救次数
+				homePageVO.setRescueSuccessNum(rs.getString("QJCGCS"));//病人抢救成功次数
+				homePageVO.setIsAutoLeavehospital(rs.getString("ZDCYPB"));//是否为自动出院
+				homePageVO.setReturnToType(rs.getString("CYQKDM"));//转归情况HomePage homePageVO=new HomePage();
+				homePageVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homePageVO.setHospitalId(Long.valueOf("3"));//医院ID
+				homePageVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院序号
+				homePageVO.setHospitalCode(rs.getString("ZZJGID"));//组织机构id
+				homePageVO.setHospitalName(rs.getString("ZZJGMC"));//医疗机构名称
+				homePageVO.setOrgCode(rs.getString("ZZJGBH"));//医疗机构代码
+				homePageVO.setPayType(rs.getString("YLFKLB"));//医疗付费方式
+				homePageVO.setHealthCard(rs.getString("BRJKKH"));//健康卡号
+				homePageVO.setBehospitalNum(rs.getString("BRZYCS"));//住院次数
+				homePageVO.setFileCode(rs.getString("BRBABH"));//病案号
+				homePageVO.setName(rs.getString("BRBAXM"));//姓名
+				homePageVO.setSex(rs.getString("BRBAXB"));//性别
+				homePageVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				homePageVO.setAge(rs.getString("BRDQNL"));//病人年龄
+				homePageVO.setAgeUnit(rs.getString("BRNLDW"));//年龄单位
+				homePageVO.setNationality(rs.getString("BRBAGJ"));//国籍
+				homePageVO.setNewbornMonth(rs.getString("YENLYS"));//新生儿出生月数
+				homePageVO.setNewbornDay(rs.getString("YENLTS"));//新生儿出生天数
+				homePageVO.setNewbornWeight(rs.getString("YECSTZ"));//新生儿出生体重
+				homePageVO.setNewbornBehospitalWeight(rs.getString("YERYTZ"));//新生儿入院体重
+				homePageVO.setBornAddress(rs.getString("BRCSDZ"));//出生地
+				homePageVO.setBornPlace(rs.getString("BRBAJG"));//籍贯
+				homePageVO.setNation(rs.getString("BRBAMZ"));//民族
+				homePageVO.setIdentityCardNo(rs.getString("BRSFZH"));//身份证号
+				homePageVO.setJobType(rs.getString("BRBASF"));//职业
+				homePageVO.setMarriage(rs.getString("BRHYZK"));//婚姻
+				homePageVO.setCurAddress(rs.getString("BRLXDZ"));//现住址
+				homePageVO.setCurPhone(rs.getString("BRLXDH"));//现住址电话
+				homePageVO.setCurPostCode(rs.getString("LXDZYB"));//现住址邮编
+				homePageVO.setResidenceAddress(rs.getString("BRHKDZ"));//户口地址
+				homePageVO.setResidencePostCode(rs.getString("HKDZYB"));//户口地址邮编
+				homePageVO.setWorkAddress(rs.getString("GZDWMC"));//工作单位
+				homePageVO.setWorkPhone(rs.getString("GZDWDH"));//工作单位电话
+				homePageVO.setWorkPostCode(rs.getString("GZDWYB"));//工作单位邮编
+				homePageVO.setContactName(rs.getString("LXRYXM"));//联系人姓名
+				homePageVO.setContactRelation(rs.getString("LXRYGX"));//联系人关系
+				homePageVO.setContactAddress(rs.getString("LXRYDZ"));//联系人地址
+				homePageVO.setContactPhone(rs.getString("LXRYDH"));//联系人电话
+				homePageVO.setBehospitalWay(rs.getString("RYLYDM"));//入院途径
+				homePageVO.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				homePageVO.setBehospitalDept(rs.getString("RYKSID"));//入院科室
+				homePageVO.setBehospitalWard(rs.getString("RYBQID"));//入院病房
+				homePageVO.setBehospitalBedId(rs.getString("RYCWID"));//入院床位序号
+				homePageVO.setBehospitalBedCode(rs.getString("RYCWHM"));//入院床位号码
+				homePageVO.setChangeDept(rs.getString("BRZKKB"));//转科科别
+				homePageVO.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				homePageVO.setLeaveHospitalDept(rs.getString("CYKSID"));//出院科别
+				homePageVO.setLeaveHospitalWard(rs.getString("CYBQID"));//出院病房
+				homePageVO.setLeaveHospitalBedId(rs.getString("CYCWID"));//出院床位序号
+				homePageVO.setLeaveHospitalBedCode(rs.getString("CYCWHM"));//出院床位号码
+				homePageVO.setBehospitalDayNum(rs.getString("SJZYTS"));//实际住院天数
+				homePageVO.setOutpatientEmrDiagnose(rs.getString("BRMZZD"));//门急诊诊断
+				homePageVO.setOutpatientEmrDiagnoseCode(rs.getString("MZZDDM"));//门急诊诊断编码
+				homePageVO.setPoisonFactor(rs.getString("SSZDYSMC"));//损伤中毒因素
+				homePageVO.setPoisonFactorCode(rs.getString("SSZDYSBM"));//损伤中毒因素编码
+				homePageVO.setPathologyDiagnose(rs.getString("BLZDMC"));//病理诊断
+				homePageVO.setPathologyDiagnoseCode(rs.getString("BLZDBM"));//病理诊断编码
+				homePageVO.setPathologyDiagnoseId(rs.getString("BLZDBH"));//病理诊断编号
+				homePageVO.setIsMedAllergy(rs.getString("YWYWGM"));//药物过敏
+				homePageVO.setMedAllergyName(rs.getString("BRGMYW"));//过敏药物
+				homePageVO.setAutopsy(rs.getString("BRSFSJ"));//死亡患者尸检
+				homePageVO.setBloodType(rs.getString("BRBAXX"));//血型
+				homePageVO.setRh(rs.getString("BRBARH"));//Rh
+				homePageVO.setDeptDirector(rs.getString("KZR"));//科主任
+				homePageVO.setDirectorDoctor(rs.getString("ZRYS"));//主任医师
+				homePageVO.setAttendingDoctor(rs.getString("ZZYS"));//主治医师
+				homePageVO.setBehospitalDoctor(rs.getString("ZYYS"));//住院医师
+				homePageVO.setResponseNurse(rs.getString("ZRHS"));//责任护士
+				homePageVO.setStudyDoctor(rs.getString("JXYS"));//进修医师
+				homePageVO.setPracticeDoctor(rs.getString("SXYS"));//实习医师
+				homePageVO.setEncodeMan(rs.getString("BMY"));//编码员
+				homePageVO.setHomePageQuality(rs.getString("BRBAZL"));//病案质量
+				homePageVO.setQcDoctor(rs.getString("BAZKYS"));//质控医师
+				homePageVO.setQcNurse(rs.getString("BAZKHS"));//质控护士
+				if(!"".equals(rs.getString("BAZKRQ"))){
+					homePageVO.setQcDate(DateUtil.parseDate(rs.getString("BAZKRQ"),DateUtil.DATE_TIME_FORMAT));//质控日期
+				}
+				homePageVO.setLeaveHospitalType(rs.getString("BRLYFS"));//离院方式
+				homePageVO.setAcceptOrgCode(rs.getString("ZYJGMC"));//接收机构名称
+				homePageVO.setAgainBehospitalPlan(rs.getString("SSYZZY"));//31天内再住院计划
+				homePageVO.setAgainBehospitalGoal(rs.getString("SSYZZYMD"));//再住院目的
+				homePageVO.setTbiBeforeDay(rs.getString("RYQHMTS"));//颅脑损伤患者昏迷前天数
+				homePageVO.setTbiBeforeHour(rs.getString("RYQHMXS"));//颅脑损伤患者昏迷前小时
+				homePageVO.setTbiBeforeMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷前分钟
+				homePageVO.setTbiAfterDay(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后天数
+				homePageVO.setTbiAfterHour(rs.getString("RYHHMXS"));//颅脑损伤患者昏迷后小时
+				homePageVO.setTbiAfterMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后分钟
+				homePageVO.setTotalFee(rs.getString("ZFY"));//总费用
+				homePageVO.setOwnFee(rs.getString("ZFJE"));//自付金额
+				homePageVO.setGeneralFee(rs.getString("YBYLFWF"));//一般医疗服务费
+				homePageVO.setServiceFee(rs.getString("YBZLCZF"));//一般治疗服务费
+				homePageVO.setNurseFee(rs.getString("HLF"));//护理费
+				//homePageVO.setOtherFee(rs.getString("QTFY"));//其他费用
+				homePageVO.setPathologyFee(rs.getString("BLZDF"));//病理诊断费
+				homePageVO.setLabFee(rs.getString("SYSZDF"));//实验室诊断费
+				homePageVO.setPacsFee(rs.getString("YXXZDF"));//影像学诊断费
+				homePageVO.setClinicDiagnoseFee(rs.getString("LCZDXMF"));//临床诊断项目费
+				homePageVO.setNotOperationFee(rs.getString("FSSZLXMF"));//非手术治疗项目费
+				homePageVO.setClinicPhysicFee(rs.getString("LCWLZLF"));//临床物理治疗费
+				homePageVO.setOperationTreatFee(rs.getString("SSZLF"));//手术治疗费
+				homePageVO.setAnaesthesiaFee(rs.getString("MZF"));//麻醉费
+				homePageVO.setOperationFee(rs.getString("SSF"));//手术费
+				homePageVO.setHealthTypeFee(rs.getString("KFF"));//康复类
+				homePageVO.setChnTreatFee(rs.getString("ZYZLF"));//中医治疗费
+				homePageVO.setWesternMedFee(rs.getString("XYF"));//西药费
+				homePageVO.setAntibiosisFee(rs.getString("KJYWF"));//抗菌药物费用
+				homePageVO.setChnMedFee(rs.getString("ZCYF"));//中成药费
+				homePageVO.setChnHerbFee(rs.getString("CYF"));//中草药费
+				homePageVO.setBloodFee(rs.getString("XF"));//血费
+				homePageVO.setAlbumenFee(rs.getString("BDBLZPF"));//白蛋白类制品费
+				homePageVO.setGlobulinFee(rs.getString("QDBLZPF"));//球蛋白类制品费
+				homePageVO.setBloodFactorFee(rs.getString("NXYZLZPF"));//凝血因子类制品费
+				homePageVO.setCellFactorFee(rs.getString("XBYZLZPF"));//细胞因子类制品费
+				homePageVO.setCheckMaterialFee(rs.getString("JCYYCXYYCLF"));//检查用一次性医用材料费
+				homePageVO.setTreatMaterialFee(rs.getString("ZLYYCXYYCLF"));//治疗用一次性医用材料费
+				homePageVO.setOperationMaterialFee(rs.getString("SSYYCXYYCLF"));//手术用一次性医用材料费
+				homePageVO.setOtherTypeFee(rs.getString("QTF"));//其他类其他费
+				homePageVO.setSingleDiagManage(rs.getString("DBZGL"));//单病种管理
+				homePageVO.setClinicPathwayManage(rs.getString("SSLCLJGL"));//临床路径管理
+				homePageVO.setIsOutpatientBehospital(rs.getString("MZZYFH"));//门诊与住院
+				homePageVO.setIsLeaveBehospital(rs.getString("RYCYFH"));//入院与出院
+				homePageVO.setIsOperationBeforeAfter(rs.getString("SQSHFH"));//术前与术后
+				homePageVO.setIsClinicPathology(rs.getString("LCBLFH"));//临床与病理
+				homePageVO.setIsRadiatePathology(rs.getString("FSBLFH"));//放射与病理
+				homePageVO.setRescueSuccessNum(rs.getString("BRQJCS"));//病人抢救次数
+				homePageVO.setRescueSuccessNum(rs.getString("QJCGCS"));//病人抢救成功次数
+				homePageVO.setIsAutoLeavehospital(rs.getString("ZDCYPB"));//是否为自动出院
+				homePageVO.setReturnToType(rs.getString("CYQKDM"));//转归情况
+
+				homePageList.add(homePageVO);
+				
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return homePageList;
+	}
+	
+	/**
+	 * 获取病历信息
+	 * @return
+	 */
+	public List<BehospitalInfo> getBehospitalInfo(String sql) {
+		List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				BehospitalInfo behospitalInfo=new BehospitalInfo();
+				behospitalInfo.setBehospitalCode(rs.getString("BRZYID"));//病人住院ID
+				behospitalInfo.setHospitalId(HOSPITAL_ID);//医院ID
+				behospitalInfo.setName(rs.getString("BRDAXM"));//姓名
+				behospitalInfo.setSex(rs.getString("BRDAXB").equals("M")?"男":"女");//性别
+				behospitalInfo.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				behospitalInfo.setFileCode(rs.getString("BRDABH"));//档案号
+				behospitalInfo.setWardCode(rs.getString("ZYBQID"));//病区编码
+				behospitalInfo.setWardName(rs.getString("ZYBQMC"));//病区名称
+				behospitalInfo.setBehDeptId(rs.getString("ZYKSID"));//住院科室ID
+				behospitalInfo.setBehDeptName(rs.getString("ZYKSMC"));//住院科室名称
+				behospitalInfo.setBedCode(rs.getString("ZYCWID"));//床位号
+				behospitalInfo.setBedName(rs.getString("ZYCWHM"));//床位名称
+				behospitalInfo.setInsuranceName(rs.getString("BRLBID"));//医保类别
+				behospitalInfo.setJobType(rs.getString("BRXZID"));//职业
+				behospitalInfo.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				behospitalInfo.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				behospitalInfo.setDiagnoseIcd(rs.getString("JBDMID"));//疾病ICD编码
+				behospitalInfo.setDiagnose(rs.getString("JBMSXX"));//疾病名称
+				behospitalInfo.setDoctorId(rs.getString("ZZYSID"));//医生ID
+				behospitalInfo.setDoctorName(rs.getString("ZZYSXM"));//医生姓名
+				
+				behospitalInfoList.add(behospitalInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		
+		return behospitalInfoList;
+	}
+	
+	/**
+	 * 从视图中获取医嘱信息
+	 * @return
+	 */
+	public List<DoctorAdvice> getDoctorAdvice(String sql){
+		List<DoctorAdvice> doctorAdviceList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				DoctorAdvice doctorAdviceVO=new DoctorAdvice();
+				doctorAdviceVO.setDoctorAdviceId(rs.getString("BRYZID"));//病人医嘱ID
+				doctorAdviceVO.setHospitalId(HOSPITAL_ID);//医院ID
+				doctorAdviceVO.setBehospitalCode(rs.getString("BRZYID"));//病人ID
+				doctorAdviceVO.setOrderDoctorName(rs.getString("YSKDPB"));//医生开单判别
+				doctorAdviceVO.setFrequency(rs.getString("YZPLPB"));//医嘱频率判别
+				doctorAdviceVO.setParentTypeId(rs.getString("FLYZID"));//父类医嘱ID
+				doctorAdviceVO.setDoctorAdviceType(rs.getString("YZLXPB"));//医嘱类型判别
+				doctorAdviceVO.setUsageNum(rs.getString("YCSYSL"));//一次使用数量
+				doctorAdviceVO.setUsageUnit(rs.getString("YCYLDW"));//一次用量单位
+				doctorAdviceVO.setDose(rs.getString("YZDCJL"));//医嘱单次剂量
+				doctorAdviceVO.setDoseUnit(rs.getString("DCJLDW"));//单次剂量单位
+				doctorAdviceVO.setMedModeType(rs.getString("GYFSID"));//给药方式
+				doctorAdviceVO.setDaFrequency(rs.getString("YZPLID"));//医嘱频率
+				doctorAdviceVO.setDaDealType(rs.getString("YZCLLX"));//医嘱处理类型
+				doctorAdviceVO.setDaStartDate(rs.getDate("YZKSSJ"));//医嘱开始时间
+				doctorAdviceVO.setDaItemName(rs.getString("YZXMMC"));//医嘱项目名称
+				doctorAdviceVO.setDaStatus(rs.getString("YZZTPB"));//医嘱状态判别
+				doctorAdviceVO.setDaStopDate(rs.getDate("YZJSSJ"));//医嘱结束时间
+				doctorAdviceVO.setDaGroupNo(rs.getString("YZTZXH"));//医嘱同组序号
+				doctorAdviceVO.setDaPrescriptionType(rs.getString("YZCFLX"));//医嘱处方类型
+				doctorAdviceVO.setDaMedType(rs.getString("YZLYLX"));//医嘱领药类型
+				doctorAdviceVO.setDoctorNotice(rs.getString("YSZTSM"));//医生嘱托
+				doctorAdviceVO.setDoctorId(rs.getString("KDYSID"));//开单医生ID
+				doctorAdviceVO.setDoctorName(rs.getString("KDYSMC"));//开单医生姓名
+
+				doctorAdviceList.add(doctorAdviceVO);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return doctorAdviceList;
+	}
+
+	/**
+	 * 从视图中获取病历记录
+	 * @return
+	 */
+	public List<MedicalRecord> getMedicalRecord(String sql){
+		List<MedicalRecord> medicalRecordList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				MedicalRecord medicalRecord=new MedicalRecord();
+				medicalRecord.setRecId(rs.getString("BLJLID"));
+				medicalRecord.setHospitalId(HOSPITAL_ID);//医院ID
+				medicalRecord.setBehospitalCode(rs.getString("BRZYID"));//病人住院ID
+				medicalRecord.setOrgCode(rs.getString("ZZJGDM"));//组织机构代码
+				medicalRecord.setRecTypeId(rs.getString("BLMBID"));//对应his模板ID
+
+				medicalRecord.setRecDate(rs.getString("BCJLSJ")!=null?DateUtil.parseDateTime(rs.getString("BCJLSJ")):null);//病历日期
+				medicalRecord.setRecTitle(rs.getString("BLJLMC"));//病历标题
+				medicalRecord.setModeId(Long.valueOf(rs.getString("BLLBID")));//对应his类别ID
+				
+				medicalRecordList.add(medicalRecord);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		
+		return medicalRecordList;
+	}
+	
+	/**
+	 * 从视图中获取文书内容
+	 * @return
+	 */
+	public List<MedicalRecordContent> getMedicalRecordContent(String sql){
+		List<MedicalRecordContent> mrContentList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				MedicalRecordContent mrContent=new MedicalRecordContent();
+				mrContent.setHospitalId(HOSPITAL_ID);
+				mrContent.setRecId(rs.getString("BLJLID"));
+				//mrContent.setHtmlText(rs.getString("HTMLSJ"));
+				mrContent.setXmlText(rs.getString("BLJLNR"));
+
+				mrContentList.add(mrContent);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return mrContentList;
+	}
+	
+	/**
+	 * 从视图中获取文书类型
+	 * @return
+	 */
+	public List<MedRecordType> getMedicalRecordType(String sql){
+		List<MedRecordType> mrTypeList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				MedRecordType mrType=new MedRecordType();
+				mrType.setTypeId(rs.getString("BLLBID"));
+				mrType.setHospitalId(HOSPITAL_ID);
+				mrType.setTypeName(rs.getString("BLLBMC"));
+				mrType.setParentTypeId(rs.getString("SJLBID"));
+				mrType.setObjName(rs.getString("BLLBFW"));
+				mrType.setSpell(rs.getString("HZSRM1"));
+				mrTypeList.add(mrType);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+
+		return mrTypeList;
+	}
+	
+}

+ 23 - 0
src/main/java/com/diagbot/vo/SysUserPagesetQueryVO.java

@@ -0,0 +1,23 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/12 10:30
+ */
+@Getter
+@Setter
+public class SysUserPagesetQueryVO {
+
+    /**
+     * 页面分组(值自定义)
+     */
+    @NotNull(message = "请输入页面分组")
+    private Long pageType;
+}

+ 24 - 0
src/main/java/com/diagbot/vo/SysUserPagesetSaveVO.java

@@ -0,0 +1,24 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/12 10:30
+ */
+@Getter
+@Setter
+public class SysUserPagesetSaveVO {
+    /**
+     * 页面分组(值自定义)
+     */
+    @NotNull(message = "请输入页面分组")
+    private Long pageType;
+
+    private List<SysUserPagesetVO> sysUserPagesetVOList;
+}

+ 40 - 0
src/main/java/com/diagbot/vo/SysUserPagesetVO.java

@@ -0,0 +1,40 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/12 10:26
+ */
+@Getter
+@Setter
+public class SysUserPagesetVO {
+    /**
+     * 列名
+     */
+    @NotBlank(message = "请输入列名")
+    private String name;
+
+    /**
+     * 列名值
+     */
+    @NotBlank(message = "请输入列名值")
+    private String val;
+
+    /**
+     * 是否启用(0:停用,1:启用)
+     */
+    @NotNull(message = "请输入是否启用装填")
+    private Integer status;
+
+    /**
+     * 排序号
+     */
+    @NotNull(message = "请输入排序号")
+    private Integer orderNo;
+}

+ 44 - 0
src/main/java/com/diagbot/vo/data/ABasDeptInfoVO.java

@@ -0,0 +1,44 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Setter
+public class ABasDeptInfoVO {
+    /**
+     * 科室编码(HIS导入)
+     */
+    private String deptId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    private String parentDeptId;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 科室类别
+     */
+    private String deptType;
+
+    /**
+     * 首字母拼音
+     */
+    private String spell;
+
+    /**
+     * 区域类别(门诊、工作站、住院等)
+     */
+    private String station;
+
+
+}

+ 38 - 0
src/main/java/com/diagbot/vo/data/ABasDoctorInfoVO.java

@@ -0,0 +1,38 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class ABasDoctorInfoVO {
+    /**
+     * HIS导入的医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院导入科室ID
+     */
+    private String deptId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 职称
+     */
+    private String professor;
+    /**
+     * 职业医师资格
+     */
+    private String occup;
+
+}

+ 134 - 0
src/main/java/com/diagbot/vo/data/ABehospitalInfoVO.java

@@ -0,0 +1,134 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ABehospitalInfoVO {
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别(男,女)
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 档案号
+     */
+    private String fileCode;
+
+    /**
+     * 质控类型
+     */
+    private Long qcTypeId;
+
+    /**
+     * 病区编码
+     */
+    private String wardCode;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 住院科室ID
+     */
+    private String behDeptId;
+
+    /**
+     * 住院科室名称
+     */
+    private String behDeptName;
+
+    /**
+     * 床位号
+     */
+    private String bedCode;
+
+    /**
+     * 床位名称
+     */
+    private String bedName;
+
+    /**
+     * 医保类别
+     */
+    private String insuranceName;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 入院时间
+     */
+    private String behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private String leaveHospitalDate;
+
+    /**
+     * 疾病ICD编码
+     */
+    private String diagnoseIcd;
+
+    /**
+     * 疾病名称
+     */
+    private String diagnose;
+
+    /**
+     * 住院医生ID
+     */
+    private String behDoctorId;
+
+    /**
+     * 住院医生姓名
+     */
+    private String behDoctorName;
+
+    /**
+     * 主治医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 主治医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 主任医生ID
+     */
+    private String directorDoctorId;
+
+    /**
+     * 主任医生姓名
+     */
+    private String directorDoctorName;
+
+}

+ 133 - 0
src/main/java/com/diagbot/vo/data/ADoctorAdviceVO.java

@@ -0,0 +1,133 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ADoctorAdviceVO {
+    /**
+     * 病人医嘱ID
+     */
+    private String doctorAdviceId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医生开单判别
+     */
+    private String orderDoctorName;
+
+    /**
+     * 医嘱频率判别
+     */
+    private String frequency;
+
+    /**
+     * 父类医嘱ID
+     */
+    private String parentTypeId;
+
+    /**
+     * 医嘱类型判别(嘱托长嘱、长期医嘱等)
+     */
+    private String doctorAdviceType;
+
+    /**
+     * 一次使用数量
+     */
+    private String usageNum;
+
+    /**
+     * 一次用量单位
+     */
+    private String usageUnit;
+
+    /**
+     * 医嘱单次剂量
+     */
+    private String dose;
+
+    /**
+     * 单次剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 给药方式
+     */
+    private String medModeType;
+
+    /**
+     * 医嘱频率
+     */
+    private String daFrequency;
+
+    /**
+     * 医嘱处理类型
+     */
+    private String daDealType;
+
+    /**
+     * 医嘱开始时间
+     */
+    private String daStartDate;
+
+    /**
+     * 医嘱项目名称
+     */
+    private String daItemName;
+
+    /**
+     * 医嘱状态判别
+     */
+    private String daStatus;
+
+    /**
+     * 医嘱结束时间
+     */
+    private String daStopDate;
+
+    /**
+     * 医嘱同组序号
+     */
+    private String daGroupNo;
+
+    /**
+     * 医嘱处方类型(检验、描述医嘱、膳食、西药、护理等)
+     */
+    private String daPrescriptionType;
+
+    /**
+     * 医嘱领药类型
+     */
+    private String daMedType;
+
+    /**
+     * 医生嘱托
+     */
+    private String doctorNotice;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 药品类型(0.普药 1.抗生素 2.激素)
+     */
+    private String medicineType;
+}

+ 41 - 0
src/main/java/com/diagbot/vo/data/AHomeDiagnoseVO.java

@@ -0,0 +1,41 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+@Data
+public class AHomeDiagnoseVO {
+    /**
+     * 病案首页ID
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 诊断序号
+     */
+    private String diagnoseOrderNo;
+
+    /**
+     * 诊断类别(主要诊断、其他诊断)
+     */
+    private String diagnoseType;
+
+    /**
+     * 诊断判别(主、次)
+     */
+    private String diagnoseTypeShort;
+
+    private String diagnoseName;
+
+    private String behospitalType;
+
+    private String leaveHospitalType;
+
+    private String pathologyDiagnose;
+
+    private String icdCode;
+}

+ 76 - 0
src/main/java/com/diagbot/vo/data/AHomeOperationVO.java

@@ -0,0 +1,76 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+@Data
+public class AHomeOperationVO {
+    /**
+     * 病案首页ID
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 手术序号
+     */
+    private String operationOrderNo;
+
+    /**
+     * 手术日期
+     */
+    private String operationDate;
+
+    /**
+     * 手术编码
+     */
+    private String operationCode;
+
+    /**
+     * 手术医生ID
+     */
+    private String operationDoctorId;
+
+    /**
+     * 一助医生ID
+     */
+    private String firstAssistantId;
+
+    /**
+     * 二助医生ID
+     */
+    private String secondAssistantId;
+
+    /**
+     * 切口等级
+     */
+    private String cutLevel;
+
+    /**
+     * 愈合等级
+     */
+    private String healingLevel;
+
+    /**
+     * 手术名称
+     */
+    private String operationName;
+
+    /**
+     * 手术级别
+     */
+    private String operationLevel;
+
+    /**
+     * 麻醉方式(全麻、局麻、静脉麻醉)
+     */
+    private String anaesthesiaName;
+
+    /**
+     * 拟手术名称
+     */
+    private String shamOperationName;
+}

+ 17 - 0
src/main/java/com/diagbot/vo/data/AHomePageIngVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.List;
+
+@Getter
+@Setter
+public class AHomePageIngVO {
+
+    @NotBlank(message = "对接模式类型编码不能为空")
+    private String dockModeType;//对接模式类型编码,1:页面模式,2:接口引擎模式
+
+    private List<AHomePageVO> homePages;
+}

+ 650 - 0
src/main/java/com/diagbot/vo/data/AHomePageVO.java

@@ -0,0 +1,650 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+public class AHomePageVO {
+    /**
+     * 病案首页编号
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院序号
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构id
+     */
+    private String hospitalCode;
+
+    /**
+     * 医疗机构名称
+     */
+    private String hospitalName;
+
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 医疗付费方式
+     */
+    private String payType;
+
+    /**
+     * 健康卡号
+     */
+    private String healthCard;
+
+    /**
+     * 住院次数
+     */
+    private String behospitalNum;
+
+    /**
+     * 病案号
+     */
+    private String fileCode;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 年龄单位
+     */
+    private String ageUnit;
+
+    /**
+     * 国籍
+     */
+    private String nationality;
+
+    /**
+     * 新生儿出生月数
+     */
+    private String newbornMonth;
+
+    /**
+     * 新生儿出生天数
+     */
+    private String newbornDay;
+
+    /**
+     * 新生儿出生体重
+     */
+    private String newbornWeight;
+
+    /**
+     * 新生儿入院体重
+     */
+    private String newbornBehospitalWeight;
+
+    /**
+     * 出生地
+     */
+    private String bornAddress;
+
+    /**
+     * 籍贯
+     */
+    private String bornPlace;
+
+    /**
+     * 民族
+     */
+    private String nation;
+
+    /**
+     * 身份证号
+     */
+    private String identityCardNo;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 婚姻
+     */
+    private String marriage;
+
+    /**
+     * 现住址
+     */
+    private String curAddress;
+
+    /**
+     * 现住址电话
+     */
+    private String curPhone;
+
+    /**
+     * 现住址邮编
+     */
+    private String curPostCode;
+
+    /**
+     * 户口地址
+     */
+    private String residenceAddress;
+
+    /**
+     * 户口地址邮编
+     */
+    private String residencePostCode;
+
+    /**
+     * 工作单位
+     */
+    private String workAddress;
+
+    /**
+     * 工作单位电话
+     */
+    private String workPhone;
+
+    /**
+     * 工作单位邮编
+     */
+    private String workPostCode;
+
+    /**
+     * 联系人姓名
+     */
+    private String contactName;
+
+    /**
+     * 联系人关系
+     */
+    private String contactRelation;
+
+    /**
+     * 联系人地址
+     */
+    private String contactAddress;
+
+    /**
+     * 联系人电话
+     */
+    private String contactPhone;
+
+    /**
+     * 入院途径
+     */
+    private String behospitalWay;
+
+    /**
+     * 入院时间
+     */
+    private String behospitalDate;
+
+    /**
+     * 入院科别
+     */
+    private String behospitalDept;
+
+    /**
+     * 入院病房
+     */
+    private String behospitalWard;
+
+    /**
+     * 入院床位序号
+     */
+    private String behospitalBedId;
+
+    /**
+     * 入院床位号码
+     */
+    private String behospitalBedCode;
+
+    /**
+     * 转科科别
+     */
+    private String changeDept;
+
+    /**
+     * 出院时间
+     */
+    private String leaveHospitalDate;
+
+    /**
+     * 出院科别
+     */
+    private String leaveHospitalDept;
+
+    /**
+     * 出院病房
+     */
+    private String leaveHospitalWard;
+
+    /**
+     * 出院床位序号
+     */
+    private String leaveHospitalBedId;
+
+    /**
+     * 出院床位号码
+     */
+    private String leaveHospitalBedCode;
+
+    /**
+     * 实际住院天数
+     */
+    private String behospitalDayNum;
+
+    /**
+     * 门急诊诊断
+     */
+    private String outpatientEmrDiagnose;
+
+    /**
+     * 门急诊诊断编码
+     */
+    private String outpatientEmrDiagnoseCode;
+
+    /**
+     * 损伤中毒因素
+     */
+    private String poisonFactor;
+
+    /**
+     * 损伤中毒因素编码
+     */
+    private String poisonFactorCode;
+
+    /**
+     * 病理诊断
+     */
+    private String pathologyDiagnose;
+
+    /**
+     * 病理诊断编码
+     */
+    private String pathologyDiagnoseCode;
+
+    /**
+     * 病理诊断编号
+     */
+    private String pathologyDiagnoseId;
+
+    /**
+     * 药物过敏
+     */
+    private String isMedAllergy;
+
+    /**
+     * 过敏药物
+     */
+    private String medAllergyName;
+
+    /**
+     * 死亡患者尸检
+     */
+    private String autopsy;
+
+    /**
+     * 血型
+     */
+    private String bloodType;
+
+    /**
+     * Rh
+     */
+    private String rh;
+
+    /**
+     * 科主任
+     */
+    private String deptDirector;
+
+    /**
+     * 主任医师
+     */
+    private String directorDoctor;
+
+    /**
+     * 主治医师
+     */
+    private String attendingDoctor;
+
+    /**
+     * 住院医师
+     */
+    private String behospitalDoctor;
+
+    /**
+     * 责任护士
+     */
+    private String responseNurse;
+
+    /**
+     * 进修医师
+     */
+    private String studyDoctor;
+
+    /**
+     * 实习医师
+     */
+    private String practiceDoctor;
+
+    /**
+     * 编码员
+     */
+    private String encodeMan;
+
+    /**
+     * 病案质量
+     */
+    private String homePageQuality;
+
+    /**
+     * 质控医师
+     */
+    private String qcDoctor;
+
+    /**
+     * 质控护士
+     */
+    private String qcNurse;
+
+    /**
+     * 质控日期
+     */
+    private String qcDate;
+
+    /**
+     * 离院方式
+     */
+    private String leaveHospitalType;
+
+    /**
+     * 接收机构名称
+     */
+    private String acceptOrgCode;
+
+    /**
+     * 31天内再住院计划
+     */
+    private String againBehospitalPlan;
+
+    /**
+     * 再住院目的
+     */
+    private String againBehospitalGoal;
+
+    /**
+     * 颅脑损伤患者昏迷前天数
+     */
+    private String tbiBeforeDay;
+
+    /**
+     * 颅脑损伤患者昏迷前小时
+     */
+    private String tbiBeforeHour;
+
+    /**
+     * 颅脑损伤患者昏迷前分钟
+     */
+    private String tbiBeforeMinute;
+
+    /**
+     * 颅脑损伤患者昏迷后天数
+     */
+    private String tbiAfterDay;
+
+    /**
+     * 颅脑损伤患者昏迷后小时
+     */
+    private String tbiAfterHour;
+
+    /**
+     * 颅脑损伤患者昏迷后分钟
+     */
+    private String tbiAfterMinute;
+
+    /**
+     * 总费用
+     */
+    private String totalFee;
+
+    /**
+     * 自付金额
+     */
+    private String ownFee;
+
+    /**
+     * 一般医疗服务费
+     */
+    private String generalFee;
+
+    /**
+     * 一般治疗服务费
+     */
+    private String serviceFee;
+
+    /**
+     * 护理费
+     */
+    private String nurseFee;
+
+    /**
+     * 其他费用
+     */
+    private String otherFee;
+
+    /**
+     * 病理诊断费
+     */
+    private String pathologyFee;
+
+    /**
+     * 实验室诊断费
+     */
+    private String labFee;
+
+    /**
+     * 影像学诊断费
+     */
+    private String pacsFee;
+
+    /**
+     * 临床诊断项目费
+     */
+    private String clinicDiagnoseFee;
+
+    /**
+     * 非手术治疗项目费
+     */
+    private String notOperationFee;
+
+    /**
+     * 临床物理治疗费
+     */
+    private String clinicPhysicFee;
+
+    /**
+     * 手术治疗费
+     */
+    private String operationTreatFee;
+
+    /**
+     * 麻醉费
+     */
+    private String anaesthesiaFee;
+
+    /**
+     * 手术费
+     */
+    private String operationFee;
+
+    /**
+     * 康复类
+     */
+    private String healthTypeFee;
+
+    /**
+     * 中医治疗费
+     */
+    private String chnTreatFee;
+
+    /**
+     * 西药费
+     */
+    private String westernMedFee;
+
+    /**
+     * 抗菌药物费用
+     */
+    private String antibiosisFee;
+
+    /**
+     * 中成药费
+     */
+    private String chnMedFee;
+
+    /**
+     * 中草药费
+     */
+    private String chnHerbFee;
+
+    /**
+     * 血费
+     */
+    private String bloodFee;
+
+    /**
+     * 白蛋白类制品费
+     */
+    private String albumenFee;
+
+    /**
+     * 球蛋白类制品费
+     */
+    private String globulinFee;
+
+    /**
+     * 凝血因子类制品费
+     */
+    private String bloodFactorFee;
+
+    /**
+     * 细胞因子类制品费
+     */
+    private String cellFactorFee;
+
+    /**
+     * 检查用一次性医用材料费
+     */
+    private String checkMaterialFee;
+
+    /**
+     * 治疗用一次性医用材料费
+     */
+    private String treatMaterialFee;
+
+    /**
+     * 手术用一次性医用材料费
+     */
+    private String operationMaterialFee;
+
+    /**
+     * 其他类其他费
+     */
+    private String otherTypeFee;
+
+    /**
+     * 单病种管理
+     */
+    private String singleDiagManage;
+
+    /**
+     * 临床路径管理
+     */
+    private String clinicPathwayManage;
+
+    /**
+     * 门诊与住院
+     */
+    private String isOutpatientBehospital;
+
+    /**
+     * 入院与出院
+     */
+    private String isLeaveBehospital;
+
+    /**
+     * 术前与术后
+     */
+    private String isOperationBeforeAfter;
+
+    /**
+     * 临床与病理
+     */
+    private String isClinicPathology;
+
+    /**
+     * 放射与病理
+     */
+    private String isRadiatePathology;
+
+    /**
+     * 病人抢救次数
+     */
+    private String rescueNum;
+
+    /**
+     * 病人抢救成功次数
+     */
+    private String rescueSuccessNum;
+
+    /**
+     * 是否为自动出院
+     */
+    private String isAutoLeavehospital;
+
+    /**
+     * 转归情况
+     */
+    private String returnToType;
+
+    /**
+     * 出院诊断
+     */
+    private List<AHomeDiagnoseVO> leaveDiags;
+
+    /**
+     * 手术情况
+     */
+    private List<AHomeOperationVO> operations;
+}

+ 93 - 0
src/main/java/com/diagbot/vo/data/AMedCrisisVO.java

@@ -0,0 +1,93 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+public class AMedCrisisVO {
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 记录类型
+     */
+    private String recType;
+
+    /**
+     * 危急值ID
+     */
+    private String crisisId;
+
+    /**
+     * 危急值名称
+     */
+    private String crisisName;
+
+    /**
+     * 开单科室ID
+     */
+    private String deptId;
+
+    /**
+     * 开单科室名称
+     */
+    private String deptName;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 危急结果值
+     */
+    private String crisisValue;
+
+    /**
+     * 危急值描述
+     */
+    private String crisisDesc;
+
+    /**
+     * 危急值状态
+     */
+    private String crisisStatus;
+
+    /**
+     * 参考上限
+     */
+    private String crisisTopValue;
+
+    /**
+     * 参考下限
+     */
+    private String crisisLowerValue;
+
+    /**
+     * 送检时间
+     */
+    private String sendDate;
+
+    /**
+     * 报告时间
+     */
+    private String repDate;
+
+}

+ 37 - 0
src/main/java/com/diagbot/vo/data/AMedicalRecordContentVO.java

@@ -0,0 +1,37 @@
+package com.diagbot.vo.data;
+
+import java.sql.Blob;
+import lombok.Data;
+
+@Data
+public class AMedicalRecordContentVO {
+    /**
+     * 病历ID
+     */
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 文书内容(blob)
+     */
+    private Blob contentBlob;
+
+    /**
+     * 病历文本(文本)
+     */
+    private String contentText;
+
+    /**
+     * html文本信息
+     */
+    private String htmlText;
+
+    /**
+     * xml文本信息
+     */
+    private String xmlText;
+}

+ 36 - 0
src/main/java/com/diagbot/vo/data/AMedicalRecordTypeVO.java

@@ -0,0 +1,36 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+@Data
+public class AMedicalRecordTypeVO {
+	/**
+     * 类别ID
+     */
+    private String typeId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 类别名称
+     */
+    private String typeName;
+
+    /**
+     * 上级类别
+     */
+    private String parentTypeId;
+
+    /**
+     * 服务对象(全院、科室、个人)
+     */
+    private String objName;
+
+    /**
+     * 拼音
+     */
+    private String spell;
+}

+ 48 - 0
src/main/java/com/diagbot/vo/data/AMedicalRecordVO.java

@@ -0,0 +1,48 @@
+package com.diagbot.vo.data;
+
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AMedicalRecordVO {
+
+	private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 病历类别编号
+     */
+    private String recTypeId;
+
+    /**
+     * 病历日期
+     */
+    private String recDate;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+
+    /**
+     * 病历内容
+     */
+    private List<AMedicalRecordContentVO> contents;
+}

+ 16 - 0
src/main/java/com/diagbot/vo/data/AMrContentVO.java

@@ -0,0 +1,16 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.List;
+
+@Getter
+@Setter
+public class AMrContentVO {
+    @NotBlank(message = "对接模式类型编码不能为空")
+    private String dockModeType;//对接模式类型编码,1:页面模式,2:接口引擎模式
+
+    private List<AMedicalRecordVO> records;
+}

+ 151 - 0
src/main/java/com/diagbot/web/DataController.java

@@ -0,0 +1,151 @@
+package com.diagbot.web;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.*;
+import com.diagbot.facade.data.*;
+import com.diagbot.vo.data.*;
+import io.swagger.annotations.ApiOperation;
+import jdk.nashorn.internal.ir.annotations.Ignore;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+import io.swagger.annotations.Api;
+
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/qc/data")
+@Api(value = "对接接口API", tags = { "对接接口API" })
+public class DataController {
+
+    @Autowired
+    private ABasDoctorInfoFacade aBasDoctorInfoFacade;
+
+    @Autowired
+    private ABasDeptInfoFacade aBasDeptInfoFacade;
+
+    @Autowired
+    private AMedRecordTypeFacade aMedRecordTypeFacade;
+
+    @Autowired
+    private ABehospitalInfoFacade aBehospitalInfoFacade;
+
+    @Autowired
+    private ADoctorAdviceFacade aDoctorAdviceFacade;
+
+    @Autowired
+    private AHomePageFacade aHomePageFacade;
+
+    @Autowired
+    private AHomeDiagnoseInfoFacade aHomeDiagnoseInfoFacade;
+
+    @Autowired
+    private AHomeOperationInfoFacade aHomeOperationInfoFacade;
+
+    @Autowired
+    private AMedCrisisFacade aMedCrisisFacade;
+
+    @Autowired
+    private AMedicalRecordFacade aMedicalRecordFacade;
+
+    @Autowired
+    private AMedicalRecordContentFacade aMedicalRecordContentFacade;
+
+    @ApiOperation(value = "数据引擎-获取医院所有在职医生的基本信息")
+    @PostMapping("/sendDoctorInfos")
+    @SysLogger("sendDoctorInfos")
+    public RespDTO<List<ABasDoctorInfoDTO>> sendDoctorInfos(@RequestBody List<ABasDoctorInfoVO> list){
+        return aBasDoctorInfoFacade.executeDoctor(list);
+    }
+
+    @ApiOperation(value = "数据引擎-获取医院所有有效科室的基本信息")
+    @PostMapping("/sendDeptInfos")
+    @SysLogger("sendDeptInfos")
+    public RespDTO<List<ABasDeptInfoDTO>> sendDeptInfos(@RequestBody List<ABasDeptInfoVO> list){
+        return aBasDeptInfoFacade.executeDept(list);
+    }
+
+    @ApiOperation(value = "数据引擎-获取医院所有文书模板基本信息")
+    @PostMapping("/sendRecordTypes")
+    @SysLogger("sendRecordTypes")
+    public RespDTO<List<AMedicalRecordTypeDTO>> sendRecordTypes(@RequestBody List<AMedicalRecordTypeVO> list){
+        return aMedRecordTypeFacade.executeMRType(list);
+    }
+
+    @ApiOperation(value = "运行质控-评分-文书信息")
+    @PostMapping("/sendMrRecordIng")
+    @SysLogger("sendMrRecordIng")
+    public RespDTO<Map<String, Object>> sendMrRecordIng(@Valid @RequestBody AMrContentVO aMrContentVO){
+        return aMedicalRecordFacade.executeMrRecordIng(aMrContentVO);
+    }
+
+    @ApiOperation(value = "终末质控-文书信息")
+    @PostMapping("/sendMrRecord")
+    @SysLogger("sendMrRecord")
+    public RespDTO<List<AMedicalRecordDTO>> sendMrRecord(@RequestBody List<AMedicalRecordVO> list){
+        return aMedicalRecordFacade.executeMrRecord(list);
+    }
+
+    @ApiOperation(value = "终末质控-文书详情")
+    @PostMapping("/sendMrContent")
+    @SysLogger("sendMrContent")
+    public RespDTO<List<AMedicalRecordContentDTO>> sendMrContent(@RequestBody List<AMedicalRecordContentVO> list){
+        return aMedicalRecordContentFacade.executeMrRecordContent(list);
+    }
+
+    @ApiOperation(value = "数据引擎-获取医院病人住院记录信息")
+    @PostMapping("/sendPatientInfo")
+    @SysLogger("sendPatientInfo")
+    public RespDTO<List<ABehospitalInfoDTO>> sendPatientInfo(@RequestBody List<ABehospitalInfoVO> list){
+        return aBehospitalInfoFacade.executeBehospital(list);
+    }
+
+    @ApiOperation(value = "数据引擎-获取医院医生医嘱信息")
+    @PostMapping("/sendDoctorAdvice")
+    @SysLogger("sendDoctorAdvice")
+    public RespDTO<List<ADoctorAdviceDTO>> sendDoctorAdvice(@RequestBody List<ADoctorAdviceVO> list){
+        return aDoctorAdviceFacade.executeDoctorAdvice(list);
+    }
+
+    @ApiOperation(value = "运行质控-获取病案首页")
+    @PostMapping("/sendHomePageIng")
+    @SysLogger("sendHomePageIng")
+    public RespDTO<Map<String, Object>> sendHomePageIng(@Valid @RequestBody AHomePageIngVO aHomePageIngVO){
+        return aHomePageFacade.executeHomePageIng(aHomePageIngVO);
+    }
+
+    @ApiOperation(value = "终末质控-获取病案首页")
+    @PostMapping("/sendHomePage")
+    @SysLogger("sendHomePage")
+    public RespDTO<List<AHomePageDTO>> sendHomePage(@RequestBody List<AHomePageVO> list){
+        return aHomePageFacade.executeHomePage(list);
+    }
+
+    @ApiOperation(value = "终末质控-获取病案首页诊断")
+    @PostMapping("/sendHomeDiagnose")
+    @SysLogger("sendHomeDiagnose")
+    public RespDTO<List<AHomeDiagnoseDTO>> sendHomeDiagnose(@RequestBody List<AHomeDiagnoseVO> list){
+        return aHomeDiagnoseInfoFacade.executeHomeDiagnose(list);
+    }
+
+    @ApiOperation(value = "终末质控-获取病案首页手术")
+    @PostMapping("/sendHomeOperation")
+    @SysLogger("sendHomeOperation")
+    public RespDTO<List<AHomeOperationDTO>> sendHomeOperation(@RequestBody List<AHomeOperationVO> list){
+        return RespDTO.onSuc(aHomeOperationInfoFacade.executeHomeOperation(list));
+    }
+
+    @ApiOperation(value = "数据引擎-获取危急值")
+    @PostMapping("/sendCrisis")
+    @SysLogger("sendCrisis")
+    public RespDTO<List<AMedCrisisDTO>> sendCrisis(@RequestBody List<AMedCrisisVO> list){
+        return aMedCrisisFacade.executeMedCrisis(list);
+    }
+
+}

+ 59 - 0
src/main/java/com/diagbot/web/SysUserPagesetController.java

@@ -0,0 +1,59 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysUserPagesetDTO;
+import com.diagbot.facade.SysUserPagesetFacade;
+import com.diagbot.vo.SysUserPagesetQueryVO;
+import com.diagbot.vo.SysUserPagesetSaveVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * <p>
+ * 用户页面设定表 前端控制器
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-06-12
+ */
+@RestController
+@Api(value = "用户页面设置API", tags = { "用户页面设置API" })
+@RequestMapping("/sys/user/pageset")
+@SuppressWarnings("unchecked")
+public class SysUserPagesetController {
+
+    @Autowired
+    private SysUserPagesetFacade sysUserPagesetFacade;
+
+    @ApiOperation(value = "获取用户对应页面设置[by:gaodm]",
+            notes = "pageType:页面分组,必填<br>")
+    @PostMapping("/getPageSet")
+    @SysLogger("getPageSet")
+    public RespDTO<List<SysUserPagesetDTO>> getPageSet(@RequestBody @Valid SysUserPagesetQueryVO sysUserPagesetQueryVO) {
+        return RespDTO.onSuc(sysUserPagesetFacade.getPageSet(sysUserPagesetQueryVO));
+    }
+
+
+    @ApiOperation(value = "保存用户对应页面设置[by:gaodm]",
+            notes = "pageType:页面分组,必填<br>" +
+                    "name: 列名,必填<br>" +
+                    "val: 列名值,必填<br>" +
+                    "status:  是否启用(0:停用,1:启用),必填<br>" +
+                    "orderNo: 排序号,必填<br>")
+    @PostMapping("/savePageSet")
+    @SysLogger("savePageSet")
+    public RespDTO<Boolean> savePageSet(@RequestBody @Valid SysUserPagesetSaveVO sysUserPagesetSaveVO) {
+        return RespDTO.onSuc(sysUserPagesetFacade.savePageSet(sysUserPagesetSaveVO));
+    }
+}

+ 24 - 0
src/main/resources/jdbc.properties

@@ -0,0 +1,24 @@
+#\u6570\u636e\u5e93\u914d\u7f6e
+#jdbc.driverClassName=com.mysql.jdbc.Driver
+#jdbc.url=jdbc:mysql://127.0.0.1:3306/diagbot-app?useUnicode=true&characterEncoding=UTF-8
+#jdbc.username=root
+#jdbc.password=root
+
+#jdbc.driverClassName=oracle.jdbc.OracleDriver
+#jdbc.url=jdbc:oracle:thin:@192.168.2.246:1521/ORCL
+#jdbc.username=ETRACKMRQC
+#jdbc.password=ETRACKMRQC
+
+jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
+jdbc.url=jdbc:sqlserver://192.168.100.39\\tzmhemr;DatabaseName=bigemr
+jdbc.username=zjlt
+jdbc.password=zjlt@2020
+
+#\u6570\u636e\u670d\u52a1\u6a21\u5f0f
+remote.address.ver=http://192.18.101.207:2030/index.html
+remote.address.hor=http://192.18.101.207:2030/indexHorizontal.html
+
+process.qc.url=http://192.168.100.157:1489/index.html
+
+#his\u65b9\u60a3\u8005\u63a5\u53e3\u5730\u5740
+his.patient.url=

+ 30 - 0
src/main/resources/mapper/BasDeptInfoMapper.xml

@@ -76,4 +76,34 @@
             AND a.hospital_id = #{hospitalId}
         </if>
     </select>
+
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update bas_dept_info
+            <set>
+                <if test="item.parentDeptId != null">
+                    parent_dept_id = #{item.parentDeptId},
+                </if>
+                <if test="item.deptName != null">
+                    dept_name = #{item.deptName},
+                </if>
+                <if test="item.deptType != null">
+                    dept_type = #{item.deptType},
+                </if>
+                <if test="item.spell != null">
+                    spell = #{item.spell},
+                </if>
+                <if test="item.station != null">
+                    station = #{item.station},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where dept_id = #{item.deptId} and hospital_id = #{item.hospitalId}
+        </foreach>
+    </update>
 </mapper>

+ 47 - 0
src/main/resources/mapper/BasDoctorInfoMapper.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.BasDoctorInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.BasDoctorInfo">
+        <id column="doctor_id" property="doctorId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="dept_id" property="deptId" />
+        <result column="name" property="name" />
+        <result column="professor" property="professor" />
+        <result column="occup" property="occup" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+    </resultMap>
+
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update bas_doctor_info
+            <set>
+                <if test="item.deptId != null">
+                    dept_id = #{item.deptId},
+                </if>
+                <if test="item.name != null">
+                    name = #{item.name},
+                </if>
+                <if test="item.professor != null">
+                    professor = #{item.professor},
+                </if>
+                <if test="item.occup != null">
+                    occup = #{item.occup},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where doctor_id = #{item.doctorId} and hospital_id = #{item.hospitalId}
+        </foreach>
+    </update>
+
+</mapper>

+ 0 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels