瀏覽代碼

Merge remote-tracking branch 'origin/his/commonNew' into his/csxy3

# Conflicts:
#	src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java
#	src/main/java/com/diagbot/facade/data/AMedicalRecordContentFacade.java
#	src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java
#	src/main/java/com/diagbot/web/DataController.java
#	src/main/resources/application-local.yml
#	src/main/resources/application-test.yml
shiyue 3 年之前
父節點
當前提交
da42d9d8dd
共有 100 個文件被更改,包括 6763 次插入213 次删除
  1. 174 0
      doc/037.20211117_2.1.4/qc_initv2.1.4.sql
  2. 9 0
      doc/038.20211129_2.1.3/qc_initv2.1.3.sql
  3. 14 1
      pom.xml
  4. 2 1
      src/main/java/com/diagbot/MrqcSysApplication.java
  5. 262 0
      src/main/java/com/diagbot/aggregate/HisDataSupplementAggregate.java
  6. 15 0
      src/main/java/com/diagbot/annotation/MrqcLog.java
  7. 81 0
      src/main/java/com/diagbot/aop/MrqcLogAspect.java
  8. 37 0
      src/main/java/com/diagbot/config/AccessDeniedExceptionPoint.java
  9. 32 0
      src/main/java/com/diagbot/config/AuthExceptionEntryPoint.java
  10. 90 0
      src/main/java/com/diagbot/config/AuthenticationExceptionHandler.java
  11. 223 0
      src/main/java/com/diagbot/config/MyJwtTokenStore.java
  12. 14 2
      src/main/java/com/diagbot/config/OAuth2Configurer.java
  13. 32 3
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  14. 63 4
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  15. 13 1
      src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java
  16. 94 0
      src/main/java/com/diagbot/dto/BehospitalAnalysisDTO.java
  17. 72 0
      src/main/java/com/diagbot/dto/BehospitalCodeDetail.java
  18. 20 0
      src/main/java/com/diagbot/dto/BehospitalCodeInfo.java
  19. 58 37
      src/main/java/com/diagbot/dto/BehospitalInfoDTO.java
  20. 26 0
      src/main/java/com/diagbot/dto/EntryDefectImprove.java
  21. 24 0
      src/main/java/com/diagbot/dto/EntryDefectImproveInner.java
  22. 25 0
      src/main/java/com/diagbot/dto/EntryDefectImproveInnerDoctor.java
  23. 27 0
      src/main/java/com/diagbot/dto/EntryDefectImproveInnerExport.java
  24. 77 0
      src/main/java/com/diagbot/dto/GetEntryDefectImproveDTO.java
  25. 85 0
      src/main/java/com/diagbot/dto/GetEntryDefectImproveDeptDTO.java
  26. 35 0
      src/main/java/com/diagbot/dto/GetEntryInfoDTO.java
  27. 40 0
      src/main/java/com/diagbot/dto/GetQcClickDTO.java
  28. 52 0
      src/main/java/com/diagbot/dto/GetQcClickInnerPageDTO.java
  29. 20 0
      src/main/java/com/diagbot/dto/QcResultDetailInfo.java
  30. 161 0
      src/main/java/com/diagbot/entity/LogInfo.java
  31. 7 2
      src/main/java/com/diagbot/entity/MedClickInfo.java
  32. 6 0
      src/main/java/com/diagbot/entity/MedQcresultCases.java
  33. 61 0
      src/main/java/com/diagbot/entity/MedQcresultClick.java
  34. 4 0
      src/main/java/com/diagbot/entity/QcresultDetail.java
  35. 340 0
      src/main/java/com/diagbot/entity/his/HisBehospitalInfo.java
  36. 303 0
      src/main/java/com/diagbot/entity/his/HisDoctorAdvice.java
  37. 162 0
      src/main/java/com/diagbot/entity/his/HisHomeDiagnoseInfo.java
  38. 219 0
      src/main/java/com/diagbot/entity/his/HisHomeOperationInfo.java
  39. 1568 0
      src/main/java/com/diagbot/entity/his/HisHomePage.java
  40. 105 0
      src/main/java/com/diagbot/entity/his/HisMedicalRecord.java
  41. 86 0
      src/main/java/com/diagbot/entity/his/HisMedicalRecordContent.java
  42. 3 0
      src/main/java/com/diagbot/exception/ServiceErrorCode.java
  43. 15 1
      src/main/java/com/diagbot/facade/BasDeptInfoFacade.java
  44. 93 25
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java
  45. 215 0
      src/main/java/com/diagbot/facade/DataAnalysisDeptFacade.java
  46. 758 0
      src/main/java/com/diagbot/facade/DataAnalysisFacade.java
  47. 88 28
      src/main/java/com/diagbot/facade/QcresultInfoFacade.java
  48. 9 0
      src/main/java/com/diagbot/facade/SysDictionaryFacade.java
  49. 6 0
      src/main/java/com/diagbot/facade/SysUserFacade.java
  50. 2 0
      src/main/java/com/diagbot/facade/data/ABasDoctorInfoFacade.java
  51. 13 28
      src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java
  52. 4 17
      src/main/java/com/diagbot/facade/data/ADoctorAdviceFacade.java
  53. 1 11
      src/main/java/com/diagbot/facade/data/AHomeDiagnoseInfoFacade.java
  54. 1 13
      src/main/java/com/diagbot/facade/data/AHomeOperationInfoFacade.java
  55. 1 20
      src/main/java/com/diagbot/facade/data/AHomePageFacade.java
  56. 11 17
      src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java
  57. 8 0
      src/main/java/com/diagbot/facade/data/LogInfoFacade.java
  58. 72 0
      src/main/java/com/diagbot/facade/his/HisBehospitalInfoFacade.java
  59. 28 0
      src/main/java/com/diagbot/facade/his/HisDoctorAdviceFacade.java
  60. 29 0
      src/main/java/com/diagbot/facade/his/HisHomeDiagnoseInfoFacade.java
  61. 28 0
      src/main/java/com/diagbot/facade/his/HisHomeOperationInfoFacade.java
  62. 27 0
      src/main/java/com/diagbot/facade/his/HisHomePageFacade.java
  63. 26 0
      src/main/java/com/diagbot/facade/his/HisMedicalRecordContentFacade.java
  64. 27 0
      src/main/java/com/diagbot/facade/his/HisMedicalRecordFacade.java
  65. 1 0
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  66. 16 0
      src/main/java/com/diagbot/mapper/HisBehospitalInfoMapper.java
  67. 15 0
      src/main/java/com/diagbot/mapper/HisDoctorAdviceMapper.java
  68. 16 0
      src/main/java/com/diagbot/mapper/HisHomeDiagnoseInfoMapper.java
  69. 16 0
      src/main/java/com/diagbot/mapper/HisHomeOperationInfoMapper.java
  70. 15 0
      src/main/java/com/diagbot/mapper/HisHomePageMapper.java
  71. 16 0
      src/main/java/com/diagbot/mapper/HisMedicalRecordContentMapper.java
  72. 16 0
      src/main/java/com/diagbot/mapper/HisMedicalRecordMapper.java
  73. 16 0
      src/main/java/com/diagbot/mapper/LogInfoMapper.java
  74. 22 1
      src/main/java/com/diagbot/mapper/MedClickInfoMapper.java
  75. 16 0
      src/main/java/com/diagbot/mapper/MedQcresultClickMapper.java
  76. 23 0
      src/main/java/com/diagbot/rabbit/MyProcessor.java
  77. 29 0
      src/main/java/com/diagbot/rabbit/MyReceiver.java
  78. 28 0
      src/main/java/com/diagbot/rabbit/MySender.java
  79. 7 0
      src/main/java/com/diagbot/service/HisMedicalRecordContentService.java
  80. 16 0
      src/main/java/com/diagbot/service/LogInfoService.java
  81. 16 0
      src/main/java/com/diagbot/service/MedQcresultClickService.java
  82. 8 0
      src/main/java/com/diagbot/service/SysTokenService.java
  83. 9 0
      src/main/java/com/diagbot/service/his/HisBehospitalInfoService.java
  84. 7 0
      src/main/java/com/diagbot/service/his/HisDoctorAdviceService.java
  85. 16 0
      src/main/java/com/diagbot/service/his/HisHomeDiagnoseInfoService.java
  86. 16 0
      src/main/java/com/diagbot/service/his/HisHomeOperationInfoService.java
  87. 16 0
      src/main/java/com/diagbot/service/his/HisHomePageService.java
  88. 7 0
      src/main/java/com/diagbot/service/his/HisMedicalRecordService.java
  89. 20 0
      src/main/java/com/diagbot/service/impl/LogInfoServiceImpl.java
  90. 20 0
      src/main/java/com/diagbot/service/impl/MedQcresultClickServiceImpl.java
  91. 54 0
      src/main/java/com/diagbot/service/impl/SysTokenServiceImpl.java
  92. 13 0
      src/main/java/com/diagbot/service/impl/his/HisBehospitalInfoServiceImpl.java
  93. 13 0
      src/main/java/com/diagbot/service/impl/his/HisDoctorAdviceServiceImpl.java
  94. 13 0
      src/main/java/com/diagbot/service/impl/his/HisHomeDiagnoseInfoServiceImpl.java
  95. 13 0
      src/main/java/com/diagbot/service/impl/his/HisHomeOperationInfoServiceImpl.java
  96. 24 0
      src/main/java/com/diagbot/service/impl/his/HisHomePageServiceImpl.java
  97. 13 0
      src/main/java/com/diagbot/service/impl/his/HisMedicalRecordContentServiceImpl.java
  98. 13 0
      src/main/java/com/diagbot/service/impl/his/HisMedicalRecordServiceImpl.java
  99. 1 1
      src/main/java/com/diagbot/task/BehospitalInfoTask.java
  100. 0 0
      src/main/java/com/diagbot/task/DoctorAdviceTask.java

+ 174 - 0
doc/037.20211117_2.1.4/qc_initv2.1.4.sql

@@ -0,0 +1,174 @@
+
+use `qc`;
+-- 执行前请看注意事项!
+-- 此脚本为通版脚本,均执行病历doctorId、doctorName回查 @hospitalId =**:需要更新的医院hospitalId在下面调整即可SET @hospitalId =**
+
+-- 如果其它医院不使用此次版本的数据分析报表,则需要手动到关闭数据分析报表
+SET @hospitalId =35;
+ UPDATE med_behospital_info a,
+ (
+	SELECT
+		doctor_id,
+		name
+		NAME
+	FROM
+		bas_doctor_info b
+	WHERE
+		b.hospital_id = @hospitalId
+	AND b.is_deleted = 'N'
+) c
+SET a.doctor_name = c. NAME
+WHERE
+	a.doctor_id = c.doctor_id
+AND a.hospital_id = @hospitalId
+AND (a.doctor_name is null or a.doctor_name = '' or a.doctor_name ='-' or a.doctor_name ='—' or LENGTH(a.doctor_name)>64);
+
+-- med_behospital_info病历doctorId回查
+UPDATE med_behospital_info a,
+ (
+	SELECT
+		doctor_id,
+		NAME
+	FROM
+		bas_doctor_info b
+	WHERE
+		b.hospital_id = @hospitalId
+	AND b.is_deleted = 'N'
+	GROUP BY
+		b. NAME
+	HAVING
+		count(b.doctor_id) = 1
+) c
+SET a.doctor_id = c.doctor_id
+WHERE
+	a.doctor_name = c.NAME
+AND a.hospital_id = @hospitalId
+AND (a.doctor_id is null or a.doctor_id = '' or a.doctor_id ='-' or a.doctor_id ='—' or LENGTH(a.doctor_id)>64);
+
+
+-- 对空数据初始化
+UPDATE med_behospital_info a set a.doctor_name = '-' where (a.doctor_name is null or a.doctor_name = '') AND a.hospital_id = @hospitalId;
+UPDATE med_behospital_info a set a.doctor_id = '-' where (a.doctor_id is null or a.doctor_id = '') AND a.hospital_id = @hospitalId;
+
+
+DROP TABLE IF EXISTS `med_click_info`;
+CREATE TABLE `med_click_info` (
+  `id` int(20) NOT NULL AUTO_INCREMENT,
+  `hospital_id` tinyint(5) DEFAULT '0' COMMENT '医院ID',
+  `dept_id` varchar(16) DEFAULT NULL COMMENT '科室ID',
+  `dept_name` varchar(64) DEFAULT NULL COMMENT '科室名称',
+  `doctor_id` varchar(16) DEFAULT NULL COMMENT '医生ID',
+  `doctor_name` varchar(64) DEFAULT NULL COMMENT '医生姓名',
+  `opt_type` tinyint(1) DEFAULT '1' COMMENT '0-单模块质控 1-全病历质控',
+  `qcresult_info_id` int(16) DEFAULT NULL COMMENT '评分结果id',
+  `behospital_code` varchar(16) DEFAULT NULL COMMENT '病人住院ID',
+  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT ' 记录创建时间',
+  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT ' 记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20) DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  PRIMARY KEY (`id`),
+  KEY `idx_all` (`hospital_id`,`behospital_code`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=62313 DEFAULT CHARSET=utf8 COMMENT='临床医生点击质控病历次数基本表';
+
+DROP TABLE IF EXISTS `med_qcresult_click`;
+CREATE TABLE `med_qcresult_click` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
+  `behospital_code` varchar(16) NOT NULL COMMENT '病人住院ID',
+  `dept_id` varchar(16) DEFAULT NULL COMMENT '住院科室ID',
+  `dept_name` varchar(64) DEFAULT NULL COMMENT '住院科室名称',
+  `qcresult_info_id` bigint(20) NOT NULL COMMENT '评分结果id',
+  `cases_entry_ids` varchar(1024) DEFAULT '0' COMMENT '触发埋点病历质控缺陷id集',
+  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT ' 记录创建时间',
+  PRIMARY KEY (`id`),
+  KEY `idx_all` (`hospital_id`,`behospital_code`)
+) ENGINE=InnoDB AUTO_INCREMENT=8587 DEFAULT CHARSET=utf8 COMMENT='全病历质控、单模块质控(触发埋点)缺陷详情';
+
+
+
+/**
+med_qcresult_detail表新增评分结果主表id字段
+ */
+ALTER TABLE `med_qcresult_detail` ADD COLUMN qcresult_info_id BIGINT (20) DEFAULT NULL COMMENT '评分结果id' AFTER `behospital_code`;
+
+/**
+med_qcresult_cases表新增评分结果主表id字段
+ */
+ALTER TABLE `med_qcresult_cases` ADD COLUMN qcresult_info_id BIGINT (20) DEFAULT NULL COMMENT '评分结果id' AFTER `behospital_code`;
+
+-- 全院
+SET @id =69;
+INSERT INTO `sys_menu` ( `id`,`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES (@id,'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '数据分析', '-1', 'YH-SJFX', '1', '1', '12', '用户-数据分析');
+
+
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '临床质控使用统计', @id , 'YH-ZKK-LCZKSYTJ', '1', '1', '1', '用户-质控科-临床质控使用统计');
+SET @idSec =@@identity;
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计', @id , 'YH-ZKK-TMQXGSTJ', '1', '1', '2', '用户-质控科-条目缺陷改善统计');
+SET @idThr =@@identity;
+
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @id, NULL);
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @id, NULL);
+
+
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idSec, NULL);
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @idSec, NULL);
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idThr, NULL);
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @idThr, NULL);
+
+
+
+INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '临床质控使用统计', '', '/qc/analysis/getQcClick', 'ALL', '临床质控使用统计', NULL);
+SET @idperFir =@@identity;
+INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '临床质控使用统计(内页)', '', '/qc/analysis/getQcClickInnerPage', 'ALL', '临床质控使用统计(内页)', NULL);
+SET @idperSec =@@identity;
+INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计', '', '/qc/analysis/getEntryDefectImprove', 'ALL', '条目缺陷改善统计', NULL);
+SET @idperThr =@@identity;
+INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计(内页)', '', '/qc/analysis/getEntryDefectImproveInner', 'ALL', '条目缺陷改善统计(内页)-病历列表', NULL);
+SET @idperFou =@@identity;
+
+
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idperFir, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idperSec, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idperThr, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idperFou, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @idperFir, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @idperSec, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @idperThr, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @idperFou, NULL);
+
+-- INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @idSec, @idperFir, NULL, '临床质控使用统计');
+-- INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @idSec, @idperSec, NULL, '临床质控使用统计(内页)');
+-- INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @idThr, @idperThr, NULL, '条目缺陷改善统计');
+-- INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @idThr, @idperFou, NULL, '条目缺陷改善统计(内页)');
+
+
+-- 科室
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '数据分析(科室)', '-1', 'YH-SJFXKS', '1', '1', '13', '用户-数据分析(科室)');
+SET @idks =@@identity;
+
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计', @idks , 'YH-KSZR-TMQXGSTJ', '1', '1', '2', '用户-质控科-条目缺陷改善统计(科室)');
+SET @idksThr =@@identity;
+
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idks, NULL);
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', @idks, NULL);
+
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idksThr, NULL);
+INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', @idksThr, NULL);
+
+
+
+INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计', '', '/qc/analysisDept/getEntryDefectImproveDept', 'ALL', '条目缺陷改善统计-科室', NULL);
+SET @idperFiv =@@identity;
+INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计(内页)', '', '/qc/analysisDept/getEntryDefectImproveInnerDept', 'ALL', '条目缺陷改善统计(内页)-科室', NULL);
+SET @idperSix =@@identity;
+
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idperFiv, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idperSix, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', @idperFiv, NULL);
+INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', @idperSix, NULL);
+
+
+-- INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @idksThr, @idperFiv, NULL, '条目缺陷改善统计');
+-- INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @idksThr, @idperSix, NULL, '条目缺陷改善统计(内页)');

+ 9 - 0
doc/038.20211129_2.1.3/qc_initv2.1.3.sql

@@ -0,0 +1,9 @@
+
+use `qc`;
+-- 执行前请看注意事项!
+-- 通用版本token有效时间配置化
+/**
+sys_dictionary_info表新增token时间配置
+ */
+INSERT INTO `sys_dictionary_info` (`group_type`, `name`, `val`, `return_type`, `remark`) VALUES ('31', 'accessToken', '86400', '2', 'accessToken有效期(单位秒)');
+INSERT INTO `sys_dictionary_info` (`group_type`, `name`, `val`, `return_type`, `remark`) VALUES ('31', 'refreshToken', '604800', '2', 'refreshToken有效期(单位秒)');

+ 14 - 1
pom.xml

@@ -33,7 +33,7 @@
         <!--<swagger-bootstrap.version>1.9.1</swagger-bootstrap.version>-->
         <logstash.version>5.2</logstash.version>
         <poi.version>4.1.1</poi.version>
-        <aggregator.version>1.1.0</aggregator.version>
+        <aggregator.version>1.1.3</aggregator.version>
         <okhttp.version>4.2.2</okhttp.version>
         <easypoi.version>4.2.0</easypoi.version>
         <patchca.version>1.1.2</patchca.version>
@@ -205,13 +205,26 @@
             <version>${aggregator.version}</version>
         </dependency>
 
+        <!--消息中心-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
+        </dependency>
+
         <!-- easypoi -->
         <dependency>
             <groupId>cn.afterturn</groupId>
             <artifactId>easypoi-spring-boot-starter</artifactId>
             <version>${easypoi.version}</version>
         </dependency>
+        <!--多数据源-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.3.1</version>
+        </dependency>
 
+        <!--oracle-database-->
         <dependency>
             <groupId>com.oracle</groupId>
             <artifactId>ojdbc6</artifactId>

+ 2 - 1
src/main/java/com/diagbot/MrqcSysApplication.java

@@ -1,5 +1,6 @@
 package com.diagbot;
 
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@@ -20,7 +21,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
  * @time: 2018/8/7 9:26
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
-        JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class })
+        JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class, DruidDataSourceAutoConfigure.class })
 @EnableFeignClients({ "com.diagbot.client" })
 @EnableHystrixDashboard
 @EnableHystrix

+ 262 - 0
src/main/java/com/diagbot/aggregate/HisDataSupplementAggregate.java

@@ -0,0 +1,262 @@
+package com.diagbot.aggregate;
+
+import com.alibaba.fastjson.JSONObject;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.his.*;
+import com.diagbot.facade.data.*;
+import com.diagbot.facade.his.*;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.vo.data.*;
+import com.google.common.collect.Lists;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class HisDataSupplementAggregate {
+
+    @Autowired
+    private HisBehospitalInfoFacade hisBehospitalInfoFacade;
+    @Autowired
+    private HisDoctorAdviceFacade hisDoctorAdviceFacade;
+    @Autowired
+    private HisHomePageFacade hisHomePageFacade;
+    @Autowired
+    private HisHomeDiagnoseInfoFacade hisHomeDiagnoseInfoFacade;
+    @Autowired
+    private HisHomeOperationInfoFacade hisHomeOperationInfoFacade;
+    @Autowired
+    private HisMedicalRecordFacade hisMedicalRecordFacade;
+    @Autowired
+    private HisMedicalRecordContentFacade hisMedicalRecordContentFacade;
+
+    @Autowired
+    private ABehospitalInfoFacade aBehospitalInfoFacade;
+    @Autowired
+    private ADoctorAdviceFacade aDoctorAdviceFacade;
+    @Autowired
+    private AHomePageFacade aHomePageFacade;
+    @Autowired
+    private AHomeDiagnoseInfoFacade aHomeDiagnoseInfoFacade;
+    @Autowired
+    private AHomeOperationInfoFacade aHomeOperationInfoFacade;
+    @Autowired
+    private AMedicalRecordFacade aMedicalRecordFacade;
+    @Autowired
+    private AMedicalRecordContentFacade aMedicalRecordContentFacade;
+
+    @DataProvider("dataSupplement")
+    public RespDTO dataSupplement(@InvokeParameter("aBehospitalInfoVO") List<ABehospitalInfoVO> list,
+                                  @DataConsumer("getHisBeHospitalInfoData") RespDTO beHospitalInfoResp,
+                                  @DataConsumer("getHisDoctorAdviceData") RespDTO doctorAdviceResp,
+                                  @DataConsumer("getHisHomePageData") RespDTO homePageResp,
+                                  @DataConsumer("getHisHomeDiagnoseInfoData") RespDTO homeDiagnoseInfoResp,
+                                  @DataConsumer("getHisHomeOperationInfoData") RespDTO homeOperationInfoResp,
+                                  @DataConsumer("getHisMedicalRecordData") RespDTO medicalRecordResp,
+                                  @DataConsumer("getHisMedicalRecordContentData") RespDTO medicalRecordContentResp) {
+        StringBuffer sb = new StringBuffer();
+        if (beHospitalInfoResp.code.equals("0")
+                && doctorAdviceResp.code.equals("0")
+                && homePageResp.code.equals("0")
+                && homeDiagnoseInfoResp.code.equals("0")
+                && homeOperationInfoResp.code.equals("0")
+                && medicalRecordResp.code.equals("0")
+                && medicalRecordContentResp.code.equals("0")) {
+            return RespDTO.onSuc("数据补录成功!");
+        } else {
+            if (beHospitalInfoResp.code.equals("-1")) {
+                sb.append(beHospitalInfoResp.msg);
+            }
+            if (doctorAdviceResp.code.equals("-1")) {
+                sb.append(doctorAdviceResp.msg);
+            }
+            if (homePageResp.code.equals("-1")) {
+                sb.append(homePageResp.msg);
+            }
+            if (homeDiagnoseInfoResp.code.equals("-1")) {
+                sb.append(homeDiagnoseInfoResp.msg);
+            }
+            if (homeOperationInfoResp.code.equals("-1")) {
+                sb.append(homeOperationInfoResp.msg);
+            }
+            if (medicalRecordResp.code.equals("-1")) {
+                sb.append(medicalRecordResp.msg);
+            }
+            if (medicalRecordContentResp.code.equals("-1")) {
+                sb.append(medicalRecordContentResp.msg);
+            }
+            return RespDTO.onError(sb.toString());
+        }
+
+    }
+
+    //视图获取入院登记信息
+    @DataProvider("getHisBeHospitalInfoData")
+    public RespDTO getHisBeHospitalInfoData(@InvokeParameter("aBehospitalInfoVO") List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<ABehospitalInfoVO> aList = Lists.newLinkedList();
+        List<HisBehospitalInfo> list = hisBehospitalInfoFacade.getHisBeHospitalInfoData(aBehospitalInfoVO);
+        try {
+            if (list != null && list.size() > 0) {
+                for (HisBehospitalInfo hisBehospitalInfo : list) {
+                    ABehospitalInfoVO a = new ABehospitalInfoVO();
+                    BeanUtil.copyProperties(hisBehospitalInfo, a);
+                    aList.add(a);
+                }
+                RespDTO resp = aBehospitalInfoFacade.executeBehospital(aList);
+                if (resp.code.equals("-1")) {
+                    return RespDTO.onError(resp.msg + "=====入院登记补录失败,入参:" + JSONObject.toJSONString(aList));
+                }
+            } else {
+                return RespDTO.onError("未从视图中查询到需要补录的入院登记数据!");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return RespDTO.onSuc("补录成功!");
+    }
+
+    //视图获取医嘱信息
+    @DataProvider("getHisDoctorAdviceData")
+    public RespDTO getHisDoctorAdviceData(@InvokeParameter("aBehospitalInfoVO") List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<List<ADoctorAdviceVO>> aList = Lists.newLinkedList();
+        List<List<HisDoctorAdvice>> list = hisDoctorAdviceFacade.getHisDoctorAdviceData(aBehospitalInfoVO);
+        if (aList != null && aList.size() > 0) {
+            RespDTO resp;
+            BeanUtil.copyProperties(list, aList);
+            for (List<ADoctorAdviceVO> aDoctorAdviceVO : aList) {
+                try {
+                    resp = aDoctorAdviceFacade.executeDoctorAdvice(aDoctorAdviceVO);
+                    if (resp.code.equals("-1")) {
+                        return RespDTO.onError(resp.msg + "=====医嘱信息补录失败,入参:" + JSONObject.toJSONString(aDoctorAdviceVO));
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        } else {
+            return RespDTO.onError("未从视图中查询到需要补录的医嘱信息数据!");
+        }
+        return RespDTO.onSuc("补录成功!");
+    }
+
+    //视图获取病案首页信息
+    @DataProvider("getHisHomePageData")
+    public RespDTO getHisHomePageData(@InvokeParameter("aBehospitalInfoVO") List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<AHomePageVO> aList = Lists.newLinkedList();
+        List<HisHomePage> list = hisHomePageFacade.getHomePageData(aBehospitalInfoVO);
+        try {
+            if (list != null && list.size() > 0) {
+                BeanUtil.copyProperties(list, aList);
+                RespDTO resp = aHomePageFacade.executeHomePage(aList);
+                if (resp.code.equals(-1)) {
+                    return RespDTO.onError(resp.msg + "=====病案首页补录失败,入参:" + JSONObject.toJSONString(aList));
+                }
+            } else {
+                return RespDTO.onError("未从视图中查询到需要补录的病案首页数据!");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return RespDTO.onSuc("补录成功!");
+    }
+
+    //视图获取病案首页诊断信息
+    @DataProvider("getHisHomeDiagnoseInfoData")
+    public RespDTO getHisHomeDiagnoseInfoData(@InvokeParameter("aBehospitalInfoVO") List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<List<AHomeDiagnoseVO>> aList = Lists.newLinkedList();
+        List<List<HisHomeDiagnoseInfo>> list = hisHomeDiagnoseInfoFacade.getHisHomeDiagnoseInfoData(aBehospitalInfoVO);
+        if (aList != null && aList.size() > 0) {
+            BeanUtil.copyProperties(list, aList);
+            RespDTO resp;
+            for (List<AHomeDiagnoseVO> aHomeDiagnoseVO : aList) {
+                try {
+                    resp = aHomeDiagnoseInfoFacade.executeHomeDiagnose(aHomeDiagnoseVO);
+                    if (resp.code.equals(-1)) {
+                        return RespDTO.onError(resp.msg + "=====病案首页诊断补录失败,入参:" + JSONObject.toJSONString(aHomeDiagnoseVO));
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        } else {
+            return RespDTO.onError("未从视图中查询到需要补录的病案首页诊断数据!");
+        }
+        return RespDTO.onSuc("补录成功!");
+    }
+
+    //视图获取病案首页手术信息
+    @DataProvider("getHisHomeOperationInfoData")
+    public RespDTO getHisHomeOperationInfoData(@InvokeParameter("aBehospitalInfoVO") List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<List<AHomeOperationVO>> aList = Lists.newLinkedList();
+        List<List<HisHomeOperationInfo>> list = hisHomeOperationInfoFacade.getHisHomeOperationInfoData(aBehospitalInfoVO);
+        if (aList != null && aList.size() > 0) {
+            BeanUtil.copyProperties(list, aList);
+            for (List<AHomeOperationVO> aHomeOperationVO : aList) {
+                RespDTO resp;
+                try {
+                    resp = aHomeOperationInfoFacade.executeHomeOperation(aHomeOperationVO);
+                    if (resp.code.equals(-1)) {
+                        return RespDTO.onError(resp.msg + "=====病案首页手术补录失败,入参:" + JSONObject.toJSONString(aHomeOperationVO));
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        } else {
+            return RespDTO.onError("未从视图中查询到需要补录的病案首页手术数据!");
+        }
+        return RespDTO.onSuc("补录成功!");
+    }
+
+    //视图获取文书信息
+    @DataProvider("getHisMedicalRecordData")
+    public RespDTO getHisMedicalRecordData(@InvokeParameter("aBehospitalInfoVO") List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<List<AMedicalRecordVO>> aList = Lists.newLinkedList();
+        List<List<HisMedicalRecord>> list = hisMedicalRecordFacade.getHisMedicalRecordData(aBehospitalInfoVO);
+        if (aList != null && aList.size() > 0) {
+            BeanUtil.copyProperties(list, aList);
+            RespDTO resp;
+            for (List<AMedicalRecordVO> aMedicalRecordVO : aList) {
+                try {
+                    resp = aMedicalRecordFacade.executeMrRecord(aMedicalRecordVO);
+                    if (resp.code.equals(-1)) {
+                        return RespDTO.onError(resp.msg + "=====文书信息补录失败,入参:" + JSONObject.toJSONString(aMedicalRecordVO));
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        } else {
+            return RespDTO.onError("未从视图中查询到需要补录的文书信息数据!");
+        }
+        return RespDTO.onSuc("补录成功!");
+    }
+
+    //视图获取文书内容
+    @DataProvider("getHisMedicalRecordContentData")
+    public RespDTO getHisMedicalRecordContentData(@InvokeParameter("aBehospitalInfoVO") List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<List<AMedicalRecordContentVO>> aList = Lists.newLinkedList();
+        List<List<HisMedicalRecordContent>> list = hisMedicalRecordContentFacade.getHisMedicalRecordContentData(aBehospitalInfoVO);
+        if (aList != null && aList.size() > 0) {
+            BeanUtil.copyProperties(list, aList);
+            RespDTO resp;
+            for (List<AMedicalRecordContentVO> aMedicalRecordContentVO : aList) {
+                try {
+                    resp = aMedicalRecordContentFacade.executeMrRecordContent(aMedicalRecordContentVO);
+                    if (resp.code.equals(-1)) {
+                        return RespDTO.onError(resp.msg + "=====文书内容补录失败,入参:" + JSONObject.toJSONString(aMedicalRecordContentVO));
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        } else {
+            return RespDTO.onError("未从视图中查询到需要补录的文书内容数据!");
+        }
+        return RespDTO.onSuc("补录成功!");
+    }
+}

+ 15 - 0
src/main/java/com/diagbot/annotation/MrqcLog.java

@@ -0,0 +1,15 @@
+package com.diagbot.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * @Description:日志记录
+ * @Author:liuqq
+ * @time: ${DATE} ${TIME}
+ **/
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface MrqcLog {
+    String value() default "";
+}

+ 81 - 0
src/main/java/com/diagbot/aop/MrqcLogAspect.java

@@ -0,0 +1,81 @@
+package com.diagbot.aop;
+
+import com.diagbot.entity.LogInfo;
+import com.diagbot.rabbit.MySender;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.FastJsonUtils;
+import com.diagbot.util.MrqcLogUtil;
+import com.diagbot.vo.data.ABasDoctorInfoVO;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Date;
+
+@Aspect
+@Component
+@ConditionalOnProperty(prefix = "mrqcLog", value = { "enable" }, havingValue = "true")
+@Slf4j
+public class MrqcLogAspect {
+
+    @Autowired
+    MySender mySender;
+
+    //切所有Controller
+    @Pointcut("execution(* com.diagbot.web..*.*(..)) && @annotation(com.diagbot.annotation.MrqcLog)")
+    public void pointcutController() {
+    }
+
+    @Around("pointcutController()")
+    public Object mrqcLogIntercept(ProceedingJoinPoint joinPoint) throws Throwable {
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+        //获取方法参数
+        Object[] args = joinPoint.getArgs();
+        //请求的参数
+        LogInfo tanLog = MrqcLogUtil.tranLogReqAspect(joinPoint);
+        //tanLog.setBehospitalCode();
+        //tanLog.setHospitalId();
+        tanLog.setFuncName(method.getName());
+        tanLog.setReqParam(FastJsonUtils.getBeanToJson(args));
+        Date now = DateUtil.now();
+        tanLog.setGmtReq(now);
+        long start = System.currentTimeMillis();
+        tanLog.setGmtReq(DateUtil.now());
+
+        Object proceed = joinPoint.proceed(args);
+        //执行方法后获取出参
+        tanLog = MrqcLogUtil.tranLogRespAspect(proceed, tanLog, start, joinPoint);
+
+        //异步记录日志
+        mySender.outputMrqcLogSend(tanLog);
+        return proceed;
+    }
+
+    @AfterThrowing(pointcut = "pointcutController()", throwing = "ex")
+    public void mrqcLogInterceptThrow(JoinPoint joinPoint, Throwable ex) {
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+        LogInfo tanLog = new LogInfo();
+        Date now = DateUtil.now();
+        /*tanLog.setGmtCreate(now);
+        tanLog.setGmtModified(now);
+        tanLog.setSceneName(method.getAnnotation(CdssLog.class).value());*/
+        long start = System.currentTimeMillis();
+        tanLog.setGmtReq(DateUtil.now());
+        tanLog = MrqcLogUtil.tranLogRespAspectThrow(joinPoint, tanLog, start, ex);
+
+        //保存日志
+        mySender.outputMrqcLogSend(tanLog);
+    }
+}

+ 37 - 0
src/main/java/com/diagbot/config/AccessDeniedExceptionPoint.java

@@ -0,0 +1,37 @@
+package com.diagbot.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.web.access.AccessDeniedHandler;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author songxl
+ * @Date 2021/11/30
+ */
+@Component
+public class AccessDeniedExceptionPoint implements AccessDeniedHandler {
+    @Override
+    public void handle(HttpServletRequest httpServletRequest, HttpServletResponse response, AccessDeniedException e) throws IOException, ServletException {
+        Map map = new HashMap();
+        //响应状态码统一为200
+        response.setStatus(HttpServletResponse.SC_OK);
+        map.put("code", "00000001");
+        map.put("msg","没有该权限");
+        response.setContentType("application/json");
+        try {
+            ObjectMapper mapper = new ObjectMapper();
+            mapper.writeValue(response.getOutputStream(), map);
+        } catch (Exception e1) {
+            throw new ServletException();
+        }
+    }
+}

+ 32 - 0
src/main/java/com/diagbot/config/AuthExceptionEntryPoint.java

@@ -0,0 +1,32 @@
+package com.diagbot.config;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @Description:
+ * @Author songxl
+ * @Date 2021/11/30
+ */
+@Component
+public class AuthExceptionEntryPoint implements AuthenticationEntryPoint {
+    @Autowired
+    AuthenticationExceptionHandler authenticationExceptionHandler;
+
+    @Override
+    public void commence(HttpServletRequest request, HttpServletResponse response,
+                         AuthenticationException authException)
+            throws ServletException {
+        try {
+            authenticationExceptionHandler.handleException(request,response,authException);
+        } catch (Exception e) {
+            throw new ServletException();
+        }
+    }
+}

+ 90 - 0
src/main/java/com/diagbot/config/AuthenticationExceptionHandler.java

@@ -0,0 +1,90 @@
+package com.diagbot.config;
+
+
+import com.diagbot.facade.SysUserFacade;
+import com.diagbot.util.StringUtil;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.AccountExpiredException;
+import org.springframework.security.authentication.AccountStatusException;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.CredentialsExpiredException;
+import org.springframework.security.authentication.DisabledException;
+import org.springframework.security.authentication.InsufficientAuthenticationException;
+import org.springframework.security.authentication.LockedException;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+import org.springframework.stereotype.Component;
+import org.springframework.validation.BindException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Description:权限认证异常处理
+ * @Author songxl
+ * @Date 2021/12/13
+ */
+@Component
+public class AuthenticationExceptionHandler {
+    @Autowired
+    private SysUserFacade userFacade;
+
+    public void handleException(HttpServletRequest request, HttpServletResponse response,
+                                AuthenticationException authException) throws ServletException {
+        Map map = new HashMap();
+        //登录前的获取登录页面的请求接口不知道什么原因会抛出未认证(Full authentication is required to access this resource)
+        //如果抛出未认证在这个调用这个服务接口返回消息
+        //响应状态码统一为200
+        response.setStatus(HttpServletResponse.SC_OK);
+        if (matchers("/sys/user/getHospitalMark", request)) {
+            map.put("code", "0");
+            map.put("msg", "");
+            map.put("data", userFacade.getHospitalMark());
+        } else if (authException instanceof BadCredentialsException) {
+            map.put("code", "00000001");
+            map.put("msg", "用户或密码不正确");
+        } else if (authException instanceof AccountStatusException) {
+            if (authException instanceof LockedException) {
+                map.put("code", "00000001");
+                map.put("msg", "账户锁定");
+            } else if (authException instanceof AccountExpiredException) {//账户过期
+                map.put("code", "10020011");
+                map.put("msg", "登录超时。为确保您的账户安全,系统已自动退出,请重新登录。");
+            } else if (authException instanceof CredentialsExpiredException) {//证书过期
+                map.put("code", "10020011");
+                map.put("msg", "登录超时。为确保您的账户安全,系统已自动退出,请重新登录。");
+            } else if (authException instanceof DisabledException) {
+                map.put("code", "00000001");
+                map.put("msg", "账户不可用");
+            } else {
+                map.put("code", "00000001");
+                map.put("msg", "用户状态异常");
+            }
+        } else if (authException instanceof InsufficientAuthenticationException) {
+            map.put("code", "10020011");
+            map.put("msg", "登录超时。为确保您的账户安全,系统已自动退出,请重新登录。");
+        } else {
+            map.put("code", "00000001");
+            map.put("msg", authException.getMessage());
+        }
+        response.setContentType("application/json");
+        try {
+            ObjectMapper mapper = new ObjectMapper();
+            mapper.writeValue(response.getOutputStream(), map);
+        } catch (Exception e) {
+            throw new ServletException();
+        }
+    }
+
+    private boolean matchers(String url, HttpServletRequest request) {
+        AntPathRequestMatcher matcher = new AntPathRequestMatcher(url);
+        if (matcher.matches(request)) {
+            return true;
+        }
+        return false;
+    }
+}

+ 223 - 0
src/main/java/com/diagbot/config/MyJwtTokenStore.java

@@ -0,0 +1,223 @@
+package com.diagbot.config;
+
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.RedisUtils;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.jwt.Jwt;
+import org.springframework.security.jwt.JwtHelper;
+import org.springframework.security.jwt.crypto.sign.RsaVerifier;
+import org.springframework.security.jwt.crypto.sign.SignatureVerifier;
+import org.springframework.security.oauth2.common.DefaultExpiringOAuth2RefreshToken;
+import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
+import org.springframework.security.oauth2.common.DefaultOAuth2RefreshToken;
+import org.springframework.security.oauth2.common.OAuth2AccessToken;
+import org.springframework.security.oauth2.common.OAuth2RefreshToken;
+import org.springframework.security.oauth2.common.exceptions.InvalidTokenException;
+import org.springframework.security.oauth2.common.util.JsonParser;
+import org.springframework.security.oauth2.common.util.JsonParserFactory;
+import org.springframework.security.oauth2.provider.OAuth2Authentication;
+import org.springframework.security.oauth2.provider.approval.Approval;
+import org.springframework.security.oauth2.provider.approval.ApprovalStore;
+import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
+import org.springframework.security.oauth2.provider.token.store.JwtClaimsSetVerifier;
+import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
+import org.springframework.security.oauth2.provider.approval.Approval.ApprovalStatus;
+import org.springframework.util.FileCopyUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @Description:token续签
+ * @Author songxl
+ * @Date 2021/12/17
+ */
+public class MyJwtTokenStore extends JwtTokenStore {
+    private JwtAccessTokenConverter jwtTokenEnhancer;
+    private ApprovalStore approvalStore;
+    private JsonParser objectMapper = JsonParserFactory.create();
+    private JwtClaimsSetVerifier jwtClaimsSetVerifier = new NoOpJwtClaimsSetVerifier();
+    private SignatureVerifier verifier;
+    private RedisUtils redisUtils;
+    public MyJwtTokenStore(JwtAccessTokenConverter jwtTokenEnhancer,RedisUtils redisUtils) {
+        super(jwtTokenEnhancer);
+        verifier = createVerifier();
+        this.jwtTokenEnhancer = jwtTokenEnhancer;
+        this.redisUtils = redisUtils;
+    }
+
+    private SignatureVerifier createVerifier() {
+        Resource resource = new ClassPathResource("public.cert");
+        String publicKey;
+        try {
+            publicKey = new String(FileCopyUtils.copyToByteArray(resource.getInputStream()));
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        return new RsaVerifier(publicKey);
+    }
+
+    public void setApprovalStore(ApprovalStore approvalStore) {
+        this.approvalStore = approvalStore;
+    }
+
+    public OAuth2Authentication readAuthentication(OAuth2AccessToken token) {
+        return this.readAuthentication(token.getValue());
+    }
+
+
+    public void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication) {
+    }
+
+    public OAuth2AccessToken readAccessToken(String tokenValue) {
+        DefaultOAuth2AccessToken accessToken = (DefaultOAuth2AccessToken) this.convertAccessToken(tokenValue);
+        OAuth2AccessToken newAccessToken = updateTokenOutTime(accessToken);
+        if (this.jwtTokenEnhancer.isRefreshToken(accessToken)) {
+            throw new InvalidTokenException("Encoded token is a refresh token");
+        } else {
+            return newAccessToken;
+        }
+    }
+
+    private OAuth2AccessToken updateTokenOutTime(DefaultOAuth2AccessToken accessToken) {
+        if(accessToken.getAdditionalInformation()!=null&&accessToken.getAdditionalInformation().containsKey("user_id")){
+            //通过用户id获取redis存储的token过期时间
+            Object userIdObj = accessToken.getAdditionalInformation().get("user_id");
+            Integer value =(Integer) redisUtils.get("user:refreshToken:outTime_" + userIdObj);
+            if (value!=null){
+                //更新token过期时间为明天
+                accessToken.setExpiration(DateUtil.addDay(new Date(),1));
+                //将这个时间重新存到redis
+                redisUtils.set("user:refreshToken:outTime_" + userIdObj, value, value);
+            }
+        }
+        return accessToken;
+    }
+
+    private OAuth2AccessToken convertAccessToken(String tokenValue) {
+        return this.jwtTokenEnhancer.extractAccessToken(tokenValue, decode(tokenValue));
+    }
+
+    public void removeAccessToken(OAuth2AccessToken token) {
+    }
+
+    public void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication) {
+    }
+
+    public OAuth2RefreshToken readRefreshToken(String tokenValue) {
+        OAuth2AccessToken encodedRefreshToken = this.convertAccessToken(tokenValue);
+        OAuth2RefreshToken refreshToken = this.createRefreshToken(encodedRefreshToken);
+        if (this.approvalStore != null) {
+            OAuth2Authentication authentication = this.readAuthentication(tokenValue);
+            if (authentication.getUserAuthentication() != null) {
+                String userId = authentication.getUserAuthentication().getName();
+                String clientId = authentication.getOAuth2Request().getClientId();
+                Collection<Approval> approvals = this.approvalStore.getApprovals(userId, clientId);
+                Collection<String> approvedScopes = new HashSet();
+                Iterator var9 = approvals.iterator();
+
+                while(var9.hasNext()) {
+                    Approval approval = (Approval)var9.next();
+                    if (approval.isApproved()) {
+                        approvedScopes.add(approval.getScope());
+                    }
+                }
+
+                if (!approvedScopes.containsAll(authentication.getOAuth2Request().getScope())) {
+                    return null;
+                }
+            }
+        }
+
+        return refreshToken;
+    }
+
+    private OAuth2RefreshToken createRefreshToken(OAuth2AccessToken encodedRefreshToken) {
+        if (!this.jwtTokenEnhancer.isRefreshToken(encodedRefreshToken)) {
+            throw new InvalidTokenException("Encoded token is not a refresh token");
+        } else {
+            return (OAuth2RefreshToken)(encodedRefreshToken.getExpiration() != null ? new DefaultExpiringOAuth2RefreshToken(encodedRefreshToken.getValue(), encodedRefreshToken.getExpiration()) : new DefaultOAuth2RefreshToken(encodedRefreshToken.getValue()));
+        }
+    }
+
+    public OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token) {
+        return this.readAuthentication(token.getValue());
+    }
+
+    public void removeRefreshToken(OAuth2RefreshToken token) {
+        this.remove(token.getValue());
+    }
+
+    public void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken) {
+    }
+
+    public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication) {
+        return null;
+    }
+
+    public Collection<OAuth2AccessToken> findTokensByClientIdAndUserName(String clientId, String userName) {
+        return Collections.emptySet();
+    }
+
+    public Collection<OAuth2AccessToken> findTokensByClientId(String clientId) {
+        return Collections.emptySet();
+    }
+
+    public void setTokenEnhancer(JwtAccessTokenConverter tokenEnhancer) {
+        this.jwtTokenEnhancer = tokenEnhancer;
+    }
+
+    private void remove(String token) {
+        if (this.approvalStore != null) {
+            OAuth2Authentication auth = this.readAuthentication(token);
+            String clientId = auth.getOAuth2Request().getClientId();
+            Authentication user = auth.getUserAuthentication();
+            if (user != null) {
+                Collection<Approval> approvals = new ArrayList();
+                Iterator var6 = auth.getOAuth2Request().getScope().iterator();
+
+                while(var6.hasNext()) {
+                    String scope = (String)var6.next();
+                    approvals.add(new Approval(user.getName(), clientId, scope, new Date(), ApprovalStatus.APPROVED));
+                }
+
+                this.approvalStore.revokeApprovals(approvals);
+            }
+        }
+
+    }
+
+    protected Map<String, Object> decode(String token) {
+        try {
+            Jwt jwt = JwtHelper.decodeAndVerify(token,verifier);
+            String claimsStr = jwt.getClaims();
+            Map<String, Object> claims = this.objectMapper.parseMap(claimsStr);
+            if (claims.containsKey("exp") && claims.get("exp") instanceof Integer) {
+                Integer intValue = (Integer)claims.get("exp");
+                claims.put("exp", new Long((long)intValue));
+            }
+
+            jwtClaimsSetVerifier.verify(claims);
+            return claims;
+        } catch (Exception var6) {
+            throw new InvalidTokenException("Cannot convert access token to JSON", var6);
+        }
+    }
+
+
+    private class NoOpJwtClaimsSetVerifier implements JwtClaimsSetVerifier {
+        private NoOpJwtClaimsSetVerifier() {
+        }
+
+        public void verify(Map<String, Object> claims) throws InvalidTokenException {
+        }
+    }
+}

+ 14 - 2
src/main/java/com/diagbot/config/OAuth2Configurer.java

@@ -1,5 +1,6 @@
 package com.diagbot.config;
 
+import com.diagbot.facade.SysDictionaryFacade;
 import com.diagbot.service.UrlUserService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,17 +34,28 @@ import java.util.Arrays;
 public class OAuth2Configurer extends AuthorizationServerConfigurerAdapter {
     @Autowired
     private UrlUserService urlUserService;
+    @Autowired
+    private SysDictionaryFacade sysDictionaryFacade;
 
     @Override
     public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
+        int accessToken = 24 * 3600;
+        int refreshToken = 30 * 24 * 3600;
+        if (sysDictionaryFacade.getDictionaryWithKey() != null
+                && sysDictionaryFacade.getDictionaryWithKey().containsKey("31")
+                && sysDictionaryFacade.getDictionaryWithKey().get("31").containsKey("accessToken")
+                && sysDictionaryFacade.getDictionaryWithKey().get("31").containsKey("refreshToken")) {
+            accessToken = Integer.parseInt(sysDictionaryFacade.getDictionaryWithKey().get("31").get("accessToken"));
+            refreshToken = Integer.parseInt(sysDictionaryFacade.getDictionaryWithKey().get("31").get("refreshToken"));
+        }
         clients.inMemory()
                 .withClient("uaa-service")
                 .secret("{noop}123456")
                 .scopes("service")
                 .autoApprove(true)
                 .authorizedGrantTypes("implicit", "refresh_token", "password", "authorization_code")
-                .accessTokenValiditySeconds(24 * 3600)
-                .refreshTokenValiditySeconds(30 * 24 * 3600);
+                .accessTokenValiditySeconds(accessToken)
+                .refreshTokenValiditySeconds(refreshToken);
     }
 
     /**

+ 32 - 3
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -1,5 +1,6 @@
 package com.diagbot.config;
 
+import com.diagbot.util.RedisUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +14,7 @@ import org.springframework.security.jwt.crypto.sign.RsaVerifier;
 import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
 import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
 import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
+import org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint;
 import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
 import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
 import org.springframework.util.FileCopyUtils;
@@ -29,10 +31,20 @@ import java.io.IOException;
 @ComponentScan({"com.diagbot.config"})
 public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
     Logger log = LoggerFactory.getLogger(ResourceServerConfigurer.class);
+    @Autowired
+    private AuthExceptionEntryPoint authExceptionEntryPoint;
+    @Autowired
+    private AccessDeniedExceptionPoint accessDeniedExceptionPoint;
+    @Autowired
+    private RedisUtils redisUtils;
 
     @Override
     public void configure(HttpSecurity http) throws Exception {
         http.cors()
+                .and()
+                .exceptionHandling().authenticationEntryPoint(authExceptionEntryPoint)
+                .and()
+                .exceptionHandling().accessDeniedHandler(accessDeniedExceptionPoint)
                 .and()
                 .csrf().disable()
                 .authorizeRequests()
@@ -180,8 +192,6 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/data/placeFile").permitAll()
                 .antMatchers("/qc/data/sendLisResults").permitAll()
                 .antMatchers("/qc/data/sendPacsResults").permitAll()
-                .antMatchers("/qc/data/sendLisInfos").permitAll()
-                .antMatchers("/qc/data/sendPacsInfos").permitAll()
                 .antMatchers("/qc/data/getColumnZhAndCh").permitAll()
                 .antMatchers("/qc/data/analyseRec").permitAll()
                 .antMatchers("/qc/data/viewTask").permitAll()
@@ -272,14 +282,33 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/medCheckInfo/addMedCheckInfo").permitAll()
                 .antMatchers("/qc/medCheckInfo/getDataEdit").permitAll()
                 .antMatchers("/qc/medCheckInfo/saveDataEdit").permitAll()
+                .antMatchers("/qc/analysis/addMedClickInfo").permitAll()
+                .antMatchers("/qc/analysis/getQcClickDeptList").permitAll()
+                .antMatchers("/qc/analysis/getQcClick").permitAll()
+                .antMatchers("/qc/analysis/getQcClickByExport").permitAll()
+                .antMatchers("/qc/analysis/getQcClickInnerPage").permitAll()
+                .antMatchers("/qc/analysis/getQcClickInnerPageByExport").permitAll()
+                .antMatchers("/qc/analysis/getEntryDefectImprove").permitAll()
+                .antMatchers("/qc/analysis/getEntryDefectImproveByExport").permitAll()
+                .antMatchers("/qc/analysis/getEntryDefectImproveInner").permitAll()
+                .antMatchers("/qc/analysis/getDefectImproveInnerByExport").permitAll()
+                .antMatchers("/qc/analysisDept/getEntryDefectImproveDept").permitAll()
+                .antMatchers("/qc/analysisDept/getEntryDefectImproveByDeptExport").permitAll()
+                .antMatchers("/qc/analysisDept/getEntryDefectImproveInnerDept").permitAll()
+                .antMatchers("/qc/analysisDept/getDefectImproveInnerByDeptExport").permitAll()
+                .antMatchers("/qc/data/dataSupplement").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }
+
     @Override
     public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
         log.info("Configuring ResourceServerSecurityConfigurer");
-        resources.resourceId("user-service").tokenStore(new JwtTokenStore(jwtTokenEnhancerClient()));
+        resources.resourceId("user-service").tokenStore(new MyJwtTokenStore(jwtTokenEnhancerClient(),redisUtils));
+        resources.authenticationEntryPoint(authExceptionEntryPoint);
+        resources.accessDeniedHandler(accessDeniedExceptionPoint);
     }
+
     @Autowired
     private CustomAccessTokenConverter customAccessTokenConverter;
 

+ 63 - 4
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -1,5 +1,8 @@
 package com.diagbot.config.security;
 
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.exception.ServiceErrorCode;
 import com.diagbot.facade.TokenFacade;
 import com.diagbot.util.HttpUtils;
 import com.diagbot.util.StringUtil;
@@ -32,17 +35,34 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
     public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
         HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
         String url, method;
+        String tokenStr = HttpUtils.getHeaders(request).get("Authorization");
+        if (!request.getMethod().equals("OPTIONS") && StringUtil.isEmpty(tokenStr)) {
+            tokenStr = HttpUtils.getHeaders(request).get("authorization");
+        }
+        //用户是否被顶掉校验
+        if (StringUtil.isNotEmpty(tokenStr) && !matchNotCheckUrl(request)) {
+            tokenStr = tokenStr.replaceFirst("Bearer ", "");
+            int res = tokenFacade.newVerifyToken(tokenStr, 1);
+            if (-1 == res) {
+                throw new CommonException(ServiceErrorCode.LONGIN_ERROE);
+            }else if (-2 == res) {
+                throw new CommonException(ServiceErrorCode.USER_POWER_UP);
+            }
+        }
+
         if (matchPermitAllUrl(request)) {
             return;
         }
         if ("anonymousUser".equals(authentication.getPrincipal())) {
             throw new AccessDeniedException("no right");
         } else {
-            String tokenStr = HttpUtils.getHeaders(request).get("Authorization");
             if (StringUtil.isNotEmpty(tokenStr)) {
                 tokenStr = tokenStr.replaceFirst("Bearer ", "");
-                Boolean res = tokenFacade.verifyToken(tokenStr, 1);
-                if (!res) {
+//                Boolean res = tokenFacade.verifyToken(tokenStr, 1);
+                int res = tokenFacade.newVerifyToken(tokenStr, 1);
+                if (-1 == res) {
+                    throw new CommonException(ServiceErrorCode.LONGIN_ERROE);
+                } else if (1 != res) {
                     throw new AccountExpiredException("token expire");
                 }
             }
@@ -264,7 +284,6 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/medPacsInfo/getCheckPage", request)
                 || matchers("/qc/medLisInfo/getExaminePage", request)
                 || matchers("/qc/behospitalInfo/analyzeCds", request)
-                || matchers("/qc/behospitalInfo/addMedClickInfo", request)
                 || matchers("/qc/medLisInfo/getExamineSonPage", request)
                 || matchers("/console/medicalCheckForm", request)
                 || matchers("/console/medicalCheckTitle", request)
@@ -316,6 +335,21 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/medCheckInfo/addMedCheckInfo", request)
                 || matchers("/qc/dataEdit/getDataEdit", request)
                 || matchers("/qc/dataEdit/saveDataEdit", request)
+                || matchers("/qc/analysis/addMedClickInfo", request)
+                || matchers("/qc/analysis/getQcClickDeptList", request)
+                || matchers("/qc/analysis/getQcClick", request)
+                || matchers("/qc/analysis/getQcClickByExport", request)
+                || matchers("/qc/analysis/getQcClickInnerPage", request)
+                || matchers("/qc/analysis/getQcClickInnerPageByExport", request)
+                || matchers("/qc/analysis/getEntryDefectImprove", request)
+                || matchers("/qc/analysis/getEntryDefectImproveByExport", request)
+                || matchers("/qc/analysis/getEntryDefectImproveInner", request)
+                || matchers("/qc/analysis/getDefectImproveInnerByExport", request)
+                || matchers("/qc/analysisDept/getEntryDefectImproveDept", request)
+                || matchers("/qc/analysisDept/getEntryDefectImproveByDeptExport", request)
+                || matchers("/qc/analysisDept/getEntryDefectImproveInnerDept", request)
+                || matchers("/qc/analysisDept/getDefectImproveInnerByDeptExport", request)
+                || matchers("/qc/data/dataSupplement", request)
                 || matchers("/", request)) {
             return true;
         }
@@ -329,4 +363,29 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
         }
         return false;
     }
+
+    private boolean matchNotCheckUrl(HttpServletRequest request) {
+        if (matchers("/swagger/**", request)
+                || matchers("/v2/**", request)
+                || matchers("/swagger-ui.html/**", request)
+                || matchers("/swagger-resources/**", request)
+                || matchers("/webjars/**", request)
+                || matchers("/druid/**", request)
+                || matchers("/actuator/**", request)
+                || matchers("/hystrix/**", request)
+                || matchers("/sys/user/getJwt", request)
+                || matchers("/sys/user/logout", request)
+                || matchers("/sys/user/getCaptcha", request)
+                || matchers("/sys/user/getHospitalMark", request)
+                || matchers("/sys/user/getJwtNoPass", request)
+                || matchers("/sys/user/refreshJwt", request)
+                || matchers("/sys/dictionaryInfo/getDictionary", request)
+                || matchers("/sys/user/checkToken", request)
+                || matchers("/oauth/token", request)
+                || matchers("/oauth/check_token", request)
+                || matchers("/cache/clear", request)) {
+            return true;
+        }
+        return false;
+    }
 }

+ 13 - 1
src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java

@@ -1,5 +1,7 @@
 package com.diagbot.config.security;
 
+import com.alibaba.fastjson.JSONObject;
+import com.diagbot.exception.CommonException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.SecurityMetadataSource;
 import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
@@ -43,7 +45,17 @@ public class UrlFilterSecurityInterceptor extends AbstractSecurityInterceptor im
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
 
         FilterInvocation fi = new FilterInvocation(request, response, chain);
-        invoke(fi);
+        try {
+            invoke(fi);
+        }catch (CommonException e)
+        {
+            JSONObject error = new JSONObject();
+            response.setContentType("text/html;charset=utf-8");
+            error.put("code",e.getCode());
+            error.put("msg", e.getMessage());
+            response.getWriter().println(error);
+            response.flushBuffer();
+        }
     }
 
 

+ 94 - 0
src/main/java/com/diagbot/dto/BehospitalAnalysisDTO.java

@@ -0,0 +1,94 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 住院病历信息
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+@Data
+public class BehospitalAnalysisDTO implements Serializable {
+
+    /**
+     * 病历等级
+     */
+    @Excel(name = "病历等级")
+    private String level;
+
+    /**
+     * 最后得分
+     */
+    @Excel(name = "病历得分")
+    private Double scoreRes;
+
+    /**
+     * 病人住院ID
+     */
+    @Excel(name = "病人住院序号",width = 12d)
+    private String behospitalCode;
+
+    /**
+     * 档案号
+     */
+    @Excel(name = "病案号")
+    private String fileCode;
+
+    /**
+     * 姓名
+     */
+    @Excel(name = "病人姓名")
+    private String name;
+
+
+    /**
+     * 年龄
+     */
+    @Excel(name = "年龄")
+    private String age = "";
+
+
+    /**
+     * 入院时间
+     */
+    @Excel(name = "入院日期", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    @Excel(name = "出院日期", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+
+    /**
+     * 医生姓名
+     */
+    @Excel(name = "主管医生",width = 12d)
+    private String doctorName;
+
+    /**
+     * 住院科室名称
+     */
+    @Excel(name = "科室")
+    private String behDeptName;
+
+    private String behDoctorName;
+
+
+    /**
+     * 评分时间
+     */
+    @Excel(name = "评分时间", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date gradeTime;
+}

+ 72 - 0
src/main/java/com/diagbot/dto/BehospitalCodeDetail.java

@@ -0,0 +1,72 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: cy
+ * @time: 2021/12/2 11:04
+ */
+@Data
+public class BehospitalCodeDetail {
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 档案号
+     */
+    private String fileCode;
+
+    /**
+     * 入院时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 病历等级
+     */
+    private String level;
+
+    /**
+     * 最后得分
+     */
+    private Double scoreRes;
+
+    /**
+     * 评分时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date gradeTime;
+
+    List<QcResultDetailInfo> qcResultDetailInfos;
+}

+ 20 - 0
src/main/java/com/diagbot/dto/BehospitalCodeInfo.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: cy
+ * @time: 2021/12/2 11:04
+ */
+@Data
+public class BehospitalCodeInfo {
+    /**
+     * 住院号
+     */
+    private String behospitalCode;
+
+    List<QcResultDetailInfo> qcResultDetailInfos;
+}

+ 58 - 37
src/main/java/com/diagbot/dto/BehospitalInfoDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
@@ -20,82 +21,107 @@ public class BehospitalInfoDTO implements Serializable {
     private static final long serialVersionUID = 1L;
 
     /**
-     * 病人住院ID
+     * 住院科室名称
      */
-    private String behospitalCode;
+    @Excel(name = "科室", mergeVertical = true, width = 25d, orderNum = "1")
+    private String behDeptName;
+
+
+    /**
+     * 医生姓名
+     */
+    @Excel(name = "主管医生", orderNum = "2")
+    private String doctorName;
 
+
+    private String behDoctorName;
     /**
      * 姓名
      */
+    @Excel(name = "患者姓名", orderNum = "3")
     private String name;
 
     /**
-     * 性别
+     * 档案号
      */
-    private String sex;
+    @Excel(name = "病案号", orderNum = "4")
+    private String fileCode;
 
     /**
-     * 出生日期
+     * 年龄
      */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date birthday;
+    @Excel(name = "年龄", orderNum = "5")
+    private String age = "";
+
 
     /**
-     * 档案号
+     * 入院时间
      */
-    private String fileCode;
+    @Excel(name = "入院时间", orderNum = "6", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
 
     /**
-     * 病区名称
+     * 出院时间
      */
-    private String wardName;
+    @Excel(name = "出院时间", orderNum = "7", exportFormat = "yyyy/MM/dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+
 
     /**
-     * 住院科室名称
+     * 最后得分
      */
-    private String behDeptName;
+    @Excel(name = "病历得分", orderNum = "8")
+    private Double scoreRes;
 
     /**
-     * 床位号
+     * 病历等级
      */
-    private String bedCode;
+    @Excel(name = "病历等级", orderNum = "9")
+    private String level;
 
     /**
-     * 入院时间
+     * 评分时间
      */
+    @Excel(name = "评分时间", orderNum = "10", exportFormat = "yyyy/MM/dd")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date behospitalDate;
+    private Date gradeTime;
+
 
     /**
-     * 出院时间
+     * 病人住院ID
      */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date leaveHospitalDate;
+    private String behospitalCode;
+
 
     /**
-     * 疾病名称
+     * 性别
      */
-    private String diagnose;
+    private String sex;
 
     /**
-     * 医生姓名
+     * 出生日期
      */
-    private String doctorName;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date birthday;
 
     /**
-     * 年龄
+     * 病区名称
      */
-    private String age;
+    private String wardName;
 
     /**
-     * 病历等级
+     * 床位号
      */
-    private String level;
+    private String bedCode;
+
 
     /**
-     * 最后得分
+     * 疾病名称
      */
-    private Double scoreRes;
+    private String diagnose;
+
 
     /**
      * 病案首页得分
@@ -107,15 +133,10 @@ public class BehospitalInfoDTO implements Serializable {
      */
     private String gradeType;
 
-    /**
-     * 评分时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date gradeTime;
 
-    private String directorDoctorName ;
+    private String directorDoctorName;
+
 
-    private String behDoctorName;
 
     /**
      * 归档时间

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

@@ -0,0 +1,26 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: cy
+ * @time: 2021/12/2 11:04
+ */
+@Data
+public class EntryDefectImprove {
+    /**
+     * 科室id
+     */
+    private String deptId;
+
+    /**
+     * 科室name
+     */
+    private String deptName;
+
+    List<BehospitalCodeInfo> behospitalCodeInfos;
+
+}

+ 24 - 0
src/main/java/com/diagbot/dto/EntryDefectImproveInner.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: cy
+ * @time: 2021/12/2 11:04
+ */
+@Data
+public class EntryDefectImproveInner {
+
+    /**
+     * 住院科室名称
+     */
+    private String behDeptName;
+
+
+    List<BehospitalCodeDetail> behospitalCodeInfos;
+}

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

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: cy
+ * @time: 2021/12/2 11:04
+ */
+@Data
+public class EntryDefectImproveInnerDoctor {
+    /**
+     * 医生id
+     */
+    private String doctorId;
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+
+
+    List<BehospitalCodeInfo> behospitalCodeInfos;
+}

+ 27 - 0
src/main/java/com/diagbot/dto/EntryDefectImproveInnerExport.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: cy
+ * @time: 2021/12/2 11:04
+ */
+@Data
+public class EntryDefectImproveInnerExport {
+
+    /**
+     * 科室id
+     */
+    private String deptId;
+
+    /**
+     * 科室name
+     */
+    private String deptName;
+
+
+    List<EntryDefectImproveInnerDoctor> entryDefectImproveInnerDoctors;
+}

+ 77 - 0
src/main/java/com/diagbot/dto/GetEntryDefectImproveDTO.java

@@ -0,0 +1,77 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.text.DecimalFormat;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/4 14:59
+ */
+@Data
+public class GetEntryDefectImproveDTO {
+    /**
+     * 科室id
+     */
+    private String deptId;
+
+
+    /**
+     * 科室名称
+     */
+    @Excel(name = "科室", width = 25d, orderNum = "1")
+    private String deptName;
+
+    /**
+     * 模块id
+     */
+    private String casesId;
+
+    /**
+     * 模块名称
+     */
+    @Excel(name = "模块名称", width = 15d, orderNum = "2")
+    private String casesName;
+
+    /**
+     * 缺陷id
+     */
+    private String entryId;
+
+    /**
+     * 缺陷名称
+     */
+    @Excel(name = "缺陷名称", width = 30d, orderNum = "3")
+    private String entryName;
+
+
+    /**
+     * 缺陷总数
+     */
+    @Excel(name = "总数量", width = 10d, orderNum = "4")
+    private Long totalNum = 0L;
+
+    /**
+     * 已改善数
+     */
+    @Excel(name = "已改善数量", width = 13d, orderNum = "5")
+    private Long handleNum = 0L;
+
+    /**
+     * 待改善数
+     */
+    @Excel(name = "待改善数量", width = 13d, orderNum = "6")
+    private Long improveleNum = 0L;
+
+    /**
+     * 改善率
+     */
+    @Excel(name = "改善率", width = 10d, orderNum = "7")
+    private String handleStr = "0.00%";
+
+}

+ 85 - 0
src/main/java/com/diagbot/dto/GetEntryDefectImproveDeptDTO.java

@@ -0,0 +1,85 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/4 14:59
+ */
+@Data
+public class GetEntryDefectImproveDeptDTO {
+    /**
+     * 科室id
+     */
+    private String deptId;
+
+
+    /**
+     * 科室名称
+     */
+    @Excel(name = "科室", width = 25d, orderNum = "1")
+    private String deptName;
+
+    /**
+     * 模块id
+     */
+    private String casesId;
+
+    /**
+     * 模块名称
+     */
+    @Excel(name = "模块名称", width = 15d, orderNum = "2")
+    private String casesName;
+
+    /**
+     * 缺陷id
+     */
+    private String entryId;
+
+    /**
+     * 缺陷名称
+     */
+    @Excel(name = "缺陷名称", width = 30d, orderNum = "3")
+    private String entryName;
+
+    /**
+     * 主管医生
+     */
+    @Excel(name = "主管医生", width = 10d, orderNum = "4")
+    private String doctorName;
+
+    /**
+     * 医师工号
+     */
+    @Excel(name = "医师工号", width = 10d, orderNum = "5")
+    private String doctorId;
+
+
+
+    /**
+     * 缺陷总数
+     */
+    @Excel(name = "总数量", width = 10d, orderNum = "6")
+    private Long totalNum=0L;
+
+    /**
+     * 已改善数
+     */
+    @Excel(name = "已改善数量", width = 13d, orderNum = "7")
+    private Long handleNum=0L;
+
+    /**
+     * 待改善数
+     */
+    @Excel(name = "待改善数量", width = 13d, orderNum = "8")
+    private Long improveleNum=0L;
+
+    /**
+     * 改善率
+     */
+    @Excel(name = "改善率", width = 10d, orderNum = "9")
+    private String handleStr= "0.00%";
+
+}

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

@@ -0,0 +1,35 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: cy
+ * @time: 2021/12/2 11:04
+ */
+@Data
+public class GetEntryInfoDTO {
+    /**
+     * 模块id
+     */
+    private String casesId;
+
+    /**
+     * 模块名称
+     */
+    private String casesName;
+
+    /**
+     * 缺陷id
+     */
+    private String entryId;
+
+    /**
+     * 缺陷名称
+     */
+    private String entryName;
+
+}

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

@@ -0,0 +1,40 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+import java.io.Serializable;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/4 14:59
+ */
+@Getter
+@Setter
+public class GetQcClickDTO implements Serializable {
+
+    /**
+     * 科室id
+     */
+    private String deptId;
+
+    /**
+     * 科室名称
+     */
+    @Excel(name = "科室", width = 30d, orderNum = "1")
+    private String deptName;
+
+    /**
+     * 模块质控按钮点击数
+     */
+    @Excel(name = "模块质控按钮点击数", width = 20d,orderNum = "2")
+    private Integer singleModeNum;
+
+    /**
+     * 全病历质控按钮点击数
+     */
+    @Excel(name = "全病历质控按钮点击数", width = 20d,orderNum = "3")
+    private Integer totalModeNum;
+
+}

+ 52 - 0
src/main/java/com/diagbot/dto/GetQcClickInnerPageDTO.java

@@ -0,0 +1,52 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/4 14:59
+ */
+@Getter
+@Setter
+public class GetQcClickInnerPageDTO implements Serializable {
+    /**
+     * 科室id
+     */
+    private String deptId;
+
+
+    /**
+     * 科室名称
+     */
+    @Excel(name = "科室", width = 30d, orderNum = "1")
+    private String deptName;
+
+    /**
+     * 医师id
+     */
+    @Excel(name = "医师工号", width = 10d, orderNum = "2")
+    private String doctorId;
+
+    /**
+     * 医师姓名
+     */
+    @Excel(name = "医师姓名", width = 10d, orderNum = "3")
+    private String doctorName;
+
+    /**
+     * 模块质控按钮点击数
+     */
+    @Excel(name = "模块质控按钮点击数", width = 20d,orderNum = "4")
+    private Integer singleModeNum;
+
+    /**
+     * 全病历质控按钮点击数
+     */
+    @Excel(name = "全病历质控按钮点击数", width = 20d,orderNum = "5")
+    private Integer totalModeNum;
+}

+ 20 - 0
src/main/java/com/diagbot/dto/QcResultDetailInfo.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author: cy
+ * @time: 2021/12/2 11:04
+ */
+@Data
+public class QcResultDetailInfo {
+
+    /**
+     * 触发埋点病历质控缺陷id集
+     */
+    private String CasesEntryIds;
+
+}

+ 161 - 0
src/main/java/com/diagbot/entity/LogInfo.java

@@ -0,0 +1,161 @@
+package com.diagbot.entity;
+
+import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2021-12-31
+ */
+public class LogInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病历号
+     */
+    private String behospitalCode;
+
+    /**
+     * 接口方法名
+     */
+    private String funcName;
+
+    /**
+     * 入参
+     */
+    private String reqParam;
+
+    /**
+     * 回参
+     */
+    private String respParam;
+
+    /**
+     * 请求时间
+     */
+    private Date gmtReq;
+
+    /**
+     * 响应时间
+     */
+    private Date gmtResp;
+
+    private String execTime;
+
+    private String status;
+
+    private String remark;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+    public String getFuncName() {
+        return funcName;
+    }
+
+    public void setFuncName(String funcName) {
+        this.funcName = funcName;
+    }
+    public String getReqParam() {
+        return reqParam;
+    }
+
+    public void setReqParam(String reqParam) {
+        this.reqParam = reqParam;
+    }
+    public String getRespParam() {
+        return respParam;
+    }
+
+    public void setRespParam(String respParam) {
+        this.respParam = respParam;
+    }
+    public Date getGmtReq() {
+        return gmtReq;
+    }
+
+    public void setGmtReq(Date gmtReq) {
+        this.gmtReq = gmtReq;
+    }
+    public Date getGmtResp() {
+        return gmtResp;
+    }
+
+    public void setGmtResp(Date gmtResp) {
+        this.gmtResp = gmtResp;
+    }
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getExecTime() {
+        return execTime;
+    }
+
+    public void setExecTime(String execTime) {
+        this.execTime = execTime;
+    }
+
+    @Override
+    public String toString() {
+        return "LogInfo{" +
+            "id=" + id +
+            ", hospitalId=" + hospitalId +
+            ", behospitalCode=" + behospitalCode +
+            ", funcName=" + funcName +
+            ", reqParam=" + reqParam +
+            ", respParam=" + respParam +
+            ", gmtReq=" + gmtReq +
+            ", gmtResp=" + gmtResp +
+            ", status=" + status +
+            ", remark=" + remark +
+                ", execTime=" + execTime +
+        "}";
+    }
+}

+ 7 - 2
src/main/java/com/diagbot/entity/MedClickInfo.java

@@ -28,7 +28,7 @@ public class MedClickInfo implements Serializable {
     /**
      * 医院ID
      */
-    private Integer hospitalId;
+    private Long hospitalId;
 
     /**
      * 科室ID
@@ -50,10 +50,15 @@ public class MedClickInfo implements Serializable {
      */
     private String doctorName;
 
+    /**
+     * 0-单模块质控 1-全病历质控
+     */
+    private Long optType;
+
     /**
      * 质控结果基本信息ID
      */
-    private Integer qcresultInfoId;
+    private Long qcresultInfoId;
 
     /**
      * 病人住院ID

+ 6 - 0
src/main/java/com/diagbot/entity/MedQcresultCases.java

@@ -2,6 +2,7 @@ package com.diagbot.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -15,6 +16,7 @@ import java.util.Date;
  * @author gaodm
  * @since 2020-05-19
  */
+@Data
 public class MedQcresultCases implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -26,6 +28,10 @@ public class MedQcresultCases implements Serializable {
      * 医院ID
      */
     private Long hospitalId;
+    /**
+     * 评分结果ID
+     */
+    private Long qcresultInfoId;
 
     /**
      * 病人住院ID

+ 61 - 0
src/main/java/com/diagbot/entity/MedQcresultClick.java

@@ -0,0 +1,61 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2021-12-02
+ */
+@Data
+public class MedQcresultClick implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 住院号
+     */
+    private String behospitalCode;
+
+    /**
+     * 科室id
+     */
+    private String deptId;
+
+    /**
+     * 科室name
+     */
+    private String deptName;
+
+
+    /**
+     * 评分结果id
+     */
+    private Long qcresultInfoId;
+
+    /**
+     * 触发埋点病历质控缺陷id集
+     */
+    private String CasesEntryIds;
+
+    /**
+     *  记录创建时间
+     */
+    private Date gmtCreate;
+}

+ 4 - 0
src/main/java/com/diagbot/entity/QcresultDetail.java

@@ -31,6 +31,10 @@ public class QcresultDetail implements Serializable {
      * 医院ID
      */
     private Long hospitalId;
+    /**
+     * 评分结果ID
+     */
+    private Long qcresultInfoId;
 
     /**
      * 病人住院ID

+ 340 - 0
src/main/java/com/diagbot/entity/his/HisBehospitalInfo.java

@@ -0,0 +1,340 @@
+package com.diagbot.entity.his;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author lipc
+ * @since 2021-09-28
+ */
+@TableName("HIS_BEHOSPITAL_INFO")
+public class HisBehospitalInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableField("BEHOSPITAL_CODE")
+    private String behospitalCode;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("SEX")
+    private String sex;
+
+    @TableField("BIRTHDAY")
+    private Date birthday;
+
+    @TableField("FILE_CODE")
+    private String fileCode;
+
+    @TableField("WARD_CODE")
+    private String wardCode;
+
+    @TableField("WARD_NAME")
+    private String wardName;
+
+    @TableField("BEH_DEPT_ID")
+    private String behDeptId;
+
+    @TableField("BEH_DEPT_NAME")
+    private String behDeptName;
+
+    @TableField("BED_CODE")
+    private String bedCode;
+
+    @TableField("BED_NAME")
+    private String bedName;
+
+    @TableField("INSURANCE_NAME")
+    private String insuranceName;
+
+    @TableField("JOB_TYPE")
+    private String jobType;
+
+    @TableField("BEHOSPITAL_DATE")
+    private Date behospitalDate;
+
+    @TableField("LEAVE_HOSPITAL_DATE")
+    private Date leaveHospitalDate;
+
+    @TableField("TRANS_IN_TIME")
+    private Date transInTime;
+
+    @TableField("TRANS_OUT_TIME")
+    private Date transOutTime;
+
+    @TableField("DIAGNOSE_ICD")
+    private String diagnoseIcd;
+
+    @TableField("DOCTOR_ID")
+    private String doctorId;
+
+    @TableField("DOCTOR_NAME")
+    private String doctorName;
+
+    @TableField("BEH_DOCTOR_ID")
+    private String behDoctorId;
+
+    @TableField("BEH_DOCTOR_NAME")
+    private String behDoctorName;
+
+    @TableField("DIRECTOR_DOCTOR_ID")
+    private String directorDoctorId;
+
+    @TableField("DIRECTOR_DOCTOR_NAME")
+    private String directorDoctorName;
+
+    @TableField("DIAGNOSE")
+    private String diagnose;
+
+    @TableField("HOSPITAL_ID")
+    private Long hospitalId;
+
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public Date getBirthday() {
+        return birthday;
+    }
+
+    public void setBirthday(Date birthday) {
+        this.birthday = birthday;
+    }
+
+    public String getFileCode() {
+        return fileCode;
+    }
+
+    public void setFileCode(String fileCode) {
+        this.fileCode = fileCode;
+    }
+
+    public String getWardCode() {
+        return wardCode;
+    }
+
+    public void setWardCode(String wardCode) {
+        this.wardCode = wardCode;
+    }
+
+    public String getWardName() {
+        return wardName;
+    }
+
+    public void setWardName(String wardName) {
+        this.wardName = wardName;
+    }
+
+    public String getBehDeptId() {
+        return behDeptId;
+    }
+
+    public void setBehDeptId(String behDeptId) {
+        this.behDeptId = behDeptId;
+    }
+
+    public String getBehDeptName() {
+        return behDeptName;
+    }
+
+    public void setBehDeptName(String behDeptName) {
+        this.behDeptName = behDeptName;
+    }
+
+    public String getBedCode() {
+        return bedCode;
+    }
+
+    public void setBedCode(String bedCode) {
+        this.bedCode = bedCode;
+    }
+
+    public String getBedName() {
+        return bedName;
+    }
+
+    public void setBedName(String bedName) {
+        this.bedName = bedName;
+    }
+
+    public String getInsuranceName() {
+        return insuranceName;
+    }
+
+    public void setInsuranceName(String insuranceName) {
+        this.insuranceName = insuranceName;
+    }
+
+    public String getJobType() {
+        return jobType;
+    }
+
+    public void setJobType(String jobType) {
+        this.jobType = jobType;
+    }
+
+    public Date getBehospitalDate() {
+        return behospitalDate;
+    }
+
+    public void setBehospitalDate(Date behospitalDate) {
+        this.behospitalDate = behospitalDate;
+    }
+
+    public Date getLeaveHospitalDate() {
+        return leaveHospitalDate;
+    }
+
+    public void setLeaveHospitalDate(Date leaveHospitalDate) {
+        this.leaveHospitalDate = leaveHospitalDate;
+    }
+
+    public Date getTransInTime() {
+        return transInTime;
+    }
+
+    public void setTransInTime(Date transInTime) {
+        this.transInTime = transInTime;
+    }
+
+    public Date getTransOutTime() {
+        return transOutTime;
+    }
+
+    public void setTransOutTime(Date transOutTime) {
+        this.transOutTime = transOutTime;
+    }
+
+    public String getDiagnoseIcd() {
+        return diagnoseIcd;
+    }
+
+    public void setDiagnoseIcd(String diagnoseIcd) {
+        this.diagnoseIcd = diagnoseIcd;
+    }
+
+    public String getDoctorId() {
+        return doctorId;
+    }
+
+    public void setDoctorId(String doctorId) {
+        this.doctorId = doctorId;
+    }
+
+    public String getDoctorName() {
+        return doctorName;
+    }
+
+    public void setDoctorName(String doctorName) {
+        this.doctorName = doctorName;
+    }
+
+    public String getBehDoctorId() {
+        return behDoctorId;
+    }
+
+    public void setBehDoctorId(String behDoctorId) {
+        this.behDoctorId = behDoctorId;
+    }
+
+    public String getBehDoctorName() {
+        return behDoctorName;
+    }
+
+    public void setBehDoctorName(String behDoctorName) {
+        this.behDoctorName = behDoctorName;
+    }
+
+    public String getDirectorDoctorId() {
+        return directorDoctorId;
+    }
+
+    public void setDirectorDoctorId(String directorDoctorId) {
+        this.directorDoctorId = directorDoctorId;
+    }
+
+    public String getDirectorDoctorName() {
+        return directorDoctorName;
+    }
+
+    public void setDirectorDoctorName(String directorDoctorName) {
+        this.directorDoctorName = directorDoctorName;
+    }
+
+    public String getDiagnose() {
+        return diagnose;
+    }
+
+    public void setDiagnose(String diagnose) {
+        this.diagnose = diagnose;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    @Override
+    public String toString() {
+        return "HisBehospitalInfo{" +
+                "behospitalCode=" + behospitalCode +
+                ", name=" + name +
+                ", sex=" + sex +
+                ", birthday=" + birthday +
+                ", fileCode=" + fileCode +
+                ", wardCode=" + wardCode +
+                ", wardName=" + wardName +
+                ", behDeptId=" + behDeptId +
+                ", behDeptName=" + behDeptName +
+                ", bedCode=" + bedCode +
+                ", bedName=" + bedName +
+                ", insuranceName=" + insuranceName +
+                ", jobType=" + jobType +
+                ", behospitalDate=" + behospitalDate +
+                ", leaveHospitalDate=" + leaveHospitalDate +
+                ", transInTime=" + transInTime +
+                ", transOutTime=" + transOutTime +
+                ", diagnoseIcd=" + diagnoseIcd +
+                ", doctorId=" + doctorId +
+                ", doctorName=" + doctorName +
+                ", behDoctorId=" + behDoctorId +
+                ", behDoctorName=" + behDoctorName +
+                ", directorDoctorId=" + directorDoctorId +
+                ", directorDoctorName=" + directorDoctorName +
+                ", diagnose=" + diagnose +
+                ", hospitalId=" + hospitalId +
+                "}";
+    }
+
+}

+ 303 - 0
src/main/java/com/diagbot/entity/his/HisDoctorAdvice.java

@@ -0,0 +1,303 @@
+package com.diagbot.entity.his;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author lipc
+ * @since 2021-09-28
+ */
+@TableName("HIS_DOCTOR_ADVICE")
+public class HisDoctorAdvice implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableField("DOCTOR_ADVICE_ID")
+    private String doctorAdviceId;
+
+    @TableField("BEHOSPITAL_CODE")
+    private String behospitalCode;
+
+    @TableField("ORDER_DOCTOR_NAME")
+    private String orderDoctorName;
+
+    @TableField("FREQUENCY")
+    private String frequency;
+
+    @TableField("PARENT_TYPE_ID")
+    private String parentTypeId;
+
+    @TableField("DOCTOR_ADVICE_TYPE")
+    private String doctorAdviceType;
+
+    @TableField("USAGE_NUM")
+    private String usageNum;
+
+    @TableField("USAGE_UNIT")
+    private String usageUnit;
+
+    @TableField("DOSE")
+    private String dose;
+
+    @TableField("DOSE_UNIT")
+    private String doseUnit;
+
+    @TableField("MED_MODE_TYPE")
+    private String medModeType;
+
+    @TableField("DA_FREQUENCY")
+    private String daFrequency;
+
+    @TableField("DA_DEAL_TYPE")
+    private String daDealType;
+
+    @TableField("DA_START_DATE")
+    private Date daStartDate;
+
+    @TableField("DA_ITEM_NAME")
+    private String daItemName;
+
+    @TableField("DA_STATUS")
+    private String daStatus;
+
+    @TableField("DA_STOP_DATE")
+    private Date daStopDate;
+
+    @TableField("DA_GROUP_NO")
+    private String daGroupNo;
+
+    @TableField("DA_PRESCRIPTION_TYPE")
+    private String daPrescriptionType;
+
+    @TableField("MEDICINE_TYPE")
+    private String medicineType;
+
+    @TableField("DA_MED_TYPE")
+    private String daMedType;
+
+    @TableField("DOCTOR_NOTICE")
+    private String doctorNotice;
+
+    @TableField("DOCTOR_ID")
+    private String doctorId;
+
+    @TableField("HOSPITAL_ID")
+    private Long hospitalId;
+
+    @TableField("DOCTOR_NAME")
+    private String doctorName;
+
+    public String getDoctorAdviceId() {
+        return doctorAdviceId;
+    }
+
+    public void setDoctorAdviceId(String doctorAdviceId) {
+        this.doctorAdviceId = doctorAdviceId;
+    }
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+    public String getOrderDoctorName() {
+        return orderDoctorName;
+    }
+
+    public void setOrderDoctorName(String orderDoctorName) {
+        this.orderDoctorName = orderDoctorName;
+    }
+    public String getFrequency() {
+        return frequency;
+    }
+
+    public void setFrequency(String frequency) {
+        this.frequency = frequency;
+    }
+    public String getParentTypeId() {
+        return parentTypeId;
+    }
+
+    public void setParentTypeId(String parentTypeId) {
+        this.parentTypeId = parentTypeId;
+    }
+    public String getDoctorAdviceType() {
+        return doctorAdviceType;
+    }
+
+    public void setDoctorAdviceType(String doctorAdviceType) {
+        this.doctorAdviceType = doctorAdviceType;
+    }
+    public String getUsageNum() {
+        return usageNum;
+    }
+
+    public void setUsageNum(String usageNum) {
+        this.usageNum = usageNum;
+    }
+    public String getUsageUnit() {
+        return usageUnit;
+    }
+
+    public void setUsageUnit(String usageUnit) {
+        this.usageUnit = usageUnit;
+    }
+    public String getDose() {
+        return dose;
+    }
+
+    public void setDose(String dose) {
+        this.dose = dose;
+    }
+    public String getDoseUnit() {
+        return doseUnit;
+    }
+
+    public void setDoseUnit(String doseUnit) {
+        this.doseUnit = doseUnit;
+    }
+    public String getMedModeType() {
+        return medModeType;
+    }
+
+    public void setMedModeType(String medModeType) {
+        this.medModeType = medModeType;
+    }
+    public String getDaFrequency() {
+        return daFrequency;
+    }
+
+    public void setDaFrequency(String daFrequency) {
+        this.daFrequency = daFrequency;
+    }
+    public String getDaDealType() {
+        return daDealType;
+    }
+
+    public void setDaDealType(String daDealType) {
+        this.daDealType = daDealType;
+    }
+    public Date getDaStartDate() {
+        return daStartDate;
+    }
+
+    public void setDaStartDate(Date daStartDate) {
+        this.daStartDate = daStartDate;
+    }
+    public String getDaItemName() {
+        return daItemName;
+    }
+
+    public void setDaItemName(String daItemName) {
+        this.daItemName = daItemName;
+    }
+    public String getDaStatus() {
+        return daStatus;
+    }
+
+    public void setDaStatus(String daStatus) {
+        this.daStatus = daStatus;
+    }
+    public Date getDaStopDate() {
+        return daStopDate;
+    }
+
+    public void setDaStopDate(Date daStopDate) {
+        this.daStopDate = daStopDate;
+    }
+    public String getDaGroupNo() {
+        return daGroupNo;
+    }
+
+    public void setDaGroupNo(String daGroupNo) {
+        this.daGroupNo = daGroupNo;
+    }
+    public String getDaPrescriptionType() {
+        return daPrescriptionType;
+    }
+
+    public void setDaPrescriptionType(String daPrescriptionType) {
+        this.daPrescriptionType = daPrescriptionType;
+    }
+    public String getMedicineType() {
+        return medicineType;
+    }
+
+    public void setMedicineType(String medicineType) {
+        this.medicineType = medicineType;
+    }
+    public String getDaMedType() {
+        return daMedType;
+    }
+
+    public void setDaMedType(String daMedType) {
+        this.daMedType = daMedType;
+    }
+    public String getDoctorNotice() {
+        return doctorNotice;
+    }
+
+    public void setDoctorNotice(String doctorNotice) {
+        this.doctorNotice = doctorNotice;
+    }
+    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 getDoctorName() {
+        return doctorName;
+    }
+
+    public void setDoctorName(String doctorName) {
+        this.doctorName = doctorName;
+    }
+
+    @Override
+    public String toString() {
+        return "HisDoctorAdvice{" +
+                "doctorAdviceId=" + doctorAdviceId +
+                ", behospitalCode=" + behospitalCode +
+                ", orderDoctorName=" + orderDoctorName +
+                ", frequency=" + frequency +
+                ", parentTypeId=" + parentTypeId +
+                ", doctorAdviceType=" + doctorAdviceType +
+                ", usageNum=" + usageNum +
+                ", usageUnit=" + usageUnit +
+                ", dose=" + dose +
+                ", doseUnit=" + doseUnit +
+                ", medModeType=" + medModeType +
+                ", daFrequency=" + daFrequency +
+                ", daDealType=" + daDealType +
+                ", daStartDate=" + daStartDate +
+                ", daItemName=" + daItemName +
+                ", daStatus=" + daStatus +
+                ", daStopDate=" + daStopDate +
+                ", daGroupNo=" + daGroupNo +
+                ", daPrescriptionType=" + daPrescriptionType +
+                ", medicineType=" + medicineType +
+                ", daMedType=" + daMedType +
+                ", doctorNotice=" + doctorNotice +
+                ", doctorId=" + doctorId +
+                ", hospitalId=" + hospitalId +
+                ", doctorName=" + doctorName +
+                "}";
+    }
+}

+ 162 - 0
src/main/java/com/diagbot/entity/his/HisHomeDiagnoseInfo.java

@@ -0,0 +1,162 @@
+package com.diagbot.entity.his;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author lipc
+ * @since 2021-09-28
+ */
+@TableName("HIS_HOME_DIAGNOSE_INFO")
+public class HisHomeDiagnoseInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableField("HOME_PAGE_ID")
+    private String homePageId;
+
+    @TableField("BEHOSPITAL_CODE")
+    private String behospitalCode;
+
+    @TableField("DIAGNOSE_ORDER_NO")
+    private String diagnoseOrderNo;
+
+    @TableField("DIAGNOSE_TYPE")
+    private String diagnoseType;
+
+    @TableField("DIAGNOSE_TYPE_SHORT")
+    private String diagnoseTypeShort;
+
+    @TableField("DIAGNOSE_NAME")
+    private String diagnoseName;
+
+    @TableField("BEHOSPITAL_TYPE")
+    private String behospitalType;
+
+    @TableField("LEAVE_HOSPITAL_TYPE")
+    private String leaveHospitalType;
+
+    @TableField("PATHOLOGY_DIAGNOSE")
+    private String pathologyDiagnose;
+
+    @TableField("ICD_CODE")
+    private String icdCode;
+
+    @TableField("HOSPITAL_ID")
+    private Long hospitalId;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getHomePageId() {
+        return homePageId;
+    }
+
+    public void setHomePageId(String homePageId) {
+        this.homePageId = homePageId;
+    }
+
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+
+    public String getDiagnoseOrderNo() {
+        return diagnoseOrderNo;
+    }
+
+    public void setDiagnoseOrderNo(String diagnoseOrderNo) {
+        this.diagnoseOrderNo = diagnoseOrderNo;
+    }
+
+    public String getDiagnoseType() {
+        return diagnoseType;
+    }
+
+    public void setDiagnoseType(String diagnoseType) {
+        this.diagnoseType = diagnoseType;
+    }
+
+    public String getDiagnoseTypeShort() {
+        return diagnoseTypeShort;
+    }
+
+    public void setDiagnoseTypeShort(String diagnoseTypeShort) {
+        this.diagnoseTypeShort = diagnoseTypeShort;
+    }
+
+    public String getDiagnoseName() {
+        return diagnoseName;
+    }
+
+    public void setDiagnoseName(String diagnoseName) {
+        this.diagnoseName = diagnoseName;
+    }
+
+    public String getBehospitalType() {
+        return behospitalType;
+    }
+
+    public void setBehospitalType(String behospitalType) {
+        this.behospitalType = behospitalType;
+    }
+
+    public String getLeaveHospitalType() {
+        return leaveHospitalType;
+    }
+
+    public void setLeaveHospitalType(String leaveHospitalType) {
+        this.leaveHospitalType = leaveHospitalType;
+    }
+
+    public String getPathologyDiagnose() {
+        return pathologyDiagnose;
+    }
+
+    public void setPathologyDiagnose(String pathologyDiagnose) {
+        this.pathologyDiagnose = pathologyDiagnose;
+    }
+
+    public String getIcdCode() {
+        return icdCode;
+    }
+
+    public void setIcdCode(String icdCode) {
+        this.icdCode = icdCode;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    @Override
+    public String toString() {
+        return "HisHomeDiagnoseInfo{" +
+                "homePageId='" + homePageId + '\'' +
+                ", behospitalCode='" + behospitalCode + '\'' +
+                ", diagnoseOrderNo='" + diagnoseOrderNo + '\'' +
+                ", diagnoseType='" + diagnoseType + '\'' +
+                ", diagnoseTypeShort='" + diagnoseTypeShort + '\'' +
+                ", diagnoseName='" + diagnoseName + '\'' +
+                ", behospitalType='" + behospitalType + '\'' +
+                ", leaveHospitalType='" + leaveHospitalType + '\'' +
+                ", pathologyDiagnose='" + pathologyDiagnose + '\'' +
+                ", icdCode='" + icdCode + '\'' +
+                ", hospitalId=" + hospitalId +
+                '}';
+    }
+}

+ 219 - 0
src/main/java/com/diagbot/entity/his/HisHomeOperationInfo.java

@@ -0,0 +1,219 @@
+package com.diagbot.entity.his;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author lipc
+ * @since 2021-09-28
+ */
+@TableName("HIS_HOME_OPERATION_INFO")
+public class HisHomeOperationInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableField("HOME_PAGE_ID")
+    private String homePageId;
+
+    @TableField("BEHOSPITAL_CODE")
+    private String behospitalCode;
+
+    @TableField("OPERATION_ORDER_NO")
+    private String operationOrderNo;
+
+    @TableField("OPERATION_DATE")
+    private Date operationDate;
+
+    @TableField("OPERATION_CODE")
+    private String operationCode;
+
+    @TableField("OPERATION_DOCTOR_ID")
+    private String operationDoctorId;
+
+    @TableField("FIRST_ASSISTANT_ID")
+    private String firstAssistantId;
+
+    @TableField("SECOND_ASSISTANT_ID")
+    private String secondAssistantId;
+
+    @TableField("CUT_LEVEL")
+    private String cutLevel;
+
+    @TableField("HEALING_LEVEL")
+    private String healingLevel;
+
+    @TableField("OPERATION_NAME")
+    private String operationName;
+
+    @TableField("OPERATION_LEVEL")
+    private String operationLevel;
+
+    @TableField("ANAESTHESIA_NAME")
+    private String anaesthesiaName;
+
+    @TableField("ANAESTHESIA_DOCTOR")
+    private String anaesthesiaDoctor;
+
+    @TableField("SHAM_OPERATION_NAME")
+    private String shamOperationName;
+
+    @TableField("HOSPITAL_ID")
+    private Long hospitalId;
+
+    public String getHomePageId() {
+        return homePageId;
+    }
+
+    public void setHomePageId(String homePageId) {
+        this.homePageId = homePageId;
+    }
+
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+
+    public String getOperationOrderNo() {
+        return operationOrderNo;
+    }
+
+    public void setOperationOrderNo(String operationOrderNo) {
+        this.operationOrderNo = operationOrderNo;
+    }
+
+    public Date getOperationDate() {
+        return operationDate;
+    }
+
+    public void setOperationDate(Date operationDate) {
+        this.operationDate = operationDate;
+    }
+
+    public String getOperationCode() {
+        return operationCode;
+    }
+
+    public void setOperationCode(String operationCode) {
+        this.operationCode = operationCode;
+    }
+
+    public String getOperationDoctorId() {
+        return operationDoctorId;
+    }
+
+    public void setOperationDoctorId(String operationDoctorId) {
+        this.operationDoctorId = operationDoctorId;
+    }
+
+    public String getFirstAssistantId() {
+        return firstAssistantId;
+    }
+
+    public void setFirstAssistantId(String firstAssistantId) {
+        this.firstAssistantId = firstAssistantId;
+    }
+
+    public String getSecondAssistantId() {
+        return secondAssistantId;
+    }
+
+    public void setSecondAssistantId(String secondAssistantId) {
+        this.secondAssistantId = secondAssistantId;
+    }
+
+    public String getCutLevel() {
+        return cutLevel;
+    }
+
+    public void setCutLevel(String cutLevel) {
+        this.cutLevel = cutLevel;
+    }
+
+    public String getHealingLevel() {
+        return healingLevel;
+    }
+
+    public void setHealingLevel(String healingLevel) {
+        this.healingLevel = healingLevel;
+    }
+
+    public String getOperationName() {
+        return operationName;
+    }
+
+    public void setOperationName(String operationName) {
+        this.operationName = operationName;
+    }
+
+    public String getOperationLevel() {
+        return operationLevel;
+    }
+
+    public void setOperationLevel(String operationLevel) {
+        this.operationLevel = operationLevel;
+    }
+
+    public String getAnaesthesiaName() {
+        return anaesthesiaName;
+    }
+
+    public void setAnaesthesiaName(String anaesthesiaName) {
+        this.anaesthesiaName = anaesthesiaName;
+    }
+
+    public String getAnaesthesiaDoctor() {
+        return anaesthesiaDoctor;
+    }
+
+    public void setAnaesthesiaDoctor(String anaesthesiaDoctor) {
+        this.anaesthesiaDoctor = anaesthesiaDoctor;
+    }
+
+    public String getShamOperationName() {
+        return shamOperationName;
+    }
+
+    public void setShamOperationName(String shamOperationName) {
+        this.shamOperationName = shamOperationName;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    @Override
+    public String toString() {
+        return "HisHomeOperationInfo{" +
+                "homePageId='" + homePageId + '\'' +
+                ", behospitalCode='" + behospitalCode + '\'' +
+                ", operationOrderNo='" + operationOrderNo + '\'' +
+                ", operationDate=" + operationDate +
+                ", operationCode='" + operationCode + '\'' +
+                ", operationDoctorId='" + operationDoctorId + '\'' +
+                ", firstAssistantId='" + firstAssistantId + '\'' +
+                ", secondAssistantId='" + secondAssistantId + '\'' +
+                ", cutLevel='" + cutLevel + '\'' +
+                ", healingLevel='" + healingLevel + '\'' +
+                ", operationName='" + operationName + '\'' +
+                ", operationLevel='" + operationLevel + '\'' +
+                ", anaesthesiaName='" + anaesthesiaName + '\'' +
+                ", anaesthesiaDoctor='" + anaesthesiaDoctor + '\'' +
+                ", shamOperationName='" + shamOperationName + '\'' +
+                ", hospitalId=" + hospitalId +
+                '}';
+    }
+}

文件差異過大導致無法顯示
+ 1568 - 0
src/main/java/com/diagbot/entity/his/HisHomePage.java


+ 105 - 0
src/main/java/com/diagbot/entity/his/HisMedicalRecord.java

@@ -0,0 +1,105 @@
+package com.diagbot.entity.his;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author lipc
+ * @since 2021-09-28
+ */
+@TableName("HIS_MEDICAL_RECORD")
+public class HisMedicalRecord implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableField("REC_ID")
+    private String recId;
+
+    @TableField("BEHOSPITAL_CODE")
+    private String behospitalCode;
+
+    @TableField("ORG_CODE")
+    private String orgCode;
+
+    @TableField("REC_TYPE_ID")
+    private String recTypeId;
+
+    @TableField("REC_DATE")
+    private Date recDate;
+
+    @TableField("REC_TITLE")
+    private String recTitle;
+
+    @TableField("HOSPITAL_ID")
+    private Long hospitalId;
+
+    public String getRecId() {
+        return recId;
+    }
+
+    public void setRecId(String recId) {
+        this.recId = recId;
+    }
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+    public String getOrgCode() {
+        return orgCode;
+    }
+
+    public void setOrgCode(String orgCode) {
+        this.orgCode = orgCode;
+    }
+    public String getRecTypeId() {
+        return recTypeId;
+    }
+
+    public void setRecTypeId(String recTypeId) {
+        this.recTypeId = recTypeId;
+    }
+    public Date getRecDate() {
+        return recDate;
+    }
+
+    public void setRecDate(Date recDate) {
+        this.recDate = recDate;
+    }
+    public String getRecTitle() {
+        return recTitle;
+    }
+
+    public void setRecTitle(String recTitle) {
+        this.recTitle = recTitle;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    @Override
+    public String toString() {
+        return "HisMedicalRecord{" +
+                "recId=" + recId +
+                ", behospitalCode=" + behospitalCode +
+                ", orgCode=" + orgCode +
+                ", recTypeId=" + recTypeId +
+                ", recDate=" + recDate +
+                ", recTitle=" + recTitle +
+                ", hospitalId=" + hospitalId +
+                "}";
+    }
+}

+ 86 - 0
src/main/java/com/diagbot/entity/his/HisMedicalRecordContent.java

@@ -0,0 +1,86 @@
+package com.diagbot.entity.his;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author lipc
+ * @since 2021-09-28
+ */
+@TableName("HIS_MEDICAL_RECORD_CONTENT")
+public class HisMedicalRecordContent implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableField("REC_ID")
+    private String recId;
+
+    @TableField("BEHOSPITAL_CODE")
+    private String behospitalCode;
+
+    @TableField("HOSPITAL_ID")
+    private Long hospitalId;
+
+    @TableField("HTML_TEXT")
+    private String htmlText;
+
+    @TableField("XML_TEXT")
+    private String xmlText;
+
+    public String getRecId() {
+        return recId;
+    }
+
+    public void setRecId(String recId) {
+        this.recId = recId;
+    }
+
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHtmlText() {
+        return htmlText;
+    }
+
+    public void setHtmlText(String htmlText) {
+        this.htmlText = htmlText;
+    }
+
+    public String getXmlText() {
+        return xmlText;
+    }
+
+    public void setXmlText(String xmlText) {
+        this.xmlText = xmlText;
+    }
+
+    @Override
+    public String toString() {
+        return "HisMedicalRecordContent{" +
+                "recId='" + recId + '\'' +
+                ", behospitalCode='" + behospitalCode + '\'' +
+                ", hospitalId=" + hospitalId +
+                ", htmlText='" + htmlText + '\'' +
+                ", xmlText='" + xmlText + '\'' +
+                '}';
+    }
+}

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

@@ -12,6 +12,9 @@ public enum ServiceErrorCode implements ErrorCode {
     USER_PASSWORD_ERROR("10020001", "账号或密码不正确"),
     GET_TOKEN_FAIL("10020002", "获取token失败"),
     TOKEN_IS_NOT_MATCH_USER("10020003", "请使用自己的token进行接口请求"),
+    LONGIN_ERROE("10020012", "您的账号在其它地方已登录,您已被迫下线,请重新登录。如非本人授权,登录后请及时修改密码。"),
+    USER_POWER_UP("10020012", "您的权限已被管理员修改,您已被迫下线,请重新登录。"),
+    LONGIN_TOKEN_ERROE("10020013", "登录异常"),
 
     SMS_SEND_ERROR("10020004", "短信发送错误"),
     USER_BIND_ERROR("10020005", "用户手机号已经绑定无需再次验证"),

+ 15 - 1
src/main/java/com/diagbot/facade/BasDeptInfoFacade.java

@@ -4,6 +4,7 @@ import com.diagbot.dto.BasDeptInfoDTO;
 import com.diagbot.service.impl.BasDeptInfoServiceImpl;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.BasDeptInfoVO;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -24,10 +25,23 @@ public class BasDeptInfoFacade extends BasDeptInfoServiceImpl {
      */
     public List<BasDeptInfoDTO> listForUser(BasDeptInfoVO basDeptInfoVO) {
         basDeptInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        listForUserSet(basDeptInfoVO);
         List<BasDeptInfoDTO> basDeptInfoDTOList = this.getList(basDeptInfoVO);
         return basDeptInfoDTOList;
     }
-
+    private void listForUserSet(BasDeptInfoVO basDeptInfoVO) {
+        if (StringUtils.isNotBlank(basDeptInfoVO.getInputStr())) {
+            String tranStr = basDeptInfoVO.getInputStr();
+            if( tranStr.contains("%")){
+                tranStr = tranStr.replace("%", "\\%");
+                basDeptInfoVO.setInputStr(tranStr);
+            }
+            if( tranStr.contains("_")){
+                tranStr = tranStr.replace("_","\\_");
+                basDeptInfoVO.setInputStr(tranStr);
+            }
+        }
+    }
 
     /**
      * 获取医院用户下拉列表信息

+ 93 - 25
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -22,6 +22,7 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
@@ -149,6 +150,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     SysUserRoleFacade sysUserRoleFacade;
     @Autowired
     MedClickInfoServiceImpl medClickInfoService;
+    @Autowired
+    QcresultDetailFacade qcresultDetailFacade;
+
 
 
     /**
@@ -338,7 +342,20 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (ListUtil.isEmpty(paramList) || paramList.contains("msg")) {
             AnalyzeVO analyzeVO = new AnalyzeVO();
             BeanUtil.copyProperties(getDetailVO, analyzeVO);
+            QcresultInfo qcresultInfo = qcresultInfoFacade.getOne(new QueryWrapper<QcresultInfo>()
+                    .eq("hospital_id", analyzeVO.getHospitalId())
+                    .eq("behospital_code", analyzeVO.getBehospitalCode())
+                    .eq("is_deleted", IsDeleteEnum.N.getKey()));
+            if (qcresultInfo != null && qcresultInfo.getId() != null) {
+                analyzeVO.setQcresultInfoId(qcresultInfo.getId());
+            }
             List<MsgDTO> msgDTOList = getMsg(analyzeVO);
+
+            if (ListUtil.isEmpty(msgDTOList)) {
+                analyzeVO.setQcresultInfoId(null);
+                msgDTOList = getMsg(analyzeVO);
+            }
+
             if (ListUtil.isNotEmpty(msgDTOList)) {
                 // 从qc_question_info的cases_entry_ids获取
                 Map<String, Object> paramMap = new HashMap<>();
@@ -1054,14 +1071,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
         queryVo.setUseCrfCache(analyzeVO.isUseCrfCache());
         //已核查抛出以评分
-        List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", analyzeVO.getHospitalId())
-                .eq("behospital_code", analyzeVO.getBehospitalCode()));
-        Set<Integer> status = medCheckInfos.stream().map(MedCheckInfo::getStatus).collect(Collectors.toSet());
-        if (medCheckInfos.size() >= 1 && status.contains(CheckStatusEnum.Enable.getKey()) && analyzeVO.getCheckFlag()) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病例已经核查无需评分!");
-        }
+//        List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
+//                .eq("is_deleted", IsDeleteEnum.N.getKey())
+//                .eq("hospital_id", analyzeVO.getHospitalId())
+//                .eq("behospital_code", analyzeVO.getBehospitalCode()));
+//        Set<Integer> status = medCheckInfos.stream().map(MedCheckInfo::getStatus).collect(Collectors.toSet());
+//        if (medCheckInfos.size() >= 1 && status.contains(CheckStatusEnum.Enable.getKey()) && analyzeVO.getCheckFlag()) {
+//            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病例已经核查无需评分!");
+//        }
         //  调用质控接口
         Response<OutputInfo> response = qcServiceClient.extract(queryVo);
         if (response == null || response.getData() == null) {
@@ -1730,7 +1747,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
         }
 
-        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
+        List<MsgDTO> msgDTOList = this.getBaseMapper().getForeignMsg(analyzeVO);
         if (ListUtil.isNotEmpty(msgDTOList)) {
             msgDTOList.forEach(msgDTO -> {
                 if (StringUtils.isNotEmpty(msgDTO.getInfo()) && StringUtils.isNotEmpty(msgDTO.getInfo().trim()) &&
@@ -2257,6 +2274,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                                                String isPlacefile) {
         Long hospitalId = analyzeVO.getHospitalId();
         List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
+        //获取本用户原手动添加的扣分条目(删除|未删除)
+        List<QcCasesEntry> qcCasesEntryHistory = new ArrayList<>();
+        List<QcresultDetail> qcresultDetails = getQcDetailHistory(analyzeVO, codeList, qcCasesEntryHistory);
+        Map<Long, List<QcCasesEntry>> qcCasesEntryHistoryMap = qcCasesEntryHistory.stream().collect(Collectors.groupingBy(QcCasesEntry::getId));
         if (ListUtil.isNotEmpty(codeList)) {
             // 根据质控结果获取质控条目
             QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
@@ -2273,6 +2294,25 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 bean.setInfo(info);
             }
         }
+        //1.1未删除的手工评分
+        List<QcResultAlgVO> rgQcResultAlgVOList = new ArrayList<>();
+        if (qcresultDetails != null) {
+            List<QcresultDetail> notDelQcDetailHistory = qcresultDetails.stream()
+                    .filter(qcresultDetail -> "N".equals(qcresultDetail.getIsDeleted())).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(notDelQcDetailHistory)) {
+                notDelQcDetailHistory.stream().forEach(qcresultDetail -> {
+                    QcResultAlgVO temp = new QcResultAlgVO();
+                    BeanUtils.copyProperties(qcresultDetail, temp);
+                    try {
+                        temp.setCode(qcCasesEntryHistoryMap.get(qcresultDetail.getCasesEntryId()).get(0).getCode());
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    rgQcResultAlgVOList.add(temp);
+                });
+            }
+            qcResultAlgVOList.addAll(rgQcResultAlgVOList);
+        }
 
         // 评分
         AlgorithmVO algorithmVO = new AlgorithmVO();
@@ -2354,6 +2394,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         String menuData = JSON.toJSONString(qcModeDTOList);
 
         // 保存评分结果信息
+        //计分删除人工添加条目
+        algorithmVO.getQcResultAlgVOList().removeAll(rgQcResultAlgVOList);
         Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask(), null);
 
         // 返回结果信息
@@ -2466,21 +2508,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return baseMapper.malignancy(filterVO);
     }
 
-    /**
-     * @Description:医生质控信息次数
-     * @Param: [medClickInfoVO]
-     * @return: void
-     * @Author: cy
-     * @Date: 2021/11/10
-     */
-    public Boolean addMedClickInfo(MedClickInfoVO medClickInfoVO) {
-        MedClickInfo medClickInfo = new MedClickInfo();
-        medClickInfo.setHospitalId(Integer.valueOf(SysUserUtils.getCurrentHospitalID()));
-        medClickInfo.setCreator(SysUserUtils.getCurrentPrincipleID());
-        BeanUtil.copyProperties(medClickInfoVO, medClickInfo);
-        medClickInfo.setGmtCreate(new Date());
-        return medClickInfoService.save(medClickInfo);
-    }
 
     /**
      * 获取患者年龄信息(通过出生日期和入院日期重新计算)
@@ -2511,5 +2538,46 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         return behospitalInfoAgeDTOList;
     }
-
+    /**
+     * @param analyzeVO
+     * @param codeList
+     * @Description获取原手动扣分分值条目
+     * @Return void
+     */
+    private List<QcresultDetail> getQcDetailHistory(AnalyzeVO analyzeVO, List<String> codeList, List<QcCasesEntry> qcCasesEntryHistory) {
+        List<QcresultDetail> qcresultDetails = null;
+        try {
+            QcresultInfo qcresultInfoup
+                    = qcresultInfoFacade.getOne(
+                    new QueryWrapper<QcresultInfo>()
+                            .eq("is_deleted", IsDeleteEnum.N.getKey())
+                            .eq("hospital_id", analyzeVO.getHospitalId())
+                            .eq("behospital_code", analyzeVO.getBehospitalCode()), false);
+            //未评过分
+            if (qcresultInfoup == null) {
+                return null;
+            }
+            //1.获取上一次评分手工添加的条目
+            qcresultDetails = qcresultDetailFacade.list(new QueryWrapper<QcresultDetail>()
+                    .eq("hospital_id", analyzeVO.getHospitalId())
+                    .eq("behospital_code", analyzeVO.getBehospitalCode())
+                    .eq("grade_type", "2")
+                    .eq("qcresult_info_id", qcresultInfoup.getId()));
+            List<Long> qcDetailIDHistory = qcresultDetails.stream().map(QcresultDetail::getCasesEntryId).collect(Collectors.toList());
+
+            if (ListUtil.isNotEmpty(qcDetailIDHistory)) {
+                List<QcCasesEntry> qcCasesEntries = qcCasesEntryFacade.list(new QueryWrapper<QcCasesEntry>()
+                        .select("id,code")
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .in("id", qcDetailIDHistory));
+                if (ListUtil.isNotEmpty(qcCasesEntries)) {
+                    qcCasesEntryHistory.addAll(qcCasesEntries);
+                    codeList.removeAll(qcCasesEntryHistory.stream().map(QcCasesEntry::getCode).collect(Collectors.toList()));
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return qcresultDetails;
+    }
 }

+ 215 - 0
src/main/java/com/diagbot/facade/DataAnalysisDeptFacade.java

@@ -0,0 +1,215 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.dto.BehospitalCodeInfo;
+import com.diagbot.dto.EntryDefectImproveInnerDoctor;
+import com.diagbot.dto.EntryDefectImproveInnerExport;
+import com.diagbot.dto.GetEntryDefectImproveDeptDTO;
+import com.diagbot.dto.GetEntryInfoDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.MedClickInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.GetEntryDefectImproveDeptVO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+import javax.servlet.http.HttpServletResponse;
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+
+/**
+ * @Description:数据分析
+ * @Author: cy
+ * @time: 2021/11/16 18:28
+ */
+@Component
+public class DataAnalysisDeptFacade {
+    @Autowired
+    @Qualifier("medClickInfoServiceImpl")
+    private MedClickInfoServiceImpl medClickInfoService;
+
+    public IPage<GetEntryDefectImproveDeptDTO> getEntryDefectImproveDept(GetEntryDefectImproveDeptVO getEntryDefectImproveDeptVO) {
+        int current = (int) getEntryDefectImproveDeptVO.getCurrent();
+        int size = (int) getEntryDefectImproveDeptVO.getSize();
+        entryDefectDeptSet(getEntryDefectImproveDeptVO);
+        IPage<GetEntryDefectImproveDeptDTO> page = new Page<>();
+        List<GetEntryDefectImproveDeptDTO> getEntryDefectImproveDeptDTOList = new ArrayList<>();
+        DecimalFormat df = new DecimalFormat("#.00");
+        //获取标准缺陷信息
+        List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
+        //查询基础数据源
+        List<EntryDefectImproveInnerExport> records = medClickInfoService.getBaseMapper().getEntryDefectImproveDept(getEntryDefectImproveDeptVO);
+        //遍历科室
+        for (EntryDefectImproveInnerExport entryDefectImproveInnerExport : records) {
+            List<EntryDefectImproveInnerDoctor> entryDefectImproveInnerDoctors = entryDefectImproveInnerExport.getEntryDefectImproveInnerDoctors();
+            for (EntryDefectImproveInnerDoctor entryDefectImproveInnerDoctor : entryDefectImproveInnerDoctors) {
+                //对科室下医生质控的病历缺陷计数
+                Map<String, Long> totalMap = new HashMap<>();
+                Map<String, Long> improveleMap = new HashMap<>();
+                List<BehospitalCodeInfo> behospitalCodeInfoList = entryDefectImproveInnerDoctor.getBehospitalCodeInfos();
+                //多份病历多次质控评分得到质控缺陷总量、待改善总量
+                DataAnalysisFacade.unitProcessing(behospitalCodeInfoList, totalMap, improveleMap);
+                //按照全院维度进行数据封装
+                for (Map.Entry<String, Long> stringLongEntry : totalMap.entrySet()) {
+                    GetEntryDefectImproveDeptDTO getEntryDefectImproveDeptDTO = new GetEntryDefectImproveDeptDTO();
+                    getEntryDefectImproveDeptDTO.setDeptId(entryDefectImproveInnerExport.getDeptId());
+                    getEntryDefectImproveDeptDTO.setDeptName(entryDefectImproveInnerExport.getDeptName());
+                    getEntryDefectImproveDeptDTO.setDoctorId(entryDefectImproveInnerDoctor.getDoctorId());
+                    getEntryDefectImproveDeptDTO.setDoctorName(entryDefectImproveInnerDoctor.getDoctorName());
+                    getEntryDefectImproveDeptDTO.setEntryId(stringLongEntry.getKey());
+                    getEntryInfoByDept(entryInfo, stringLongEntry, getEntryDefectImproveDeptDTO);
+                    getEntryDefectImproveDeptDTO.setTotalNum(stringLongEntry.getValue());
+                    if (improveleMap.containsKey(stringLongEntry.getKey())) {
+                        getEntryDefectImproveDeptDTO.setImproveleNum(improveleMap.get(stringLongEntry.getKey()));
+                    }
+                    getEntryDefectImproveDeptDTO.setHandleNum(getEntryDefectImproveDeptDTO.getTotalNum() - getEntryDefectImproveDeptDTO.getImproveleNum());
+                    double handleRatio = 0d;
+                    if(getEntryDefectImproveDeptDTO.getTotalNum()!=0 && getEntryDefectImproveDeptDTO.getHandleNum()!=0){
+                        handleRatio = getEntryDefectImproveDeptDTO.getHandleNum().doubleValue()*100/getEntryDefectImproveDeptDTO.getTotalNum().doubleValue();
+                        String handleStr = df.format(handleRatio)+"%";
+                        getEntryDefectImproveDeptDTO.setHandleStr(handleStr);
+                    }
+                    getEntryDefectImproveDeptDTOList.add(getEntryDefectImproveDeptDTO);
+                }
+            }
+        }
+        //(部分模糊查询在此)
+        if (ListUtil.isNotEmpty(getEntryDefectImproveDeptDTOList)) {
+            if (StringUtils.isNotBlank(getEntryDefectImproveDeptVO.getCasesName()) || StringUtils.isNotBlank(getEntryDefectImproveDeptVO.getEntryName())) {
+                getEntryDefectImproveQueryDept(getEntryDefectImproveDeptVO, getEntryDefectImproveDeptDTOList);
+            }
+        }
+
+        //导出操作
+        if (getEntryDefectImproveDeptVO.getExportType() == 1L) {
+            size = getEntryDefectImproveDeptDTOList.size();
+        }
+        page.setSize(size);
+        page.setTotal(getEntryDefectImproveDeptDTOList.size());
+        page.setCurrent(current);
+        //排序操作
+        if (ListUtil.isNotEmpty(getEntryDefectImproveDeptDTOList)) {
+            getEntryDefectImproveDeptDTOList = sortEntryDefectListByDdept(getEntryDefectImproveDeptDTOList, getEntryDefectImproveDeptVO);
+        }
+        //分页操作
+        List<GetEntryDefectImproveDeptDTO> getEntryDefectImproveDeptDTOS = DataAnalysisFacade.page(getEntryDefectImproveDeptDTOList, size, current);
+        page.setRecords(getEntryDefectImproveDeptDTOS);
+        return page;
+    }
+
+    public void getEntryDefectImproveQueryDept(GetEntryDefectImproveDeptVO getEntryDefectImproveDeptVO, List<GetEntryDefectImproveDeptDTO> getEntryDefectImproveDeptDTOList) {
+
+        Iterator<GetEntryDefectImproveDeptDTO> iterator = getEntryDefectImproveDeptDTOList.iterator();
+        while (iterator.hasNext()) {
+            boolean mark = true;
+            GetEntryDefectImproveDeptDTO kfc = iterator.next();
+            if (StringUtils.isNotBlank(getEntryDefectImproveDeptVO.getCasesName()) &&
+                    !kfc.getCasesName().contains(getEntryDefectImproveDeptVO.getCasesName())) {
+                iterator.remove();
+                mark = false;
+            }
+            if (mark && StringUtils.isNotBlank(getEntryDefectImproveDeptVO.getEntryName()) &&
+                    !kfc.getEntryName().contains(getEntryDefectImproveDeptVO.getEntryName())) {
+                iterator.remove();
+            }
+        }
+    }
+
+    public void getEntryDefectImproveByDeptExport(HttpServletResponse response, GetEntryDefectImproveDeptVO getEntryDefectImproveDeptVO) {
+        getEntryDefectImproveDeptVO.setCurrent(1L);
+        getEntryDefectImproveDeptVO.setSize(Long.MAX_VALUE);
+        getEntryDefectImproveDeptVO.setSearchCount(false);
+        getEntryDefectImproveDeptVO.setExportType(1L);
+        IPage<GetEntryDefectImproveDeptDTO> page = getEntryDefectImproveDept(getEntryDefectImproveDeptVO);
+        String fileName = "条目缺陷改善统计(科室).xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", GetEntryDefectImproveDeptDTO.class, fileName, response, 12.8f);
+    }
+
+    private void entryDefectDeptSet(GetEntryDefectImproveDeptVO getEntryDefectImproveDeptVO) {
+        if(StringUtils.isBlank(getEntryDefectImproveDeptVO.getDeptName())){
+            getEntryDefectImproveDeptVO.setDeptName("--");
+        }
+        getEntryDefectImproveDeptVO.setCurrent(1L);
+        getEntryDefectImproveDeptVO.setSize(Long.MAX_VALUE);
+        //入参验证
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date startDate = null;
+        Date endDate = null;
+        try {
+            startDate = simpleDateFormat.parse(getEntryDefectImproveDeptVO.getStartDate());
+            endDate = simpleDateFormat.parse(getEntryDefectImproveDeptVO.getEndDate());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (DateUtil.after(startDate, endDate)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
+        }
+        getEntryDefectImproveDeptVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+    }
+
+    public List<GetEntryDefectImproveDeptDTO> sortEntryDefectListByDdept(List<GetEntryDefectImproveDeptDTO> getEntryDefectImproveDeptDTOS, GetEntryDefectImproveDeptVO getEntryDefectImproveDeptVO) {
+        if (StringUtils.isNotBlank(getEntryDefectImproveDeptVO.getAsc())) {
+            if ("totalNum".equals(getEntryDefectImproveDeptVO.getAsc())) {
+                getEntryDefectImproveDeptDTOS = getEntryDefectImproveDeptDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDeptDTO::getTotalNum)).collect(Collectors.toList());
+
+            }
+            if ("handleNum".equals(getEntryDefectImproveDeptVO.getAsc())) {
+                getEntryDefectImproveDeptDTOS = getEntryDefectImproveDeptDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDeptDTO::getHandleNum)).collect(Collectors.toList());
+
+            }
+            if ("improveleNum".equals(getEntryDefectImproveDeptVO.getAsc())) {
+                getEntryDefectImproveDeptDTOS = getEntryDefectImproveDeptDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDeptDTO::getImproveleNum)).collect(Collectors.toList());
+            }
+        }
+
+        if (StringUtils.isNotBlank(getEntryDefectImproveDeptVO.getDesc())) {
+            if ("totalNum".equals(getEntryDefectImproveDeptVO.getDesc())) {
+                getEntryDefectImproveDeptDTOS = getEntryDefectImproveDeptDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDeptDTO::getTotalNum).reversed()).collect(Collectors.toList());
+
+            }
+            if ("handleNum".equals(getEntryDefectImproveDeptVO.getDesc())) {
+                getEntryDefectImproveDeptDTOS = getEntryDefectImproveDeptDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDeptDTO::getHandleNum).reversed()).collect(Collectors.toList());
+
+            }
+            if ("improveleNum".equals(getEntryDefectImproveDeptVO.getDesc())) {
+                getEntryDefectImproveDeptDTOS = getEntryDefectImproveDeptDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDeptDTO::getImproveleNum).reversed()).collect(Collectors.toList());
+            }
+        }
+        return getEntryDefectImproveDeptDTOS;
+    }
+
+    /**
+     * @Description: 缺陷信息封装
+     * @Param: [entryInfo, stringLongEntry, getEntryDefectImprove]
+     * @return: com.diagbot.dto.GetEntryDefectImproveDTO
+     * @Author: cy
+     * @Date: 2021/12/3
+     */
+    public GetEntryDefectImproveDeptDTO getEntryInfoByDept(List<GetEntryInfoDTO> entryInfo, Map.Entry<String, Long> stringLongEntry,
+                                                           GetEntryDefectImproveDeptDTO getEntryDefectImproveDeptDTO) {
+        entryInfo.parallelStream().filter(kfc -> kfc.getEntryId().equals(stringLongEntry.getKey())).forEach(
+                obj -> {
+                    getEntryDefectImproveDeptDTO.setCasesId(obj.getCasesId());
+                    getEntryDefectImproveDeptDTO.setCasesName(obj.getCasesName());
+                    getEntryDefectImproveDeptDTO.setEntryName(obj.getEntryName());
+                }
+        );
+        return getEntryDefectImproveDeptDTO;
+    }
+}

+ 758 - 0
src/main/java/com/diagbot/facade/DataAnalysisFacade.java

@@ -0,0 +1,758 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.dto.BehospitalAnalysisDTO;
+import com.diagbot.dto.BehospitalCodeDetail;
+import com.diagbot.dto.BehospitalCodeInfo;
+import com.diagbot.dto.DeptBaseDTO;
+import com.diagbot.dto.EntryDefectImprove;
+import com.diagbot.dto.EntryDefectImproveInner;
+import com.diagbot.dto.GetEntryDefectImproveDTO;
+import com.diagbot.dto.GetEntryInfoDTO;
+import com.diagbot.dto.GetQcClickDTO;
+import com.diagbot.dto.GetQcClickInnerPageDTO;
+import com.diagbot.dto.QcResultDetailInfo;
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.MedClickInfo;
+import com.diagbot.entity.MedQcresultClick;
+import com.diagbot.entity.QcresultDetail;
+import com.diagbot.entity.QcresultInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.MedQcresultClickService;
+import com.diagbot.service.impl.MedClickInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.BasDeptInfoVO;
+import com.diagbot.vo.GetEntryDefectImproveInnerVO;
+import com.diagbot.vo.GetEntryDefectImproveVO;
+import com.diagbot.vo.GetQcClickInnerPageVO;
+import com.diagbot.vo.GetQcClickVO;
+import com.diagbot.vo.MedClickInfoVO;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletResponse;
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+
+/**
+ * @Description:数据分析
+ * @Author: cy
+ * @time: 2021/11/16 18:28
+ */
+@Component
+public class DataAnalysisFacade {
+    @Autowired
+    @Qualifier("medClickInfoServiceImpl")
+    private MedClickInfoServiceImpl medClickInfoService;
+
+    @Autowired
+    private QcresultInfoFacade qcresultInfoFacade;
+
+    @Autowired
+    private QcresultDetailFacade qcresultDetailFacade;
+
+    @Autowired
+    private MedQcresultClickService medQcresultClickService;
+
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    /**
+     * @Description:医生质控信息次数
+     * @Param: [medClickInfoVO]
+     * @return: void
+     * @Author: cy
+     * @Date: 2021/11/10
+     */
+    public Boolean addMedClickInfo(MedClickInfoVO medClickInfoVO) {
+        BehospitalInfo behospitalInfo = behospitalInfoFacade.lambdaQuery()
+                .eq(BehospitalInfo::getHospitalId, medClickInfoVO.getHospitalId())
+                .eq(BehospitalInfo::getBehospitalCode, medClickInfoVO.getBehospitalCode())
+                .ne(BehospitalInfo::getQcTypeId, "0")
+                .eq(BehospitalInfo::getIsDeleted, IsDeleteEnum.N.getKey())
+                .one();
+        if(null == behospitalInfo){
+            throw new CommonException(CommonErrorCode.FAIL, "该病历不符合要求");
+        }
+
+        MedClickInfo medClickInfo = new MedClickInfo();
+        BeanUtil.copyProperties(medClickInfoVO, medClickInfo);
+        QcresultInfo qcresultInfo = qcresultInfoFacade.lambdaQuery()
+                .eq(QcresultInfo::getHospitalId, medClickInfoVO.getHospitalId())
+                .eq(QcresultInfo::getBehospitalCode, medClickInfoVO.getBehospitalCode())
+                .eq(QcresultInfo::getIsDeleted, IsDeleteEnum.N.getKey())
+                .select(QcresultInfo::getId).one();
+        if (null == qcresultInfo || null == qcresultInfo.getId()
+        ) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "内部参数异常");
+        }
+        medClickInfo.setQcresultInfoId(qcresultInfo.getId());
+        medClickInfo.setGmtCreate(new Date());
+        medClickInfoService.save(medClickInfo);
+
+        List<QcresultDetail> list = qcresultDetailFacade.lambdaQuery()
+                .eq(QcresultDetail::getHospitalId, medClickInfoVO.getHospitalId())
+                .eq(QcresultDetail::getBehospitalCode, medClickInfoVO.getBehospitalCode())
+                .eq(QcresultDetail::getQcresultInfoId, qcresultInfo.getId())
+                .eq(QcresultDetail::getIsDeleted, IsDeleteEnum.N.getKey()).list();
+        if (ListUtil.isNotEmpty(list)) {
+            StringBuilder sbFir = new StringBuilder();
+            for (QcresultDetail qcresultDetail : list) {
+                if (1 == qcresultDetail.getGradeType()) {
+                    if (null != qcresultDetail.getCasesEntryId() && 0L != qcresultDetail.getCasesEntryId()) {
+                        sbFir.append(qcresultDetail.getCasesEntryId() + "、");
+                    }
+                }
+            }
+            if (sbFir.length() > 0) {
+                sbFir = sbFir.deleteCharAt(sbFir.length() - 1);
+            }
+            MedQcresultClick medQcresultClick = new MedQcresultClick();
+            medQcresultClick.setHospitalId(medClickInfoVO.getHospitalId());
+            medQcresultClick.setBehospitalCode(medClickInfoVO.getBehospitalCode());
+            medQcresultClick.setDeptId(behospitalInfo.getBehDeptId());
+            medQcresultClick.setDeptName(behospitalInfo.getBehDeptName());
+            medQcresultClick.setQcresultInfoId(qcresultInfo.getId());
+            medQcresultClick.setCasesEntryIds(sbFir.toString());
+            medQcresultClick.setGmtCreate(new Date());
+            medQcresultClickService.save(medQcresultClick);
+        }
+        return true;
+    }
+
+    public List<DeptBaseDTO> getQcClickDeptList(BasDeptInfoVO basDeptInfoVO) {
+        long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
+        List<DeptBaseDTO> deptDTO = new ArrayList<>();
+        List<MedClickInfo> deptList = medClickInfoService.lambdaQuery()
+                .eq(MedClickInfo::getHospitalId, hospitalId)
+                .eq(MedClickInfo::getIsDeleted, IsDeleteEnum.N.getKey())
+                .like(MedClickInfo::getDeptName, basDeptInfoVO.getInputStr())
+                .select(MedClickInfo::getDeptId, MedClickInfo::getDeptName)
+                .groupBy(MedClickInfo::getDeptId)
+                .groupBy(MedClickInfo::getDeptName)
+                .list();
+        if (ListUtil.isNotEmpty(deptList)) {
+            for (MedClickInfo kfc : deptList) {
+                if (null == kfc) {
+                    return deptDTO;
+                }
+                DeptBaseDTO deptBaseDTO = new DeptBaseDTO();
+                deptBaseDTO.setDeptId(kfc.getDeptId());
+                deptBaseDTO.setDeptName(kfc.getDeptName());
+                deptDTO.add(deptBaseDTO);
+            }
+        }
+        return deptDTO;
+    }
+
+    public List<GetQcClickDTO> getQcClick(GetQcClickVO getQcClickVO) {
+        clickPageSet(getQcClickVO);
+        List<GetQcClickDTO> records = medClickInfoService.getBaseMapper().getQcClick(getQcClickVO);
+        //没有科室过滤时增加全院数据
+        if (StringUtil.isBlank(getQcClickVO.getDeptName()) || getQcClickVO.getDeptName().equals("全院")) {
+            GetQcClickDTO item = getGlobleTitle(records);
+            if (item != null) {
+                records.add(0, item);
+            }
+        }
+        return records;
+    }
+
+
+    public void getQcClickByExport(HttpServletResponse response, GetQcClickVO getQcClickVO) {
+        List<GetQcClickDTO> records = getQcClick(getQcClickVO);
+        String fileName = "临床质控使用统计.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", GetQcClickDTO.class, fileName, response, 12.8f);
+    }
+
+    public IPage<GetQcClickInnerPageDTO> getQcClickInnerPage(GetQcClickInnerPageVO getQcClickInnerPageVO) {
+        clickInnerPageSet(getQcClickInnerPageVO);
+        IPage<GetQcClickInnerPageDTO> records = medClickInfoService.getBaseMapper().getQcClickInnerPage(getQcClickInnerPageVO);
+        return records;
+    }
+
+    public void getQcClickInnerPageByExport(HttpServletResponse response, GetQcClickInnerPageVO getQcClickInnerPageVO) {
+        getQcClickInnerPageVO.setCurrent(1L);
+        getQcClickInnerPageVO.setSize(Long.MAX_VALUE);
+        getQcClickInnerPageVO.setSearchCount(false);
+        IPage<GetQcClickInnerPageDTO> page = getQcClickInnerPage(getQcClickInnerPageVO);
+        String fileName = "临床质控使用统计内页.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", GetQcClickInnerPageDTO.class, fileName, response, 12.8f);
+    }
+
+    public IPage<GetEntryDefectImproveDTO> getEntryDefectImprove(GetEntryDefectImproveVO getEntryDefectImproveVO) {
+        int current = (int) getEntryDefectImproveVO.getCurrent();
+        int size = (int) getEntryDefectImproveVO.getSize();
+        IPage<GetEntryDefectImproveDTO> page = new Page<>();
+        entryDefectSet(getEntryDefectImproveVO);
+        DecimalFormat df = new DecimalFormat("#.00");
+        List<GetEntryDefectImproveDTO> getEntryDefectImproveDTO = new ArrayList<>();
+        //获取标准缺陷信息
+        List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
+        //查询基础数据源
+        List<EntryDefectImprove> records = medClickInfoService.getBaseMapper().getEntryDefectImprove(getEntryDefectImproveVO);
+        //遍历科室
+        for (EntryDefectImprove entryDefectImprove : records) {
+            Map<String, Long> totalMap = new HashMap<>();
+            Map<String, Long> improveleMap = new HashMap<>();
+            List<BehospitalCodeInfo> behospitalCodeInfoList = entryDefectImprove.getBehospitalCodeInfos();
+            //多份病历多次质控评分得到质控缺陷总量、待改善总量
+            unitProcessing(behospitalCodeInfoList, totalMap, improveleMap);
+            //按照全院维度进行数据封装
+            for (Map.Entry<String, Long> stringLongEntry : totalMap.entrySet()) {
+                //封装DTO
+                GetEntryDefectImproveDTO getEntryDefectImprove = new GetEntryDefectImproveDTO();
+                getEntryDefectImprove.setDeptId(entryDefectImprove.getDeptId());
+                getEntryDefectImprove.setDeptName(entryDefectImprove.getDeptName());
+                getEntryDefectImprove.setEntryId(stringLongEntry.getKey());
+                getEntryInfo(entryInfo, stringLongEntry, getEntryDefectImprove);
+                getEntryDefectImprove.setTotalNum(stringLongEntry.getValue());
+                if (improveleMap.containsKey(stringLongEntry.getKey())) {
+                    getEntryDefectImprove.setImproveleNum(improveleMap.get(stringLongEntry.getKey()));
+                }
+                getEntryDefectImprove.setHandleNum(getEntryDefectImprove.getTotalNum() - getEntryDefectImprove.getImproveleNum());
+                double handleRatio = 0d;
+                if(getEntryDefectImprove.getTotalNum()!=0 && getEntryDefectImprove.getHandleNum()!=0){
+                    handleRatio = getEntryDefectImprove.getHandleNum().doubleValue()*100/getEntryDefectImprove.getTotalNum().doubleValue();
+                    String handleStr = df.format(handleRatio)+"%";
+                    getEntryDefectImprove.setHandleStr(handleStr);
+                }
+                getEntryDefectImproveDTO.add(getEntryDefectImprove);
+            }
+        }
+        //(部分模糊查询在此)
+            if (ListUtil.isNotEmpty(getEntryDefectImproveDTO)) {
+                if (StringUtils.isNotBlank(getEntryDefectImproveVO.getCasesName()) || StringUtils.isNotBlank(getEntryDefectImproveVO.getEntryName())) {
+                getEntryDefectImproveQuery(getEntryDefectImproveVO, getEntryDefectImproveDTO);
+            }
+        }
+
+
+        //导出操作
+        if (getEntryDefectImproveVO.getExportType() == 1L) {
+            size = getEntryDefectImproveDTO.size();
+        }
+        page.setSize(size);
+        page.setTotal(getEntryDefectImproveDTO.size());
+        page.setCurrent(current);
+        //排序操作
+        if (ListUtil.isNotEmpty(getEntryDefectImproveDTO)) {
+            getEntryDefectImproveDTO =  sortEntryDefectList( getEntryDefectImproveDTO ,getEntryDefectImproveVO);
+        }
+        //分页操作
+        List<GetEntryDefectImproveDTO> getEntryDefectImproveDTOS = page(getEntryDefectImproveDTO, size, current);
+        page.setRecords(getEntryDefectImproveDTOS);
+        return page;
+    }
+
+    /**
+     * @Description: 缺陷信息封装
+     * @Param: [entryInfo, stringLongEntry, getEntryDefectImprove]
+     * @return: com.diagbot.dto.GetEntryDefectImproveDTO
+     * @Author: cy
+     * @Date: 2021/12/3
+     */
+    public GetEntryDefectImproveDTO getEntryInfo(List<GetEntryInfoDTO> entryInfo, Map.Entry<String, Long> stringLongEntry,
+                                                 GetEntryDefectImproveDTO getEntryDefectImprove) {
+        entryInfo.parallelStream().filter(kfc -> kfc.getEntryId().equals(stringLongEntry.getKey())).forEach(
+                obj -> {
+                    getEntryDefectImprove.setCasesId(obj.getCasesId());
+                    getEntryDefectImprove.setCasesName(obj.getCasesName());
+                    getEntryDefectImprove.setEntryName(obj.getEntryName());
+                }
+        );
+        return getEntryDefectImprove;
+    }
+
+    /**
+     * @Description: 多份病历多次质控评分得到质控缺陷总量、待改善总量
+     * @Param: [behospitalCodeInfoList, totalMap, improveleMap]
+     * @return: void
+     * @Author: cy
+     * @Date: 2021/12/3
+     */
+    public static void unitProcessing(List<BehospitalCodeInfo> behospitalCodeInfoList, Map<String, Long> totalMap,
+                                      Map<String, Long> improveleMap) {
+        for (BehospitalCodeInfo behospitalCodeInfo : behospitalCodeInfoList) {
+            //病历下
+            List<QcResultDetailInfo> qcResultDetailInfos = behospitalCodeInfo.getQcResultDetailInfos();
+                //获取多病历多质控质控缺陷总量
+                totalMap = getEntryTotalMap(qcResultDetailInfos, totalMap);
+                if (MapUtils.isNotEmpty(totalMap)) {
+                    //获取多病历多质控质控缺陷待改善总量
+                    QcResultDetailInfo qcResultDetailInfo = qcResultDetailInfos.get(qcResultDetailInfos.size() - 1);
+                    improveleMap = getEntryImproveleMap(qcResultDetailInfo, improveleMap);
+                }
+        }
+    }
+
+
+    public void getEntryDefectImproveQuery(GetEntryDefectImproveVO getEntryDefectImproveVO, List<GetEntryDefectImproveDTO> getEntryDefectImproveDTO) {
+        Iterator<GetEntryDefectImproveDTO> iterator = getEntryDefectImproveDTO.iterator();
+        while (iterator.hasNext()) {
+            boolean mark = true;
+            GetEntryDefectImproveDTO kfc = iterator.next();
+            if (StringUtils.isNotBlank(getEntryDefectImproveVO.getCasesName()) &&
+                    !kfc.getCasesName().contains(getEntryDefectImproveVO.getCasesName())) {
+                iterator.remove();
+                mark = false;
+            }
+            if (mark && StringUtils.isNotBlank(getEntryDefectImproveVO.getEntryName()) &&
+                    !kfc.getEntryName().contains(getEntryDefectImproveVO.getEntryName())) {
+                iterator.remove();
+            }
+        }
+    }
+
+    /**
+     * @Description:分页数据
+     * @Param: [dataList, pageSize, currentPage]
+     * @return: java.util.List<java.lang.String>
+     * @Author: cy
+     * @Date: 2021/12/2
+     */
+    public static <T> List<T> page(List<T> retRecords, int pageSize, int currentPage) {
+        List<T> currentPageList = new ArrayList<>();
+        if (retRecords != null && retRecords.size() > 0) {
+            int currIdx = (currentPage > 1 ? (currentPage - 1) * pageSize : 0);
+            for (int i = 0; i < pageSize && i < retRecords.size() - currIdx; i++) {
+                T data = retRecords.get(currIdx + i);
+                currentPageList.add(data);
+            }
+        }
+        return currentPageList;
+    }
+
+    public  List<BehospitalAnalysisDTO>  getEntryDefectImproveInnerDTOS( List<BehospitalAnalysisDTO> behospitalInfoDTOList ,GetEntryDefectImproveInnerVO
+            getEntryDefectImproveInnerVO) {
+        if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getAsc())){
+            if("behDeptName".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehDeptName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+            }
+            if("behDoctorName".equals(getEntryDefectImproveInnerVO.getAsc()) || "doctorName".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getDoctorName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+            }
+            if("name".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+            }
+            if("fileCode".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getFileCode, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+            }
+            if("behospitalCode".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehospitalCode, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+            }
+            if("age".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getAge, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+            }
+            if("behospitalDate".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehospitalDate, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
+            }
+            if("leaveHospitalDate".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getLeaveHospitalDate, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
+            }
+            if("scoreRes".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getScoreRes, Comparator.nullsLast(Double::compareTo))).collect(Collectors.toList());
+            }
+            if("level".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getLevel, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
+            }
+            if("gradeTime".equals(getEntryDefectImproveInnerVO.getAsc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getGradeTime, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
+            }
+        }
+
+        if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getDesc())){
+            if("behDeptName".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehDeptName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("behDoctorName".equals(getEntryDefectImproveInnerVO.getDesc()) || "doctorName".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getDoctorName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("name".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getName, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("fileCode".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getFileCode, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("behospitalCode".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehospitalCode, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("age".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getAge, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("behospitalDate".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getBehospitalDate, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("leaveHospitalDate".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getLeaveHospitalDate, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("scoreRes".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getScoreRes, Comparator.nullsLast(Double::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("level".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getLevel, Comparator.nullsLast(String::compareTo)).reversed()).collect(Collectors.toList());
+            }
+            if("gradeTime".equals(getEntryDefectImproveInnerVO.getDesc())){
+                behospitalInfoDTOList = behospitalInfoDTOList.stream().sorted(Comparator.comparing(BehospitalAnalysisDTO::getGradeTime, Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
+            }
+        }
+        return behospitalInfoDTOList;
+    }
+    public  List<GetEntryDefectImproveDTO>  sortEntryDefectList( List<GetEntryDefectImproveDTO> getEntryDefectImproveDTOS ,GetEntryDefectImproveVO getEntryDefectImproveVO) {
+        if(StringUtils.isNotBlank(getEntryDefectImproveVO.getAsc())){
+            if("totalNum".equals(getEntryDefectImproveVO.getAsc())){
+                getEntryDefectImproveDTOS = getEntryDefectImproveDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDTO::getTotalNum)).collect(Collectors.toList());
+
+            }
+            if("handleNum".equals(getEntryDefectImproveVO.getAsc())){
+                getEntryDefectImproveDTOS = getEntryDefectImproveDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDTO::getHandleNum)).collect(Collectors.toList());
+
+            }
+            if("improveleNum".equals(getEntryDefectImproveVO.getAsc())){
+                getEntryDefectImproveDTOS = getEntryDefectImproveDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDTO::getImproveleNum)).collect(Collectors.toList());
+            }
+        }
+
+        if(StringUtils.isNotBlank(getEntryDefectImproveVO.getDesc())){
+            if("totalNum".equals(getEntryDefectImproveVO.getDesc())){
+                getEntryDefectImproveDTOS = getEntryDefectImproveDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDTO::getTotalNum).reversed()).collect(Collectors.toList());
+
+            }
+            if("handleNum".equals(getEntryDefectImproveVO.getDesc())){
+                getEntryDefectImproveDTOS = getEntryDefectImproveDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDTO::getHandleNum).reversed()).collect(Collectors.toList());
+
+            }
+            if("improveleNum".equals(getEntryDefectImproveVO.getDesc())){
+                getEntryDefectImproveDTOS = getEntryDefectImproveDTOS.stream().sorted(Comparator.comparing(GetEntryDefectImproveDTO::getImproveleNum).reversed()).collect(Collectors.toList());
+            }
+        }
+        return getEntryDefectImproveDTOS;
+    }
+
+    public static Map getEntryTotalMap(List<QcResultDetailInfo> qcResultDetailInfos, Map<String, Long> totalMap) {
+        Set<String> totalSet = new HashSet<String>();
+        for (QcResultDetailInfo qcResultDetailInfo : qcResultDetailInfos) {
+                //质控下获取科室下总缺陷
+                String casesEntryIds = qcResultDetailInfo.getCasesEntryIds();
+                totalSet = getSetEntry(casesEntryIds, totalSet);
+        }
+        if (null == totalSet && totalSet.size() == 0) {
+            return totalMap;
+        }
+        totalMap = getSetEntryCount(totalMap, totalSet);
+        return totalMap;
+    }
+
+    public static Map getEntryImproveleMap(QcResultDetailInfo qcResultDetailInfo, Map<String, Long> improveMap) {
+        Set<String> improveleSet = new HashSet<String>();
+        String casesEntryIds = qcResultDetailInfo.getCasesEntryIds();
+        improveleSet = getSetEntry(casesEntryIds, improveleSet);
+        improveMap = getSetEntryCount(improveMap, improveleSet);
+        return improveMap;
+    }
+
+    public static Set getSetEntry(String casesEntryIds, Set set) {
+        if (StringUtils.isNotBlank(casesEntryIds) && !"0".equals(casesEntryIds)) {
+            if (casesEntryIds.contains("、")) {
+                String[] split = casesEntryIds.split("、");
+                for (String id : split) {
+                    set.add(id);
+                }
+            } else {
+                set.add(casesEntryIds);
+            }
+        }
+        return set;
+    }
+
+    public static Map getSetEntryCount(Map<String, Long> map, Set<String> sets) {
+        if (null != sets && sets.size() > 0) {
+        for (String set : sets) {
+            if (map.containsKey(set)) {
+                long count = map.get(set) + 1l;
+                map.put(set, count);
+            } else {
+                map.put(set, 1L);
+                }
+            }
+        }
+        return map;
+    }
+
+    public void getEntryDefectImproveByExport(HttpServletResponse response, GetEntryDefectImproveVO
+            getEntryDefectImproveVO) {
+        getEntryDefectImproveVO.setExportType(1L);
+        getEntryDefectImproveVO.setCurrent(1L);
+        getEntryDefectImproveVO.setSize(Long.MAX_VALUE);
+        getEntryDefectImproveVO.setSearchCount(false);
+        IPage<GetEntryDefectImproveDTO> page = getEntryDefectImprove(getEntryDefectImproveVO);
+        String fileName = "条目缺陷改善统计.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", GetEntryDefectImproveDTO.class, fileName, response, 12.8f);
+    }
+
+
+    public IPage<BehospitalAnalysisDTO> getEntryDefectImproveInner(GetEntryDefectImproveInnerVO
+                                                                       getEntryDefectImproveInnerVO) {
+        int current = (int) getEntryDefectImproveInnerVO.getCurrent();
+        int size = (int) getEntryDefectImproveInnerVO.getSize();
+        IPage<BehospitalAnalysisDTO> page = new Page<>();
+        List<BehospitalAnalysisDTO> behospitalInfoDTOS = new ArrayList<>();
+        entryDefectInnerSet(getEntryDefectImproveInnerVO);
+        // List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
+        List<EntryDefectImproveInner> records = medClickInfoService.getBaseMapper().getEntryDefectImproveInner(getEntryDefectImproveInnerVO);
+        if (ListUtil.isNotEmpty(records) && records.size() == 1) {
+            EntryDefectImproveInner entryDefectImproveInner = records.get(0);
+            List<BehospitalCodeDetail> behospitalCodeDetails = entryDefectImproveInner.getBehospitalCodeInfos();
+            for (BehospitalCodeDetail behospitalCodeDetail : behospitalCodeDetails) {
+                List<QcResultDetailInfo> qcResultDetailInfos = behospitalCodeDetail.getQcResultDetailInfos();
+                Set<String> totalSet = new HashSet<String>();
+                Set<String> improveleSet = new HashSet<String>();
+                for (QcResultDetailInfo qcResultDetailInfo : qcResultDetailInfos) {
+                    String casesEntryIds = qcResultDetailInfo.getCasesEntryIds();
+                    totalSet = getSetEntry(casesEntryIds, totalSet);
+                }
+                QcResultDetailInfo qcResultDetailInfo = qcResultDetailInfos.get(qcResultDetailInfos.size() - 1);
+                if (null != qcResultDetailInfo && StringUtils.isNotBlank(qcResultDetailInfo.getCasesEntryIds())) {
+                    improveleSet = getSetEntry(qcResultDetailInfo.getCasesEntryIds(), improveleSet);
+                }
+                if ("0".equals(getEntryDefectImproveInnerVO.getTypeMark()) && totalSet.contains(getEntryDefectImproveInnerVO.getEntryId())) {
+                    behospitalInfoDTOS = getBehospitalInfoDTO(entryDefectImproveInner, behospitalCodeDetail, behospitalInfoDTOS);
+                }
+                if ("1".equals(getEntryDefectImproveInnerVO.getTypeMark()) && totalSet.contains(getEntryDefectImproveInnerVO.getEntryId())
+                        && !improveleSet.contains(getEntryDefectImproveInnerVO.getEntryId())) {
+                    behospitalInfoDTOS = getBehospitalInfoDTO(entryDefectImproveInner, behospitalCodeDetail, behospitalInfoDTOS);
+                }
+                if ("2".equals(getEntryDefectImproveInnerVO.getTypeMark()) && totalSet.contains(getEntryDefectImproveInnerVO.getEntryId())
+                        && improveleSet.contains(getEntryDefectImproveInnerVO.getEntryId())) {
+                    behospitalInfoDTOS = getBehospitalInfoDTO(entryDefectImproveInner, behospitalCodeDetail, behospitalInfoDTOS);
+                }
+            }
+        }
+        //导出操作
+        if (getEntryDefectImproveInnerVO.getExportType() == 1L) {
+            size = behospitalInfoDTOS.size();
+        }
+        page.setSize(size);
+        page.setTotal(behospitalInfoDTOS.size());
+        page.setCurrent(current);
+        //排序操作
+        if (ListUtil.isNotEmpty(behospitalInfoDTOS)) {
+            behospitalInfoDTOS =  getEntryDefectImproveInnerDTOS( behospitalInfoDTOS ,getEntryDefectImproveInnerVO);
+        }
+        //分页操作
+        List<BehospitalAnalysisDTO> behospitalInfoDTOList = page(behospitalInfoDTOS, size, current);
+        page.setRecords(behospitalInfoDTOList);
+        return page;
+    }
+
+    /**
+     * @Description: 数据封装
+     * @Param: [entryDefectImproveInner, behospitalCodeDetail, qcResultDetailInfo, behospitalInfoDTOS]
+     * @return: java.util.List<com.diagbot.dto.BehospitalInfoDTO>
+     * @Author: cy
+     * @Date: 2021/12/3
+     */
+    public List<BehospitalAnalysisDTO> getBehospitalInfoDTO(EntryDefectImproveInner entryDefectImproveInner, BehospitalCodeDetail behospitalCodeDetail,
+                                                        List<BehospitalAnalysisDTO> behospitalInfoDTOS) {
+        BehospitalAnalysisDTO behospitalInfoDTO = new BehospitalAnalysisDTO();
+        behospitalInfoDTO.setLevel(behospitalCodeDetail.getLevel());
+        behospitalInfoDTO.setScoreRes(behospitalCodeDetail.getScoreRes());
+        behospitalInfoDTO.setFileCode(behospitalCodeDetail.getFileCode());
+        behospitalInfoDTO.setBehospitalCode(behospitalCodeDetail.getBehospitalCode());
+        behospitalInfoDTO.setName(behospitalCodeDetail.getName());
+        behospitalInfoDTO.setAge(behospitalCodeDetail.getAge());
+        behospitalInfoDTO.setBehospitalDate(behospitalCodeDetail.getBehospitalDate());
+        behospitalInfoDTO.setLeaveHospitalDate(behospitalCodeDetail.getLeaveHospitalDate());
+        behospitalInfoDTO.setDoctorName(behospitalCodeDetail.getDoctorName());
+        behospitalInfoDTO.setBehDoctorName(behospitalCodeDetail.getDoctorName());
+        behospitalInfoDTO.setBehDeptName(entryDefectImproveInner.getBehDeptName());
+        behospitalInfoDTO.setGradeTime(behospitalCodeDetail.getGradeTime());
+        behospitalInfoDTOS.add(behospitalInfoDTO);
+        return behospitalInfoDTOS;
+    }
+
+    public void getDefectImproveInnerByExport(HttpServletResponse response, GetEntryDefectImproveInnerVO
+            getEntryDefectImproveInnerVO) {
+        getEntryDefectImproveInnerVO.setExportType(1L);
+        getEntryDefectImproveInnerVO.setCurrent(1L);
+        getEntryDefectImproveInnerVO.setSize(Long.MAX_VALUE);
+        getEntryDefectImproveInnerVO.setSearchCount(false);
+        String fileName = "条目缺陷改善统计病历列表.xls";
+        IPage<BehospitalAnalysisDTO> page = this.getEntryDefectImproveInner(getEntryDefectImproveInnerVO);
+        ExcelUtils.exportExcelUser(page.getRecords(), null, "sheet1", BehospitalAnalysisDTO.class, fileName, response);
+    }
+
+    /**
+     * 增加全院记录
+     *
+     * @param records
+     * @return
+     */
+    public GetQcClickDTO getGlobleTitle(List<GetQcClickDTO> records) {
+        GetQcClickDTO item = new GetQcClickDTO();
+        if (ListUtil.isEmpty(records)) {
+            return null;
+        }
+
+        //缺陷总数
+        Integer singleMode = records
+                .stream()
+                .map(GetQcClickDTO::getSingleModeNum)
+                .reduce(0, Integer::sum);
+        if (singleMode == null) {
+            singleMode = 0;
+        }
+        Integer totalMode = records
+                .stream()
+                .map(GetQcClickDTO::getTotalModeNum)
+                .reduce(0, Integer::sum);
+        if (totalMode == null) {
+            totalMode = 0;
+        }
+        item.setDeptName("全院");
+        item.setSingleModeNum(singleMode);
+        item.setTotalModeNum(totalMode);
+        return item;
+    }
+
+    private void clickPageSet(GetQcClickVO getQcClickVO) {
+        if(StringUtils.isNotBlank(getQcClickVO.getDeptName())){
+            getQcClickVO.setDeptName(transferredMeaning(getQcClickVO.getDeptName()));
+        }
+        //入参验证
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date startDate = null;
+        Date endDate = null;
+        try {
+            startDate = simpleDateFormat.parse(getQcClickVO.getStartDate());
+            endDate = simpleDateFormat.parse(getQcClickVO.getEndDate());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (DateUtil.after(startDate, endDate)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
+        }
+        getQcClickVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+    }
+
+    private void clickInnerPageSet(GetQcClickInnerPageVO getQcClickInnerPageVO) {
+        if(StringUtils.isNotBlank(getQcClickInnerPageVO.getDoctorId())){
+            getQcClickInnerPageVO.setDoctorId(transferredMeaning(getQcClickInnerPageVO.getDoctorId()));
+        }
+        if(StringUtils.isNotBlank(getQcClickInnerPageVO.getDoctorName())){
+            getQcClickInnerPageVO.setDoctorName(transferredMeaning(getQcClickInnerPageVO.getDoctorName()));
+        }
+        //入参验证
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date startDate = null;
+        Date endDate = null;
+        try {
+            startDate = simpleDateFormat.parse(getQcClickInnerPageVO.getStartDate());
+            endDate = simpleDateFormat.parse(getQcClickInnerPageVO.getEndDate());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (DateUtil.after(startDate, endDate)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
+        }
+        getQcClickInnerPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+    }
+
+   public String transferredMeaning(String tranStr){
+          if( tranStr.contains("%")){
+              tranStr = tranStr.replace("%", "\\%");
+          }
+           if( tranStr.contains("_")){
+              tranStr = tranStr.replace("_","\\_");
+           }
+       return tranStr;
+    };
+    private void entryDefectSet(GetEntryDefectImproveVO getEntryDefectImproveVO) {
+        if(StringUtils.isNotBlank(getEntryDefectImproveVO.getDeptName())){
+            getEntryDefectImproveVO.setDeptName(transferredMeaning(getEntryDefectImproveVO.getDeptName()));
+        }
+        getEntryDefectImproveVO.setCurrent(1L);
+        getEntryDefectImproveVO.setSize(Long.MAX_VALUE);
+        //入参验证
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date startDate = null;
+        Date endDate = null;
+        try {
+            startDate = simpleDateFormat.parse(getEntryDefectImproveVO.getStartDate());
+            endDate = simpleDateFormat.parse(getEntryDefectImproveVO.getEndDate());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (DateUtil.after(startDate, endDate)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
+        }
+        getEntryDefectImproveVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+    }
+
+    private void entryDefectInnerSet(GetEntryDefectImproveInnerVO getEntryDefectImproveInnerVO) {
+        if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getPatName())){
+            getEntryDefectImproveInnerVO.setPatName(transferredMeaning(getEntryDefectImproveInnerVO.getPatName()));
+        }
+        if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getDoctorId())){
+            getEntryDefectImproveInnerVO.setDoctorId(transferredMeaning(getEntryDefectImproveInnerVO.getDoctorId()));
+        }
+        if(StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getDoctorName())){
+            getEntryDefectImproveInnerVO.setDoctorName(transferredMeaning(getEntryDefectImproveInnerVO.getDoctorName()));
+        }
+        getEntryDefectImproveInnerVO.setCurrent(1L);
+        getEntryDefectImproveInnerVO.setSize(Long.MAX_VALUE);
+        //入参验证
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date startDate = null;
+        Date endDate = null;
+        try {
+            startDate = simpleDateFormat.parse(getEntryDefectImproveInnerVO.getStartDate());
+            endDate = simpleDateFormat.parse(getEntryDefectImproveInnerVO.getEndDate());
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        if (DateUtil.after(startDate, endDate)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
+        }
+        if (StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getChTimeStart())
+                && StringUtils.isNotBlank(getEntryDefectImproveInnerVO.getChTimeEnd())
+        ) {
+            Date chTimeStartDate = null;
+            Date chTimeEndDate = null;
+            try {
+                chTimeStartDate = simpleDateFormat.parse(getEntryDefectImproveInnerVO.getChTimeStart());
+                chTimeEndDate = simpleDateFormat.parse(getEntryDefectImproveInnerVO.getChTimeStart());
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            if (DateUtil.after(chTimeStartDate, chTimeEndDate)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "病历核查开始时间必须小于结束时间!");
+            }
+        }
+        getEntryDefectImproveInnerVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+    }
+}

+ 88 - 28
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -149,12 +149,18 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
             try {
                 useId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
             } catch (Exception e) {
-            //analyze_run运行质控没有登录认证   所以会获取不到
+                //analyze_run运行质控没有登录认证   所以会获取不到
                 useId = 952795279527L;
             }
         }
+        //获取上一次人工添加的缺陷
+        QcresultInfo qcresultInfoup
+                = this.getOne(
+                new QueryWrapper<QcresultInfo>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("hospital_id", analyzeVO.getHospitalId())
+                        .eq("behospital_code", analyzeVO.getBehospitalCode()), false);
         Date now = DateUtil.now();
-        //逻辑删除记录
         this.update(new UpdateWrapper<QcresultInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", analyzeVO.getHospitalId())
@@ -192,16 +198,43 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         qcresultInfo.setGmtModified(now);
         qcresultInfo.setModifier(useId.toString());
         this.save(qcresultInfo);
+        Long newId = qcresultInfo.getId();
         //更新质控评分明细信息
         switch (algorithmVO.getType()) {
             //自动评分
             case 0:
                 //删除记录
-                qcresultDetailServiceImpl.remove(new QueryWrapper<QcresultDetail>()
+//                qcresultDetailServiceImpl.remove(new QueryWrapper<QcresultDetail>()
+//                        .eq("hospital_id", analyzeVO.getHospitalId())
+//                        .eq("behospital_code", analyzeVO.getBehospitalCode()));
+
+                //上一次人工评分条目
+                List<QcresultDetail> oldQcresultDetails = null;
+                if (qcresultInfoup != null) {
+                    oldQcresultDetails = qcresultDetailServiceImpl.list(new QueryWrapper<QcresultDetail>()
+                            .eq("hospital_id", analyzeVO.getHospitalId())
+                            .eq("qcresult_info_id", qcresultInfoup.getId())
+                            .eq("grade_type", "2")
+                            .eq("behospital_code", analyzeVO.getBehospitalCode()));
+                }
+
+                qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("hospital_id", analyzeVO.getHospitalId())
-                        .eq("behospital_code", analyzeVO.getBehospitalCode()));
+                        .eq("behospital_code", analyzeVO.getBehospitalCode())
+                        .set("is_deleted", IsDeleteEnum.Y.getKey())
+                        .set("modifier", useId)
+                        .set("gmt_modified", now));
+                //
                 //批量插入新的数据
                 List<QcresultDetail> qcresultDetailList = new ArrayList<>();
+                if (ListUtil.isNotEmpty(oldQcresultDetails)) {
+                    qcresultDetailList.addAll(oldQcresultDetails);
+                    qcresultDetailList.forEach(qcresultDetail -> {
+                        //原手动添加缺陷绑定新机器评分id
+                        qcresultDetail.setQcresultInfoId(newId);
+                    });
+                }
                 List<QcResultAlgVO> qcResultAlgVORes = algorithmVO.getQcResultAlgVOList();
                 if (ListUtil.isNotEmpty(qcResultAlgVORes)) {
                     for (QcResultAlgVO qcResultAlgVO : qcResultAlgVORes) {
@@ -216,6 +249,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                         qcresultDetail.setGmtModified(now);
                         qcresultDetail.setModifier(useId.toString());
                         qcresultDetail.setInfo(StringUtil.isNotBlank(qcResultAlgVO.getInfo()) ? qcResultAlgVO.getInfo() : "");
+                        qcresultDetail.setQcresultInfoId(newId);
                         qcresultDetailList.add(qcresultDetail);
                     }
                     qcresultDetailServiceImpl.saveBatch(qcresultDetailList);
@@ -233,6 +267,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                 qcresultDetailAdd.setCreator(useId.toString());
                 qcresultDetailAdd.setGmtModified(now);
                 qcresultDetailAdd.setModifier(useId.toString());
+                qcresultDetailAdd.setQcresultInfoId(newId);
                 qcresultDetailServiceImpl.save(qcresultDetailAdd);
                 break;
             case 2:
@@ -253,44 +288,44 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                         .set("msg", algorithmVO.getOptResultAlgVO().getMsg())
                         .set("score", algorithmVO.getOptResultAlgVO().getScore())
                         .set("opt_type", 3)
-                        .set("grade_type",2)
+                        .set("grade_type", 2)
                         .set("modifier", useId)
+                        .set("qcresult_info_id", newId)
                         .set("gmt_modified", now)
-                        .set("explain_info",algorithmVO.getOptResultAlgVO().getExplainInfo())
+                        .set("explain_info", algorithmVO.getOptResultAlgVO().getExplainInfo())
                 );
                 break;
             case 4:
                 //获取病历核查人员id,该操作只能是核查员操作
-                Long checkId = medCheckInfoFacade.getOne(new QueryWrapper<MedCheckInfo>()
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", analyzeVO.getHospitalId())
-                        .eq("behospital_code", analyzeVO.getBehospitalCode())).getCheckId();
-                if(checkId==null)
-                {
-                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "病历没有分配核查人员");
-                }
-                if(!checkId.equals(useId))
-                {
-                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前用户不是分配的核查人员");
-                }
+//                Long checkId = medCheckInfoFacade.getOne(new QueryWrapper<MedCheckInfo>()
+//                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+//                        .eq("hospital_id", analyzeVO.getHospitalId())
+//                        .eq("behospital_code", analyzeVO.getBehospitalCode())).getCheckId();
+//                if(checkId==null)
+//                {
+//                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "病历没有分配核查人员");
+//                }
+//                if(!checkId.equals(useId))
+//                {
+//                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前用户不是分配的核查人员");
+//                }
                 //逻辑删除质控明细 0删除
-                if(analyzeVO.getDelStatus()==0)
-                {
+                if (analyzeVO.getDelStatus() == 0) {
                     qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
                             .eq("id", algorithmVO.getOptResultAlgVO().getId())
                             .eq("is_deleted", IsDeleteEnum.N.getKey())
                             .eq("hospital_id", analyzeVO.getHospitalId())
                             .eq("behospital_code", analyzeVO.getBehospitalCode())
                             .set("is_deleted", IsDeleteEnum.Y.getKey())
-                            .set("grade_type",2)
+                            .set("grade_type", 2)
                             .set("opt_type", 2)
+                            .set("qcresult_info_id", newId)
                             .set("modifier", useId)
                             .set("gmt_modified", now)
                     );
                 }
                 //1恢复
-                else if(analyzeVO.getDelStatus()==1)
-                {
+                else if (analyzeVO.getDelStatus() == 1) {
                     //该条目是机器插入条目
                     qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
                             .eq("id", algorithmVO.getOptResultAlgVO().getId())
@@ -298,24 +333,48 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                             .eq("hospital_id", analyzeVO.getHospitalId())
                             .eq("behospital_code", analyzeVO.getBehospitalCode())
                             .set("is_deleted", IsDeleteEnum.N.getKey())
-                            .set("grade_type",2)
+                            .set("grade_type", 2)
                             .set("opt_type", 1)
+                            .set("qcresult_info_id", newId)
                             .set("modifier", useId)
                             .set("remark", null)
                             .set("gmt_modified", now)
                     );
-                }
-                else {
+                } else {
                     throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "delStatus参数错误");
                 }
-
-
                 break;
             default:
                 /* DO NOTHING */
                 break;
         }
 
+        //如果不是自动评分(是新增修改删除条目)修改评分主表id
+        if (algorithmVO.getType() != 0) {
+            //修改上一次人工条目 评分主表id
+            if (qcresultInfoup != null && qcresultInfoup.getId() != null) {
+                qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
+                        .eq("qcresult_info_id", qcresultInfoup.getId())
+                        .eq("hospital_id", analyzeVO.getHospitalId())
+                        .eq("grade_type", 2)
+                        .eq("behospital_code", analyzeVO.getBehospitalCode())
+                        .set("qcresult_info_id", newId)
+                        .set("modifier", useId)
+                        .set("gmt_modified", now)
+                );
+            }
+            //未删除的 评分主表id
+            qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("hospital_id", analyzeVO.getHospitalId())
+                    .eq("behospital_code", analyzeVO.getBehospitalCode())
+                    .set("qcresult_info_id", newId)
+                    .set("modifier", useId)
+                    .set("gmt_modified", now)
+            );
+        }
+
+
         //质控模块评分数据
         //统一为长兴的算法
         //逻辑删除数据
@@ -337,6 +396,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                 medQcresultCases.setCreator(useId.toString());
                 medQcresultCases.setGmtModified(now);
                 medQcresultCases.setModifier(useId.toString());
+                medQcresultCases.setQcresultInfoId(newId);
                 medQcresultCasesList.add(medQcresultCases);
             }
             medQcresultCasesService.saveBatch(medQcresultCasesList);

+ 9 - 0
src/main/java/com/diagbot/facade/SysDictionaryFacade.java

@@ -61,4 +61,13 @@ public class SysDictionaryFacade extends SysDictionaryInfoServiceImpl {
         return res;
     }
 
+    public long getAccessTokenOutTime() {
+        long accessToken = 24 * 3600*1l;
+        if (getDictionaryWithKey() != null
+                && getDictionaryWithKey().containsKey("31")
+                && getDictionaryWithKey().get("31").containsKey("accessToken")) {
+            accessToken = Long.parseLong(getDictionaryWithKey().get("31").get("accessToken"));
+        }
+        return accessToken;
+    }
 }

+ 6 - 0
src/main/java/com/diagbot/facade/SysUserFacade.java

@@ -215,6 +215,10 @@ public class SysUserFacade extends SysUserServiceImpl {
         jwtStore.setAccessToken(jwt.getAccess_token());
         jwtStore.setRefreshToken(jwt.getRefresh_token());
         tokenFacade.createToken(jwtStore);
+
+        //每次登录在redis缓存该用户登录成功的token;缓存时间为token有效时间
+        long accessTokenTime = sysDictionaryFacade.getAccessTokenOutTime();
+        redisUtils.set("user:refreshToken:outTime_" + user.getId(), accessTokenTime, accessTokenTime);
         /***
          * 未经过MD5加密密码复杂度判断
          */
@@ -703,6 +707,8 @@ public class SysUserFacade extends SysUserServiceImpl {
             }
             sysUserDeptService.saveBatch(sysUserDeptList);
         }
+        //删除Token
+        tokenFacade.deleteToken(sysUserDeptVO.getUserId().toString());
         //更新用户表
         return this.update(new UpdateWrapper<SysUser>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())

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

@@ -7,6 +7,7 @@ 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.MrqcLogUtil;
 import com.diagbot.util.TZDBConn;
 import com.diagbot.vo.data.ABasDoctorInfoVO;
 import com.google.common.collect.Lists;
@@ -67,6 +68,7 @@ public class ABasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
                         return RespDTO.onError("请输入医院编码!");
                     }
                 }
+
                 execute(basDoctorInfoList);
 
                 if (logSwitch) {

+ 13 - 28
src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.ABehospitalInfoDTO;
+import com.diagbot.entity.BasDoctorInfo;
 import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.entity.MedPacsResult;
 import com.diagbot.entity.MedicalRecord;
@@ -49,26 +50,6 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
     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
@@ -107,7 +88,6 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
                         behospitalInfo.setPlacefileDate(DateUtil.parseDateTime(s.getPlacefileDate()));
                     }
                     behospitalInfoList.add(behospitalInfo);
-
                 });
 
                 execute(behospitalInfoList);
@@ -128,8 +108,8 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
     }
 
     public void execute(List<BehospitalInfo> behospitalInfoList){
-        List<BehospitalInfo> addE = Lists.newLinkedList();
-        List<BehospitalInfo> updateE = Lists.newLinkedList();
+        List<BehospitalInfo> addE=Lists.newArrayList();
+        List<BehospitalInfo> updateE=Lists.newArrayList();
         behospitalInfoList.stream().forEach(s -> {
             try {
                 s.setIsDeleted("N");
@@ -216,6 +196,11 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return qcTypeId;
     }
 
+    /**
+     * @Description:归档/取消归档
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
     public RespDTO deleteFlag(ADeleteFlagVO aDeleteFlagVO){
         try {
             //验证数据是否存在
@@ -225,11 +210,11 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 return RespDTO.onError("请输入医院编码!");
             }else {
                 UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
-                updateWrapper.eq("behospital_code", aDeleteFlagVO.getBehospitalCode())
-                        .eq("hospital_id", aDeleteFlagVO.getHospitalId())
-                        .eq("is_deleted",IsDeleteEnum.N)
-                        .set("is_deleted",IsDeleteEnum.Y)
-                        .set("gmt_modified", DateUtil.now());
+                updateWrapper.eq("behospital_code", aDeleteFlagVO.getBehospitalCode());
+                updateWrapper.eq("hospital_id", aDeleteFlagVO.getHospitalId());
+                updateWrapper.eq("is_deleted",IsDeleteEnum.N);
+                updateWrapper.set("is_deleted",IsDeleteEnum.Y);
+                updateWrapper.set("gmt_modified", DateUtil.now());
 
                 Boolean flag=update(new BehospitalInfo(),updateWrapper);
                 aMedAbnormalInfoFacade.saveAbnormalInfo("病人住院登记-删除成功",JSON.toJSONString(aDeleteFlagVO),"",flag.toString(),"");

+ 4 - 17
src/main/java/com/diagbot/facade/data/ADoctorAdviceFacade.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.DoctorAdviceServiceImpl;
@@ -35,21 +36,6 @@ public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
 
     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
@@ -106,9 +92,10 @@ public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
                 DoctorAdvice doctorAdvice = this.getOne(new QueryWrapper<DoctorAdvice>()
                         .eq("doctor_advice_id", s.getDoctorAdviceId())
                         .eq("hospital_id", s.getHospitalId())
-                        .eq("behospital_code",s.getBehospitalCode()), false);
+                        .eq("behospital_code",s.getBehospitalCode()));
                 if (doctorAdvice != null) {
-                    s.setGmtModified(new Date());
+                    s.setIsDeleted(IsDeleteEnum.N.getKey());
+                    s.setGmtModified(DateUtil.now());
                     updateE.add(s);
                 } else {
                     s.setGmtCreate(new Date());

+ 1 - 11
src/main/java/com/diagbot/facade/data/AHomeDiagnoseInfoFacade.java

@@ -36,17 +36,6 @@ public class AHomeDiagnoseInfoFacade extends HomeDiagnoseInfoServiceImpl{
 
     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
@@ -87,6 +76,7 @@ public class AHomeDiagnoseInfoFacade extends HomeDiagnoseInfoServiceImpl{
                             .eq("diagnose_order_no", s.getDiagnoseOrderNo()), false);
                     if (diagnoseInfo != null) {
                         s.setGmtModified(new Date());
+                        s.setIsDeleted(IsDeleteEnum.N.getKey());
                         updateE.add(s);
                     } else {
                         s.setGmtCreate(new Date());

+ 1 - 13
src/main/java/com/diagbot/facade/data/AHomeOperationInfoFacade.java

@@ -36,17 +36,6 @@ public class AHomeOperationInfoFacade extends HomeOperationInfoServiceImpl{
 
     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
@@ -55,7 +44,6 @@ public class AHomeOperationInfoFacade extends HomeOperationInfoServiceImpl{
     public RespDTO executeHomeOperation(List<AHomeOperationVO> list) {
         try {
             List<HomeOperationInfo> homeOperationList=Lists.newArrayList();
-            List<AHomeOperationDTO> homeOperationDtoList=Lists.newArrayList();
             if(list!=null && list.size()>0){
                 list.stream().forEach(s->{
                     HomeOperationInfo homeOperationInfo=new HomeOperationInfo();
@@ -63,7 +51,6 @@ public class AHomeOperationInfoFacade extends HomeOperationInfoServiceImpl{
                     homeOperationInfo.setOperationDate(DateUtil.parseDateTime(s.getOperationDate()));
                     homeOperationList.add(homeOperationInfo);
                 });
-                homeOperationDtoList=BeanUtil.listCopyTo(list,AHomeOperationDTO.class);
                 execute(homeOperationList);
                 if(logSwitch){
                     homeOperationList.forEach(s->{
@@ -94,6 +81,7 @@ public class AHomeOperationInfoFacade extends HomeOperationInfoServiceImpl{
                     HomeOperationInfo operationInfo = this.getOne(queryWrapper, false);
                     if (operationInfo != null) {
                         s.setGmtModified(new Date());
+                        s.setIsDeleted(IsDeleteEnum.N.getKey());
                         updateE.add(s);
                     } else {
                         s.setGmtCreate(new Date());

+ 1 - 20
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -60,26 +60,6 @@ public class AHomePageFacade extends HomePageServiceImpl{
 
     private TZDBConn tzDBConn = new TZDBConn();
 
-    /**
-     * 同步前一天病案首页
-     */
-    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
@@ -265,6 +245,7 @@ public class AHomePageFacade extends HomePageServiceImpl{
                             .eq("behospital_code", s.getBehospitalCode()), false);
                     if (homePage != null) {
                         s.setGmtModified(new Date());
+                        s.setIsDeleted(IsDeleteEnum.N.getKey());
                         updateE.add(s);
                     } else {
                         s.setGmtCreate(new Date());

+ 11 - 17
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -7,13 +7,11 @@ import com.diagbot.dto.AnalyzeRunDTO;
 import com.diagbot.dto.RecordContentDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.AMedicalRecordDTO;
-import com.diagbot.dto.data.AMrContentDTO;
 import com.diagbot.entity.*;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.ModeIdEnum;
 import com.diagbot.facade.*;
 import com.diagbot.service.impl.MedicalRecordServiceImpl;
-import com.diagbot.service.impl.QcAbnormalServiceImpl;
 import com.diagbot.util.*;
 import com.diagbot.vo.AnalyzeRunVO;
 import com.diagbot.vo.MedrecVo;
@@ -49,10 +47,6 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
 
-    @Autowired
-    @Qualifier("qcAbnormalServiceImpl")
-    private QcAbnormalServiceImpl qcAbnormalService;
-
     @Autowired
     private QcTypeFacade qcTypeFacade;
 
@@ -415,21 +409,20 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
             List<MedicalRecord> addE = Lists.newLinkedList();
             List<MedicalRecord> updateE = Lists.newLinkedList();
             List<BehospitalInfo> behospitalInfoList = Lists.newLinkedList();
-            List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
+            List<ModelHospital> modelHospitalList = 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);
+                        //未匹配到模板的进行记录,后续可跟进
+                        ModelHospital modelHospital = new ModelHospital();
+                        modelHospital.setHospitalId(s.getHospitalId());
+                        modelHospital.setHospitalModelName(s.getRecTitle());
+                        modelHospital.setRemark(s.getRecTypeId());
+                        modelHospitalList.add(modelHospital);
                     } else if (modeId == Long.valueOf("1")) {
+                        //入院记录保存时,同步调整住院病人的质控类型,即qc_type_id
                         BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
                                 .eq("behospital_code", s.getBehospitalCode())
                                 .eq("hospital_id", s.getHospitalId()), false);
@@ -468,6 +461,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                             .eq("behospital_code", s.getBehospitalCode()), false);
                     if (mRecord != null) {
                         s.setGmtModified(new Date());
+                        s.setIsDeleted(IsDeleteEnum.N.getKey());
                         updateE.add(s);
                     } else {
                         s.setGmtCreate(new Date());
@@ -481,8 +475,8 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
             if (updateE.size() > 0) {
                 medicalRecordService.updateBatchByKey(updateE);
             }
-            if (qcAbnormalList.size() > 0) {
-                qcAbnormalService.saveBatch(qcAbnormalList);
+            if (modelHospitalList.size() > 0) {
+                modelHospitalFacade.saveBatch(modelHospitalList);
             }
             if (behospitalInfoList.size() > 0) {
                 behospitalInfoFacade.updateBatchByKey(behospitalInfoList);

+ 8 - 0
src/main/java/com/diagbot/facade/data/LogInfoFacade.java

@@ -0,0 +1,8 @@
+package com.diagbot.facade.data;
+
+import com.diagbot.service.impl.LogInfoServiceImpl;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LogInfoFacade extends LogInfoServiceImpl {
+}

+ 72 - 0
src/main/java/com/diagbot/facade/his/HisBehospitalInfoFacade.java

@@ -0,0 +1,72 @@
+package com.diagbot.facade.his;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.his.HisBehospitalInfo;
+import com.diagbot.service.impl.his.HisBehospitalInfoServiceImpl;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.diagbot.vo.data.HisDataDealVO;
+import com.diagbot.vo.data.HisDataImportVO;
+import com.google.common.collect.Lists;
+import io.github.lvyahui8.spring.facade.DataFacade;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+@Slf4j
+public class HisBehospitalInfoFacade extends HisBehospitalInfoServiceImpl {
+
+    public List<HisBehospitalInfo> getHisBeHospitalInfoData(List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<HisBehospitalInfo> list = Lists.newLinkedList();
+        aBehospitalInfoVO.stream().forEach(s -> {
+            HisBehospitalInfo hisBehospitalInfo = this.baseMapper.selectOne(new QueryWrapper<HisBehospitalInfo>()
+                    .eq("behospital_code", s.getBehospitalCode())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (hisBehospitalInfo != null) {
+                list.add(hisBehospitalInfo);
+            }
+        });
+        return list;
+    }
+
+    /*
+     * @Description:拉取指定病历号,或指定出院时间段内的病历号的所有病历号用户导入历史数据
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
+    public void getPatientRecord(HisDataImportVO hisDataImportVO){
+        try {
+            QueryWrapper queryWrapper=new QueryWrapper<HisBehospitalInfo>();
+            if(hisDataImportVO.getHospitalId()!=null && hisDataImportVO.getHospitalId()!=0L){
+                queryWrapper.eq("hospital_id", hisDataImportVO.getHospitalId());
+            }
+            if(StringUtil.isNotEmpty(hisDataImportVO.getBehospitalCode())){
+                queryWrapper.eq("behospital_code", hisDataImportVO.getBehospitalCode());
+            }
+            if(StringUtil.isNotEmpty(hisDataImportVO.getStartDate()) && StringUtil.isNotEmpty(hisDataImportVO.getEndDate())){
+                queryWrapper.gt("LEAVE_HOSPITAL_DATE",hisDataImportVO.getStartDate());
+                queryWrapper.lt("LEAVE_HOSPITAL_DATE",hisDataImportVO.getEndDate());
+            }
+            List<HisBehospitalInfo> list=this.baseMapper.selectList(queryWrapper);
+            if(list.size()>0){
+                List<ABehospitalInfoVO> aList=Lists.newLinkedList();
+                list.stream().forEach(s->{
+                    ABehospitalInfoVO aBehospitalInfoVO=new ABehospitalInfoVO();
+                    aBehospitalInfoVO.setBehospitalCode(s.getBehospitalCode());
+                    aList.add(aBehospitalInfoVO);
+                });
+                Map<String, Object> invokeParams = new HashMap<>();
+                invokeParams.put("aBehospitalInfoVO", list);
+                DataFacade.get("dataSupplement", invokeParams, RespDTO.class);
+            }
+        } catch (Exception e) {
+            log.error("导入历史数据异常==========",e.getMessage());
+            e.printStackTrace();
+        }
+    }
+}

+ 28 - 0
src/main/java/com/diagbot/facade/his/HisDoctorAdviceFacade.java

@@ -0,0 +1,28 @@
+package com.diagbot.facade.his;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.his.HisDoctorAdvice;
+import com.diagbot.service.impl.his.HisDoctorAdviceServiceImpl;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class HisDoctorAdviceFacade extends HisDoctorAdviceServiceImpl {
+
+    public List<List<HisDoctorAdvice>> getHisDoctorAdviceData(List<ABehospitalInfoVO> aBehospitalInfoVO) {
+
+        List<List<HisDoctorAdvice>> list = Lists.newLinkedList();
+        aBehospitalInfoVO.stream().forEach(s -> {
+            List<HisDoctorAdvice> hisDoctorAdvice = this.baseMapper.selectList(new QueryWrapper<HisDoctorAdvice>()
+                    .eq("behospital_code", s.getBehospitalCode())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (hisDoctorAdvice != null && hisDoctorAdvice.size() > 0) {
+                list.add(hisDoctorAdvice);
+            }
+        });
+        return list;
+    }
+}

+ 29 - 0
src/main/java/com/diagbot/facade/his/HisHomeDiagnoseInfoFacade.java

@@ -0,0 +1,29 @@
+package com.diagbot.facade.his;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.his.HisBehospitalInfo;
+import com.diagbot.entity.his.HisHomeDiagnoseInfo;
+import com.diagbot.service.impl.his.HisHomeDiagnoseInfoServiceImpl;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class HisHomeDiagnoseInfoFacade extends HisHomeDiagnoseInfoServiceImpl {
+
+    public List<List<HisHomeDiagnoseInfo>> getHisHomeDiagnoseInfoData(List<ABehospitalInfoVO> aBehospitalInfoVO) {
+
+        List<List<HisHomeDiagnoseInfo>> list = Lists.newLinkedList();
+        aBehospitalInfoVO.stream().forEach(s -> {
+            List<HisHomeDiagnoseInfo> hisHomeDiagnoseInfo = this.baseMapper.selectList(new QueryWrapper<HisHomeDiagnoseInfo>()
+                    .eq("behospital_code", s.getBehospitalCode())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (hisHomeDiagnoseInfo != null && hisHomeDiagnoseInfo.size() > 0) {
+                list.add(hisHomeDiagnoseInfo);
+            }
+        });
+        return list;
+    }
+}

+ 28 - 0
src/main/java/com/diagbot/facade/his/HisHomeOperationInfoFacade.java

@@ -0,0 +1,28 @@
+package com.diagbot.facade.his;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.his.HisHomeOperationInfo;
+import com.diagbot.service.impl.his.HisHomeOperationInfoServiceImpl;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class HisHomeOperationInfoFacade extends HisHomeOperationInfoServiceImpl {
+
+    public List<List<HisHomeOperationInfo>> getHisHomeOperationInfoData(List<ABehospitalInfoVO> aBehospitalInfoVO) {
+
+        List<List<HisHomeOperationInfo>> list = Lists.newLinkedList();
+        aBehospitalInfoVO.stream().forEach(s -> {
+            List<HisHomeOperationInfo> hisHomeOperationInfo = this.baseMapper.selectList(new QueryWrapper<HisHomeOperationInfo>()
+                    .eq("behospital_code", s.getBehospitalCode())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (hisHomeOperationInfo != null && hisHomeOperationInfo.size() > 0) {
+                list.add(hisHomeOperationInfo);
+            }
+        });
+        return list;
+    }
+}

+ 27 - 0
src/main/java/com/diagbot/facade/his/HisHomePageFacade.java

@@ -0,0 +1,27 @@
+package com.diagbot.facade.his;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.his.HisHomePage;
+import com.diagbot.service.impl.his.HisHomePageServiceImpl;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class HisHomePageFacade extends HisHomePageServiceImpl {
+
+    public List<HisHomePage> getHomePageData(List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<HisHomePage> list = Lists.newLinkedList();
+        aBehospitalInfoVO.stream().forEach(s -> {
+            HisHomePage hisHomePage = this.baseMapper.selectOne(new QueryWrapper<HisHomePage>()
+                    .eq("behospital_code", s.getBehospitalCode())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (hisHomePage != null) {
+                list.add(hisHomePage);
+            }
+        });
+        return list;
+    }
+}

+ 26 - 0
src/main/java/com/diagbot/facade/his/HisMedicalRecordContentFacade.java

@@ -0,0 +1,26 @@
+package com.diagbot.facade.his;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.his.HisMedicalRecordContent;
+import com.diagbot.service.impl.his.HisMedicalRecordContentServiceImpl;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class HisMedicalRecordContentFacade extends HisMedicalRecordContentServiceImpl {
+    public List<List<HisMedicalRecordContent>> getHisMedicalRecordContentData(List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<List<HisMedicalRecordContent>> list = Lists.newLinkedList();
+        aBehospitalInfoVO.stream().forEach(s -> {
+            List<HisMedicalRecordContent> hisMedicalRecordContent = this.baseMapper.selectList(new QueryWrapper<HisMedicalRecordContent>()
+                    .eq("behospital_code", s.getBehospitalCode())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (hisMedicalRecordContent != null && hisMedicalRecordContent.size() > 0) {
+                list.add(hisMedicalRecordContent);
+            }
+        });
+        return list;
+    }
+}

+ 27 - 0
src/main/java/com/diagbot/facade/his/HisMedicalRecordFacade.java

@@ -0,0 +1,27 @@
+package com.diagbot.facade.his;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.his.HisBehospitalInfo;
+import com.diagbot.entity.his.HisMedicalRecord;
+import com.diagbot.service.impl.his.HisMedicalRecordServiceImpl;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class HisMedicalRecordFacade extends HisMedicalRecordServiceImpl {
+    public List<List<HisMedicalRecord>> getHisMedicalRecordData(List<ABehospitalInfoVO> aBehospitalInfoVO) {
+        List<List<HisMedicalRecord>> list = Lists.newLinkedList();
+        aBehospitalInfoVO.stream().forEach(s -> {
+            List<HisMedicalRecord> hisMedicalRecord = this.baseMapper.selectList(new QueryWrapper<HisMedicalRecord>()
+                    .eq("behospital_code", s.getBehospitalCode())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (hisMedicalRecord != null) {
+                list.add(hisMedicalRecord);
+            }
+        });
+        return list;
+    }
+}

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

@@ -24,6 +24,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public IPage<BehospitalInfoDTO> getPage(BehospitalPageVO behospitalPageVO);
 
     public List<MsgDTO> getMsg(AnalyzeVO analyzeVO);
+    public List<MsgDTO> getForeignMsg(AnalyzeVO analyzeVO);
 
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
 

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.his.HisBehospitalInfo;
+
+/**
+ * <p>
+ * 住院病历信息 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+public interface HisBehospitalInfoMapper extends BaseMapper<HisBehospitalInfo> {
+
+}

+ 15 - 0
src/main/java/com/diagbot/mapper/HisDoctorAdviceMapper.java

@@ -0,0 +1,15 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.his.HisDoctorAdvice;
+
+/**
+ * <p>
+ * 病人医嘱 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+public interface HisDoctorAdviceMapper extends BaseMapper<HisDoctorAdvice> {
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.his.HisHomeDiagnoseInfo;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+public interface HisHomeDiagnoseInfoMapper extends BaseMapper<HisHomeDiagnoseInfo> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.his.HisHomeOperationInfo;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+public interface HisHomeOperationInfoMapper extends BaseMapper<HisHomeOperationInfo> {
+
+}

+ 15 - 0
src/main/java/com/diagbot/mapper/HisHomePageMapper.java

@@ -0,0 +1,15 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.his.HisHomePage;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+public interface HisHomePageMapper extends BaseMapper<HisHomePage> {
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.his.HisMedicalRecordContent;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+public interface HisMedicalRecordContentMapper extends BaseMapper<HisMedicalRecordContent> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.his.HisMedicalRecord;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+public interface HisMedicalRecordMapper extends BaseMapper<HisMedicalRecord> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.LogInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2021-12-31
+ */
+public interface LogInfoMapper extends BaseMapper<LogInfo> {
+
+}

+ 22 - 1
src/main/java/com/diagbot/mapper/MedClickInfoMapper.java

@@ -1,7 +1,22 @@
 package com.diagbot.mapper;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.EntryDefectImprove;
+import com.diagbot.dto.EntryDefectImproveInner;
+import com.diagbot.dto.EntryDefectImproveInnerExport;
+import com.diagbot.dto.ExportExcelDTO;
+import com.diagbot.dto.GetEntryInfoDTO;
+import com.diagbot.dto.GetQcClickDTO;
+import com.diagbot.dto.GetQcClickInnerPageDTO;
 import com.diagbot.entity.MedClickInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.GetEntryDefectImproveDeptVO;
+import com.diagbot.vo.GetEntryDefectImproveInnerVO;
+import com.diagbot.vo.GetEntryDefectImproveVO;
+import com.diagbot.vo.GetQcClickInnerPageVO;
+import com.diagbot.vo.GetQcClickVO;
+
+import java.util.List;
 
 /**
  * <p>
@@ -12,5 +27,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @since 2021-11-10
  */
 public interface MedClickInfoMapper extends BaseMapper<MedClickInfo> {
-
+    public List<GetQcClickDTO> getQcClick(GetQcClickVO getQcClickVO);
+    public IPage<GetQcClickInnerPageDTO> getQcClickInnerPage(GetQcClickInnerPageVO getQcClickInnerPageVO);
+    public List<EntryDefectImprove> getEntryDefectImprove(GetEntryDefectImproveVO getEntryDefectImproveVO);
+    public List<GetEntryInfoDTO> getEntryInfo();
+    public List<EntryDefectImproveInnerExport> getEntryDefectImproveDept(GetEntryDefectImproveDeptVO getEntryDefectImproveDeptVO);
+    public List<EntryDefectImproveInner> getEntryDefectImproveInner(GetEntryDefectImproveInnerVO getEntryDefectImproveInnerVO);
+    public List<ExportExcelDTO> getDefectImproveInnerByExport(GetEntryDefectImproveInnerVO getEntryDefectImproveInnerVO);
 }

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.MedQcresultClick;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2021-12-02
+ */
+public interface MedQcresultClickMapper extends BaseMapper<MedQcresultClick> {
+
+}

+ 23 - 0
src/main/java/com/diagbot/rabbit/MyProcessor.java

@@ -0,0 +1,23 @@
+package com.diagbot.rabbit;
+
+import org.springframework.cloud.stream.annotation.Input;
+import org.springframework.cloud.stream.annotation.Output;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.SubscribableChannel;
+
+/**
+ * @Description: 自定义Stream发布和消费对象
+ * @author: gaodm
+ * @time: 2018/8/29 13:39
+ */
+public interface MyProcessor {
+
+    String INPUT_MrqcLog = "inputMrqcLog";
+    String OUTPUT_MrqcLog= "outputMrqcLog";
+
+    @Input(INPUT_MrqcLog)
+    SubscribableChannel inputMrqcLog();
+    @Output(OUTPUT_MrqcLog)
+    MessageChannel outputMrqcLog();
+
+}

+ 29 - 0
src/main/java/com/diagbot/rabbit/MyReceiver.java

@@ -0,0 +1,29 @@
+package com.diagbot.rabbit;
+
+import com.diagbot.entity.LogInfo;
+import com.diagbot.facade.data.LogInfoFacade;
+import com.diagbot.util.FastJsonUtils;
+import com.diagbot.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cloud.stream.annotation.EnableBinding;
+import org.springframework.cloud.stream.annotation.StreamListener;
+
+/**
+ * @Description: 消费者
+ * @author: wangfeng
+ * @time: 2018/8/29 14:02
+ */
+@EnableBinding({ MyProcessor.class })
+public class MyReceiver {
+
+    @Autowired
+    private LogInfoFacade logInfoFacade;
+
+    @StreamListener(MyProcessor.INPUT_MrqcLog)
+    public void inputMrqcLog(String message) {
+        //System.out.println("Received <" + "接受到的信息" + ">" + message);
+        if (StringUtil.isNotBlank(message)) {
+            logInfoFacade.save(FastJsonUtils.getJsonToBean(message, LogInfo.class));
+        }
+    }
+}

+ 28 - 0
src/main/java/com/diagbot/rabbit/MySender.java

@@ -0,0 +1,28 @@
+package com.diagbot.rabbit;
+
+import com.diagbot.entity.LogInfo;
+import com.diagbot.util.FastJsonUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.cloud.stream.annotation.EnableBinding;
+import org.springframework.integration.support.MessageBuilder;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 发布者
+ * @author: gaodm
+ * @time: 2018/8/29 13:41
+ */
+@Component
+@EnableBinding({ MyProcessor.class })
+public class MySender {
+
+    @Autowired
+    @Qualifier("outputMrqcLog")
+    MessageChannel outputMrqcLog;
+
+    public void outputMrqcLogSend(LogInfo msg) {
+        outputMrqcLog.send(MessageBuilder.withPayload(FastJsonUtils.getBeanToJson(msg)).build());
+    }
+}

+ 7 - 0
src/main/java/com/diagbot/service/HisMedicalRecordContentService.java

@@ -0,0 +1,7 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.his.HisMedicalRecordContent;
+
+public interface HisMedicalRecordContentService extends IService<HisMedicalRecordContent> {
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.LogInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2021-12-31
+ */
+public interface LogInfoService extends IService<LogInfo> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.MedQcresultClick;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2021-12-02
+ */
+public interface MedQcresultClickService extends IService<MedQcresultClick> {
+
+}

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

@@ -27,6 +27,14 @@ public interface SysTokenService {
      * @return
      */
     Boolean verifyToken(String token, Integer type);
+    /**
+     * 验证token是否有效
+     *
+     * @param token 待验证的token
+     * @param type  1:accessToken,2:refreshToken
+     * @return
+     */
+    int newVerifyToken(String token, Integer type);
 
     /**
      * 删除用户token

+ 9 - 0
src/main/java/com/diagbot/service/his/HisBehospitalInfoService.java

@@ -0,0 +1,9 @@
+package com.diagbot.service.his;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.his.HisBehospitalInfo;
+
+public interface HisBehospitalInfoService extends IService<HisBehospitalInfo> {
+
+
+}

+ 7 - 0
src/main/java/com/diagbot/service/his/HisDoctorAdviceService.java

@@ -0,0 +1,7 @@
+package com.diagbot.service.his;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.his.HisDoctorAdvice;
+
+public interface HisDoctorAdviceService extends IService<HisDoctorAdvice> {
+}

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

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

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

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

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

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

+ 7 - 0
src/main/java/com/diagbot/service/his/HisMedicalRecordService.java

@@ -0,0 +1,7 @@
+package com.diagbot.service.his;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.his.HisMedicalRecord;
+
+public interface HisMedicalRecordService extends IService<HisMedicalRecord> {
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.LogInfo;
+import com.diagbot.mapper.LogInfoMapper;
+import com.diagbot.service.LogInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2021-12-31
+ */
+@Service
+public class LogInfoServiceImpl extends ServiceImpl<LogInfoMapper, LogInfo> implements LogInfoService {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.MedQcresultClick;
+import com.diagbot.mapper.MedQcresultClickMapper;
+import com.diagbot.service.MedQcresultClickService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2021-12-02
+ */
+@Service
+public class MedQcresultClickServiceImpl extends ServiceImpl<MedQcresultClickMapper, MedQcresultClick> implements MedQcresultClickService {
+
+}

+ 54 - 0
src/main/java/com/diagbot/service/impl/SysTokenServiceImpl.java

@@ -127,6 +127,60 @@ public class SysTokenServiceImpl implements SysTokenService {
         return res;
     }
 
+    /**
+     * 验证token是否有效
+     *
+     * @param token 待验证的token
+     * @param type  1:accessToken,2:refreshToken
+     * @return -1:token无效(与服务器token不一致,异地登录),1:token有效,0:其他
+     */
+    @Override
+    public int newVerifyToken(String token, Integer type) {
+        Integer res = 0;
+        if (null == token) {
+            return 0;
+        }
+        String userId = JwtUtil.getUserId(token);
+        //从redis中取出
+        final byte[] redis_key = getUserTokenKey(userId);
+        JwtStore tokenStore = (JwtStore) redisForToken.execute(new RedisCallback<JwtStore>() {
+            @Override
+            public JwtStore doInRedis(RedisConnection connection) throws DataAccessException {
+                byte[] bytes = connection.get(redis_key);
+                if (bytes == null) {
+                    return null;
+                }
+                return (JwtStore) deserializeValue(bytes);
+            }
+        });
+
+        if (null != tokenStore) {
+            if (type == 1) {
+                if (null != tokenStore.getAccessToken()) {
+                    if (tokenStore.getAccessToken().equals(token)) {
+                        res = 1;
+                    } else {
+                        res = -1;
+                    }
+                }
+            }
+
+            if (type == 2) {
+                if (null != tokenStore.getRefreshToken()) {
+                    if (tokenStore.getRefreshToken().equals(token)) {
+                        res = 1;
+                    } else {
+                        res = -1;
+                    }
+                }
+            }
+        } else {
+            res = -2;       //redis取不到token原因是因为用户权限修改被清空掉了,如果是到时钱被清空会先提示用户登录超时
+        }
+
+        return res;
+    }
+
     /**
      * 删除用户token
      *

+ 13 - 0
src/main/java/com/diagbot/service/impl/his/HisBehospitalInfoServiceImpl.java

@@ -0,0 +1,13 @@
+package com.diagbot.service.impl.his;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.his.HisBehospitalInfo;
+import com.diagbot.mapper.HisBehospitalInfoMapper;
+import com.diagbot.service.his.HisBehospitalInfoService;
+import org.springframework.stereotype.Service;
+
+@Service
+@DS("slave")
+public class HisBehospitalInfoServiceImpl extends ServiceImpl<HisBehospitalInfoMapper, HisBehospitalInfo> implements HisBehospitalInfoService {
+}

+ 13 - 0
src/main/java/com/diagbot/service/impl/his/HisDoctorAdviceServiceImpl.java

@@ -0,0 +1,13 @@
+package com.diagbot.service.impl.his;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.his.HisDoctorAdvice;
+import com.diagbot.mapper.HisDoctorAdviceMapper;
+import com.diagbot.service.his.HisDoctorAdviceService;
+import org.springframework.stereotype.Service;
+
+@Service
+@DS("slave")
+public class HisDoctorAdviceServiceImpl  extends ServiceImpl<HisDoctorAdviceMapper, HisDoctorAdvice> implements HisDoctorAdviceService {
+}

+ 13 - 0
src/main/java/com/diagbot/service/impl/his/HisHomeDiagnoseInfoServiceImpl.java

@@ -0,0 +1,13 @@
+package com.diagbot.service.impl.his;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.his.HisHomeDiagnoseInfo;
+import com.diagbot.mapper.HisHomeDiagnoseInfoMapper;
+import com.diagbot.service.his.HisHomeDiagnoseInfoService;
+import org.springframework.stereotype.Service;
+
+@Service
+@DS("slave")
+public class HisHomeDiagnoseInfoServiceImpl extends ServiceImpl<HisHomeDiagnoseInfoMapper, HisHomeDiagnoseInfo> implements HisHomeDiagnoseInfoService {
+}

+ 13 - 0
src/main/java/com/diagbot/service/impl/his/HisHomeOperationInfoServiceImpl.java

@@ -0,0 +1,13 @@
+package com.diagbot.service.impl.his;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.his.HisHomeOperationInfo;
+import com.diagbot.mapper.HisHomeOperationInfoMapper;
+import com.diagbot.service.his.HisHomeOperationInfoService;
+import org.springframework.stereotype.Service;
+
+@Service
+@DS("slave")
+public class HisHomeOperationInfoServiceImpl extends ServiceImpl<HisHomeOperationInfoMapper, HisHomeOperationInfo> implements HisHomeOperationInfoService {
+}

+ 24 - 0
src/main/java/com/diagbot/service/impl/his/HisHomePageServiceImpl.java

@@ -0,0 +1,24 @@
+package com.diagbot.service.impl.his;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.his.HisHomePage;
+import com.diagbot.mapper.HisHomePageMapper;
+import com.diagbot.service.his.HisHomePageService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+@Service
+@DS("slave")
+public class HisHomePageServiceImpl extends ServiceImpl<HisHomePageMapper, HisHomePage> implements HisHomePageService {
+
+}

+ 13 - 0
src/main/java/com/diagbot/service/impl/his/HisMedicalRecordContentServiceImpl.java

@@ -0,0 +1,13 @@
+package com.diagbot.service.impl.his;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.his.HisMedicalRecordContent;
+import com.diagbot.mapper.HisMedicalRecordContentMapper;
+import com.diagbot.service.HisMedicalRecordContentService;
+import org.springframework.stereotype.Service;
+
+@Service
+@DS("slave")
+public class HisMedicalRecordContentServiceImpl  extends ServiceImpl<HisMedicalRecordContentMapper, HisMedicalRecordContent> implements HisMedicalRecordContentService {
+}

+ 13 - 0
src/main/java/com/diagbot/service/impl/his/HisMedicalRecordServiceImpl.java

@@ -0,0 +1,13 @@
+package com.diagbot.service.impl.his;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.his.HisMedicalRecord;
+import com.diagbot.mapper.HisMedicalRecordMapper;
+import com.diagbot.service.his.HisMedicalRecordService;
+import org.springframework.stereotype.Service;
+
+@Service
+@DS("slave")
+public class HisMedicalRecordServiceImpl extends ServiceImpl<HisMedicalRecordMapper, HisMedicalRecord> implements HisMedicalRecordService {
+}

+ 1 - 1
src/main/java/com/diagbot/task/BehospitalInfoTask.java

@@ -46,7 +46,7 @@ public class BehospitalInfoTask implements SchedulingConfigurer{
                         && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task001.getIsUsed().equals(1)) {
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
-                    aBehospitalInfoFacade.executeBehospital();
+                    //aBehospitalInfoFacade.executeBehospital();
                 }
             }
         }, new Trigger() {

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


部分文件因文件數量過多而無法顯示