Browse Source

Merge branch 'master' into his/common

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
#	src/main/java/com/diagbot/entity/MedCrisisInfo.java
#	src/main/java/com/diagbot/facade/BehospitalInfoFacade.java
#	src/main/java/com/diagbot/facade/QcTypeFacade.java
#	src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
#	src/main/java/com/diagbot/mapper/MedCrisisInfoMapper.java
#	src/main/java/com/diagbot/service/MedCrisisInfoService.java
#	src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
#	src/main/java/com/diagbot/service/impl/MedCrisisInfoServiceImpl.java
#	src/main/resources/mapper/BehospitalInfoMapper.xml
#	src/main/resources/mapper/MedCrisisInfoMapper.xml
#	src/test/java/com/diagbot/CodeGeneration.java
lantone 5 years ago
parent
commit
0cd8d9c3c1
100 changed files with 4650 additions and 1244 deletions
  1. 29 0
      doc/004.20200527v.1.3.0/qc_init.sql
  2. 1059 0
      doc/005.20200528v1.2.x/qc_init.sql
  3. 5 0
      doc/006.20200602数据导入/qc_init.sql
  4. 34 0
      doc/006.20200604v1.3.1/qc_initv1.3.1.sql
  5. 3 0
      doc/007.20200608v1.2.3/qc_initv1.2.3.sql
  6. 8 0
      doc/008.20200610v1.3.3/qc_initv1.3.3.sql
  7. 9 0
      pom.xml
  8. 1 1
      src/main/java/com/diagbot/aggregate/AverageStatisticsAggregate.java
  9. 4 10
      src/main/java/com/diagbot/aggregate/MrStatisticsAggregate.java
  10. 4 54
      src/main/java/com/diagbot/aggregate/ResultStatisticsAggregate.java
  11. 4 0
      src/main/java/com/diagbot/client/AuthServiceClient.java
  12. 7 0
      src/main/java/com/diagbot/client/hystrix/AuthServiceHystrix.java
  13. 10 13
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  14. 10 13
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  15. 6 4
      src/main/java/com/diagbot/dto/AverageStatisticsDTO.java
  16. 5 0
      src/main/java/com/diagbot/dto/BehospitalInfoDTO.java
  17. 18 0
      src/main/java/com/diagbot/dto/CaseAndDeptNumDTO.java
  18. 16 0
      src/main/java/com/diagbot/dto/CaseNumDTO.java
  19. 36 0
      src/main/java/com/diagbot/dto/DeptEntryNumDTO.java
  20. 31 0
      src/main/java/com/diagbot/dto/EntryNumDTO.java
  21. 34 0
      src/main/java/com/diagbot/dto/ExportExcelBehospitalDTO.java
  22. 9 0
      src/main/java/com/diagbot/dto/ExportExcelCase.java
  23. 23 0
      src/main/java/com/diagbot/dto/ExportExcelCaseDTO.java
  24. 26 0
      src/main/java/com/diagbot/dto/ExportExcelDTO.java
  25. 17 0
      src/main/java/com/diagbot/dto/ExportExcelMsgDTO.java
  26. 58 0
      src/main/java/com/diagbot/dto/ExportQcresultDTO.java
  27. 37 0
      src/main/java/com/diagbot/dto/HomePageNumDTO.java
  28. 3 0
      src/main/java/com/diagbot/dto/LevelStatisticsDTO.java
  29. 34 0
      src/main/java/com/diagbot/dto/MedicalRecordDTO.java
  30. 9 0
      src/main/java/com/diagbot/dto/MsgDTO.java
  31. 4 4
      src/main/java/com/diagbot/dto/NumDTO.java
  32. 29 0
      src/main/java/com/diagbot/dto/QcAbnormalModeDTO.java
  33. 1 2
      src/main/java/com/diagbot/dto/QcCasesEntryHospitalDTO.java
  34. 38 0
      src/main/java/com/diagbot/dto/QcCasesEntrySimpleDTO.java
  35. 25 0
      src/main/java/com/diagbot/dto/QcTypeDTO.java
  36. 66 0
      src/main/java/com/diagbot/dto/QcTypePageDTO.java
  37. 10 0
      src/main/java/com/diagbot/dto/RecordContentDTO.java
  38. 56 1
      src/main/java/com/diagbot/entity/BehospitalInfo.java
  39. 19 0
      src/main/java/com/diagbot/entity/CommonParam.java
  40. 13 22
      src/main/java/com/diagbot/entity/MedCrisisInfo.java
  41. 29 62
      src/main/java/com/diagbot/entity/MedRecordType.java
  42. 10 0
      src/main/java/com/diagbot/entity/MedicalRecord.java
  43. 8 120
      src/main/java/com/diagbot/entity/QcCasesEntry.java
  44. 9 1
      src/main/java/com/diagbot/entity/QcType.java
  45. 10 0
      src/main/java/com/diagbot/entity/QcresultDetail.java
  46. 6 94
      src/main/java/com/diagbot/entity/SysTaskCron.java
  47. 50 0
      src/main/java/com/diagbot/enums/InsertOrUpdateEnum.java
  48. 4 10
      src/main/java/com/diagbot/facade/AlgorithmFacade.java
  49. 239 145
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java
  50. 139 211
      src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java
  51. 203 187
      src/main/java/com/diagbot/facade/ConsoleFacade.java
  52. 535 0
      src/main/java/com/diagbot/facade/DataImportFacade.java
  53. 150 1
      src/main/java/com/diagbot/facade/FilterFacade.java
  54. 33 40
      src/main/java/com/diagbot/facade/ModelHospitalFacade.java
  55. 60 0
      src/main/java/com/diagbot/facade/QcAbnormalFacade.java
  56. 1 1
      src/main/java/com/diagbot/facade/QcModeFacade.java
  57. 11 0
      src/main/java/com/diagbot/facade/QcTypeCasesEntryFacade.java
  58. 237 10
      src/main/java/com/diagbot/facade/QcTypeFacade.java
  59. 85 44
      src/main/java/com/diagbot/facade/QcresultInfoFacade.java
  60. 71 32
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  61. 2 4
      src/main/java/com/diagbot/mapper/MedCrisisInfoMapper.java
  62. 8 1
      src/main/java/com/diagbot/mapper/QcCasesEntryMapper.java
  63. 5 0
      src/main/java/com/diagbot/mapper/QcTypeCasesEntryMapper.java
  64. 10 0
      src/main/java/com/diagbot/mapper/QcTypeMapper.java
  65. 49 6
      src/main/java/com/diagbot/mapper/QcresultInfoMapper.java
  66. 74 30
      src/main/java/com/diagbot/service/BehospitalInfoService.java
  67. 1 1
      src/main/java/com/diagbot/service/MedCrisisInfoService.java
  68. 7 0
      src/main/java/com/diagbot/service/QcCasesEntryService.java
  69. 6 2
      src/main/java/com/diagbot/service/QcTypeCasesEntryService.java
  70. 5 1
      src/main/java/com/diagbot/service/QcTypeService.java
  71. 48 5
      src/main/java/com/diagbot/service/QcresultInfoService.java
  72. 103 55
      src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
  73. 66 0
      src/main/java/com/diagbot/service/impl/ExcelExportStylerUserImpl.java
  74. 2 6
      src/main/java/com/diagbot/service/impl/MedCrisisInfoServiceImpl.java
  75. 13 0
      src/main/java/com/diagbot/service/impl/QcCasesEntryServiceImpl.java
  76. 9 2
      src/main/java/com/diagbot/service/impl/QcTypeCasesEntryServiceImpl.java
  77. 7 1
      src/main/java/com/diagbot/service/impl/QcTypeServiceImpl.java
  78. 62 6
      src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java
  79. 6 1
      src/main/java/com/diagbot/task/BehospitalInfoAnalyzeTask.java
  80. 9 1
      src/main/java/com/diagbot/task/TASK_CX.java
  81. 143 0
      src/main/java/com/diagbot/util/ExcelUtils.java
  82. 3 0
      src/main/java/com/diagbot/vo/AnalyzeVO.java
  83. 12 0
      src/main/java/com/diagbot/vo/BehospitalPageVO.java
  84. 42 0
      src/main/java/com/diagbot/vo/DataImportVO.java
  85. 19 0
      src/main/java/com/diagbot/vo/DeleteQcTypeVO.java
  86. 30 0
      src/main/java/com/diagbot/vo/ExportQcresultVO.java
  87. 19 7
      src/main/java/com/diagbot/vo/FilterPageVO.java
  88. 10 2
      src/main/java/com/diagbot/vo/FilterVO.java
  89. 0 23
      src/main/java/com/diagbot/vo/HomePageFilterVO.java
  90. 9 5
      src/main/java/com/diagbot/vo/ModelHospitalUpdataVO.java
  91. 22 0
      src/main/java/com/diagbot/vo/QcAbnormalModeVO.java
  92. 25 0
      src/main/java/com/diagbot/vo/QcAbnormalSaveNameVO.java
  93. 1 3
      src/main/java/com/diagbot/vo/QcCasesEntryHospitalVO.java
  94. 18 0
      src/main/java/com/diagbot/vo/QcEntryHospitalVO.java
  95. 15 0
      src/main/java/com/diagbot/vo/QcTypeCasesEntryVO.java
  96. 24 0
      src/main/java/com/diagbot/vo/QcTypeIndexVO.java
  97. 22 0
      src/main/java/com/diagbot/vo/QcTypePageVO.java
  98. 26 0
      src/main/java/com/diagbot/vo/QcTypeSaveVO.java
  99. 18 0
      src/main/java/com/diagbot/vo/QcTypeVO.java
  100. 0 0
      src/main/java/com/diagbot/vo/QueryVo.java

+ 29 - 0
doc/004.20200527v.1.3.0/qc_init.sql

@@ -0,0 +1,29 @@
+use `qc`;
+
+INSERT INTO `qc`.`sys_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ('32', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '质控类型维护', '2', 'YH-JCSJWH-ZKLXWH', '1', '0', '3', '用户-基础数据维护-质控类型维护');
+
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('78', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '分页列表', 'FUNC000078', '/qc/qcType/page', 'ALL', '用户-质控类型维护-分页列表', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('79', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '新增或更新', 'FUNC000079', '/qc/qcType/saveOrUpdate', 'ALL', '用户-质控类型维护-新增或更新', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('80', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '新增时质控条目分组信息', 'FUNC000080', '/qc/qcType/getEntryByHospital', 'ALL', '用户-质控类型维护-新增时质控条目分组信息', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('81', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '质控条目检索', 'FUNC000081', '/qc/qcType/index', 'ALL', '用户-质控类型维护-质控条目检索', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('82', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '删除', 'FUNC000082', '/qc/qcType/delete', 'ALL', '用户-质控类型维护-删除', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('83', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '根据id返回内容', 'FUNC000083', '/qc/qcType/getById', 'ALL', '用户-质控类型维护-根据id返回内容', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('84', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '获取医院数据全部条目', 'FUNC000084', '/qc/modelHospital/getModelHospitalAll', 'ALL', '用户-质控类型维护-获取医院数据全部条目', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('85', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '根据id获取医院数据', 'FUNC000085', '/qc/modelHospital/getModelHospitalById', 'ALL', '用户-质控类型维护-根据id获取医院数据', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('86', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '添加和修改医院数据模块', 'FUNC000086', '/qc/modelHospital/saveAndupdataModel', 'ALL', '用户-质控类型维护-添加和修改医院数据模块', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('87', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '删除医院数据模块', 'FUNC000087', '/qc/modelHospital/clearModelHospital', 'ALL', '用户-质控类型维护-删除医院数据模块', NULL);
+INSERT INTO `qc`.`sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('88', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '获取医院全部模块', 'FUNC0000888', '/qc/mode/getModes', 'ALL', '用户-质控类型维护-获取医院全部模块', NULL);
+
+INSERT INTO `qc`.`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', '32', '用户-基础数据维护-质控类型维护');
+
+INSERT INTO `qc`.`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', '78', '用户-质控类型维护-分页列表');
+INSERT INTO `qc`.`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', '79', '用户-质控类型维护-新增或更新');
+INSERT INTO `qc`.`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', '80', '用户-质控类型维护-新增时质控条目分组信息');
+INSERT INTO `qc`.`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', '81', '用户-质控类型维护-质控条目检索');
+INSERT INTO `qc`.`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', '82', '用户-质控类型维护-删除');
+INSERT INTO `qc`.`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', '83', '用户-质控类型维护-根据id返回内容');
+INSERT INTO `qc`.`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', '84', '用户-质控类型维护-获取医院数据全部条目');
+INSERT INTO `qc`.`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', '85', '用户-质控类型维护-根据id获取医院数据');
+INSERT INTO `qc`.`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', '86', '用户-质控类型维护-添加和修改医院数据模块');
+INSERT INTO `qc`.`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', '87', '用户-质控类型维护-删除医院数据模块');
+INSERT INTO `qc`.`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', '88', '用户-质控类型维护-获取医院全部模块');

File diff suppressed because it is too large
+ 1059 - 0
doc/005.20200528v1.2.x/qc_init.sql


+ 5 - 0
doc/006.20200602数据导入/qc_init.sql

@@ -0,0 +1,5 @@
+use `qc`;
+
+INSERT INTO `qc_mode` (`id`, `name`, `order_no`, `parent_id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('56', '日常病程录', '210', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
+
+delete from sys_dictionary_info where group_type = 0 and is_deleted = 'Y';

+ 34 - 0
doc/006.20200604v1.3.1/qc_initv1.3.1.sql

@@ -0,0 +1,34 @@
+use `qc`;
+
+-- alter table qc_cases_entry add COLUMN `rule_type` TINYINT(4) DEFAULT '0' COMMENT '规则类型(0:无,1:空项,2:错误)' after `name`;
+-- INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('286', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '日常病程录', '56', '1', '286', '所属模块');
+-- INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('287', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '14', '无', '0', '1', '1', '质控错误类型');
+-- INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('288', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '14', '空项', '1', '1', '2', '质控错误类型');
+-- INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('289', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '14', '错误', '2', '1', '3', '质控错误类型');
+
+-- 已经在四个环境执行过并且已经和技术服务部同步
+-- ALTER TABLE `med_medical_record` ADD INDEX `idx_hos_becode` ( `hospital_id`, `behospital_code` ) USING BTREE;
+-- ALTER TABLE `med_medical_record` ADD INDEX `idx_mode_id` ( `mode_id` ) USING BTREE;
+
+-- ALTER TABLE `med_qcresult_detail` ADD INDEX `idx_cases_entry_id` (`cases_entry_id`) USING BTREE;
+-- ALTER TABLE `med_qcresult_detail` ADD INDEX `idx_cases_id` (`cases_id`) USING BTREE;
+--
+-- ALTER TABLE `qc_cases_entry_hospital` ADD INDEX `idx_cases_entry_id` (`cases_entry_id`) USING BTREE;
+-- ALTER TABLE `qc_cases_entry_hospital` ADD INDEX `idx_is_reject` (`is_reject`) USING BTREE;
+
+ALTER TABLE `med_behospital_info` ADD INDEX `idx_leave_hospital_date` (`leave_hospital_date`) USING BTREE;
+ALTER TABLE `qc_cases_entry_hospital` ADD INDEX `idx_hospital_id` (`hospital_id`) USING BTREE;
+
+
+ALTER TABLE `med_record_type` ADD `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除' AFTER `remark`;
+ALTER TABLE `med_record_type` ADD `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间' AFTER `is_deleted`;
+ALTER TABLE `med_record_type` ADD `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改' AFTER `gmt_create`;
+ALTER TABLE `med_record_type` ADD `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值' AFTER `gmt_modified`;
+ALTER TABLE `med_record_type` ADD `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改' AFTER `creator`;
+
+
+INSERT INTO `qc_mode` (`id`, `name`, `order_no`, `parent_id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('56', '日常病程录', '210', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
+
+delete from sys_dictionary_info where group_type = 0 and is_deleted = 'Y';
+
+ALTER TABLE `qc_cases_entry_hospital` MODIFY COLUMN  `is_reject` int(3) NOT NULL DEFAULT '0' COMMENT '单项否决(1-单项否决 0-非)' AFTER `is_used`;

+ 3 - 0
doc/007.20200608v1.2.3/qc_initv1.2.3.sql

@@ -0,0 +1,3 @@
+use `qc`;
+
+UPDATE `sys_task_cron` SET `id`='-1', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `cron_code`='TASK_CX', `cron`='0 0 4 * * ?', `param`='1', `is_used`='1', `remark`='每天早上自动评分当天外的未评分的数据、同时强制质控出院日期推前四天的数据' WHERE (`id`='-1');

+ 8 - 0
doc/008.20200610v1.3.3/qc_initv1.3.3.sql

@@ -0,0 +1,8 @@
+use `qc`;
+
+ALTER TABLE `med_behospital_info` ADD `placefile_date` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '归档时间' AFTER `is_placefile`;
+
+UPDATE `med_behospital_info` set `placefile_date` = date_add(leave_hospital_date,interval 3 day) where leave_hospital_date is not null;
+
+--  【已执行】 2020-06-11
+-- INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('290', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '4', 'leaveHospitalType', '出院情况', '2', '0', '病案首页诊断信息');

+ 9 - 0
pom.xml

@@ -35,6 +35,7 @@
         <poi.version>4.1.1</poi.version>
         <poi.version>4.1.1</poi.version>
         <aggregator.version>1.1.0</aggregator.version>
         <aggregator.version>1.1.0</aggregator.version>
         <okhttp.version>4.2.2</okhttp.version>
         <okhttp.version>4.2.2</okhttp.version>
+        <easypoi.version>4.2.0</easypoi.version>
         <docker-maven-plugin.version>1.2.1</docker-maven-plugin.version>
         <docker-maven-plugin.version>1.2.1</docker-maven-plugin.version>
         <docker.image.prefix>192.168.2.236:5000/diagbotcloud</docker.image.prefix>
         <docker.image.prefix>192.168.2.236:5000/diagbotcloud</docker.image.prefix>
         <registryUrl>http://192.168.2.236:5000/repository/diagbotcloud/</registryUrl>
         <registryUrl>http://192.168.2.236:5000/repository/diagbotcloud/</registryUrl>
@@ -189,6 +190,14 @@
             <version>${aggregator.version}</version>
             <version>${aggregator.version}</version>
         </dependency>
         </dependency>
 
 
+        <!-- easypoi -->
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+            <version>${easypoi.version}</version>
+        </dependency>
+
+
     </dependencies>
     </dependencies>
 
 
     <!-- 私有仓库 -->
     <!-- 私有仓库 -->

+ 1 - 1
src/main/java/com/diagbot/aggregate/AverageStatisticsAggregate.java

@@ -253,7 +253,7 @@ public class AverageStatisticsAggregate {
     @DataProvider("getAverageScore")
     @DataProvider("getAverageScore")
     public List<AverageStatisticsDTO> getAverageScore(@InvokeParameter("filterVO") FilterVO filterVO) {
     public List<AverageStatisticsDTO> getAverageScore(@InvokeParameter("filterVO") FilterVO filterVO) {
         List<AverageStatisticsDTO> retAverageScoreList = Lists.newLinkedList();
         List<AverageStatisticsDTO> retAverageScoreList = Lists.newLinkedList();
-        List<AverageStatisticsDTO> averageScoreList = qcresultInfoFacade.getAverageScoreByDept(filterVO);
+        List<AverageStatisticsDTO> averageScoreList = qcresultInfoFacade.getAverageScore(filterVO);
         Integer limitCount = filterVO.getLimitCount();
         Integer limitCount = filterVO.getLimitCount();
         //质控平均分
         //质控平均分
         if (ListUtil.isNotEmpty(averageScoreList)) {
         if (ListUtil.isNotEmpty(averageScoreList)) {

+ 4 - 10
src/main/java/com/diagbot/aggregate/MrStatisticsAggregate.java

@@ -7,7 +7,6 @@ import com.diagbot.facade.QcresultInfoFacade;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.vo.FilterVO;
 import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.HomePageFilterVO;
 import com.diagbot.vo.QcresultFilterVO;
 import com.diagbot.vo.QcresultFilterVO;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import io.github.lvyahui8.spring.annotation.DataConsumer;
 import io.github.lvyahui8.spring.annotation.DataConsumer;
@@ -89,15 +88,10 @@ public class MrStatisticsAggregate {
         retMap.put("死亡人数", 0);
         retMap.put("死亡人数", 0);
         retMap.put("新生儿人数", 0);
         retMap.put("新生儿人数", 0);
         retMap.put("手术病人数", 0);
         retMap.put("手术病人数", 0);
-        HomePageFilterVO homePageFilterVO = new HomePageFilterVO();
-        BeanUtil.copyProperties(filterVO, homePageFilterVO);
-        Integer totleNum = behospitalInfoFacade.homePageCount(homePageFilterVO);
-        homePageFilterVO.setDeath(1);
-        Integer deathNum = behospitalInfoFacade.homePageCount(homePageFilterVO);
-        homePageFilterVO.setDeath(null);
-        homePageFilterVO.setNewBorn(1);
-        Integer newBornNum = behospitalInfoFacade.homePageCount(homePageFilterVO);
-        Integer operationNum = behospitalInfoFacade.homePageCountForOperation(filterVO);
+        Integer totleNum = behospitalInfoFacade.leaveHosCount(filterVO);
+        Integer deathNum = behospitalInfoFacade.deathCount(filterVO);
+        Integer newBornNum = behospitalInfoFacade.newBornCount(filterVO);
+        Integer operationNum = behospitalInfoFacade.operationCount(filterVO);
         retMap.put("总人数", totleNum);
         retMap.put("总人数", totleNum);
         retMap.put("死亡人数", deathNum);
         retMap.put("死亡人数", deathNum);
         retMap.put("新生儿人数", newBornNum);
         retMap.put("新生儿人数", newBornNum);

+ 4 - 54
src/main/java/com/diagbot/aggregate/ResultStatisticsAggregate.java

@@ -136,64 +136,14 @@ public class ResultStatisticsAggregate {
      */
      */
     @DataProvider("entryCountGroupByEntry")
     @DataProvider("entryCountGroupByEntry")
     public List<NumDTO> entryCountGroupByEntry(@InvokeParameter("filterVO") FilterVO filterVO) {
     public List<NumDTO> entryCountGroupByEntry(@InvokeParameter("filterVO") FilterVO filterVO) {
-        DecimalFormat df = new DecimalFormat("#0.00");
         Integer limitCount = filterVO.getLimitCount();
         Integer limitCount = filterVO.getLimitCount();
         List<NumDTO> numDTOList = qcresultInfoFacade.entryCountGroupByEntry(filterVO);
         List<NumDTO> numDTOList = qcresultInfoFacade.entryCountGroupByEntry(filterVO);
         if (ListUtil.isNotEmpty(numDTOList)) {
         if (ListUtil.isNotEmpty(numDTOList)) {
-            int totle = numDTOList
-                    .stream()
-                    .map(NumDTO::getNum)
-                    .reduce(0, Integer::sum);
             List<NumDTO> retList = Lists.newLinkedList();
             List<NumDTO> retList = Lists.newLinkedList();
-            numDTOList.forEach(numDTO -> {
-                numDTO.setTotleNum(totle);
-                Double percent = BigDecimal.valueOf(numDTO.getNum())
-                        .divide(BigDecimal.valueOf(totle), 4, RoundingMode.HALF_UP)
-                        .doubleValue();
-                numDTO.setPercent(percent);
-                String percentStr
-                        = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
-                numDTO.setPercentStr(percentStr);
-            });
-
-            //降序排序
-            Collections.sort(numDTOList, new Comparator<NumDTO>() {
-                @Override
-                public int compare(NumDTO o1, NumDTO o2) {
-                    return o2.getPercent().compareTo(o1.getPercent());
-                }
-            });
-
-            //top9+其他
             if (numDTOList.size() <= limitCount) {
             if (numDTOList.size() <= limitCount) {
-                retList.addAll(numDTOList);
+                retList = numDTOList;
             } else {
             } else {
-                int count = 0;
-                double sumPercent = 0d;
-                for (NumDTO numDTO : numDTOList) {
-                    if (retList.size() < limitCount - 1) {
-                        retList.add(numDTO);
-                        count += numDTO.getNum();
-                        sumPercent = BigDecimal.valueOf(sumPercent)
-                                .add(BigDecimal.valueOf(numDTO.getPercent()))
-                                .doubleValue();
-                    } else {
-                        NumDTO otherNumDTO = new NumDTO();
-                        int num = totle - count;
-                        otherNumDTO.setName("其他");
-                        otherNumDTO.setNum(num);
-                        otherNumDTO.setTotleNum(totle);
-                        Double percent = BigDecimal.valueOf(num)
-                                .divide(BigDecimal.valueOf(totle), 4, RoundingMode.HALF_UP)
-                                .doubleValue();
-                        otherNumDTO.setPercent(percent);
-                        String percentStr
-                                = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
-                        otherNumDTO.setPercentStr(percentStr);
-                        retList.add(otherNumDTO);
-                        break;
-                    }
-                }
+                retList = numDTOList.subList(0, limitCount);
             }
             }
             return retList;
             return retList;
         }
         }
@@ -201,7 +151,7 @@ public class ResultStatisticsAggregate {
     }
     }
 
 
     /**
     /**
-     * 各科室缺陷占比
+     * 各科室缺陷占比-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
@@ -209,7 +159,7 @@ public class ResultStatisticsAggregate {
     @DataProvider("entryByDept")
     @DataProvider("entryByDept")
     public List<NumDTO> entryByDept(@InvokeParameter("filterVO") FilterVO filterVO) {
     public List<NumDTO> entryByDept(@InvokeParameter("filterVO") FilterVO filterVO) {
         Integer limitCount = filterVO.getLimitCount();
         Integer limitCount = filterVO.getLimitCount();
-        List<NumDTO> numDTOList = behospitalInfoFacade.resultStatisticsByDept2(filterVO);
+        List<NumDTO> numDTOList = behospitalInfoFacade.entryByDept(filterVO);
         if (ListUtil.isNotEmpty(numDTOList)) {
         if (ListUtil.isNotEmpty(numDTOList)) {
             int totle = numDTOList
             int totle = numDTOList
                     .stream()
                     .stream()

+ 4 - 0
src/main/java/com/diagbot/client/AuthServiceClient.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.AnalyzeDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.JWT;
 import com.diagbot.entity.JWT;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
+import com.diagbot.vo.DataImportVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -32,6 +33,9 @@ public interface AuthServiceClient {
 
 
     @PostMapping(value = "/qc/behospitalInfo/analyze_rpc")
     @PostMapping(value = "/qc/behospitalInfo/analyze_rpc")
     RespDTO<AnalyzeDTO> analyze_rpc(@RequestBody AnalyzeVO analyzeVO);
     RespDTO<AnalyzeDTO> analyze_rpc(@RequestBody AnalyzeVO analyzeVO);
+
+    @PostMapping(value = "/qc/dataimport/import")
+    RespDTO<Boolean> dataimport(@RequestBody DataImportVO dataImportVO);
 }
 }
 
 
 
 

+ 7 - 0
src/main/java/com/diagbot/client/hystrix/AuthServiceHystrix.java

@@ -6,6 +6,7 @@ import com.diagbot.dto.AnalyzeDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.JWT;
 import com.diagbot.entity.JWT;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
+import com.diagbot.vo.DataImportVO;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
@@ -41,4 +42,10 @@ public class AuthServiceHystrix implements AuthServiceClient {
         log.error("【hystrix】调用{}异常", "analyze_rpc");
         log.error("【hystrix】调用{}异常", "analyze_rpc");
         return null;
         return null;
     }
     }
+
+    @Override
+    public RespDTO<Boolean> dataimport(DataImportVO dataImportVO) {
+        log.error("【hystrix】调用{}异常", "dataimport");
+        return null;
+    }
 }
 }

+ 10 - 13
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -60,19 +60,16 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/behospitalInfo/page_dept").permitAll()
                 .antMatchers("/qc/behospitalInfo/page_dept").permitAll()
                 .antMatchers("/qc/behospitalInfo/page_person").permitAll()
                 .antMatchers("/qc/behospitalInfo/page_person").permitAll()
                 .antMatchers("/consoleByDept/getDept").permitAll()
                 .antMatchers("/consoleByDept/getDept").permitAll()
-                .antMatchers("/qc/data/sendDoctorInfos").permitAll()
-                .antMatchers("/qc/data/sendDeptInfos").permitAll()
-                .antMatchers("/qc/data/sendRecordTypes").permitAll()
-                .antMatchers("/qc/data/sendMrRecordIng").permitAll()
-                .antMatchers("/qc/data/sendMrContent").permitAll()
-                .antMatchers("/qc/data/sendMrRecord").permitAll()
-                .antMatchers("/qc/data/sendPatientInfo").permitAll()
-                .antMatchers("/qc/data/sendDoctorAdvice").permitAll()
-                .antMatchers("/qc/data/sendHomePageIng").permitAll()
-                .antMatchers("/qc/data/sendHomePage").permitAll()
-                .antMatchers("/qc/data/sendHomeDiagnose").permitAll()
-                .antMatchers("/qc/data/sendHomeOperation").permitAll()
-                .antMatchers("/qc/data/sendCrisis").permitAll()
+                .antMatchers("/qc/casesEntryHospital/findQcCasesEntry").permitAll()
+                .antMatchers("/qc/behospitalInfo/exportExcel").permitAll()
+                .antMatchers("/qc/behospitalInfo/exportQcresult").permitAll()
+                .antMatchers("/qc/behospitalInfo/exportQcresultByDept").permitAll()
+                .antMatchers("/console/entryRejectPercent").permitAll()
+                .antMatchers("/qc/abnormal/getQcAnnormalMode").permitAll()
+                .antMatchers("/console/qcResultLevelPercent").permitAll()
+                .antMatchers("/qc/dataimport/import").permitAll()
+                .antMatchers("/qc/dataimport/dataimportPrepare").permitAll()
+                .antMatchers("/qc/dataimport/test").permitAll()
                 .antMatchers("/**").authenticated();
                 .antMatchers("/**").authenticated();
 //                .antMatchers("/**").permitAll();
 //                .antMatchers("/**").permitAll();
     }
     }

+ 10 - 13
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -103,19 +103,16 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/page_dept", request)
                 || matchers("/qc/behospitalInfo/page_dept", request)
                 || matchers("/qc/behospitalInfo/page_person", request)
                 || matchers("/qc/behospitalInfo/page_person", request)
                 || matchers("/consoleByDept/getDept", request)
                 || matchers("/consoleByDept/getDept", request)
-                || matchers("/qc/data/sendDoctorInfos", request)
-                || matchers("/qc/data/sendDeptInfos", request)
-                || matchers("/qc/data/sendRecordTypes", request)
-                || matchers("/qc/data/sendMrRecordIng", request)
-                || matchers("/qc/data/sendMrContent", request)
-                || matchers("/qc/data/sendMrRecord", request)
-                || matchers("/qc/data/sendPatientInfo", request)
-                || matchers("/qc/data/sendDoctorAdvice", request)
-                || matchers("/qc/data/sendHomePageIng", request)
-                || matchers("/qc/data/sendHomePage", request)
-                || matchers("/qc/data/sendHomeDiagnose", request)
-                || matchers("/qc/data/sendHomeOperation", request)
-                || matchers("/qc/data/sendCrisis", request)
+                || matchers("/qc/casesEntryHospital/findQcCasesEntry", request)
+                || matchers("/qc/behospitalInfo/exportExcel", request)
+                || matchers("/qc/behospitalInfo/exportQcresult", request)
+                || matchers("/qc/behospitalInfo/exportQcresultByDept", request)
+                || matchers("/console/entryRejectPercent", request)
+                || matchers("/qc/abnormal/getQcAnnormalMode", request)
+                || matchers("/console/qcResultLevelPercent", request)
+                || matchers("/qc/dataimport/import", request)
+                || matchers("/qc/dataimport/dataimportPrepare", request)
+                || matchers("/qc/dataimport/test", request)
                 || matchers("/", request)) {
                 || matchers("/", request)) {
             return true;
             return true;
         }
         }

+ 6 - 4
src/main/java/com/diagbot/dto/AverageStatisticsDTO.java

@@ -14,10 +14,12 @@ public class AverageStatisticsDTO {
     private String id;
     private String id;
     private String name;
     private String name;
     private Integer num;
     private Integer num;
-    private Double averageValue=0d;
-    private Double totleValue=0d;
+    private Double averageValue = 0d;
+    private Double totleValue = 0d;
     //环比平均值
     //环比平均值
-    private Double lastAverageValue=0d;
+    private Double lastAverageValue = 0d;
     //同比平均值
     //同比平均值
-    private Double lastYearAverageValue=0d;
+    private Double lastYearAverageValue = 0d;
+    //科室分类
+    private String deptClass;
 }
 }

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

@@ -106,4 +106,9 @@ public class BehospitalInfoDTO implements Serializable {
     private String directorDoctorName ;
     private String directorDoctorName ;
 
 
     private String behDoctorName;
     private String behDoctorName;
+
+    /**
+     * 归档时间
+     */
+    private Date placefileDate;
 }
 }

+ 18 - 0
src/main/java/com/diagbot/dto/CaseAndDeptNumDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/5/28 14:49
+ */
+@Getter
+@Setter
+public class CaseAndDeptNumDTO extends NumDTO {
+    private String deptId;
+    private String deptName;
+    private Long casesId;
+    private String casesName;
+}

+ 16 - 0
src/main/java/com/diagbot/dto/CaseNumDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/5/28 14:45
+ */
+@Getter
+@Setter
+public class CaseNumDTO extends NumDTO {
+    private Long casesId;
+    private String casesName;
+}

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

@@ -0,0 +1,36 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/6/5 14:26
+ */
+@Getter
+@Setter
+public class DeptEntryNumDTO {
+    private Long id;
+    /**
+     * 条目名称
+     */
+    private String name;
+    private Long casesId;
+    /**
+     * 模块名称
+     */
+    private String casesName;
+    private String deptId;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+    private Integer totleNum = 0;
+    private Integer num = 0;
+    private Double percent = 0.00d;
+    private String percentStr = "0.00%";
+    private Double score = 0d;
+    private Integer isReject;
+    private Integer ruleType;
+}

+ 31 - 0
src/main/java/com/diagbot/dto/EntryNumDTO.java

@@ -0,0 +1,31 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/6/5 13:20
+ */
+@Getter
+@Setter
+public class EntryNumDTO {
+    private Long id;
+    /**
+     * 条目名称
+     */
+    private String name;
+    private Long casesId;
+    /**
+     * 模块名称
+     */
+    private String casesName;
+    private Integer totleNum = 0;
+    private Integer num = 0;
+    private Double percent = 0.00d;
+    private String percentStr = "0.00%";
+    private Double score = 0d;
+    private Integer isReject;
+    private Integer ruleType;
+}

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

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

+ 9 - 0
src/main/java/com/diagbot/dto/ExportExcelCase.java

@@ -0,0 +1,9 @@
+package com.diagbot.dto;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:47
+ */
+public class ExportExcelCase {
+}

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

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:47
+ */
+@Getter
+@Setter
+public class ExportExcelCaseDTO {
+    @Excel(name = "错误所属区块", needMerge = true)
+    private String caseName;
+    @ExcelCollection(name = "")
+    private List<ExportExcelMsgDTO> exportExcelMsgDTOS;
+
+}

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

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

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

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:47
+ */
+@Getter
+@Setter
+public class ExportExcelMsgDTO {
+    @Excel(name = "存在问题", isWrap = false)
+    private String msg;
+}

+ 58 - 0
src/main/java/com/diagbot/dto/ExportQcresultDTO.java

@@ -0,0 +1,58 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/6/2 19:57
+ */
+@Getter
+@Setter
+public class ExportQcresultDTO {
+    /**
+     * 科室编码/科室id
+     */
+    private String deptId;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+    /**
+     * 主管医生名称(主任医生+主治医生)
+     */
+    private String doctorName;
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+    /**
+     * 病历号
+     */
+    private String behospitalCode;
+    /**
+     * 入院日期
+     */
+    private String behospitalDate;
+    /**
+     * 出院日期
+     */
+    private String leaveHospitalDate;
+    /**
+     * 质控评分
+     */
+    private Double scoreRes;
+    /**
+     * 科室质控平均分
+     */
+    private Double averageScore;
+    /**
+     * 存在问题
+     */
+    private String msg;
+    /**
+     * 错误所属区块
+     */
+    private String casesName;
+}

+ 37 - 0
src/main/java/com/diagbot/dto/HomePageNumDTO.java

@@ -0,0 +1,37 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/6/5 17:32
+ */
+@Getter
+@Setter
+public class HomePageNumDTO {
+    private String deptId;
+    private String deptName;
+    private String doctorId;
+    private String doctorName;
+    private Integer entryNum = 0;
+    private Integer mrNum = 0;
+    private Double totleValue = 0d;
+    private Double averageValue = 0d;
+    private Integer firstLevelNum = 0;
+    private Integer secondLevelNum = 0;
+    private Double firstLevelPercent = 0.00d;
+    private Double secondLevelPercent = 0.00d;
+    private String firstLevelPercentStr = "0.00%";
+    private String secondLevelPercentStr = "0.00%";
+    private String deptClassId;
+    private String deptClass;
+    private Integer emptyNum = 0;
+    private Integer errorNum = 0;
+    private Integer entryTotleNum = 0;
+    private Double emptyPercent = 0.00d;
+    private Double errorPercent = 0.00d;
+    private String emptyPercentStr = "0.00%";
+    private String errorPercentStr = "0.00%";
+}

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

@@ -28,4 +28,7 @@ public class LevelStatisticsDTO {
     private String firstLevelPercentStr;
     private String firstLevelPercentStr;
     private String secondLevelPercentStr;
     private String secondLevelPercentStr;
     private String thirdLevelPercentStr;
     private String thirdLevelPercentStr;
+
+    private String deptClassId;
+    private String deptClass;
 }
 }

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

@@ -0,0 +1,34 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+@Data
+public class MedicalRecordDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 模块id
+     */
+    private Long modeId;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+
+    /**
+     * 病历日期
+     */
+    private String recDate;
+}

+ 9 - 0
src/main/java/com/diagbot/dto/MsgDTO.java

@@ -5,6 +5,7 @@ import lombok.Setter;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -27,6 +28,10 @@ public class MsgDTO {
     private String info;
     private String info;
     //标准提示信息
     //标准提示信息
     private String standardMsg;
     private String standardMsg;
+    // 操作类型(1:新增,2:删除,3:修改)
+    private Integer optType;
+    // 初始类型(1:机器,2:人工)
+    private Integer gradeType;
     //单项否决
     //单项否决
     private String isReject;
     private String isReject;
     //模块名称
     //模块名称
@@ -39,6 +44,10 @@ public class MsgDTO {
     private BigDecimal casesScore;
     private BigDecimal casesScore;
     // 条目ID
     // 条目ID
     private Long casesEntryId;
     private Long casesEntryId;
+    // 记录创建时间
+    private Date gmtCreate;
+    // 记录修改时间,如果时间是1970年则表示纪录未修改
+    private Date gmtModified;
     // 条目id对应页面数据的key值
     // 条目id对应页面数据的key值
     private List<Long> pageKeyList = new ArrayList<>();
     private List<Long> pageKeyList = new ArrayList<>();
 }
 }

+ 4 - 4
src/main/java/com/diagbot/dto/NumDTO.java

@@ -13,8 +13,8 @@ import lombok.Setter;
 public class NumDTO {
 public class NumDTO {
     private String id;
     private String id;
     private String name;
     private String name;
-    private Integer totleNum;
-    private Integer num;
-    private Double percent;
-    private String percentStr;
+    private Integer totleNum = 0;
+    private Integer num = 0;
+    private Double percent = 0.00d;
+    private String percentStr = "0.00%";
 }
 }

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

@@ -0,0 +1,29 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-06-03 10:56
+ */
+@Setter
+@Getter
+public class QcAbnormalModeDTO {
+    /**
+     * 异常描述
+     */
+    private String description;
+
+    private Long modeId;
+    /**
+     * 模块名称
+     */
+    private String modeMame;
+
+
+    private List<QcModeAllDTO> QcModeDatas;
+}

+ 1 - 2
src/main/java/com/diagbot/dto/QcCasesEntryHospitalDTO.java

@@ -3,8 +3,6 @@ package com.diagbot.dto;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
-import java.math.BigDecimal;
-
 /**
 /**
  * @author wangfeng
  * @author wangfeng
  * @Description:
  * @Description:
@@ -21,4 +19,5 @@ public class QcCasesEntryHospitalDTO {
     private Double score;
     private Double score;
     private Integer isReject;
     private Integer isReject;
     private Integer isUsed;
     private Integer isUsed;
+    private Integer ruleType;
 }
 }

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

@@ -0,0 +1,38 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author zhoutg
+ * @Description:
+ * @date 2020-04-27 10:09
+ */
+@Setter
+@Getter
+public class QcCasesEntrySimpleDTO {
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 条目
+     */
+    private String name;
+
+    /**
+     * 0-未启用 1-启用
+     */
+    private String isUsed;
+
+    /**
+     * modeName
+     */
+    private String modeName;
+
+    /**
+     * 是否勾选
+     */
+    private Integer sel;
+}

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

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Getter
+@Setter
+public class QcTypeDTO {
+    // 主键
+    private Long id;
+    // 医院ID
+    private Long hospitalId;
+    // 质控类型名称
+    private String name;
+    // 质控类型和质控条目对应关系
+    private Map<String, List<QcCasesEntrySimpleDTO>> entryMap;
+}

+ 66 - 0
src/main/java/com/diagbot/dto/QcTypePageDTO.java

@@ -0,0 +1,66 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 质控类型标准
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-05-14
+ */
+@Data
+public class QcTypePageDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 质控类型名称
+     */
+    private String name;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+}

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

@@ -46,4 +46,14 @@ public class RecordContentDTO implements Serializable {
      */
      */
     private String recTitle;
     private String recTitle;
 
 
+    /**
+     * 病历类别编号
+     */
+    private String recTypeId;
+
+    /**
+     * 模块id
+     */
+    private Long modeId;
+
 }
 }

+ 56 - 1
src/main/java/com/diagbot/entity/BehospitalInfo.java

@@ -25,7 +25,7 @@ public class BehospitalInfo implements Serializable {
     /**
     /**
      * 病人住院ID
      * 病人住院ID
      */
      */
-    @TableId(value = "behospital_code",type = IdType.INPUT)
+    @TableId(value = "behospital_code", type = IdType.INPUT)
     private String behospitalCode;
     private String behospitalCode;
 
 
     /**
     /**
@@ -148,6 +148,16 @@ public class BehospitalInfo implements Serializable {
      */
      */
     private String directorDoctorName;
     private String directorDoctorName;
 
 
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile;
+
+    /**
+     * 归档时间
+     */
+    private Date placefileDate;
+
     /**
     /**
      * 是否删除,N:未删除,Y:删除
      * 是否删除,N:未删除,Y:删除
      */
      */
@@ -180,6 +190,7 @@ public class BehospitalInfo implements Serializable {
     public void setBehospitalCode(String behospitalCode) {
     public void setBehospitalCode(String behospitalCode) {
         this.behospitalCode = behospitalCode;
         this.behospitalCode = behospitalCode;
     }
     }
+
     public Long getHospitalId() {
     public Long getHospitalId() {
         return hospitalId;
         return hospitalId;
     }
     }
@@ -187,6 +198,7 @@ public class BehospitalInfo implements Serializable {
     public void setHospitalId(Long hospitalId) {
     public void setHospitalId(Long hospitalId) {
         this.hospitalId = hospitalId;
         this.hospitalId = hospitalId;
     }
     }
+
     public String getName() {
     public String getName() {
         return name;
         return name;
     }
     }
@@ -194,6 +206,7 @@ public class BehospitalInfo implements Serializable {
     public void setName(String name) {
     public void setName(String name) {
         this.name = name;
         this.name = name;
     }
     }
+
     public String getSex() {
     public String getSex() {
         return sex;
         return sex;
     }
     }
@@ -201,6 +214,7 @@ public class BehospitalInfo implements Serializable {
     public void setSex(String sex) {
     public void setSex(String sex) {
         this.sex = sex;
         this.sex = sex;
     }
     }
+
     public Date getBirthday() {
     public Date getBirthday() {
         return birthday;
         return birthday;
     }
     }
@@ -208,6 +222,7 @@ public class BehospitalInfo implements Serializable {
     public void setBirthday(Date birthday) {
     public void setBirthday(Date birthday) {
         this.birthday = birthday;
         this.birthday = birthday;
     }
     }
+
     public String getFileCode() {
     public String getFileCode() {
         return fileCode;
         return fileCode;
     }
     }
@@ -215,6 +230,7 @@ public class BehospitalInfo implements Serializable {
     public void setFileCode(String fileCode) {
     public void setFileCode(String fileCode) {
         this.fileCode = fileCode;
         this.fileCode = fileCode;
     }
     }
+
     public Long getQcTypeId() {
     public Long getQcTypeId() {
         return qcTypeId;
         return qcTypeId;
     }
     }
@@ -222,6 +238,7 @@ public class BehospitalInfo implements Serializable {
     public void setQcTypeId(Long qcTypeId) {
     public void setQcTypeId(Long qcTypeId) {
         this.qcTypeId = qcTypeId;
         this.qcTypeId = qcTypeId;
     }
     }
+
     public String getWardCode() {
     public String getWardCode() {
         return wardCode;
         return wardCode;
     }
     }
@@ -229,6 +246,7 @@ public class BehospitalInfo implements Serializable {
     public void setWardCode(String wardCode) {
     public void setWardCode(String wardCode) {
         this.wardCode = wardCode;
         this.wardCode = wardCode;
     }
     }
+
     public String getWardName() {
     public String getWardName() {
         return wardName;
         return wardName;
     }
     }
@@ -236,6 +254,7 @@ public class BehospitalInfo implements Serializable {
     public void setWardName(String wardName) {
     public void setWardName(String wardName) {
         this.wardName = wardName;
         this.wardName = wardName;
     }
     }
+
     public String getBehDeptId() {
     public String getBehDeptId() {
         return behDeptId;
         return behDeptId;
     }
     }
@@ -243,6 +262,7 @@ public class BehospitalInfo implements Serializable {
     public void setBehDeptId(String behDeptId) {
     public void setBehDeptId(String behDeptId) {
         this.behDeptId = behDeptId;
         this.behDeptId = behDeptId;
     }
     }
+
     public String getBehDeptName() {
     public String getBehDeptName() {
         return behDeptName;
         return behDeptName;
     }
     }
@@ -250,6 +270,7 @@ public class BehospitalInfo implements Serializable {
     public void setBehDeptName(String behDeptName) {
     public void setBehDeptName(String behDeptName) {
         this.behDeptName = behDeptName;
         this.behDeptName = behDeptName;
     }
     }
+
     public String getBedCode() {
     public String getBedCode() {
         return bedCode;
         return bedCode;
     }
     }
@@ -257,6 +278,7 @@ public class BehospitalInfo implements Serializable {
     public void setBedCode(String bedCode) {
     public void setBedCode(String bedCode) {
         this.bedCode = bedCode;
         this.bedCode = bedCode;
     }
     }
+
     public String getBedName() {
     public String getBedName() {
         return bedName;
         return bedName;
     }
     }
@@ -264,6 +286,7 @@ public class BehospitalInfo implements Serializable {
     public void setBedName(String bedName) {
     public void setBedName(String bedName) {
         this.bedName = bedName;
         this.bedName = bedName;
     }
     }
+
     public String getInsuranceName() {
     public String getInsuranceName() {
         return insuranceName;
         return insuranceName;
     }
     }
@@ -271,6 +294,7 @@ public class BehospitalInfo implements Serializable {
     public void setInsuranceName(String insuranceName) {
     public void setInsuranceName(String insuranceName) {
         this.insuranceName = insuranceName;
         this.insuranceName = insuranceName;
     }
     }
+
     public String getJobType() {
     public String getJobType() {
         return jobType;
         return jobType;
     }
     }
@@ -278,6 +302,7 @@ public class BehospitalInfo implements Serializable {
     public void setJobType(String jobType) {
     public void setJobType(String jobType) {
         this.jobType = jobType;
         this.jobType = jobType;
     }
     }
+
     public Date getBehospitalDate() {
     public Date getBehospitalDate() {
         return behospitalDate;
         return behospitalDate;
     }
     }
@@ -285,6 +310,7 @@ public class BehospitalInfo implements Serializable {
     public void setBehospitalDate(Date behospitalDate) {
     public void setBehospitalDate(Date behospitalDate) {
         this.behospitalDate = behospitalDate;
         this.behospitalDate = behospitalDate;
     }
     }
+
     public Date getLeaveHospitalDate() {
     public Date getLeaveHospitalDate() {
         return leaveHospitalDate;
         return leaveHospitalDate;
     }
     }
@@ -292,6 +318,7 @@ public class BehospitalInfo implements Serializable {
     public void setLeaveHospitalDate(Date leaveHospitalDate) {
     public void setLeaveHospitalDate(Date leaveHospitalDate) {
         this.leaveHospitalDate = leaveHospitalDate;
         this.leaveHospitalDate = leaveHospitalDate;
     }
     }
+
     public String getDiagnoseIcd() {
     public String getDiagnoseIcd() {
         return diagnoseIcd;
         return diagnoseIcd;
     }
     }
@@ -299,6 +326,7 @@ public class BehospitalInfo implements Serializable {
     public void setDiagnoseIcd(String diagnoseIcd) {
     public void setDiagnoseIcd(String diagnoseIcd) {
         this.diagnoseIcd = diagnoseIcd;
         this.diagnoseIcd = diagnoseIcd;
     }
     }
+
     public String getDiagnose() {
     public String getDiagnose() {
         return diagnose;
         return diagnose;
     }
     }
@@ -306,6 +334,7 @@ public class BehospitalInfo implements Serializable {
     public void setDiagnose(String diagnose) {
     public void setDiagnose(String diagnose) {
         this.diagnose = diagnose;
         this.diagnose = diagnose;
     }
     }
+
     public String getBehDoctorId() {
     public String getBehDoctorId() {
         return behDoctorId;
         return behDoctorId;
     }
     }
@@ -313,6 +342,7 @@ public class BehospitalInfo implements Serializable {
     public void setBehDoctorId(String behDoctorId) {
     public void setBehDoctorId(String behDoctorId) {
         this.behDoctorId = behDoctorId;
         this.behDoctorId = behDoctorId;
     }
     }
+
     public String getBehDoctorName() {
     public String getBehDoctorName() {
         return behDoctorName;
         return behDoctorName;
     }
     }
@@ -320,6 +350,7 @@ public class BehospitalInfo implements Serializable {
     public void setBehDoctorName(String behDoctorName) {
     public void setBehDoctorName(String behDoctorName) {
         this.behDoctorName = behDoctorName;
         this.behDoctorName = behDoctorName;
     }
     }
+
     public String getDoctorId() {
     public String getDoctorId() {
         return doctorId;
         return doctorId;
     }
     }
@@ -327,6 +358,7 @@ public class BehospitalInfo implements Serializable {
     public void setDoctorId(String doctorId) {
     public void setDoctorId(String doctorId) {
         this.doctorId = doctorId;
         this.doctorId = doctorId;
     }
     }
+
     public String getDoctorName() {
     public String getDoctorName() {
         return doctorName;
         return doctorName;
     }
     }
@@ -334,6 +366,7 @@ public class BehospitalInfo implements Serializable {
     public void setDoctorName(String doctorName) {
     public void setDoctorName(String doctorName) {
         this.doctorName = doctorName;
         this.doctorName = doctorName;
     }
     }
+
     public String getDirectorDoctorId() {
     public String getDirectorDoctorId() {
         return directorDoctorId;
         return directorDoctorId;
     }
     }
@@ -341,6 +374,7 @@ public class BehospitalInfo implements Serializable {
     public void setDirectorDoctorId(String directorDoctorId) {
     public void setDirectorDoctorId(String directorDoctorId) {
         this.directorDoctorId = directorDoctorId;
         this.directorDoctorId = directorDoctorId;
     }
     }
+
     public String getDirectorDoctorName() {
     public String getDirectorDoctorName() {
         return directorDoctorName;
         return directorDoctorName;
     }
     }
@@ -348,6 +382,23 @@ public class BehospitalInfo implements Serializable {
     public void setDirectorDoctorName(String directorDoctorName) {
     public void setDirectorDoctorName(String directorDoctorName) {
         this.directorDoctorName = directorDoctorName;
         this.directorDoctorName = directorDoctorName;
     }
     }
+
+    public String getIsPlacefile() {
+        return isPlacefile;
+    }
+
+    public void setIsPlacefile(String isPlacefile) {
+        this.isPlacefile = isPlacefile;
+    }
+
+    public Date getPlacefileDate() {
+        return placefileDate;
+    }
+
+    public void setPlacefileDate(Date placefileDate) {
+        this.placefileDate = placefileDate;
+    }
+
     public String getIsDeleted() {
     public String getIsDeleted() {
         return isDeleted;
         return isDeleted;
     }
     }
@@ -355,6 +406,7 @@ public class BehospitalInfo implements Serializable {
     public void setIsDeleted(String isDeleted) {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
         this.isDeleted = isDeleted;
     }
     }
+
     public Date getGmtCreate() {
     public Date getGmtCreate() {
         return gmtCreate;
         return gmtCreate;
     }
     }
@@ -362,6 +414,7 @@ public class BehospitalInfo implements Serializable {
     public void setGmtCreate(Date gmtCreate) {
     public void setGmtCreate(Date gmtCreate) {
         this.gmtCreate = gmtCreate;
         this.gmtCreate = gmtCreate;
     }
     }
+
     public Date getGmtModified() {
     public Date getGmtModified() {
         return gmtModified;
         return gmtModified;
     }
     }
@@ -369,6 +422,7 @@ public class BehospitalInfo implements Serializable {
     public void setGmtModified(Date gmtModified) {
     public void setGmtModified(Date gmtModified) {
         this.gmtModified = gmtModified;
         this.gmtModified = gmtModified;
     }
     }
+
     public String getCreator() {
     public String getCreator() {
         return creator;
         return creator;
     }
     }
@@ -376,6 +430,7 @@ public class BehospitalInfo implements Serializable {
     public void setCreator(String creator) {
     public void setCreator(String creator) {
         this.creator = creator;
         this.creator = creator;
     }
     }
+
     public String getModifier() {
     public String getModifier() {
         return modifier;
         return modifier;
     }
     }

+ 19 - 0
src/main/java/com/diagbot/entity/CommonParam.java

@@ -0,0 +1,19 @@
+package com.diagbot.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @Author: ztg
+ * @Date: 2018/12/14 14:15
+ */
+@Getter
+@Setter
+public class CommonParam {
+    private String person;     //操作人
+    private Date now;          //当前时间
+    private int insertOrUpdate;//更新或新增标识
+}

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

@@ -1,14 +1,8 @@
 package com.diagbot.entity;
 package com.diagbot.entity;
 
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.io.Serializable;
 import java.io.Serializable;
-import java.util.Date;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -16,15 +10,12 @@ import java.util.Date;
  * </p>
  * </p>
  *
  *
  * @author zhoutg
  * @author zhoutg
- * @since 2020-05-28
+ * @since 2020-06-02
  */
  */
-@TableName("med_crisis_info")
-@Data
 public class MedCrisisInfo implements Serializable {
 public class MedCrisisInfo implements Serializable {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
-    @TableId(value = "rec_id",type = IdType.INPUT)
     private String recId;
     private String recId;
 
 
     /**
     /**
@@ -100,12 +91,12 @@ public class MedCrisisInfo implements Serializable {
     /**
     /**
      * 送检时间
      * 送检时间
      */
      */
-    private Date sendDate;
+    private LocalDate sendDate;
 
 
     /**
     /**
      * 报告时间
      * 报告时间
      */
      */
-    private Date repDate;
+    private LocalDate repDate;
 
 
     /**
     /**
      * 是否删除,N:未删除,Y:删除
      * 是否删除,N:未删除,Y:删除
@@ -115,12 +106,12 @@ public class MedCrisisInfo implements Serializable {
     /**
     /**
      * 记录创建时间
      * 记录创建时间
      */
      */
-    private Date gmtCreate;
+    private LocalDateTime gmtCreate;
 
 
     /**
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
      */
-    private Date gmtModified;
+    private LocalDateTime gmtModified;
 
 
     /**
     /**
      * 创建人,0表示无创建人值
      * 创建人,0表示无创建人值
@@ -237,18 +228,18 @@ public class MedCrisisInfo implements Serializable {
     public void setCrisisLowerValue(String crisisLowerValue) {
     public void setCrisisLowerValue(String crisisLowerValue) {
         this.crisisLowerValue = crisisLowerValue;
         this.crisisLowerValue = crisisLowerValue;
     }
     }
-    public Date getSendDate() {
+    public LocalDate getSendDate() {
         return sendDate;
         return sendDate;
     }
     }
 
 
-    public void setSendDate(Date sendDate) {
+    public void setSendDate(LocalDate sendDate) {
         this.sendDate = sendDate;
         this.sendDate = sendDate;
     }
     }
-    public Date getRepDate() {
+    public LocalDate getRepDate() {
         return repDate;
         return repDate;
     }
     }
 
 
-    public void setRepDate(Date repDate) {
+    public void setRepDate(LocalDate repDate) {
         this.repDate = repDate;
         this.repDate = repDate;
     }
     }
     public String getIsDeleted() {
     public String getIsDeleted() {
@@ -258,18 +249,18 @@ public class MedCrisisInfo implements Serializable {
     public void setIsDeleted(String isDeleted) {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
         this.isDeleted = isDeleted;
     }
     }
-    public Date getGmtCreate() {
+    public LocalDateTime getGmtCreate() {
         return gmtCreate;
         return gmtCreate;
     }
     }
 
 
-    public void setGmtCreate(Date gmtCreate) {
+    public void setGmtCreate(LocalDateTime gmtCreate) {
         this.gmtCreate = gmtCreate;
         this.gmtCreate = gmtCreate;
     }
     }
-    public Date getGmtModified() {
+    public LocalDateTime getGmtModified() {
         return gmtModified;
         return gmtModified;
     }
     }
 
 
-    public void setGmtModified(Date gmtModified) {
+    public void setGmtModified(LocalDateTime gmtModified) {
         this.gmtModified = gmtModified;
         this.gmtModified = gmtModified;
     }
     }
     public String getCreator() {
     public String getCreator() {

+ 29 - 62
src/main/java/com/diagbot/entity/MedRecordType.java

@@ -2,8 +2,11 @@ package com.diagbot.entity;
 
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
+import java.util.Date;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -13,6 +16,8 @@ import java.io.Serializable;
  * @author gaodm
  * @author gaodm
  * @since 2020-04-13
  * @since 2020-04-13
  */
  */
+@Getter
+@Setter
 public class MedRecordType implements Serializable {
 public class MedRecordType implements Serializable {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
@@ -50,66 +55,28 @@ public class MedRecordType implements Serializable {
 
 
     private String remark;
     private String remark;
 
 
-    public String getTypeId() {
-        return typeId;
-    }
-
-    public void setTypeId(String typeId) {
-        this.typeId = typeId;
-    }
-    public Long getHospitalId() {
-        return hospitalId;
-    }
-
-    public void setHospitalId(Long hospitalId) {
-        this.hospitalId = hospitalId;
-    }
-    public String getTypeName() {
-        return typeName;
-    }
-
-    public void setTypeName(String typeName) {
-        this.typeName = typeName;
-    }
-    public String getParentTypeId() {
-        return parentTypeId;
-    }
-
-    public void setParentTypeId(String parentTypeId) {
-        this.parentTypeId = parentTypeId;
-    }
-    public String getObjName() {
-        return objName;
-    }
-
-    public void setObjName(String objName) {
-        this.objName = objName;
-    }
-    public String getSpell() {
-        return spell;
-    }
-
-    public void setSpell(String spell) {
-        this.spell = spell;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "MedRecordType{" +
-            "typeId=" + typeId +
-            ", hospitalId=" + hospitalId +
-            ", typeName=" + typeName +
-            ", parentTypeId=" + parentTypeId +
-            ", objName=" + objName +
-            ", spell=" + spell +
-            ", remark=" + remark +
-        "}";
-    }
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
 }
 }

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

@@ -45,6 +45,11 @@ public class MedicalRecord implements Serializable {
      */
      */
     private String recTypeId;
     private String recTypeId;
 
 
+    /**
+     * 模块id
+     */
+    private Long modeId;
+
     /**
     /**
      * 病历日期
      * 病历日期
      */
      */
@@ -60,6 +65,11 @@ public class MedicalRecord implements Serializable {
      */
      */
     private String recTitle;
     private String recTitle;
 
 
+    /**
+     * 模板处理状态(0:未处理,1:已处理)
+     */
+    private Integer status;
+
     /**
     /**
      * 是否删除,N:未删除,Y:删除
      * 是否删除,N:未删除,Y:删除
      */
      */

+ 8 - 120
src/main/java/com/diagbot/entity/QcCasesEntry.java

@@ -2,7 +2,8 @@ package com.diagbot.entity;
 
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
+import lombok.Data;
+
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
 
 
@@ -14,6 +15,7 @@ import java.util.Date;
  * @author wangfeng
  * @author wangfeng
  * @since 2020-04-13
  * @since 2020-04-13
  */
  */
+@Data
 public class QcCasesEntry implements Serializable {
 public class QcCasesEntry implements Serializable {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
@@ -43,6 +45,11 @@ public class QcCasesEntry implements Serializable {
      */
      */
     private String name;
     private String name;
 
 
+    /**
+     * 规则类型(0:无,1:空项,2:错误)
+     */
+    private Integer ruleType;
+
     private String precond;
     private String precond;
 
 
     /**
     /**
@@ -79,123 +86,4 @@ public class QcCasesEntry implements Serializable {
      * 修改人,如果为0则表示纪录未修改
      * 修改人,如果为0则表示纪录未修改
      */
      */
     private String modifier;
     private String modifier;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-    public Long getCasesId() {
-        return casesId;
-    }
-
-    public void setCasesId(Long casesId) {
-        this.casesId = casesId;
-    }
-    public String getCasesName() {
-        return casesName;
-    }
-
-    public void setCasesName(String casesName) {
-        this.casesName = casesName;
-    }
-    public Long getModeId() {
-        return modeId;
-    }
-
-    public void setModeId(Long modeId) {
-        this.modeId = modeId;
-    }
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-    public String getPrecond() {
-        return precond;
-    }
-
-    public void setPrecond(String precond) {
-        this.precond = precond;
-    }
-    public Integer getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(Integer orderNo) {
-        this.orderNo = orderNo;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    @Override
-    public String toString() {
-        return "QcCasesEntry{" +
-            "id=" + id +
-            ", casesId=" + casesId +
-            ", casesName=" + casesName +
-            ", modeId=" + modeId +
-            ", code=" + code +
-            ", name=" + name +
-            ", precond=" + precond +
-            ", orderNo=" + orderNo +
-            ", remark=" + remark +
-            ", isDeleted=" + isDeleted +
-            ", gmtCreate=" + gmtCreate +
-            ", gmtModified=" + gmtModified +
-            ", creator=" + creator +
-            ", modifier=" + modifier +
-        "}";
-    }
 }
 }

+ 9 - 1
src/main/java/com/diagbot/entity/QcType.java

@@ -12,7 +12,7 @@ import java.util.Date;
  * </p>
  * </p>
  *
  *
  * @author gaodm
  * @author gaodm
- * @since 2020-04-13
+ * @since 2020-05-27
  */
  */
 public class QcType implements Serializable {
 public class QcType implements Serializable {
 
 
@@ -79,6 +79,14 @@ public class QcType implements Serializable {
         this.hospitalId = hospitalId;
         this.hospitalId = hospitalId;
     }
     }
 
 
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
     public String getName() {
     public String getName() {
         return name;
         return name;
     }
     }

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

@@ -72,6 +72,16 @@ public class QcresultDetail implements Serializable {
      */
      */
     private Integer isReject;
     private Integer isReject;
 
 
+    /**
+     * 初始类型(1:机器,2:人工)
+     */
+    private Integer gradeType;
+
+    /**
+     * 操作类型(1:新增,2:删除,3:修改)
+     */
+    private Integer optType;
+
     /**
     /**
      * 是否删除,N:未删除,Y:删除
      * 是否删除,N:未删除,Y:删除
      */
      */

+ 6 - 94
src/main/java/com/diagbot/entity/SysTaskCron.java

@@ -2,6 +2,7 @@ package com.diagbot.entity;
 
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
@@ -14,6 +15,7 @@ import java.util.Date;
  * @author gaodm
  * @author gaodm
  * @since 2020-04-15
  * @since 2020-04-15
  */
  */
+@Data
 public class SysTaskCron implements Serializable {
 public class SysTaskCron implements Serializable {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
@@ -69,98 +71,8 @@ public class SysTaskCron implements Serializable {
      */
      */
     private String remark;
     private String remark;
 
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public String getCronCode() {
-        return cronCode;
-    }
-
-    public void setCronCode(String cronCode) {
-        this.cronCode = cronCode;
-    }
-
-    public String getCron() {
-        return cron;
-    }
-
-    public void setCron(String cron) {
-        this.cron = cron;
-    }
-
-    public Integer getIsUsed() {
-        return isUsed;
-    }
-
-    public void setIsUsed(Integer isUsed) {
-        this.isUsed = isUsed;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "SysTaskCron{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", cronCode=" + cronCode +
-                ", cron=" + cron +
-                ", remark=" + remark +
-                "}";
-    }
+    /**
+     * 参数
+     */
+    private String param;
 }
 }

+ 50 - 0
src/main/java/com/diagbot/enums/InsertOrUpdateEnum.java

@@ -0,0 +1,50 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum InsertOrUpdateEnum implements KeyedNamed {
+    Insert(1, "新增"),
+    Update(2, "修改");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    InsertOrUpdateEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static InsertOrUpdateEnum getEnum(int key) {
+        for (InsertOrUpdateEnum item : InsertOrUpdateEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        InsertOrUpdateEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 4 - 10
src/main/java/com/diagbot/facade/AlgorithmFacade.java

@@ -56,14 +56,8 @@ public class AlgorithmFacade {
         dataDeal(algorithmVO);
         dataDeal(algorithmVO);
 
 
         BigDecimal res = BigDecimal.ZERO;
         BigDecimal res = BigDecimal.ZERO;
-        //计算得分
-        if (algorithmVO.getHospitalId().equals(1L)) {
-            //长兴医院的情况下
-            res = getScoreForCx(algorithmVO);
-        } else {
-            //非长兴医院的情况下
-            res = cal(algorithmVO);
-        }
+        //统一为长兴的算法
+        res = getScoreForCx(algorithmVO);
         return res;
         return res;
     }
     }
 
 
@@ -241,8 +235,8 @@ public class AlgorithmFacade {
      */
      */
     private BigDecimal cal(AlgorithmVO algorithmVO) {
     private BigDecimal cal(AlgorithmVO algorithmVO) {
         BigDecimal res = new BigDecimal(100);
         BigDecimal res = new BigDecimal(100);
-        if (algorithmVO.getHospitalId().equals(1L)
-                && algorithmVO.getIsHomePage().equals(true)) {
+        //统一为长兴的算法
+        if (algorithmVO.getIsHomePage().equals(true)) {
             res = new BigDecimal(20);
             res = new BigDecimal(20);
         }
         }
         //模块总分
         //模块总分

+ 239 - 145
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -10,6 +10,8 @@ import com.diagbot.dto.AnalyzeDTO;
 import com.diagbot.dto.AnalyzeRunDTO;
 import com.diagbot.dto.AnalyzeRunDTO;
 import com.diagbot.dto.BehosDTO;
 import com.diagbot.dto.BehosDTO;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.BehospitalInfoDTO;
+import com.diagbot.dto.ExportExcelDTO;
+import com.diagbot.dto.MedicalRecordDTO;
 import com.diagbot.dto.MsgApiDTO;
 import com.diagbot.dto.MsgApiDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.OutputInfo;
 import com.diagbot.dto.OutputInfo;
@@ -25,6 +27,7 @@ import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.entity.HomeDiagnoseInfo;
 import com.diagbot.entity.HomeDiagnoseInfo;
 import com.diagbot.entity.HomeOperationInfo;
 import com.diagbot.entity.HomeOperationInfo;
 import com.diagbot.entity.HomePage;
 import com.diagbot.entity.HomePage;
+import com.diagbot.entity.MedicalRecord;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.exception.CommonException;
@@ -33,6 +36,7 @@ import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.EncrypDES;
 import com.diagbot.util.EncrypDES;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.MapUtil;
 import com.diagbot.util.MapUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.StringUtil;
@@ -43,6 +47,7 @@ import com.diagbot.vo.AnalyzeCodeVO;
 import com.diagbot.vo.AnalyzeRunVO;
 import com.diagbot.vo.AnalyzeRunVO;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.BehospitalPageVO;
 import com.diagbot.vo.BehospitalPageVO;
+import com.diagbot.vo.ExportQcresultVO;
 import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.MedrecVo;
 import com.diagbot.vo.MedrecVo;
 import com.diagbot.vo.QcResultAlgQueryVO;
 import com.diagbot.vo.QcResultAlgQueryVO;
@@ -54,6 +59,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.Date;
@@ -104,6 +111,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     Boolean encryptFlag;
     Boolean encryptFlag;
     @Autowired
     @Autowired
     QcQuestionFacade qcQuestionFacade;
     QcQuestionFacade qcQuestionFacade;
+    @Autowired
+    QcModelHospitalFacade qcModelHospitalFacade;
+    @Autowired
+    private FilterFacade filterFacade;
 
 
     /**
     /**
      * 分页
      * 分页
@@ -112,32 +123,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @return
      * @return
      */
      */
     public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
     public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
-        //入参验证
-        //入院时间
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
-            behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
-            behospitalPageVO.setBehosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getBehosDateEnd()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
-            if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须小于结束时间!");
-            }
-        }
-        //出院时间
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
-            behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
-            behospitalPageVO.setLeaveHosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getLeaveHosDateEnd()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
-            if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
-            }
-        }
-        behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+        behospitalPageSet(behospitalPageVO);
         IPage<BehospitalInfoDTO> res = getPage(behospitalPageVO);
         IPage<BehospitalInfoDTO> res = getPage(behospitalPageVO);
         return res;
         return res;
     }
     }
@@ -218,7 +204,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO) {
     public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO) {
         // 获取质控条目
         // 获取质控条目
         List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
         List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
-        if(ListUtil.isEmpty(qcCasesEntryDTOList)){
+        if (ListUtil.isEmpty(qcCasesEntryDTOList)) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
         }
         }
 
 
@@ -267,6 +253,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("hospital_id", hospitalId)
                     .eq("hospital_id", hospitalId)
                     .eq("home_page_id", homePage.getHomePageId())
                     .eq("home_page_id", homePage.getHomePageId())
+                    .orderByAsc("diagnose_order_no")
             );
             );
 
 
             // 获取首页手术信息
             // 获取首页手术信息
@@ -274,6 +261,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("hospital_id", hospitalId)
                     .eq("hospital_id", hospitalId)
                     .eq("home_page_id", homePage.getHomePageId())
                     .eq("home_page_id", homePage.getHomePageId())
+                    .orderByAsc("operation_order_no")
             );
             );
         }
         }
 
 
@@ -285,6 +273,36 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         queryVo.setInputCatalogueMap(getInputCatalogueMap(qcCasesEntryDTOList)); // 设置质控条目编码
         queryVo.setInputCatalogueMap(getInputCatalogueMap(qcCasesEntryDTOList)); // 设置质控条目编码
         List<MedrecVo> medrecVoList = new ArrayList<>(); // 设置内容
         List<MedrecVo> medrecVoList = new ArrayList<>(); // 设置内容
 
 
+        // 添加住院病历信息
+        List<BehospitalInfo> behospitalInfoList = this.list(new QueryWrapper<BehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId)
+                .eq("behospital_code", analyzeVO.getBehospitalCode())
+        );
+        if (ListUtil.isNotEmpty(behospitalInfoList)) {
+            MedrecVo medrecVo = new MedrecVo();
+            medrecVo.setTitle("住院病历信息");
+            Map<String, Object> content = new HashMap<>();
+            content.put("content", behospitalInfoList);
+            medrecVo.setContent(content);
+            medrecVoList.add(medrecVo);
+
+            queryVo.setBehospitalInfo(behospitalInfoList.get(0));
+        }
+
+        // 会诊记录
+        addDataWithKey("会诊", recMap, medrecVoList,
+                Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"));
+
+        // 手术
+        addDataWithKey("手术", recMap, medrecVoList,
+                Arrays.asList("术后首次病程及谈话记录", "手术记录",
+                        "术前讨论、术前小结", "手术知情同意书", "手术安全核查表"));
+
+        // 转科
+        addDataWithKey("转科", recMap, medrecVoList,
+                Arrays.asList("转入记录", "转出记录"));
+
         addData("入院记录", recMap, medrecVoList);
         addData("入院记录", recMap, medrecVoList);
         addData("病危通知书", recMap, medrecVoList);
         addData("病危通知书", recMap, medrecVoList);
         addData("阶段小结", recMap, medrecVoList);
         addData("阶段小结", recMap, medrecVoList);
@@ -300,23 +318,11 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         addData("疑难病例讨论记录", recMap, medrecVoList);
         addData("疑难病例讨论记录", recMap, medrecVoList);
         addData("输血后效果评价", recMap, medrecVoList);
         addData("输血后效果评价", recMap, medrecVoList);
         addData("病理检验送检单", recMap, medrecVoList);
         addData("病理检验送检单", recMap, medrecVoList);
+        addData("日常病程录", recMap, medrecVoList);
 
 
         addDataWithInnerKey("知情同意书", recMap, medrecVoList);
         addDataWithInnerKey("知情同意书", recMap, medrecVoList);
         addDataWithInnerKey("谈话告知书", recMap, medrecVoList);
         addDataWithInnerKey("谈话告知书", recMap, medrecVoList);
 
 
-        // 会诊记录
-        addDataWithKey("会诊", recMap, medrecVoList,
-                Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"));
-
-        // 手术
-        addDataWithKey("手术", recMap, medrecVoList,
-                Arrays.asList("术后首次病程及谈话记录", "手术记录",
-                        "术前讨论、术前小结", "手术知情同意书", "手术安全核查表"));
-
-        // 转科
-        addDataWithKey("转科", recMap, medrecVoList,
-                Arrays.asList("转入记录", "转出记录"));
-
         // 医嘱
         // 医嘱
         if (ListUtil.isNotEmpty(doctorAdviceList)) {
         if (ListUtil.isNotEmpty(doctorAdviceList)) {
             addDataWithKeyConvert("医嘱信息", doctorAdviceList, medrecVoList,
             addDataWithKeyConvert("医嘱信息", doctorAdviceList, medrecVoList,
@@ -344,15 +350,16 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (!analyzeVO.getIsTask()) {
         if (!analyzeVO.getIsTask()) {
             hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
             hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
         }
         }
-//        Long hospitalId = 1L; // 写死
+        //        Long hospitalId = 1L; // 写死
         analyzeVO.setHospitalId(hospitalId);
         analyzeVO.setHospitalId(hospitalId);
 
 
         // 处理公共数据
         // 处理公共数据
         QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
         QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
+        queryVo.setUseCrfCache(analyzeVO.isUseCrfCache());
         //  调用质控接口
         //  调用质控接口
         Response<OutputInfo> response = qcServiceClient.extract(queryVo);
         Response<OutputInfo> response = qcServiceClient.extract(queryVo);
         if (response == null || response.getData() == null) {
         if (response == null || response.getData() == null) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR, "远程质控接口没有返回数据!");
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "远程质控接口没有返回数据!【" + analyzeVO.getBehospitalCode() + "】");
         }
         }
         OutputInfo outputInfo = response.getData();
         OutputInfo outputInfo = response.getData();
         //根据质控结果获取质控条目
         //根据质控结果获取质控条目
@@ -377,7 +384,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
         }
 
 
         // 对info赋值
         // 对info赋值
-        for(QcResultAlgVO bean : qcResultAlgVOList) {
+        for (QcResultAlgVO bean : qcResultAlgVOList) {
             String info = codeToInfoMap.get(bean.getCode());
             String info = codeToInfoMap.get(bean.getCode());
             if (StringUtil.isNotBlank(info)) {
             if (StringUtil.isNotBlank(info)) {
                 bean.setInfo(info);
                 bean.setInfo(info);
@@ -393,6 +400,27 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
         AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
         //保存
         //保存
         Map<String, Object> pageMap = outputInfo.getPageData();
         Map<String, Object> pageMap = outputInfo.getPageData();
+        // 手动拼接数据【知情同意书】【谈话告知书】
+        List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("behospital_code", analyzeVO.getBehospitalCode())
+                .eq("hospital_id", hospitalId)
+                .in("mode_id", Arrays.asList(53, 54, 16))
+                .orderByAsc("rec_date")
+        );
+        List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
+        Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
+        List<MedicalRecordDTO> recordDTOList = new ArrayList<>();
+        if (recordMap.get(53L) != null) {
+            recordDTOList.addAll(recordMap.get(53L)); // 知情同意书
+        }
+        if (recordMap.get(16L) != null) {
+            recordDTOList.addAll(recordMap.get(16L)); // 手术知情同意书
+        }
+        // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
+        pageMap.put("知情同意书", recordDTOList);
+        pageMap.put("谈话告知书", recordMap.get(54L));
+
         String pageData = JSON.toJSONString(pageMap);
         String pageData = JSON.toJSONString(pageMap);
         // 获取菜单信息
         // 获取菜单信息
         List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
         List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
@@ -401,8 +429,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask());
         Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask());
 
 
         // 返回提示信息
         // 返回提示信息
-//        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
-//        Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
+        //        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
+        //        Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
 
 
         //返回参数组装
         //返回参数组装
         AnalyzeDTO analyzeDTO = new AnalyzeDTO();
         AnalyzeDTO analyzeDTO = new AnalyzeDTO();
@@ -431,7 +459,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             MedrecVo medrecVo = new MedrecVo();
             MedrecVo medrecVo = new MedrecVo();
             medrecVo.setTitle(key);
             medrecVo.setTitle(key);
             Map<String, Object> content = new HashMap<>();
             Map<String, Object> content = new HashMap<>();
-            content.put("content", list.stream().map(r -> r.getXmlText()).collect(Collectors.toList()));
+            content.put("content", list);
             medrecVo.setContent(content);
             medrecVo.setContent(content);
             medrecVoList.add(medrecVo);
             medrecVoList.add(medrecVo);
         }
         }
@@ -450,18 +478,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         MedrecVo medrecVo = new MedrecVo();
         MedrecVo medrecVo = new MedrecVo();
         medrecVo.setTitle(key);
         medrecVo.setTitle(key);
         Map<String, Object> content = new HashMap<>();
         Map<String, Object> content = new HashMap<>();
-        Map<String, List<String>> listMap = new HashMap<>();
+        Map<String, Object> listMap = new HashMap<>();
         Boolean flag = false;
         Boolean flag = false;
         for (String k : keyList) {
         for (String k : keyList) {
             if (ListUtil.isNotEmpty(recMap.get(k))) {
             if (ListUtil.isNotEmpty(recMap.get(k))) {
-                listMap.put(k, recMap.get(k).stream().map(r -> r.getXmlText()).collect(Collectors.toList()));
+                listMap.put(k, recMap.get(k));
                 flag = true;
                 flag = true;
             }
             }
         }
         }
         if (flag) {
         if (flag) {
             // 会诊记录特殊处理,有会诊申请单,没有会诊结果单,复制一份到会诊结果单
             // 会诊记录特殊处理,有会诊申请单,没有会诊结果单,复制一份到会诊结果单
-            if ("会诊记录".equals(key) && ListUtil.isNotEmpty(listMap.get("会诊申请单"))
-                    && ListUtil.isEmpty(listMap.get("会诊结果单"))) {
+            if ("会诊记录".equals(key) && listMap.get("会诊申请单") != null
+                    && listMap.get("会诊结果单") == null) {
                 listMap.put("会诊结果单", listMap.get("会诊申请单"));
                 listMap.put("会诊结果单", listMap.get("会诊申请单"));
             }
             }
             content.put("content", listMap);
             content.put("content", listMap);
@@ -482,7 +510,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         MedrecVo medrecVo = new MedrecVo();
         MedrecVo medrecVo = new MedrecVo();
         medrecVo.setTitle(key);
         medrecVo.setTitle(key);
         Map<String, Object> content = new HashMap<>();
         Map<String, Object> content = new HashMap<>();
-        Map<String, List<String>> listMap = new HashMap<>();
+        Map<String, Object> listMap = new HashMap<>();
         List<RecordContentDTO> recordContentDTOList = recMap.get(key);
         List<RecordContentDTO> recordContentDTOList = recMap.get(key);
         if (ListUtil.isNotEmpty(recordContentDTOList)) {
         if (ListUtil.isNotEmpty(recordContentDTOList)) {
             Map<String, List<RecordContentDTO>> keyMap =
             Map<String, List<RecordContentDTO>> keyMap =
@@ -490,7 +518,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             Set<String> keyList = keyMap.keySet();
             Set<String> keyList = keyMap.keySet();
             for (String k : keyList) {
             for (String k : keyList) {
                 if (ListUtil.isNotEmpty(keyMap.get(k))) {
                 if (ListUtil.isNotEmpty(keyMap.get(k))) {
-                    listMap.put(k, keyMap.get(k).stream().map(r -> r.getXmlText()).collect(Collectors.toList()));
+                    listMap.put(k, keyMap.get(k));
                 }
                 }
             }
             }
             content.put("content", listMap);
             content.put("content", listMap);
@@ -507,8 +535,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param medrecVoList
      * @param medrecVoList
      * @param map
      * @param map
      */
      */
-    public void addDataWithKeyConvert(String key,  List<DoctorAdvice> list,
-                               List<MedrecVo> medrecVoList, Map<String, String> map, List<String> dateList) {
+    public void addDataWithKeyConvert(String key, List<DoctorAdvice> list,
+                                      List<MedrecVo> medrecVoList, Map<String, String> map, List<String> dateList) {
         MedrecVo medrecVo = new MedrecVo();
         MedrecVo medrecVo = new MedrecVo();
         medrecVo.setTitle(key);
         medrecVo.setTitle(key);
         Map<String, Object> content = new HashMap<>();
         Map<String, Object> content = new HashMap<>();
@@ -521,7 +549,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 for (String objKey : objectMap.keySet()) {
                 for (String objKey : objectMap.keySet()) {
                     if (map.get(objKey) != null) {
                     if (map.get(objKey) != null) {
                         if (dateList.contains(objKey)) {
                         if (dateList.contains(objKey)) {
-                            Date date = (Date)objectMap.get(objKey);
+                            Date date = (Date) objectMap.get(objKey);
                             res.put(map.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
                             res.put(map.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
                         } else {
                         } else {
                             res.put(map.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
                             res.put(map.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
@@ -554,7 +582,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         for (String objKey : objectMap.keySet()) {
         for (String objKey : objectMap.keySet()) {
             if (dicMap.containsKey(objKey)) {
             if (dicMap.containsKey(objKey)) {
                 if (dateList.contains(objKey)) {
                 if (dateList.contains(objKey)) {
-                    Date date = (Date)objectMap.get(objKey);
+                    Date date = (Date) objectMap.get(objKey);
                     res.put(dicMap.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
                     res.put(dicMap.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
                 } else {
                 } else {
                     res.put(dicMap.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
                     res.put(dicMap.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
@@ -566,6 +594,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
 
     /**
     /**
      * 拼接数据(病案首页),从数据字典获取信息转换
      * 拼接数据(病案首页),从数据字典获取信息转换
+     *
      * @param key
      * @param key
      * @param homePage
      * @param homePage
      * @param medrecVoList
      * @param medrecVoList
@@ -573,7 +602,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param homeDiagnoseInfoList
      * @param homeDiagnoseInfoList
      * @param homeOperationInfoList
      * @param homeOperationInfoList
      */
      */
-    public void addDataWithFirstPage(String key,  HomePage homePage, List<MedrecVo> medrecVoList, Map<String, Map<String, String>> dicMap,
+    public void addDataWithFirstPage(String key, HomePage homePage, List<MedrecVo> medrecVoList, Map<String, Map<String, String>> dicMap,
                                      List<HomeDiagnoseInfo> homeDiagnoseInfoList, List<HomeOperationInfo> homeOperationInfoList) {
                                      List<HomeDiagnoseInfo> homeDiagnoseInfoList, List<HomeOperationInfo> homeOperationInfoList) {
         MedrecVo medrecVo = new MedrecVo();
         MedrecVo medrecVo = new MedrecVo();
         medrecVo.setTitle(key);
         medrecVo.setTitle(key);
@@ -586,8 +615,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             for (String objKey : objectMap.keySet()) {
             for (String objKey : objectMap.keySet()) {
                 if (map.containsKey(objKey)) {
                 if (map.containsKey(objKey)) {
                     if (firstPageDate.contains(objKey)) {
                     if (firstPageDate.contains(objKey)) {
-                        Date date = (Date)objectMap.get(objKey);
-                        content.put(map.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
+                        Date date = (Date) objectMap.get(objKey);
+                        if ("birthday".equals(objKey)) {
+                            content.put(map.get(objKey), DateUtil.formatDate(date));
+                        } else {
+                            content.put(map.get(objKey), DateUtil.formatDateTime(date));
+                        }
                     } else {
                     } else {
                         content.put(map.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
                         content.put(map.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
                     }
                     }
@@ -653,54 +686,66 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
 
 
 
     /**
     /**
-     * 执行未评分的病历
+     * 处理定时任务入参
+     *
+     * @param param
+     * @param taskVO
      */
      */
-    public void execute() {
-        TaskVO taskVO = new TaskVO();
-        List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
-        for (BehospitalInfo bean : behospitalInfoList) {
-            AnalyzeVO analyzeVO = new AnalyzeVO();
-            analyzeVO.setIsTask(true);
-            analyzeVO.setHospitalId(bean.getHospitalId());
-            analyzeVO.setBehospitalCode(bean.getBehospitalCode());
-            authServiceClient.analyze_rpc(analyzeVO);
+    public void dealTaskVO(String param, TaskVO taskVO) {
+        if (StringUtil.isNotBlank(param)) {
+            String[] hos = param.split(",");
+            List<Long> hosptialIdList = new ArrayList<>();
+            for (String id : hos) {
+                hosptialIdList.add(Long.parseLong(id));
+            }
+            taskVO.setHosptialIdList(hosptialIdList);
         }
         }
-
-//        List<BehospitalInfo> behospitalInfoList = this.list(new QueryWrapper<BehospitalInfo>()
-//                .eq("is_deleted", IsDeleteEnum.N.getKey())
-//        );
-//
-//        int i = 1;
-//        while(i < 100) {
-//            for (BehospitalInfo bean : behospitalInfoList) {
-//                AnalyzeVO analyzeVO = new AnalyzeVO();
-//                analyzeVO.setIsTask(true);
-//                analyzeVO.setHospitalId(bean.getHospitalId());
-//                analyzeVO.setBehospitalCode(bean.getBehospitalCode());
-//                authServiceClient.analyze_rpc(analyzeVO);
-//                System.out.println(i++);
-//            }
-//        }
     }
     }
 
 
-
     /**
     /**
-     * 对出院日期之前3天的未评分的病历进行评分
+     * 评分
      */
      */
-    public void execute2() {
-        TaskVO taskVO = new TaskVO();
-        Date date = DateUtil.addDay(DateUtil.now(), -3);
-        taskVO.setLeaveDate(date);
+    public void execute(TaskVO taskVO, String param) {
+        // 处理医院信息
+        dealTaskVO(param, taskVO);
+        // 类型过滤(1:出院时间比当前时间早4天前的病历(例如:长兴病历))
+        if (taskVO.getType() != null && taskVO.getType() == 1) {
+            Date date = DateUtil.addDay(DateUtil.now(), -4);
+            taskVO.setLeaveDate(date);
+        }
+        // 近3天不含当天的病历强制评分更新
+        if (taskVO != null && ListUtil.isNotEmpty(taskVO.getIndividuation()) && taskVO.getIndividuation().contains(1)) {
+            // 4天前最早时间
+            taskVO.setStartLeaveDate(DateUtil.getFirstTimeOfDay(DateUtil.addDay(DateUtil.now(), -4)));
+            // 昨天最迟时间
+            taskVO.setEndLeaveDate(DateUtil.getLastTimeOfDay(DateUtil.addDay(DateUtil.now(), -1)));
+        }
         List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
         List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
         for (BehospitalInfo bean : behospitalInfoList) {
         for (BehospitalInfo bean : behospitalInfoList) {
             AnalyzeVO analyzeVO = new AnalyzeVO();
             AnalyzeVO analyzeVO = new AnalyzeVO();
             analyzeVO.setIsTask(true);
             analyzeVO.setIsTask(true);
             analyzeVO.setHospitalId(bean.getHospitalId());
             analyzeVO.setHospitalId(bean.getHospitalId());
             analyzeVO.setBehospitalCode(bean.getBehospitalCode());
             analyzeVO.setBehospitalCode(bean.getBehospitalCode());
+            analyzeVO.setUseCrfCache(taskVO.isUseCrfCache());
             authServiceClient.analyze_rpc(analyzeVO);
             authServiceClient.analyze_rpc(analyzeVO);
         }
         }
     }
     }
 
 
+
+    // /**
+    //  * 对出院日期之前3天的未评分的病历进行评分
+    //  */
+    // public void execute2(TaskVO taskVO) {
+    //     List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
+    //     for (BehospitalInfo bean : behospitalInfoList) {
+    //         AnalyzeVO analyzeVO = new AnalyzeVO();
+    //         analyzeVO.setIsTask(true);
+    //         analyzeVO.setHospitalId(bean.getHospitalId());
+    //         analyzeVO.setBehospitalCode(bean.getBehospitalCode());
+    //         authServiceClient.analyze_rpc(analyzeVO);
+    //     }
+    // }
+
     /**
     /**
      * 评分api
      * 评分api
      *
      *
@@ -749,7 +794,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (qcResultDTO == null) {
         if (qcResultDTO == null) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "该病历未评分!【hospitalId=" + hospitalId + "】【behospitalCode="
                     "该病历未评分!【hospitalId=" + hospitalId + "】【behospitalCode="
-                    + getDetailVO.getBehospitalCode() + "】");
+                            + getDetailVO.getBehospitalCode() + "】");
         }
         }
         QcResultApiDTO qcResultApiDTO = new QcResultApiDTO();
         QcResultApiDTO qcResultApiDTO = new QcResultApiDTO();
         BeanUtil.copyProperties(qcResultDTO, qcResultApiDTO);
         BeanUtil.copyProperties(qcResultDTO, qcResultApiDTO);
@@ -767,69 +812,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     }
     }
 
 
     /**
     /**
-     *
      * @param behospitalPageVO
      * @param behospitalPageVO
      * @return
      * @return
      */
      */
     public IPage<BehospitalInfoDTO> pagePerson(BehospitalPageVO behospitalPageVO) {
     public IPage<BehospitalInfoDTO> pagePerson(BehospitalPageVO behospitalPageVO) {
-        //入参验证
-        //入院时间
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
-            behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
-            behospitalPageVO.setBehosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getBehosDateEnd()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
-            if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须小于结束时间!");
-            }
-        }
-        //出院时间
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
-            behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
-            behospitalPageVO.setLeaveHosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getLeaveHosDateEnd()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
-            if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
-            }
-        }
-        behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+        behospitalPageSet(behospitalPageVO);
         behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
         behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
         IPage<BehospitalInfoDTO> res = getPageByPerson(behospitalPageVO);
         IPage<BehospitalInfoDTO> res = getPageByPerson(behospitalPageVO);
         return res;
         return res;
     }
     }
 
 
     public IPage<BehospitalInfoDTO> pageDept(BehospitalPageVO behospitalPageVO) {
     public IPage<BehospitalInfoDTO> pageDept(BehospitalPageVO behospitalPageVO) {
-        //入参验证
-        //入院时间
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
-            behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
-            behospitalPageVO.setBehosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getBehosDateEnd()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
-            if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须小于结束时间!");
-            }
-        }
-        //出院时间
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
-            behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
-            behospitalPageVO.setLeaveHosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getLeaveHosDateEnd()));
-        }
-        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
-            if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
-            }
-        }
-        behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+        behospitalPageSet(behospitalPageVO);
         behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
         behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
         IPage<BehospitalInfoDTO> res = getPageByDept(behospitalPageVO);
         IPage<BehospitalInfoDTO> res = getPageByDept(behospitalPageVO);
         return res;
         return res;
@@ -919,4 +913,104 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return analyzeRunDTO;
         return analyzeRunDTO;
     }
     }
 
 
+    private void behospitalPageSet(BehospitalPageVO behospitalPageVO) {
+        //入参验证
+        //入院时间
+        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
+            behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
+        }
+        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
+            behospitalPageVO.setBehosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(behospitalPageVO.getBehosDateEnd(), 1)));
+        }
+        if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
+            if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须小于结束时间!");
+            }
+        }
+        //出院时间
+        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
+            behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
+        }
+        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
+            behospitalPageVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(behospitalPageVO.getLeaveHosDateEnd(), 1)));
+        }
+        if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
+            if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
+            }
+        }
+        behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+        behospitalPageVO.setIsPlacefile("1");
+        if (null != behospitalPageVO.getStatisticsType()
+                && null == behospitalPageVO.getLeaveHosDateStart()
+                && null == behospitalPageVO.getLeaveHosDateEnd()) {
+            String startDate = filterFacade.getStartDateStr(behospitalPageVO.getStatisticsType(), null);
+            String endDate = filterFacade.getEndDateStr(behospitalPageVO.getStatisticsType(), null);
+            behospitalPageVO.setLeaveHosDateStart(DateUtil.parseDate(startDate));
+            behospitalPageVO.setLeaveHosDateEnd(DateUtil.parseDate(endDate));
+        }
+    }
+
+    public void exportExcelFac(HttpServletResponse response) {
+        List<ExportExcelDTO> res = this.exportExcel();
+        String fileName = "mrqc";
+        ExcelUtils.exportExcelUser(res, null, "病案质控", ExportExcelDTO.class, fileName + ".xls", response);
+    }
+
+    /**
+     * 质控结果导出
+     *
+     * @param response
+     * @param exportQcresultVO
+     */
+    public void exportQcresult(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        exportQcresultVO.setHospitalId(hospitalId);
+        Date startDate = exportQcresultVO.getLeaveHosDateStart();
+        Date endDate = exportQcresultVO.getLeaveHosDateEnd();
+        //时间间隔7天
+        long interval = 7 * 24 * 60 * 60 * 1000;
+        if (endDate.getTime() < startDate.getTime()) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+        }
+        if (endDate.getTime() - startDate.getTime() > interval) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
+        }
+
+        exportQcresultVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(endDate, 1)));
+        List<ExportExcelDTO> res = this.exportQcresult(exportQcresultVO);
+        String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
+        response.setContentType("text/html;charset=UTF-8");
+        ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
+    }
+
+    /**
+     * 科室质控结果导出
+     *
+     * @param response
+     * @param exportQcresultVO
+     */
+    public void exportQcresultByDept(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        exportQcresultVO.setHospitalId(hospitalId);
+        exportQcresultVO.setUserId(Long.valueOf(userId));
+        Date startDate = exportQcresultVO.getLeaveHosDateStart();
+        Date endDate = exportQcresultVO.getLeaveHosDateEnd();
+        //时间间隔7天
+        long interval = 7 * 24 * 60 * 60 * 1000;
+        if (endDate.getTime() < startDate.getTime()) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+        }
+        if (endDate.getTime() - startDate.getTime() > interval) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
+        }
+        exportQcresultVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(endDate, 1)));
+        List<ExportExcelDTO> res = this.exportQcresultByDept(exportQcresultVO);
+        String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
+        response.setContentType("text/html;charset=UTF-8");
+        ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
+    }
 }
 }

+ 139 - 211
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -2,11 +2,12 @@ package com.diagbot.facade;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.DeptBaseDTO;
 import com.diagbot.dto.DeptBaseDTO;
+import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.HomePageNumDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.BeanUtil;
-import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.StringUtil;
@@ -14,7 +15,6 @@ import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterVO;
 import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.HomePageFilterVO;
 import com.diagbot.vo.QcresultFilterVO;
 import com.diagbot.vo.QcresultFilterVO;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,7 +25,6 @@ import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.text.DecimalFormat;
 import java.util.Collections;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Comparator;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.List;
@@ -59,34 +58,29 @@ public class ConsoleByDeptFacade {
      */
      */
     public Map<String, Object> leaveHosCountByDept(FilterVO filterVO) {
     public Map<String, Object> leaveHosCountByDept(FilterVO filterVO) {
         Map<String, Object> retMap = new LinkedHashMap<>();
         Map<String, Object> retMap = new LinkedHashMap<>();
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
-        filterVO.setHospitalId(hospitalId);
-        filterVO.setUserId(Long.valueOf(userId));
-        filterVO.setStartDate(startDate);
-        filterVO.setEndDate(endDate);
-        HomePageFilterVO homePageFilterVO = new HomePageFilterVO();
-        BeanUtil.copyProperties(filterVO, homePageFilterVO);
+        filterFacade.filterVOSet(filterVO);
         //关联科室
         //关联科室
         Map<String, Object> deptMap = getDeptByUser(filterVO);
         Map<String, Object> deptMap = getDeptByUser(filterVO);
         if (deptMap == null) {
         if (deptMap == null) {
             return retMap;
             return retMap;
         }
         }
         //出院总人数
         //出院总人数
-        List<NumDTO> totleNumList = behospitalInfoFacade.homePageCountByDept(homePageFilterVO);
+        List<NumDTO> totleNumList = behospitalInfoFacade.leaveHosCountByDept(filterVO);
         Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
         Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
                 ? new HashMap<>()
                 ? new HashMap<>()
                 : EntityUtil.makeEntityMap(totleNumList, "name");
                 : EntityUtil.makeEntityMap(totleNumList, "name");
+        //新生儿人数
+        List<NumDTO> newBornNumList = behospitalInfoFacade.newBornCountByDept(filterVO);
+        Map<String, NumDTO> newBornMap = ListUtil.isEmpty(newBornNumList)
+                ? new HashMap<>()
+                : EntityUtil.makeEntityMap(newBornNumList, "name");
         //死亡人数
         //死亡人数
-        homePageFilterVO.setDeath(1);
-        List<NumDTO> deathNumList = behospitalInfoFacade.homePageCountByDept(homePageFilterVO);
+        List<NumDTO> deathNumList = behospitalInfoFacade.deathCountByDept(filterVO);
         Map<String, NumDTO> deathMap = ListUtil.isEmpty(deathNumList)
         Map<String, NumDTO> deathMap = ListUtil.isEmpty(deathNumList)
                 ? new HashMap<>()
                 ? new HashMap<>()
                 : EntityUtil.makeEntityMap(deathNumList, "name");
                 : EntityUtil.makeEntityMap(deathNumList, "name");
         //手术人数
         //手术人数
-        List<NumDTO> operationNumList = behospitalInfoFacade.homePageCountForOperationByDept(filterVO);
+        List<NumDTO> operationNumList = behospitalInfoFacade.operationCountByDept(filterVO);
         Map<String, NumDTO> operationMap = ListUtil.isEmpty(operationNumList)
         Map<String, NumDTO> operationMap = ListUtil.isEmpty(operationNumList)
                 ? new HashMap<>()
                 ? new HashMap<>()
                 : EntityUtil.makeEntityMap(operationNumList, "name");
                 : EntityUtil.makeEntityMap(operationNumList, "name");
@@ -119,14 +113,7 @@ public class ConsoleByDeptFacade {
     public Map<String, Object> mrCountByDept(FilterVO filterVO) {
     public Map<String, Object> mrCountByDept(FilterVO filterVO) {
         DecimalFormat df = new DecimalFormat("#0.00");
         DecimalFormat df = new DecimalFormat("#0.00");
         Map<String, Object> retMap = new LinkedHashMap<>();
         Map<String, Object> retMap = new LinkedHashMap<>();
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
-        filterVO.setHospitalId(hospitalId);
-        filterVO.setUserId(Long.valueOf(userId));
-        filterVO.setStartDate(startDate);
-        filterVO.setEndDate(endDate);
+        filterFacade.filterVOSet(filterVO);
         QcresultFilterVO qcresultFilterVO = new QcresultFilterVO();
         QcresultFilterVO qcresultFilterVO = new QcresultFilterVO();
         BeanUtil.copyProperties(filterVO, qcresultFilterVO);
         BeanUtil.copyProperties(filterVO, qcresultFilterVO);
         //关联科室
         //关联科室
@@ -232,14 +219,7 @@ public class ConsoleByDeptFacade {
     public Map<String, Object> entryCountGroupByCaseAndDept(FilterVO filterVO) {
     public Map<String, Object> entryCountGroupByCaseAndDept(FilterVO filterVO) {
         DecimalFormat df = new DecimalFormat("#0.00");
         DecimalFormat df = new DecimalFormat("#0.00");
         Map<String, Object> retMap = new LinkedHashMap<>();
         Map<String, Object> retMap = new LinkedHashMap<>();
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
-        filterVO.setHospitalId(hospitalId);
-        filterVO.setUserId(Long.valueOf(userId));
-        filterVO.setStartDate(startDate);
-        filterVO.setEndDate(endDate);
+        filterFacade.filterVOSet(filterVO);
         if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
         if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
             filterVO.setLimitCount(10);
             filterVO.setLimitCount(10);
         }
         }
@@ -335,19 +315,8 @@ public class ConsoleByDeptFacade {
      * @return
      * @return
      */
      */
     public Map<String, Object> entryCountGroupByEntryAndDept(FilterVO filterVO) {
     public Map<String, Object> entryCountGroupByEntryAndDept(FilterVO filterVO) {
-        DecimalFormat df = new DecimalFormat("#0.00");
         Map<String, Object> retMap = new LinkedHashMap<>();
         Map<String, Object> retMap = new LinkedHashMap<>();
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
-        filterVO.setHospitalId(hospitalId);
-        filterVO.setUserId(Long.valueOf(userId));
-        filterVO.setStartDate(startDate);
-        filterVO.setEndDate(endDate);
-        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
-            filterVO.setLimitCount(10);
-        }
+        filterFacade.filterVOSet(filterVO);
         Integer limitCount = filterVO.getLimitCount();
         Integer limitCount = filterVO.getLimitCount();
         //关联科室
         //关联科室
         Map<String, Object> deptMap = getDeptByUser(filterVO);
         Map<String, Object> deptMap = getDeptByUser(filterVO);
@@ -365,63 +334,19 @@ public class ConsoleByDeptFacade {
             }
             }
             List<DeptNumDTO> listByDept = numListMap.get(deptName);
             List<DeptNumDTO> listByDept = numListMap.get(deptName);
             if (ListUtil.isNotEmpty(listByDept)) {
             if (ListUtil.isNotEmpty(listByDept)) {
-                List<NumDTO> entryByDeptList = BeanUtil.listCopyTo(listByDept, NumDTO.class);
-                int totle = entryByDeptList
-                        .stream()
-                        .map(NumDTO::getNum)
-                        .reduce(0, Integer::sum);
-                List<NumDTO> retList = Lists.newLinkedList();
-                entryByDeptList.forEach(numDTO -> {
-                    numDTO.setTotleNum(totle);
-                    Double percent = BigDecimal.valueOf(numDTO.getNum())
-                            .divide(BigDecimal.valueOf(totle), 4, RoundingMode.HALF_UP)
-                            .doubleValue();
-                    numDTO.setPercent(percent);
-                    String percentStr
-                            = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
-                    numDTO.setPercentStr(percentStr);
-                });
-
                 //降序排序
                 //降序排序
-                Collections.sort(entryByDeptList, new Comparator<NumDTO>() {
+                Collections.sort(listByDept, new Comparator<DeptNumDTO>() {
                     @Override
                     @Override
-                    public int compare(NumDTO o1, NumDTO o2) {
+                    public int compare(DeptNumDTO o1, DeptNumDTO o2) {
                         return o2.getPercent().compareTo(o1.getPercent());
                         return o2.getPercent().compareTo(o1.getPercent());
                     }
                     }
                 });
                 });
 
 
-                //top9+其他
-                if (entryByDeptList.size() <= limitCount) {
-                    retList.addAll(entryByDeptList);
+                if (listByDept.size() <= limitCount) {
+                    retMap.put(deptName, listByDept);
                 } else {
                 } else {
-                    int count = 0;
-                    double sumPercent = 0d;
-                    for (NumDTO numDTO : entryByDeptList) {
-                        if (retList.size() < limitCount - 1) {
-                            retList.add(numDTO);
-                            count += numDTO.getNum();
-                            sumPercent = BigDecimal.valueOf(sumPercent)
-                                    .add(BigDecimal.valueOf(numDTO.getPercent()))
-                                    .doubleValue();
-                        } else {
-                            NumDTO otherNumDTO = new NumDTO();
-                            int num = totle - count;
-                            otherNumDTO.setName("其他");
-                            otherNumDTO.setNum(num);
-                            otherNumDTO.setTotleNum(totle);
-                            Double percent = BigDecimal.valueOf(num)
-                                    .divide(BigDecimal.valueOf(totle), 4, RoundingMode.HALF_UP)
-                                    .doubleValue();
-                            otherNumDTO.setPercent(percent);
-                            String percentStr
-                                    = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
-                            otherNumDTO.setPercentStr(percentStr);
-                            retList.add(otherNumDTO);
-                            break;
-                        }
-                    }
+                    retMap.put(deptName, listByDept.subList(0, limitCount));
                 }
                 }
-                retMap.put(deptName, retList);
             }
             }
         }
         }
         return retMap;
         return retMap;
@@ -459,54 +384,6 @@ public class ConsoleByDeptFacade {
     }
     }
 
 
 
 
-    /**
-     * 过滤条件设置
-     *
-     * @param filterPageByDeptVO
-     */
-    private void filterPageByDeptVOSet(FilterPageByDeptVO filterPageByDeptVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        String startDate = "";
-        String endDate = "";
-        Date date = new Date();
-
-        //统计维度 1-本月,2-本年
-        //时间类型 1-本月/本年,2-上月/去年,3-去年本月/去年
-        if (filterPageByDeptVO.getType().equals(1)) {
-            if (filterPageByDeptVO.getDateType() == null) {
-                startDate = filterFacade.getStartDateStr(filterPageByDeptVO.getType(), null);
-                endDate = filterFacade.getEndDateStr(filterPageByDeptVO.getType(), null);
-            } else if (filterPageByDeptVO.getDateType().equals(2)) {
-                startDate = filterFacade.getLastStartDateStr(filterPageByDeptVO.getType());
-                endDate = filterFacade.getLastEndDateStr(filterPageByDeptVO.getType());
-            } else if (filterPageByDeptVO.getDateType().equals(3)) {
-                String year = DateUtil.getYear(date);
-                startDate = filterFacade.getStartDateStr(filterPageByDeptVO.getType(), Integer.valueOf(year) - 1);
-                endDate = filterFacade.getEndDateStr(filterPageByDeptVO.getType(), Integer.valueOf(year) - 1);
-            } else {
-                startDate = filterFacade.getStartDateStr(filterPageByDeptVO.getType(), null);
-                endDate = filterFacade.getEndDateStr(filterPageByDeptVO.getType(), null);
-            }
-        } else if (filterPageByDeptVO.getType().equals(2)) {
-            if (filterPageByDeptVO.getDateType() == null) {
-                startDate = filterFacade.getStartDateStr(filterPageByDeptVO.getType(), null);
-                endDate = filterFacade.getEndDateStr(filterPageByDeptVO.getType(), null);
-            } else if (filterPageByDeptVO.getDateType().equals(2) || filterPageByDeptVO.getDateType().equals(3)) {
-                startDate = filterFacade.getLastStartDateStr(filterPageByDeptVO.getType());
-                endDate = filterFacade.getLastEndDateStr(filterPageByDeptVO.getType());
-            } else {
-                startDate = filterFacade.getStartDateStr(filterPageByDeptVO.getType(), null);
-                endDate = filterFacade.getEndDateStr(filterPageByDeptVO.getType(), null);
-            }
-        }
-
-        filterPageByDeptVO.setStartDate(startDate);
-        filterPageByDeptVO.setEndDate(endDate);
-        filterPageByDeptVO.setHospitalId(hospitalId);
-        filterPageByDeptVO.setUserId(Long.valueOf(userId));
-    }
-
     /**
     /**
      * 各模块缺陷占比-科室(分页)
      * 各模块缺陷占比-科室(分页)
      *
      *
@@ -521,18 +398,18 @@ public class ConsoleByDeptFacade {
                 filterPageByDeptVO.setDeptName(deptList.get(0).getDeptName());
                 filterPageByDeptVO.setDeptName(deptList.get(0).getDeptName());
             }
             }
         }
         }
-        filterPageByDeptVOSet(filterPageByDeptVO);
+        filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
         IPage<DeptNumDTO> page = qcresultInfoFacade.entryCountGroupByCaseAndDeptPage(filterPageByDeptVO);
         IPage<DeptNumDTO> page = qcresultInfoFacade.entryCountGroupByCaseAndDeptPage(filterPageByDeptVO);
         return page;
         return page;
     }
     }
 
 
     /**
     /**
-     * 条目缺陷占比-科室(分页)
+     * 缺陷详情-科室(分页)
      *
      *
      * @param filterPageByDeptVO
      * @param filterPageByDeptVO
      * @return
      * @return
      */
      */
-    public IPage<DeptNumDTO> entryCountGroupByEntryAndDeptPage(FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(FilterPageByDeptVO filterPageByDeptVO) {
         if (StringUtil.isBlank(filterPageByDeptVO.getDeptName())) {
         if (StringUtil.isBlank(filterPageByDeptVO.getDeptName())) {
             List<DeptBaseDTO> deptList = this.getDept();
             List<DeptBaseDTO> deptList = this.getDept();
             //默认取第一个科室
             //默认取第一个科室
@@ -540,22 +417,11 @@ public class ConsoleByDeptFacade {
                 filterPageByDeptVO.setDeptName(deptList.get(0).getDeptName());
                 filterPageByDeptVO.setDeptName(deptList.get(0).getDeptName());
             }
             }
         }
         }
-        DecimalFormat df = new DecimalFormat("#0.00");
-        filterPageByDeptVOSet(filterPageByDeptVO);
-        IPage<DeptNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
-        List<DeptNumDTO> records = page.getRecords();
-        if (ListUtil.isNotEmpty(records)) {
-            records.forEach(item -> {
-                Double percent = BigDecimal.valueOf(item.getNum())
-                        .divide(BigDecimal.valueOf(item.getTotleNum()), 4, RoundingMode.HALF_UP)
-                        .doubleValue();
-                item.setPercent(percent);
-                String percentStr
-                        = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
-                item.setPercentStr(percentStr);
-            });
+        if (filterPageByDeptVO.getDeptName().equals(filterPageByDeptVO.getDoctorName())) {
+            filterPageByDeptVO.setDoctorName("");
         }
         }
-        page.setRecords(records);
+        filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
+        IPage<DeptEntryNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
         return page;
         return page;
     }
     }
 
 
@@ -573,11 +439,29 @@ public class ConsoleByDeptFacade {
                 filterPageByDeptVO.setDeptName(deptList.get(0).getDeptName());
                 filterPageByDeptVO.setDeptName(deptList.get(0).getDeptName());
             }
             }
         }
         }
-        filterPageByDeptVOSet(filterPageByDeptVO);
+        filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
         IPage<DeptNumDTO> page = behospitalInfoFacade.resultStatisticsByDeptAndDoctorPage(filterPageByDeptVO);
         IPage<DeptNumDTO> page = behospitalInfoFacade.resultStatisticsByDeptAndDoctorPage(filterPageByDeptVO);
         return page;
         return page;
     }
     }
 
 
+    /**
+     * 条目缺陷占比-科室(内页)
+     *
+     * @param filterPageByDeptVO
+     * @return
+     */
+    public IPage<DeptEntryNumDTO> entryGroupByEntryAndDeptInnerPage(FilterPageByDeptVO filterPageByDeptVO) {
+        if (StringUtil.isBlank(filterPageByDeptVO.getDeptName())) {
+            List<DeptBaseDTO> deptList = this.getDept();
+            //默认取第一个科室
+            if (ListUtil.isNotEmpty(deptList)) {
+                filterPageByDeptVO.setDeptName(deptList.get(0).getDeptName());
+            }
+        }
+        filterFacade.filterPageByDeptVOSet(filterPageByDeptVO);
+        IPage<DeptEntryNumDTO> page = qcresultInfoFacade.entryGroupByEntryAndDeptInnerPage(filterPageByDeptVO);
+        return page;
+    }
 
 
     /**
     /**
      * 各科室缺陷占比(组合)
      * 各科室缺陷占比(组合)
@@ -593,14 +477,7 @@ public class ConsoleByDeptFacade {
         if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())) {
         if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())) {
             filterOrderByDeptVO.setDeptName(deptList.get(0).getDeptName());
             filterOrderByDeptVO.setDeptName(deptList.get(0).getDeptName());
         }
         }
-        String hosptialId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        String startDate = filterFacade.getStartDateStr(filterOrderByDeptVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterOrderByDeptVO.getType(), null);
-        filterOrderByDeptVO.setStartDate(startDate);
-        filterOrderByDeptVO.setEndDate(endDate);
-        filterOrderByDeptVO.setHospitalId(hosptialId);
-        filterOrderByDeptVO.setUserId(Long.valueOf(userId));
+        filterFacade.filterOrderByDeptVOSet(filterOrderByDeptVO);
         List<LevelStatisticsDTO> records = behospitalInfoFacade.levelStatisticsByDept(filterOrderByDeptVO);
         List<LevelStatisticsDTO> records = behospitalInfoFacade.levelStatisticsByDept(filterOrderByDeptVO);
         return records;
         return records;
     }
     }
@@ -611,7 +488,7 @@ public class ConsoleByDeptFacade {
      * @param filterOrderByDeptVO
      * @param filterOrderByDeptVO
      * @return
      * @return
      */
      */
-    public List<LevelStatisticsDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
+    public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
         List<DeptBaseDTO> deptList = getDept();
         List<DeptBaseDTO> deptList = getDept();
         if (ListUtil.isEmpty(deptList)) {
         if (ListUtil.isEmpty(deptList)) {
             return null;
             return null;
@@ -619,15 +496,16 @@ public class ConsoleByDeptFacade {
         if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())) {
         if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())) {
             filterOrderByDeptVO.setDeptName(deptList.get(0).getDeptName());
             filterOrderByDeptVO.setDeptName(deptList.get(0).getDeptName());
         }
         }
-        String hosptialId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        String startDate = filterFacade.getStartDateStr(filterOrderByDeptVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterOrderByDeptVO.getType(), null);
-        filterOrderByDeptVO.setStartDate(startDate);
-        filterOrderByDeptVO.setEndDate(endDate);
-        filterOrderByDeptVO.setHospitalId(hosptialId);
-        filterOrderByDeptVO.setUserId(Long.valueOf(userId));
-        List<LevelStatisticsDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
+        filterFacade.filterOrderByDeptVOSet(filterOrderByDeptVO);
+        List<HomePageNumDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
+        //没有医生过滤时增加全科室数据
+        if (StringUtil.isBlank(filterOrderByDeptVO.getName())
+                || filterOrderByDeptVO.getName().equals(filterOrderByDeptVO.getDeptName())) {
+            HomePageNumDTO item = getGlobleRecord(records, filterOrderByDeptVO.getDeptName());
+            if (item != null) {
+                records.add(0, item);
+            }
+        }
         return records;
         return records;
     }
     }
 
 
@@ -637,8 +515,8 @@ public class ConsoleByDeptFacade {
      * @param filterOrderByDeptVO
      * @param filterOrderByDeptVO
      * @return
      * @return
      */
      */
-    public List<LevelStatisticsDTO> homePageLevelByDeptLimit(FilterOrderByDeptVO filterOrderByDeptVO) {
-        DecimalFormat df = new DecimalFormat("#0.00");
+    public List<HomePageNumDTO> homePageLevelByDeptLimit(FilterOrderByDeptVO filterOrderByDeptVO) {
+
         List<DeptBaseDTO> deptList = getDept();
         List<DeptBaseDTO> deptList = getDept();
         if (ListUtil.isEmpty(deptList)) {
         if (ListUtil.isEmpty(deptList)) {
             return null;
             return null;
@@ -646,73 +524,123 @@ public class ConsoleByDeptFacade {
         if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())) {
         if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())) {
             filterOrderByDeptVO.setDeptName(deptList.get(0).getDeptName());
             filterOrderByDeptVO.setDeptName(deptList.get(0).getDeptName());
         }
         }
-        String hosptialId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        String startDate = filterFacade.getStartDateStr(filterOrderByDeptVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterOrderByDeptVO.getType(), null);
-        filterOrderByDeptVO.setStartDate(startDate);
-        filterOrderByDeptVO.setEndDate(endDate);
-        filterOrderByDeptVO.setHospitalId(hosptialId);
-        filterOrderByDeptVO.setUserId(Long.valueOf(userId));
+        filterFacade.filterOrderByDeptVOSet(filterOrderByDeptVO);
         if (filterOrderByDeptVO.getLimitCount() == null || filterOrderByDeptVO.getLimitCount().equals(0)) {
         if (filterOrderByDeptVO.getLimitCount() == null || filterOrderByDeptVO.getLimitCount().equals(0)) {
             filterOrderByDeptVO.setLimitCount(10);
             filterOrderByDeptVO.setLimitCount(10);
         }
         }
-        List<LevelStatisticsDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
-        //增加全科室
-        LevelStatisticsDTO item = new LevelStatisticsDTO();
+        List<HomePageNumDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
+        HomePageNumDTO item = getGlobleRecord(records, filterOrderByDeptVO.getDeptName());
+        if (item != null) {
+            records.add(0, item);
+        }
+
+        records = records
+                .stream()
+                .limit(filterOrderByDeptVO.getLimitCount())
+                .collect(Collectors.toList());
+
+        return records;
+    }
+
+    /**
+     * 获取某个科室全科室数据
+     *
+     * @param records
+     * @param deptName
+     * @return
+     */
+    public HomePageNumDTO getGlobleRecord(List<HomePageNumDTO> records, String deptName) {
+        DecimalFormat df = new DecimalFormat("#0.00");
+        HomePageNumDTO item = new HomePageNumDTO();
+        //总病历数
         Integer mrNum = records
         Integer mrNum = records
                 .stream()
                 .stream()
-                .map(LevelStatisticsDTO::getMrNum)
+                .map(HomePageNumDTO::getMrNum)
                 .reduce(0, Integer::sum);
                 .reduce(0, Integer::sum);
         if (mrNum == null || mrNum == 0) {
         if (mrNum == null || mrNum == 0) {
-            return Lists.newLinkedList();
+            return null;
         }
         }
+        //总缺陷数
         Integer entryNum = records
         Integer entryNum = records
                 .stream()
                 .stream()
-                .map(LevelStatisticsDTO::getEntryNum)
+                .map(HomePageNumDTO::getEntryNum)
                 .reduce(0, Integer::sum);
                 .reduce(0, Integer::sum);
-        Double totleFee = records
+        //总分
+        Double totleValue = records
                 .stream()
                 .stream()
                 .map(i -> BigDecimal.valueOf(i.getTotleValue()))
                 .map(i -> BigDecimal.valueOf(i.getTotleValue()))
                 .reduce(BigDecimal.ZERO, BigDecimal::add)
                 .reduce(BigDecimal.ZERO, BigDecimal::add)
                 .doubleValue();
                 .doubleValue();
-        Double averageFee = BigDecimal.valueOf(totleFee)
+        //平均分
+        Double averageValue = BigDecimal.valueOf(totleValue)
                 .divide(BigDecimal.valueOf(mrNum), 2, RoundingMode.HALF_UP)
                 .divide(BigDecimal.valueOf(mrNum), 2, RoundingMode.HALF_UP)
                 .doubleValue();
                 .doubleValue();
+        //合格病历总数
         Integer firstLevelNum = records
         Integer firstLevelNum = records
                 .stream()
                 .stream()
-                .map(LevelStatisticsDTO::getFirstLevelNum)
+                .map(HomePageNumDTO::getFirstLevelNum)
                 .reduce(0, Integer::sum);
                 .reduce(0, Integer::sum);
+        //合格病历占比
         Double firstLevelPercent = BigDecimal.valueOf(firstLevelNum)
         Double firstLevelPercent = BigDecimal.valueOf(firstLevelNum)
                 .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
                 .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
                 .doubleValue();
                 .doubleValue();
         String firstLevelPercentStr
         String firstLevelPercentStr
                 = df.format(BigDecimal.valueOf(firstLevelPercent).multiply(BigDecimal.valueOf(100))) + "%";
                 = df.format(BigDecimal.valueOf(firstLevelPercent).multiply(BigDecimal.valueOf(100))) + "%";
-        Integer secondLevelNum = mrNum - firstLevelNum;
+        //不合格病历数
+        Integer secondLevelNum = records
+                .stream()
+                .map(HomePageNumDTO::getSecondLevelNum)
+                .reduce(0, Integer::sum);
+        //不合格病历占比
         Double secondLevelPercent = BigDecimal.valueOf(secondLevelNum)
         Double secondLevelPercent = BigDecimal.valueOf(secondLevelNum)
                 .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
                 .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
                 .doubleValue();
                 .doubleValue();
         String secondLevelPercentStr
         String secondLevelPercentStr
                 = df.format(BigDecimal.valueOf(secondLevelPercent).multiply(BigDecimal.valueOf(100))) + "%";
                 = df.format(BigDecimal.valueOf(secondLevelPercent).multiply(BigDecimal.valueOf(100))) + "%";
-        item.setDoctorName(filterOrderByDeptVO.getDeptName());
+        //条目缺陷总数(模块下条目*病历数)
+        Integer entryTotleNum = records
+                .stream()
+                .map(HomePageNumDTO::getEntryTotleNum)
+                .reduce(0, Integer::sum);
+        //空项总数
+        Integer emptyNum = records
+                .stream()
+                .map(HomePageNumDTO::getEmptyNum)
+                .reduce(0, Integer::sum);
+        Double emptyPercent = BigDecimal.valueOf(entryTotleNum - emptyNum)
+                .divide(BigDecimal.valueOf(entryTotleNum), 4, RoundingMode.HALF_UP)
+                .doubleValue();
+        String emptyPercentStr
+                = df.format(BigDecimal.valueOf(emptyPercent).multiply(BigDecimal.valueOf(100))) + "%";
+        //错误项总数
+        Integer errorNum = records
+                .stream()
+                .map(HomePageNumDTO::getErrorNum)
+                .reduce(0, Integer::sum);
+        Double errorPercent = BigDecimal.valueOf(entryTotleNum - errorNum)
+                .divide(BigDecimal.valueOf(entryTotleNum), 4, RoundingMode.HALF_UP)
+                .doubleValue();
+        String errorPercentStr
+                = df.format(BigDecimal.valueOf(errorPercent).multiply(BigDecimal.valueOf(100))) + "%";
+
+        item.setDoctorName(deptName);
         item.setEntryNum(entryNum);
         item.setEntryNum(entryNum);
         item.setMrNum(mrNum);
         item.setMrNum(mrNum);
-        item.setTotleValue(totleFee);
-        item.setAverageValue(averageFee);
+        item.setTotleValue(totleValue);
+        item.setAverageValue(averageValue);
         item.setFirstLevelNum(firstLevelNum);
         item.setFirstLevelNum(firstLevelNum);
         item.setFirstLevelPercent(firstLevelPercent);
         item.setFirstLevelPercent(firstLevelPercent);
         item.setFirstLevelPercentStr(firstLevelPercentStr);
         item.setFirstLevelPercentStr(firstLevelPercentStr);
         item.setSecondLevelNum(secondLevelNum);
         item.setSecondLevelNum(secondLevelNum);
         item.setSecondLevelPercent(secondLevelPercent);
         item.setSecondLevelPercent(secondLevelPercent);
         item.setSecondLevelPercentStr(secondLevelPercentStr);
         item.setSecondLevelPercentStr(secondLevelPercentStr);
-
-        records.add(0, item);
-
-        records = records
-                .stream()
-                .limit(filterOrderByDeptVO.getLimitCount())
-                .collect(Collectors.toList());
-
-        return records;
+        item.setEntryTotleNum(entryTotleNum);
+        item.setEmptyNum(emptyNum);
+        item.setEmptyPercent(emptyPercent);
+        item.setEmptyPercentStr(emptyPercentStr);
+        item.setErrorNum(errorNum);
+        item.setErrorPercent(errorPercent);
+        item.setErrorPercentStr(errorPercentStr);
+        return item;
     }
     }
 }
 }

+ 203 - 187
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -5,14 +5,16 @@ import com.diagbot.aggregate.AverageStatisticsAggregate;
 import com.diagbot.aggregate.MrStatisticsAggregate;
 import com.diagbot.aggregate.MrStatisticsAggregate;
 import com.diagbot.aggregate.ResultStatisticsAggregate;
 import com.diagbot.aggregate.ResultStatisticsAggregate;
 import com.diagbot.dto.AverageStatisticsDTO;
 import com.diagbot.dto.AverageStatisticsDTO;
+import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
+import com.diagbot.dto.HomePageNumDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.exception.CommonException;
-import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ListUtil;
-import com.diagbot.util.SysUserUtils;
+import com.diagbot.util.StringUtil;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByAverageVO;
 import com.diagbot.vo.FilterPageByAverageVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterPageVO;
@@ -25,7 +27,6 @@ import org.springframework.stereotype.Component;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.text.DecimalFormat;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.List;
@@ -67,15 +68,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> mrStatistics(FilterVO filterVO) {
     public Map<String, Object> mrStatistics(FilterVO filterVO) {
         Map<String, Object> retMap = new LinkedHashMap<>();
         Map<String, Object> retMap = new LinkedHashMap<>();
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
-        filterVO.setStartDate(startDate);
-        filterVO.setEndDate(endDate);
-        filterVO.setHospitalId(hospitalId);
-        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
-            filterVO.setLimitCount(10);
-        }
+        filterFacade.filterVOSet(filterVO);
         try {
         try {
             Map<String, Object> invokeParams = new HashMap<>();
             Map<String, Object> invokeParams = new HashMap<>();
             invokeParams.put("filterVO", filterVO);
             invokeParams.put("filterVO", filterVO);
@@ -95,15 +88,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> resultStatistics(FilterVO filterVO) {
     public Map<String, Object> resultStatistics(FilterVO filterVO) {
         Map<String, Object> retMap = new LinkedHashMap<>();
         Map<String, Object> retMap = new LinkedHashMap<>();
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
-        filterVO.setHospitalId(hospitalId);
-        filterVO.setStartDate(startDate);
-        filterVO.setEndDate(endDate);
-        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
-            filterVO.setLimitCount(10);
-        }
+        filterFacade.filterVOSet(filterVO);
         try {
         try {
             Map<String, Object> invokeParams = new HashMap<>();
             Map<String, Object> invokeParams = new HashMap<>();
             invokeParams.put("filterVO", filterVO);
             invokeParams.put("filterVO", filterVO);
@@ -123,15 +108,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> averageStatistics(FilterVO filterVO) {
     public Map<String, Object> averageStatistics(FilterVO filterVO) {
         Map<String, Object> retMap = new LinkedHashMap<>();
         Map<String, Object> retMap = new LinkedHashMap<>();
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
-        filterVO.setHospitalId(hospitalId);
-        filterVO.setStartDate(startDate);
-        filterVO.setEndDate(endDate);
-        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
-            filterVO.setLimitCount(10);
-        }
+        filterFacade.filterVOSet(filterVO);
         try {
         try {
             Map<String, Object> invokeParams = new HashMap<>();
             Map<String, Object> invokeParams = new HashMap<>();
             invokeParams.put("filterVO", filterVO);
             invokeParams.put("filterVO", filterVO);
@@ -155,7 +132,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> getAverageDayNum(FilterVO filterVO) {
     public Map<String, Object> getAverageDayNum(FilterVO filterVO) {
         Map<String, Object> retMap = new HashMap<>();
         Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
+        filterFacade.filterVOSet(filterVO);
         List<AverageStatisticsDTO> averageDayNumList = averageStatisticsAggregate.getAverageDayNum(filterVO);
         List<AverageStatisticsDTO> averageDayNumList = averageStatisticsAggregate.getAverageDayNum(filterVO);
         if (ListUtil.isNotEmpty(averageDayNumList)) {
         if (ListUtil.isNotEmpty(averageDayNumList)) {
             retMap.put("平均住院日", averageDayNumList);
             retMap.put("平均住院日", averageDayNumList);
@@ -171,7 +148,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> getAverageFee(FilterVO filterVO) {
     public Map<String, Object> getAverageFee(FilterVO filterVO) {
         Map<String, Object> retMap = new HashMap<>();
         Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
+        filterFacade.filterVOSet(filterVO);
         List<AverageStatisticsDTO> averageFeeList = averageStatisticsAggregate.getAverageFee(filterVO);
         List<AverageStatisticsDTO> averageFeeList = averageStatisticsAggregate.getAverageFee(filterVO);
         if (ListUtil.isNotEmpty(averageFeeList)) {
         if (ListUtil.isNotEmpty(averageFeeList)) {
             retMap.put("平均住院费用", averageFeeList);
             retMap.put("平均住院费用", averageFeeList);
@@ -187,7 +164,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> getAverageScore(FilterVO filterVO) {
     public Map<String, Object> getAverageScore(FilterVO filterVO) {
         Map<String, Object> retMap = new HashMap<>();
         Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
+        filterFacade.filterVOSet(filterVO);
         List<AverageStatisticsDTO> averageScoreList = averageStatisticsAggregate.getAverageScore(filterVO);
         List<AverageStatisticsDTO> averageScoreList = averageStatisticsAggregate.getAverageScore(filterVO);
         if (ListUtil.isNotEmpty(averageScoreList)) {
         if (ListUtil.isNotEmpty(averageScoreList)) {
             retMap.put("各科室质控平均分", averageScoreList);
             retMap.put("各科室质控平均分", averageScoreList);
@@ -195,6 +172,24 @@ public class ConsoleFacade {
         return retMap;
         return retMap;
     }
     }
 
 
+    /**
+     * 各科室质控平均分(首页)-根据内外科系统统计
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<AverageStatisticsDTO> getAverageScoreByDeptClass(FilterVO filterVO) {
+        filterFacade.filterVOSet(filterVO);
+        List<AverageStatisticsDTO> retAverageScoreList = Lists.newLinkedList();
+        List<AverageStatisticsDTO> averageScoreList = qcresultInfoFacade.getAverageScoreByDeptClass(filterVO);
+        Integer limitCount = filterVO.getLimitCount();
+        //质控平均分
+        if (ListUtil.isNotEmpty(averageScoreList)) {
+            retAverageScoreList = averageStatisticsAggregate.getLimitAverageList(averageScoreList, limitCount);
+        }
+        return retAverageScoreList;
+    }
+
     /**
     /**
      * 各科室甲级病历占比
      * 各科室甲级病历占比
      *
      *
@@ -203,7 +198,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> getLevelResultDept(FilterVO filterVO) {
     public Map<String, Object> getLevelResultDept(FilterVO filterVO) {
         Map<String, Object> retMap = new HashMap<>();
         Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
+        filterFacade.filterVOSet(filterVO);
         List<QcResultPercentDTO> levelResults = mrStatisticsAggregate.getLevelResultDept(filterVO);
         List<QcResultPercentDTO> levelResults = mrStatisticsAggregate.getLevelResultDept(filterVO);
         if (ListUtil.isNotEmpty(levelResults)) {
         if (ListUtil.isNotEmpty(levelResults)) {
             retMap.put("各科室甲级病历占比", levelResults);
             retMap.put("各科室甲级病历占比", levelResults);
@@ -219,7 +214,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> leaveHosCount(FilterVO filterVO) {
     public Map<String, Object> leaveHosCount(FilterVO filterVO) {
         Map<String, Object> retMap = new HashMap<>();
         Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
+        filterFacade.filterVOSet(filterVO);
         Map<String, Object> leaveHosMap = mrStatisticsAggregate.leaveHosCount(filterVO);
         Map<String, Object> leaveHosMap = mrStatisticsAggregate.leaveHosCount(filterVO);
         if (leaveHosMap != null) {
         if (leaveHosMap != null) {
             retMap.put("出院人数统计", leaveHosMap);
             retMap.put("出院人数统计", leaveHosMap);
@@ -235,7 +230,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> mrCount(FilterVO filterVO) {
     public Map<String, Object> mrCount(FilterVO filterVO) {
         Map<String, Object> retMap = new HashMap<>();
         Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
+        filterFacade.filterVOSet(filterVO);
         List<NumDTO> mrCountList = mrStatisticsAggregate.mrCount(filterVO);
         List<NumDTO> mrCountList = mrStatisticsAggregate.mrCount(filterVO);
         if (ListUtil.isNotEmpty(mrCountList)) {
         if (ListUtil.isNotEmpty(mrCountList)) {
             retMap.put("病历数统计", mrCountList);
             retMap.put("病历数统计", mrCountList);
@@ -251,7 +246,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> entryCountGroupByCase(FilterVO filterVO) {
     public Map<String, Object> entryCountGroupByCase(FilterVO filterVO) {
         Map<String, Object> retMap = new HashMap<>();
         Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
+        filterFacade.filterVOSet(filterVO);
         List<NumDTO> caseList = resultStatisticsAggregate.entryCountGroupByCase(filterVO);
         List<NumDTO> caseList = resultStatisticsAggregate.entryCountGroupByCase(filterVO);
         if (ListUtil.isNotEmpty(caseList)) {
         if (ListUtil.isNotEmpty(caseList)) {
             retMap.put("各模块缺陷占比排行", caseList);
             retMap.put("各模块缺陷占比排行", caseList);
@@ -267,7 +262,7 @@ public class ConsoleFacade {
      */
      */
     public Map<String, Object> entryCountGroupByEntry(FilterVO filterVO) {
     public Map<String, Object> entryCountGroupByEntry(FilterVO filterVO) {
         Map<String, Object> retMap = new HashMap<>();
         Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
+        filterFacade.filterVOSet(filterVO);
         List<NumDTO> entryList = resultStatisticsAggregate.entryCountGroupByEntry(filterVO);
         List<NumDTO> entryList = resultStatisticsAggregate.entryCountGroupByEntry(filterVO);
         if (ListUtil.isNotEmpty(entryList)) {
         if (ListUtil.isNotEmpty(entryList)) {
             retMap.put("条目缺陷占比", entryList);
             retMap.put("条目缺陷占比", entryList);
@@ -276,107 +271,69 @@ public class ConsoleFacade {
     }
     }
 
 
     /**
     /**
-     * 各科室缺陷占比
+     * 单项否决缺陷占比
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public Map<String, Object> entryByDept(FilterVO filterVO) {
-        Map<String, Object> retMap = new HashMap<>();
-        filterVOSet(filterVO);
-        List<NumDTO> deptList = resultStatisticsAggregate.entryByDept(filterVO);
-        if (ListUtil.isNotEmpty(deptList)) {
-            retMap.put("各科室缺陷占比", deptList);
-        }
-        return retMap;
-    }
-
-    private void filterVOSet(FilterVO filterVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String startDate = filterFacade.getStartDateStr(filterVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterVO.getType(), null);
-        filterVO.setStartDate(startDate);
-        filterVO.setEndDate(endDate);
-        filterVO.setHospitalId(hospitalId);
-        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
-            filterVO.setLimitCount(10);
+    public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO) {
+        List<EntryNumDTO> retList = Lists.newLinkedList();
+        filterFacade.filterVOSet(filterVO);
+        Integer limitCount = filterVO.getLimitCount();
+        List<EntryNumDTO> numDTOList = qcresultInfoFacade.entryRejectPercent(filterVO);
+        if (ListUtil.isNotEmpty(numDTOList)) {
+            if (numDTOList.size() <= limitCount) {
+                retList = numDTOList;
+            } else {
+                retList = numDTOList.subList(0, limitCount);
+            }
         }
         }
+        return retList;
     }
     }
-    //endregion-----------------------单独接口结束-------------------------------
-
-    //region_______________________分页接口开始-------------------------------
 
 
     /**
     /**
-     * 过滤条件设置
+     * 各科室甲/乙/丙级病历占比
      *
      *
-     * @param filterPageVO
+     * @param filterVO
+     * @return
      */
      */
-    private void filterPageVOSet(FilterPageVO filterPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String startDate = "";
-        String endDate = "";
-        Date date = new Date();
-
-        //统计维度 1-本月,2-本年
-        //时间类型 1-本月/本年,2-上月/去年,3-去年本月/去年
-        if (filterPageVO.getType().equals(1)) {
-            if (filterPageVO.getDateType() == null) {
-                startDate = filterFacade.getStartDateStr(filterPageVO.getType(), null);
-                endDate = filterFacade.getEndDateStr(filterPageVO.getType(), null);
-            } else if (filterPageVO.getDateType().equals(2)) {
-                startDate = filterFacade.getLastStartDateStr(filterPageVO.getType());
-                endDate = filterFacade.getLastEndDateStr(filterPageVO.getType());
-            } else if (filterPageVO.getDateType().equals(3)) {
-                String year = DateUtil.getYear(date);
-                startDate = filterFacade.getStartDateStr(filterPageVO.getType(), Integer.valueOf(year) - 1);
-                endDate = filterFacade.getEndDateStr(filterPageVO.getType(), Integer.valueOf(year) - 1);
-            } else {
-                startDate = filterFacade.getStartDateStr(filterPageVO.getType(), null);
-                endDate = filterFacade.getEndDateStr(filterPageVO.getType(), null);
-            }
-        } else if (filterPageVO.getType().equals(2)) {
-            if (filterPageVO.getDateType() == null) {
-                startDate = filterFacade.getStartDateStr(filterPageVO.getType(), null);
-                endDate = filterFacade.getEndDateStr(filterPageVO.getType(), null);
-            } else if (filterPageVO.getDateType().equals(2) || filterPageVO.getDateType().equals(3)) {
-                startDate = filterFacade.getLastStartDateStr(filterPageVO.getType());
-                endDate = filterFacade.getLastEndDateStr(filterPageVO.getType());
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getLevel())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入病历等级");
+        }
+        List<DeptNumDTO> retList = Lists.newLinkedList();
+        filterFacade.filterVOSet(filterVO);
+        Integer limitCount = filterVO.getLimitCount();
+        List<DeptNumDTO> numDTOList = qcresultInfoFacade.qcResultLevelPercent(filterVO);
+        if (ListUtil.isNotEmpty(numDTOList)) {
+            if (numDTOList.size() <= limitCount) {
+                retList = numDTOList;
             } else {
             } else {
-                startDate = filterFacade.getStartDateStr(filterPageVO.getType(), null);
-                endDate = filterFacade.getEndDateStr(filterPageVO.getType(), null);
+                retList = numDTOList.subList(0, limitCount);
             }
             }
         }
         }
-
-        filterPageVO.setStartDate(startDate);
-        filterPageVO.setEndDate(endDate);
-        filterPageVO.setHospitalId(hospitalId);
+        return retList;
     }
     }
 
 
     /**
     /**
-     * 平均住院天数、平均花费入参设置
+     * 各科室缺陷占比
      *
      *
-     * @param filterPageByAverageVO
+     * @param filterVO
+     * @return
      */
      */
-    private void filterPageByAverageVOSet(FilterPageByAverageVO filterPageByAverageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date date = new Date();
-        String year = DateUtil.getYear(date);
-        String startDate = filterFacade.getStartDateStr(filterPageByAverageVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterPageByAverageVO.getType(), null);
-        String lastStartDate = filterFacade.getLastStartDateStr(filterPageByAverageVO.getType());
-        String lastEndDate = filterFacade.getLastEndDateStr(filterPageByAverageVO.getType());
-        String lastYearStartDate = filterFacade.getStartDateStr(filterPageByAverageVO.getType(), Integer.valueOf(year) - 1);
-        String lastYearEndDate = filterFacade.getEndDateStr(filterPageByAverageVO.getType(), Integer.valueOf(year) - 1);
-        filterPageByAverageVO.setHospitalId(hospitalId);
-        filterPageByAverageVO.setUserId(Long.valueOf(userId));
-        filterPageByAverageVO.setStartDate(startDate);
-        filterPageByAverageVO.setEndDate(endDate);
-        filterPageByAverageVO.setLastStartDate(lastStartDate);
-        filterPageByAverageVO.setLastEndDate(lastEndDate);
-        filterPageByAverageVO.setLastYearStartDate(lastYearStartDate);
-        filterPageByAverageVO.setLastYearEndDate(lastYearEndDate);
+    public Map<String, Object> entryByDept(FilterVO filterVO) {
+        Map<String, Object> retMap = new HashMap<>();
+        filterFacade.filterVOSet(filterVO);
+        List<NumDTO> deptList = resultStatisticsAggregate.entryByDept(filterVO);
+        if (ListUtil.isNotEmpty(deptList)) {
+            retMap.put("各科室缺陷占比", deptList);
+        }
+        return retMap;
     }
     }
+    //endregion-----------------------单独接口结束-------------------------------
+
+    //region_______________________分页接口开始-------------------------------
+
 
 
     /**
     /**
      * 各模块缺陷占比(分页)
      * 各模块缺陷占比(分页)
@@ -385,34 +342,23 @@ public class ConsoleFacade {
      * @return
      * @return
      */
      */
     public IPage<NumDTO> entryCountGroupByCasePage(FilterPageVO filterPageVO) {
     public IPage<NumDTO> entryCountGroupByCasePage(FilterPageVO filterPageVO) {
-        filterPageVOSet(filterPageVO);
+        filterFacade.filterPageVOSet(filterPageVO);
         IPage<NumDTO> page = qcresultInfoFacade.entryCountGroupByCasePage(filterPageVO);
         IPage<NumDTO> page = qcresultInfoFacade.entryCountGroupByCasePage(filterPageVO);
         return page;
         return page;
     }
     }
 
 
     /**
     /**
-     * 条目缺陷占比(分页)
+     * 缺陷详情(分页)
      *
      *
      * @param filterPageVO
      * @param filterPageVO
      * @return
      * @return
      */
      */
-    public IPage<NumDTO> entryCountGroupByEntryPage(FilterPageVO filterPageVO) {
-        DecimalFormat df = new DecimalFormat("#0.00");
-        filterPageVOSet(filterPageVO);
-        IPage<NumDTO> page = qcresultInfoFacade.entryCountGroupByEntryPage(filterPageVO);
-        List<NumDTO> records = page.getRecords();
-        if (ListUtil.isNotEmpty(records)) {
-            records.forEach(item -> {
-                Double percent = BigDecimal.valueOf(item.getNum())
-                        .divide(BigDecimal.valueOf(item.getTotleNum()), 4, RoundingMode.HALF_UP)
-                        .doubleValue();
-                item.setPercent(percent);
-                String percentStr
-                        = df.format(BigDecimal.valueOf(percent).multiply(BigDecimal.valueOf(100))) + "%";
-                item.setPercentStr(percentStr);
-            });
+    public IPage<EntryNumDTO> entryCountGroupByEntryPage(FilterPageVO filterPageVO) {
+        filterFacade.filterPageVOSet(filterPageVO);
+        if (filterPageVO.getDeptName().equals("全院")) {
+            filterPageVO.setDeptName("");
         }
         }
-        page.setRecords(records);
+        IPage<EntryNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryPage(filterPageVO);
         return page;
         return page;
     }
     }
 
 
@@ -423,7 +369,7 @@ public class ConsoleFacade {
      * @return
      * @return
      */
      */
     public IPage<AverageStatisticsDTO> getAverageDayNumPage(FilterPageByAverageVO filterPageByAverageVO) {
     public IPage<AverageStatisticsDTO> getAverageDayNumPage(FilterPageByAverageVO filterPageByAverageVO) {
-        filterPageByAverageVOSet(filterPageByAverageVO);
+        filterFacade.filterPageByAverageVOSet(filterPageByAverageVO);
         IPage<AverageStatisticsDTO> page = homePageFacade.getAverageDayNumPage(filterPageByAverageVO);
         IPage<AverageStatisticsDTO> page = homePageFacade.getAverageDayNumPage(filterPageByAverageVO);
         return page;
         return page;
     }
     }
@@ -435,7 +381,7 @@ public class ConsoleFacade {
      * @return
      * @return
      */
      */
     public IPage<AverageStatisticsDTO> getAverageFeePage(FilterPageByAverageVO filterPageByAverageVO) {
     public IPage<AverageStatisticsDTO> getAverageFeePage(FilterPageByAverageVO filterPageByAverageVO) {
-        filterPageByAverageVOSet(filterPageByAverageVO);
+        filterFacade.filterPageByAverageVOSet(filterPageByAverageVO);
         IPage<AverageStatisticsDTO> page = homePageFacade.getAverageFeePage(filterPageByAverageVO);
         IPage<AverageStatisticsDTO> page = homePageFacade.getAverageFeePage(filterPageByAverageVO);
         return page;
         return page;
     }
     }
@@ -447,7 +393,7 @@ public class ConsoleFacade {
      * @return
      * @return
      */
      */
     public IPage<AverageStatisticsDTO> getAverageScoreByDeptPage(FilterPageVO filterPageVO) {
     public IPage<AverageStatisticsDTO> getAverageScoreByDeptPage(FilterPageVO filterPageVO) {
-        filterPageVOSet(filterPageVO);
+        filterFacade.filterPageVOSet(filterPageVO);
         IPage<AverageStatisticsDTO> page = qcresultInfoFacade.getAverageScoreByDeptPage(filterPageVO);
         IPage<AverageStatisticsDTO> page = qcresultInfoFacade.getAverageScoreByDeptPage(filterPageVO);
         return page;
         return page;
     }
     }
@@ -459,7 +405,7 @@ public class ConsoleFacade {
      * @return
      * @return
      */
      */
     public IPage<NumDTO> resultStatisticsByDeptPage(FilterPageVO filterPageVO) {
     public IPage<NumDTO> resultStatisticsByDeptPage(FilterPageVO filterPageVO) {
-        filterPageVOSet(filterPageVO);
+        filterFacade.filterPageVOSet(filterPageVO);
         IPage<NumDTO> page = behospitalInfoFacade.resultStatisticsByDeptPage(filterPageVO);
         IPage<NumDTO> page = behospitalInfoFacade.resultStatisticsByDeptPage(filterPageVO);
         return page;
         return page;
     }
     }
@@ -471,10 +417,22 @@ public class ConsoleFacade {
      * @return
      * @return
      */
      */
     public IPage<QcResultPercentDTO> levelPercentGroupByDeptPage(FilterPageVO filterPageVO) {
     public IPage<QcResultPercentDTO> levelPercentGroupByDeptPage(FilterPageVO filterPageVO) {
-        filterPageVOSet(filterPageVO);
+        filterFacade.filterPageVOSet(filterPageVO);
         IPage<QcResultPercentDTO> page = qcresultInfoFacade.levelPercentGroupByDeptPage(filterPageVO);
         IPage<QcResultPercentDTO> page = qcresultInfoFacade.levelPercentGroupByDeptPage(filterPageVO);
         return page;
         return page;
     }
     }
+
+    /**
+     * 条目缺陷占比(内页)
+     *
+     * @param filterPageVO
+     * @return
+     */
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(FilterPageVO filterPageVO) {
+        filterFacade.filterPageVOSet(filterPageVO);
+        IPage<EntryNumDTO> page = qcresultInfoFacade.entryGroupByEntryInnerPage(filterPageVO);
+        return page;
+    }
     //endregion-----------------------分页接口结束-------------------------------
     //endregion-----------------------分页接口结束-------------------------------
 
 
     /**
     /**
@@ -484,30 +442,39 @@ public class ConsoleFacade {
      * @return
      * @return
      */
      */
     public List<LevelStatisticsDTO> levelStatistics(FilterOrderVO filterOrderVO) {
     public List<LevelStatisticsDTO> levelStatistics(FilterOrderVO filterOrderVO) {
-        String hosptialId = SysUserUtils.getCurrentHospitalID();
-        String startDate = filterFacade.getStartDateStr(filterOrderVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterOrderVO.getType(), null);
-        filterOrderVO.setStartDate(startDate);
-        filterOrderVO.setEndDate(endDate);
-        filterOrderVO.setHospitalId(hosptialId);
+        filterFacade.filterOrderVOSet(filterOrderVO);
         List<LevelStatisticsDTO> records = behospitalInfoFacade.levelStatistics(filterOrderVO);
         List<LevelStatisticsDTO> records = behospitalInfoFacade.levelStatistics(filterOrderVO);
         return records;
         return records;
     }
     }
 
 
+    /**
+     * 各科室缺陷占比(组合)-全院-根据内外科系统统计
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public List<LevelStatisticsDTO> levelStatisticsByDeptClass(FilterOrderVO filterOrderVO) {
+        filterFacade.filterOrderVOSet(filterOrderVO);
+        List<LevelStatisticsDTO> records = behospitalInfoFacade.levelStatisticsByDeptClass2(filterOrderVO);
+        return records;
+    }
+
     /**
     /**
      * 病案首页合格率占比
      * 病案首页合格率占比
      *
      *
      * @param filterOrderVO
      * @param filterOrderVO
      * @return
      * @return
      */
      */
-    public List<LevelStatisticsDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO) {
-        String hosptialId = SysUserUtils.getCurrentHospitalID();
-        String startDate = filterFacade.getStartDateStr(filterOrderVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterOrderVO.getType(), null);
-        filterOrderVO.setStartDate(startDate);
-        filterOrderVO.setEndDate(endDate);
-        filterOrderVO.setHospitalId(hosptialId);
-        List<LevelStatisticsDTO> records = behospitalInfoFacade.homePageLevelStatistics(filterOrderVO);
+    public List<HomePageNumDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO) {
+        filterFacade.filterOrderVOSet(filterOrderVO);
+        List<HomePageNumDTO> records = behospitalInfoFacade.homePageLevelStatistics(filterOrderVO);
+        //没有科室过滤时增加全院数据
+        if (StringUtil.isBlank(filterOrderVO.getName()) || filterOrderVO.getName().equals("全院")) {
+            HomePageNumDTO item = getGlobleRecord(records);
+            if (item != null) {
+                records.add(0, item);
+            }
+        }
         return records;
         return records;
     }
     }
 
 
@@ -517,74 +484,123 @@ public class ConsoleFacade {
      * @param filterOrderVO
      * @param filterOrderVO
      * @return
      * @return
      */
      */
-    public List<LevelStatisticsDTO> homePageLevelLimit(FilterOrderVO filterOrderVO) {
+    public List<HomePageNumDTO> homePageLevelLimit(FilterOrderVO filterOrderVO) {
+        filterFacade.filterOrderVOSet(filterOrderVO);
+        List<HomePageNumDTO> records = behospitalInfoFacade.homePageLevelStatistics(filterOrderVO);
+        HomePageNumDTO item = getGlobleRecord(records);
+        if (item != null) {
+            records.add(0, item);
+        }
+        records = records
+                .stream()
+                .limit(filterOrderVO.getLimitCount())
+                .collect(Collectors.toList());
+        return records;
+    }
+
+    /**
+     * 增加全院记录
+     *
+     * @param records
+     * @return
+     */
+    public HomePageNumDTO getGlobleRecord(List<HomePageNumDTO> records) {
         DecimalFormat df = new DecimalFormat("#0.00");
         DecimalFormat df = new DecimalFormat("#0.00");
-        String hosptialId = SysUserUtils.getCurrentHospitalID();
-        String startDate = filterFacade.getStartDateStr(filterOrderVO.getType(), null);
-        String endDate = filterFacade.getEndDateStr(filterOrderVO.getType(), null);
-        filterOrderVO.setStartDate(startDate);
-        filterOrderVO.setEndDate(endDate);
-        filterOrderVO.setHospitalId(hosptialId);
-        if (filterOrderVO.getLimitCount() == null || filterOrderVO.getLimitCount().equals(0)) {
-            filterOrderVO.setLimitCount(10);
+        HomePageNumDTO item = new HomePageNumDTO();
+
+        if (ListUtil.isEmpty(records)) {
+            return null;
         }
         }
-        List<LevelStatisticsDTO> records = behospitalInfoFacade.homePageLevelStatistics(filterOrderVO);
 
 
-        //增加全院
-        LevelStatisticsDTO item = new LevelStatisticsDTO();
+        //总病历数
         Integer mrNum = records
         Integer mrNum = records
                 .stream()
                 .stream()
-                .map(LevelStatisticsDTO::getMrNum)
+                .map(HomePageNumDTO::getMrNum)
                 .reduce(0, Integer::sum);
                 .reduce(0, Integer::sum);
         if (mrNum == null || mrNum == 0) {
         if (mrNum == null || mrNum == 0) {
-            return Lists.newLinkedList();
+            return null;
         }
         }
+        //总缺陷数
         Integer entryNum = records
         Integer entryNum = records
                 .stream()
                 .stream()
-                .map(LevelStatisticsDTO::getEntryNum)
+                .map(HomePageNumDTO::getEntryNum)
                 .reduce(0, Integer::sum);
                 .reduce(0, Integer::sum);
-        Double totleFee = records
+        //总分
+        Double totleValue = records
                 .stream()
                 .stream()
                 .map(i -> BigDecimal.valueOf(i.getTotleValue()))
                 .map(i -> BigDecimal.valueOf(i.getTotleValue()))
                 .reduce(BigDecimal.ZERO, BigDecimal::add)
                 .reduce(BigDecimal.ZERO, BigDecimal::add)
                 .doubleValue();
                 .doubleValue();
-        Double averageFee = BigDecimal.valueOf(totleFee)
+        //平均分
+        Double averageValue = BigDecimal.valueOf(totleValue)
                 .divide(BigDecimal.valueOf(mrNum), 2, RoundingMode.HALF_UP)
                 .divide(BigDecimal.valueOf(mrNum), 2, RoundingMode.HALF_UP)
                 .doubleValue();
                 .doubleValue();
+        //合格病历总数
         Integer firstLevelNum = records
         Integer firstLevelNum = records
                 .stream()
                 .stream()
-                .map(LevelStatisticsDTO::getFirstLevelNum)
+                .map(HomePageNumDTO::getFirstLevelNum)
                 .reduce(0, Integer::sum);
                 .reduce(0, Integer::sum);
+        //合格病历占比
         Double firstLevelPercent = BigDecimal.valueOf(firstLevelNum)
         Double firstLevelPercent = BigDecimal.valueOf(firstLevelNum)
                 .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
                 .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
                 .doubleValue();
                 .doubleValue();
         String firstLevelPercentStr
         String firstLevelPercentStr
                 = df.format(BigDecimal.valueOf(firstLevelPercent).multiply(BigDecimal.valueOf(100))) + "%";
                 = df.format(BigDecimal.valueOf(firstLevelPercent).multiply(BigDecimal.valueOf(100))) + "%";
-        Integer secondLevelNum = mrNum - firstLevelNum;
+        //不合格病历数
+        Integer secondLevelNum = records
+                .stream()
+                .map(HomePageNumDTO::getSecondLevelNum)
+                .reduce(0, Integer::sum);
+        //不合格病历占比
         Double secondLevelPercent = BigDecimal.valueOf(secondLevelNum)
         Double secondLevelPercent = BigDecimal.valueOf(secondLevelNum)
                 .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
                 .divide(BigDecimal.valueOf(mrNum), 4, RoundingMode.HALF_UP)
                 .doubleValue();
                 .doubleValue();
         String secondLevelPercentStr
         String secondLevelPercentStr
                 = df.format(BigDecimal.valueOf(secondLevelPercent).multiply(BigDecimal.valueOf(100))) + "%";
                 = df.format(BigDecimal.valueOf(secondLevelPercent).multiply(BigDecimal.valueOf(100))) + "%";
+        //条目缺陷总数(模块下条目*病历数)
+        Integer entryTotleNum = records
+                .stream()
+                .map(HomePageNumDTO::getEntryTotleNum)
+                .reduce(0, Integer::sum);
+        //空项总数
+        Integer emptyNum = records
+                .stream()
+                .map(HomePageNumDTO::getEmptyNum)
+                .reduce(0, Integer::sum);
+        Double emptyPercent = BigDecimal.valueOf(entryTotleNum - emptyNum)
+                .divide(BigDecimal.valueOf(entryTotleNum), 4, RoundingMode.HALF_UP)
+                .doubleValue();
+        String emptyPercentStr
+                = df.format(BigDecimal.valueOf(emptyPercent).multiply(BigDecimal.valueOf(100))) + "%";
+        //错误项总数
+        Integer errorNum = records
+                .stream()
+                .map(HomePageNumDTO::getErrorNum)
+                .reduce(0, Integer::sum);
+        Double errorPercent = BigDecimal.valueOf(entryTotleNum - errorNum)
+                .divide(BigDecimal.valueOf(entryTotleNum), 4, RoundingMode.HALF_UP)
+                .doubleValue();
+        String errorPercentStr
+                = df.format(BigDecimal.valueOf(errorPercent).multiply(BigDecimal.valueOf(100))) + "%";
+
         item.setDeptName("全院");
         item.setDeptName("全院");
         item.setEntryNum(entryNum);
         item.setEntryNum(entryNum);
         item.setMrNum(mrNum);
         item.setMrNum(mrNum);
-        item.setTotleValue(totleFee);
-        item.setAverageValue(averageFee);
+        item.setTotleValue(totleValue);
+        item.setAverageValue(averageValue);
         item.setFirstLevelNum(firstLevelNum);
         item.setFirstLevelNum(firstLevelNum);
         item.setFirstLevelPercent(firstLevelPercent);
         item.setFirstLevelPercent(firstLevelPercent);
         item.setFirstLevelPercentStr(firstLevelPercentStr);
         item.setFirstLevelPercentStr(firstLevelPercentStr);
         item.setSecondLevelNum(secondLevelNum);
         item.setSecondLevelNum(secondLevelNum);
         item.setSecondLevelPercent(secondLevelPercent);
         item.setSecondLevelPercent(secondLevelPercent);
         item.setSecondLevelPercentStr(secondLevelPercentStr);
         item.setSecondLevelPercentStr(secondLevelPercentStr);
-
-        records.add(0, item);
-
-        records = records
-                .stream()
-                .limit(filterOrderVO.getLimitCount())
-                .collect(Collectors.toList());
-
-        return records;
+        item.setEntryTotleNum(entryTotleNum);
+        item.setEmptyNum(emptyNum);
+        item.setEmptyPercent(emptyPercent);
+        item.setEmptyPercentStr(emptyPercentStr);
+        item.setErrorNum(errorNum);
+        item.setErrorPercent(errorPercent);
+        item.setErrorPercentStr(errorPercentStr);
+        return item;
     }
     }
 }
 }

+ 535 - 0
src/main/java/com/diagbot/facade/DataImportFacade.java

@@ -0,0 +1,535 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.AuthServiceClient;
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.entity.HomePage;
+import com.diagbot.entity.MedCrisisInfo;
+import com.diagbot.entity.MedicalRecord;
+import com.diagbot.entity.MedicalRecordContent;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.BehospitalInfoService;
+import com.diagbot.service.DoctorAdviceService;
+import com.diagbot.service.HomeDiagnoseInfoService;
+import com.diagbot.service.HomeOperationInfoService;
+import com.diagbot.service.HomePageService;
+import com.diagbot.service.MedCrisisInfoService;
+import com.diagbot.service.MedicalRecordContentService;
+import com.diagbot.service.MedicalRecordService;
+import com.diagbot.util.EncrypDES;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.DataImportVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class DataImportFacade {
+
+    @Autowired
+    @Qualifier("behospitalInfoServiceImpl")
+    BehospitalInfoService behospitalInfoService;
+    @Autowired
+    @Qualifier("medCrisisInfoServiceImpl")
+    MedCrisisInfoService medCrisisInfoService;
+    @Autowired
+    @Qualifier("doctorAdviceServiceImpl")
+    DoctorAdviceService doctorAdviceService;
+    @Autowired
+    @Qualifier("homeDiagnoseInfoServiceImpl")
+    HomeDiagnoseInfoService homeDiagnoseInfoService;
+    @Autowired
+    @Qualifier("homePageServiceImpl")
+    HomePageService homePageService;
+    @Autowired
+    @Qualifier("homeOperationInfoServiceImpl")
+    HomeOperationInfoService homeOperationInfoService;
+    @Autowired
+    @Qualifier("medicalRecordServiceImpl")
+    MedicalRecordService medicalRecordService;
+    @Autowired
+    @Qualifier("medicalRecordContentServiceImpl")
+    MedicalRecordContentService medicalRecordContentService;
+    @Autowired
+    AuthServiceClient authServiceClient;
+    @Value("${encrypt.enable}")
+    Boolean encryptFlag;
+
+    /**
+     * 数据导入
+     *
+     * @param dataImportVO
+     * @return
+     */
+    public Boolean dataImportFacade(DataImportVO dataImportVO) {
+        Long hospitalId = dataImportVO.getHospitalId();
+        // 病历信息导入
+        List<BehospitalInfo> behospitalInfoList = dataImportVO.getBehospitalInfoList();
+        if (ListUtil.isNotEmpty(behospitalInfoList)) {
+            List<String> behospitalCodeList = behospitalInfoList.stream().map(r -> r.getBehospitalCode()).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(behospitalCodeList)) {
+                // 先删除
+                behospitalInfoService.remove(new QueryWrapper<BehospitalInfo>()
+                        .eq("hospital_id", hospitalId)
+                        .in("behospital_code", behospitalCodeList)
+                );
+                // 加密
+                for (BehospitalInfo behospitalInfo : behospitalInfoList) {
+                    // 姓名
+                    if (StringUtil.isNotBlank(behospitalInfo.getName())) {
+                        behospitalInfo.setName(behospitalInfo.getName().substring(0, 1) + "**");
+                    }
+                }
+                behospitalInfoService.saveBatch(behospitalInfoList);
+            }
+        }
+
+        // 危急值信息
+        List<MedCrisisInfo> medCrisisInfoList = dataImportVO.getMedCrisisInfoList();
+        if (ListUtil.isNotEmpty(medCrisisInfoList)) {
+            List<String> recIdList = medCrisisInfoList.stream().map(r -> r.getRecId()).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(recIdList)) {
+                // 先删除
+                medCrisisInfoService.remove(new QueryWrapper<MedCrisisInfo>()
+                        .eq("hospital_id", hospitalId)
+                        .in("rec_id", recIdList)
+                );
+                medCrisisInfoService.saveBatch(medCrisisInfoList);
+            }
+        }
+
+        // 病人医嘱
+        List<DoctorAdvice> doctorAdviceList = dataImportVO.getDoctorAdviceList();
+        if (ListUtil.isNotEmpty(doctorAdviceList)) {
+            List<String> doctorAdviceIdList = doctorAdviceList.stream().map(r -> r.getDoctorAdviceId()).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(doctorAdviceIdList)) {
+                // 先删除
+                doctorAdviceService.remove(new QueryWrapper<DoctorAdvice>()
+                        .eq("hospital_id", hospitalId)
+                        .in("doctor_advice_id", doctorAdviceIdList)
+                );
+                doctorAdviceService.saveBatch(doctorAdviceList);
+            }
+        }
+
+        // 病案首页诊断
+        List<HomeDiagnoseInfo> homeDiagnoseInfoList = dataImportVO.getHomeDiagnoseInfoList();
+        if (ListUtil.isNotEmpty(homeDiagnoseInfoList)) {
+            StringBuffer sb = new StringBuffer();
+            sb.append(" ( ");
+            for (int i = 0; i < homeDiagnoseInfoList.size(); i++) {
+                HomeDiagnoseInfo s = homeDiagnoseInfoList.get(i);
+                if (i == 0) {
+                    sb.append(" (home_page_id = '" + s.getHomePageId() + "'"
+                            + " and diagnose_order_no = '" + s.getDiagnoseOrderNo() + "'"
+                            + ") " );
+                } else {
+                    sb.append(" or ( home_page_id = '" + s.getHomePageId() + "'"
+                            + " and diagnose_order_no = '" + s.getDiagnoseOrderNo() + "'"
+                            + ") " );
+                }
+            }
+            sb.append(")");
+
+            // 先删除
+            homeDiagnoseInfoService.remove(new QueryWrapper<HomeDiagnoseInfo>()
+                    .eq("hospital_id", hospitalId)
+                    .apply(sb.toString())
+            );
+            homeDiagnoseInfoService.saveBatch(homeDiagnoseInfoList);
+        }
+
+        // 病案首页
+        List<HomePage> homePageList = dataImportVO.getHomePageList();
+        if (ListUtil.isNotEmpty(homePageList)) {
+            List<String> homePageIdList = homePageList.stream().map(r -> r.getHomePageId()).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(homePageIdList)) {
+                // 先删除
+                homePageService.remove(new QueryWrapper<HomePage>()
+                        .eq("hospital_id", hospitalId)
+                        .in("home_page_id", homePageIdList)
+                );
+                // 加密
+                for (HomePage homePage : dataImportVO.getHomePageList()) {
+                    // 姓名
+                    if (StringUtil.isNotBlank(homePage.getName())) {
+                        homePage.setName(homePage.getName().substring(0, 1) + "**");
+                    }
+                    // 身份证
+                    if (StringUtil.isNotBlank(homePage.getIdentityCardNo())) {
+                        homePage.setIdentityCardNo(homePage.getIdentityCardNo().substring(0, 1) + "*****************");
+                    }
+                    // 现住址电话
+                    if (StringUtil.isNotBlank(homePage.getCurPhone())) {
+                        homePage.setCurPhone(homePage.getCurPhone().substring(0, 1) + "**");
+                    }
+                    // 工作单位电话
+                    if (StringUtil.isNotBlank(homePage.getWorkPhone())) {
+                        homePage.setWorkPhone(homePage.getWorkPhone().substring(0, 1) + "**");
+                    }
+                    // 联系人姓名
+                    if (StringUtil.isNotBlank(homePage.getContactName())) {
+                        homePage.setContactName(homePage.getContactName().substring(0, 1) + "**");
+                    }
+                    // 联系人电话
+                    if (StringUtil.isNotBlank(homePage.getContactPhone())) {
+                        homePage.setContactPhone(homePage.getContactPhone().substring(0, 1) + "**");
+                    }
+                }
+                homePageService.saveBatch(homePageList);
+            }
+        }
+
+        // 病案首页手术信息
+        List<HomeOperationInfo> homeOperationInfoList = dataImportVO.getHomeOperationInfoList();
+        if (ListUtil.isNotEmpty(homeOperationInfoList)) {
+            StringBuffer sb = new StringBuffer();
+            sb.append(" ( ");
+            for (int i = 0; i < homeOperationInfoList.size(); i++) {
+                HomeOperationInfo s = homeOperationInfoList.get(i);
+                if (i == 0) {
+                    sb.append(" (home_page_id = '" + s.getHomePageId() + "'"
+                            + " and operation_order_no = '" + s.getOperationOrderNo() + "'"
+                            + ") " );
+                } else {
+                    sb.append(" or ( home_page_id = '" + s.getHomePageId() + "'"
+                            + " and operation_order_no = '" + s.getOperationOrderNo() + "'"
+                            + ") " );
+                }
+            }
+            sb.append(")");
+            // 先删除
+            homeOperationInfoService.remove(new QueryWrapper<HomeOperationInfo>()
+                    .eq("hospital_id", hospitalId)
+                    .apply(sb.toString())
+            );
+            homeOperationInfoService.saveBatch(homeOperationInfoList);
+        }
+
+        // 文书信息
+        List<MedicalRecord> medicalRecordList = dataImportVO.getMedicalRecordList();
+        if (ListUtil.isNotEmpty(medicalRecordList)) {
+            List<String> recIdList = medicalRecordList.stream().map(r -> r.getRecId()).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(recIdList)) {
+                // 先删除
+                medicalRecordService.remove(new QueryWrapper<MedicalRecord>()
+                        .eq("hospital_id", hospitalId)
+                        .in("rec_id", recIdList)
+                );
+                medicalRecordService.saveBatch(medicalRecordList);
+            }
+        }
+
+        // 文书明细信息
+        List<MedicalRecordContent> medicalRecordContentList = dataImportVO.getMedicalRecordContentList();
+        if (ListUtil.isNotEmpty(medicalRecordContentList)) {
+            List<String> recIdList = medicalRecordContentList.stream().map(r -> r.getRecId()).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(recIdList)) {
+                // 先删除
+                medicalRecordContentService.remove(new QueryWrapper<MedicalRecordContent>()
+                        .eq("hospital_id", hospitalId)
+                        .in("rec_id", recIdList));
+
+                // 加密数据
+                if (encryptFlag) {
+                    String recId = "";
+                    try {
+                        EncrypDES encrypDES = new EncrypDES();
+                        for (MedicalRecordContent medicalRecordContent : medicalRecordContentList) {
+                            recId = medicalRecordContent.getRecId();
+                            if (StringUtil.isNotBlank(medicalRecordContent.getXmlText())) {
+                                medicalRecordContent.setXmlText(encrypDES.encrytor(medicalRecordContent.getXmlText()));
+                            }
+                        }
+                    } catch (Exception e) {
+                        throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "加密xml错误!recId=【" + recId + "】");
+                    }
+                }
+                medicalRecordContentService.saveBatch(medicalRecordContentList, 100);
+            }
+        }
+        return true;
+    }
+
+
+    /**
+     * 数据导入【效率低,备用】
+     *
+     * @param dataImportVO
+     * @return
+     */
+    public Boolean dataImportPrepareFacade(DataImportVO dataImportVO) {
+        Long hospitalId = dataImportVO.getHospitalId();
+        // 病历信息导入
+        List<BehospitalInfo> behospitalInfoList = dataImportVO.getBehospitalInfoList();
+        if (ListUtil.isNotEmpty(behospitalInfoList)) {
+            behospitalInfoList.forEach(s -> {
+                QueryWrapper<BehospitalInfo> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("behospital_code", s.getBehospitalCode());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("is_deleted", IsDeleteEnum.N);
+                // 姓名加密
+                if (StringUtil.isNotBlank(s.getName())) {
+                    s.setName(s.getName().substring(0, 1) + "**");
+                }
+                int count = behospitalInfoService.count(queryWrapper);
+                if (count > 0) {
+                    behospitalInfoService.update(s, queryWrapper);
+                } else {
+                    behospitalInfoService.save(s);
+                }
+            });
+        }
+
+        // 危急值信息
+        List<MedCrisisInfo> medCrisisInfoList = dataImportVO.getMedCrisisInfoList();
+        if (ListUtil.isNotEmpty(medCrisisInfoList)) {
+            medCrisisInfoList.forEach(s -> {
+                QueryWrapper<MedCrisisInfo> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("rec_id", s.getRecId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("behospital_code", s.getBehospitalCode());
+                queryWrapper.eq("rec_type", s.getRecType());
+                int count = medCrisisInfoService.count(queryWrapper);
+                if (count > 0) {
+                    medCrisisInfoService.update(s, queryWrapper);
+                } else {
+                    medCrisisInfoService.save(s);
+                }
+            });
+        }
+
+        // 病人医嘱
+        List<DoctorAdvice> doctorAdviceList = dataImportVO.getDoctorAdviceList();
+        if (ListUtil.isNotEmpty(doctorAdviceList)) {
+            doctorAdviceList.forEach(s -> {
+                QueryWrapper<DoctorAdvice> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("doctor_advice_id", s.getDoctorAdviceId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("is_deleted",IsDeleteEnum.N);
+                int count = doctorAdviceService.count(queryWrapper);
+                if (count > 0) {
+                    doctorAdviceService.update(s, queryWrapper);
+                } else {
+                    doctorAdviceService.save(s);
+                }
+            });
+        }
+
+        // 病案首页诊断
+        List<HomeDiagnoseInfo> homeDiagnoseInfoList = dataImportVO.getHomeDiagnoseInfoList();
+        if (ListUtil.isNotEmpty(homeDiagnoseInfoList)) {
+            homeDiagnoseInfoList.forEach(s -> {
+                QueryWrapper<HomeDiagnoseInfo> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("home_page_id", s.getHomePageId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("diagnose_order_no", s.getDiagnoseOrderNo());
+                int count = homeDiagnoseInfoService.count(queryWrapper);
+                if (count > 0) {
+                    homeDiagnoseInfoService.update(s, queryWrapper);
+                } else {
+                    homeDiagnoseInfoService.save(s);
+                }
+            });
+        }
+
+        // 病案首页
+        List<HomePage> homePageList = dataImportVO.getHomePageList();
+        if (ListUtil.isNotEmpty(homePageList)) {
+            homePageList.stream().forEach(s -> {
+                // 姓名
+                if (StringUtil.isNotBlank(s.getName())) {
+                    s.setName(s.getName().substring(0, 1) + "**");
+                }
+                // 身份证
+                if (StringUtil.isNotBlank(s.getIdentityCardNo())) {
+                    s.setIdentityCardNo(s.getIdentityCardNo().substring(0, 1) + "*****************");
+                }
+                // 现住址电话
+                if (StringUtil.isNotBlank(s.getCurPhone())) {
+                    s.setCurPhone(s.getCurPhone().substring(0, 1) + "**");
+                }
+                // 工作单位电话
+                if (StringUtil.isNotBlank(s.getWorkPhone())) {
+                    s.setWorkPhone(s.getWorkPhone().substring(0, 1) + "**");
+                }
+                // 联系人姓名
+                if (StringUtil.isNotBlank(s.getContactName())) {
+                    s.setContactName(s.getContactName().substring(0, 1) + "**");
+                }
+                // 联系人电话
+                if (StringUtil.isNotBlank(s.getContactPhone())) {
+                    s.setContactPhone(s.getContactPhone().substring(0, 1) + "**");
+                }
+
+                QueryWrapper<HomePage> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("home_page_id", s.getHomePageId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("behospital_code", s.getBehospitalCode());
+                queryWrapper.eq("is_deleted",IsDeleteEnum.N);
+                int count = homePageService.count(queryWrapper);
+                if (count > 0) {
+                    homePageService.update(s, queryWrapper);
+                } else {
+                    homePageService.save(s);
+                }
+            });
+        }
+
+        // 病案首页手术信息
+        List<HomeOperationInfo> homeOperationInfoList = dataImportVO.getHomeOperationInfoList();
+        if (ListUtil.isNotEmpty(homeOperationInfoList)) {
+            homeOperationInfoList.forEach(s -> {
+                if(s.getHomePageId()!=null && !"".equals(s.getOperationOrderNo())) {
+                    QueryWrapper<HomeOperationInfo> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("home_page_id", s.getHomePageId());
+                    queryWrapper.eq("hospital_id", s.getHospitalId());
+                    queryWrapper.eq("operation_order_no", s.getOperationOrderNo());
+                    int count = homeOperationInfoService.count(queryWrapper);
+                    if (count > 0) {
+                        homeOperationInfoService.update(s, queryWrapper);
+                    } else {
+                        homeOperationInfoService.save(s);
+                    }
+                }
+            });
+        }
+
+        // 文书信息
+        List<MedicalRecord> medicalRecordList = dataImportVO.getMedicalRecordList();
+        if (ListUtil.isNotEmpty(medicalRecordList)) {
+            medicalRecordList.forEach(s -> {
+                QueryWrapper<MedicalRecord> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("rec_id", s.getRecId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                queryWrapper.eq("is_deleted",IsDeleteEnum.N);
+                int count = medicalRecordService.count(queryWrapper);
+                if (count > 0) {
+                    medicalRecordService.update(s, queryWrapper);
+                } else {
+                    medicalRecordService.save(s);
+                }
+            });
+        }
+
+        // 文书明细信息
+        List<MedicalRecordContent> medicalRecordContentList = dataImportVO.getMedicalRecordContentList();
+        if (ListUtil.isNotEmpty(medicalRecordContentList)) {
+            // 加密数据
+            if (encryptFlag) {
+                String recId = "";
+                try {
+                    EncrypDES encrypDES = new EncrypDES();
+                    for (MedicalRecordContent s : medicalRecordContentList) {
+                        recId = s.getRecId();
+                        if (StringUtil.isNotBlank(s.getXmlText())) {
+                            s.setXmlText(encrypDES.encrytor(s.getXmlText()));
+                        }
+                        QueryWrapper<MedicalRecordContent> queryWrapper = new QueryWrapper<>();
+                        queryWrapper.eq("rec_id", s.getRecId());
+                        queryWrapper.eq("hospital_id", s.getHospitalId());
+                        queryWrapper.eq("is_deleted",IsDeleteEnum.N);
+                        int count = medicalRecordContentService.count(queryWrapper);
+                        if (count > 0) {
+                            medicalRecordContentService.update(s, queryWrapper);
+                        } else {
+                            medicalRecordContentService.save(s);
+                        }
+                    }
+                } catch (Exception e) {
+                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "加密xml错误!recId=【" + recId + "】");
+                }
+            }
+        }
+        return true;
+    }
+
+
+    /**
+     * 模拟测试数据
+     *
+     * @return
+     */
+    public Boolean test() {
+        int size = 5;
+        Long hospitalId = 8L;
+        int random = (int)(Math.random() * 100);
+
+        DataImportVO dataImportVO = new DataImportVO();
+        dataImportVO.setHospitalId(hospitalId);
+
+        // // 病历信息
+        // List<BehospitalInfo> behospitalInfoList = behospitalInfoService.list(new QueryWrapper<BehospitalInfo>()
+        //         .ne("hospital_id", hospitalId)
+        //         .last(" limit " + size)
+        // );
+        // behospitalInfoList.forEach(r -> { r.setHospitalId(hospitalId); r.setBehospitalCode(r.getBehospitalCode() + random); });
+        // dataImportVO.setBehospitalInfoList(behospitalInfoList);
+        //
+        // // 医嘱信息
+        // List<DoctorAdvice> doctorAdviceList = doctorAdviceService.list(new QueryWrapper<DoctorAdvice>()
+        //         .ne("hospital_id", hospitalId)
+        //         .last(" limit " + size)
+        // );
+        // doctorAdviceList.forEach(r -> {r.setHospitalId(hospitalId); r.setBehospitalCode(r.getBehospitalCode() + random);});
+        // dataImportVO.setDoctorAdviceList(doctorAdviceList);
+        //
+        // // 病案首页诊断
+        // List<HomeDiagnoseInfo> homeDiagnoseInfoList = homeDiagnoseInfoService.list(new QueryWrapper<HomeDiagnoseInfo>()
+        //         .ne("hospital_id", hospitalId)
+        //         .last(" limit " + size)
+        // );
+        // homeDiagnoseInfoList.forEach(r -> {r.setHospitalId(hospitalId); r.setHomePageId(r.getHomePageId() + random);});
+        // dataImportVO.setHomeDiagnoseInfoList(homeDiagnoseInfoList);
+        //
+        // // 病案首页
+        // List<HomePage> homePageList = homePageService.list(new QueryWrapper<HomePage>()
+        //         .ne("hospital_id", hospitalId)
+        //         .last(" limit " + size)
+        // );
+        // homePageList.forEach(r -> {r.setHospitalId(hospitalId); r.setBehospitalCode(r.getBehospitalCode() + random);});
+        // dataImportVO.setHomePageList(homePageList);
+
+        // // 病案首页手术信息
+        // List<HomeOperationInfo> homeOperationInfoList = homeOperationInfoService.list(new QueryWrapper<HomeOperationInfo>()
+        //         .eq("hospital_id", hospitalId)
+        //         .last(" limit " + size)
+        // );
+        // homeOperationInfoList.forEach(r -> {r.setHospitalId(hospitalId); r.setHomePageId(r.getHomePageId() );});
+        // dataImportVO.setHomeOperationInfoList(homeOperationInfoList);
+        //
+        // // 文书信息
+        // List<MedicalRecord> medicalRecordList = medicalRecordService.list(new QueryWrapper<MedicalRecord>()
+        //         .ne("hospital_id", hospitalId)
+        //         .last(" limit " + size)
+        // );
+        // medicalRecordList.forEach(r -> {r.setHospitalId(hospitalId); r.setBehospitalCode(r.getBehospitalCode() + random);});
+        // dataImportVO.setMedicalRecordList(medicalRecordList);
+
+        // // 文书明细信息
+        // List<MedicalRecordContent> medicalRecordContentList = medicalRecordContentService.list(new QueryWrapper<MedicalRecordContent>()
+        //         .ne("hospital_id", hospitalId)
+        //         .last(" limit " + size)
+        // );
+        // medicalRecordContentList.forEach(r -> {r.setHospitalId(hospitalId); r.setRecId(r.getRecId() + random);});
+        // dataImportVO.setMedicalRecordContentList(medicalRecordContentList);
+
+        authServiceClient.dataimport(dataImportVO);
+        return true;
+    }
+}

+ 150 - 1
src/main/java/com/diagbot/facade/FilterFacade.java

@@ -1,8 +1,19 @@
 package com.diagbot.facade;
 package com.diagbot.facade;
 
 
+import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.FilterOrderByDeptVO;
+import com.diagbot.vo.FilterOrderVO;
+import com.diagbot.vo.FilterPageByAverageVO;
+import com.diagbot.vo.FilterPageByDeptVO;
+import com.diagbot.vo.FilterPageVO;
+import com.diagbot.vo.FilterVO;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Date;
 
 
 /**
 /**
@@ -91,4 +102,142 @@ public class FilterFacade {
         //上一统计周期的截止时间等于本周期的起始时间
         //上一统计周期的截止时间等于本周期的起始时间
         return getStartDateStr(type, null);
         return getStartDateStr(type, null);
     }
     }
-}
+
+    /**
+     * 入参拼接
+     *
+     * @param filterVO
+     */
+    public void filterVOSet(FilterVO filterVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        filterVO.setHospitalId(hospitalId);
+        filterVO.setUserId(Long.valueOf(userId));
+        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
+            filterVO.setLimitCount(10);
+        }
+
+        if (StringUtil.isBlank(filterVO.getStartDate())) {
+            String startDate = getStartDateStr(filterVO.getType(), null);
+            filterVO.setStartDate(startDate);
+        }
+        if (StringUtil.isBlank(filterVO.getEndDate())) {
+            String endDate = getEndDateStr(filterVO.getType(), null);
+            filterVO.setEndDate(endDate);
+        } else {
+            try {
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Date date = dateFormat.parse(filterVO.getEndDate());
+                long interval = date.getTime() + 1000;
+                filterVO.setEndDate(dateFormat.format(new Date(Long.valueOf(interval))));
+            } catch (ParseException e) {
+
+            }
+        }
+    }
+
+    /**
+     * 分页入参拼接
+     *
+     * @param filterPageVO
+     */
+    public void filterPageVOSet(FilterPageVO filterPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        filterPageVO.setHospitalId(hospitalId);
+        filterPageVO.setUserId(Long.valueOf(userId));
+        String startDate = "";
+        String endDate = "";
+        if (StringUtil.isBlank(filterPageVO.getStartDate())) {
+            startDate = getStartDateStr(filterPageVO.getType(), null);
+            filterPageVO.setStartDate(startDate);
+        }
+        if (StringUtil.isBlank(filterPageVO.getEndDate())) {
+            endDate = getEndDateStr(filterPageVO.getType(), null);
+            filterPageVO.setEndDate(endDate);
+        } else {
+            try {
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Date date = dateFormat.parse(filterPageVO.getEndDate());
+                long interval = date.getTime() + 1000;
+                filterPageVO.setEndDate(dateFormat.format(new Date(Long.valueOf(interval))));
+            } catch (ParseException e) {
+
+            }
+        }
+    }
+
+
+    /**
+     * 过滤条件设置
+     *
+     * @param filterPageByDeptVO
+     */
+    public void filterPageByDeptVOSet(FilterPageByDeptVO filterPageByDeptVO) {
+        FilterPageVO filterPageVO = new FilterPageVO();
+        BeanUtil.copyProperties(filterPageByDeptVO, filterPageVO);
+        filterPageVOSet(filterPageVO);
+        filterPageByDeptVO.setHospitalId(filterPageVO.getHospitalId());
+        filterPageByDeptVO.setUserId(filterPageVO.getUserId());
+        filterPageByDeptVO.setStartDate(filterPageVO.getStartDate());
+        filterPageByDeptVO.setEndDate(filterPageVO.getEndDate());
+    }
+
+    /**
+     * 过滤条件设置
+     *
+     * @param filterOrderVO
+     */
+    public void filterOrderVOSet(FilterOrderVO filterOrderVO) {
+        FilterVO filterVO = new FilterVO();
+        BeanUtil.copyProperties(filterOrderVO, filterVO);
+        filterVOSet(filterVO);
+        filterOrderVO.setHospitalId(filterVO.getHospitalId());
+        filterOrderVO.setUserId(filterVO.getUserId());
+        filterOrderVO.setStartDate(filterVO.getStartDate());
+        filterOrderVO.setEndDate(filterVO.getEndDate());
+        filterOrderVO.setLimitCount(filterVO.getLimitCount());
+    }
+
+    /**
+     * 过滤条件设置
+     *
+     * @param filterOrderByDeptVO
+     */
+    public void filterOrderByDeptVOSet(FilterOrderByDeptVO filterOrderByDeptVO) {
+        FilterVO filterVO = new FilterVO();
+        BeanUtil.copyProperties(filterOrderByDeptVO, filterVO);
+        filterVOSet(filterVO);
+        filterOrderByDeptVO.setHospitalId(filterVO.getHospitalId());
+        filterOrderByDeptVO.setUserId(filterVO.getUserId());
+        filterOrderByDeptVO.setStartDate(filterVO.getStartDate());
+        filterOrderByDeptVO.setEndDate(filterVO.getEndDate());
+        filterOrderByDeptVO.setLimitCount(filterVO.getLimitCount());
+    }
+
+    /**
+     * 平均住院天数、平均花费入参设置
+     *
+     * @param filterPageByAverageVO
+     */
+    public void filterPageByAverageVOSet(FilterPageByAverageVO filterPageByAverageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date date = new Date();
+        String year = DateUtil.getYear(date);
+        String startDate = getStartDateStr(filterPageByAverageVO.getType(), null);
+        String endDate = getEndDateStr(filterPageByAverageVO.getType(), null);
+        String lastStartDate = getLastStartDateStr(filterPageByAverageVO.getType());
+        String lastEndDate = getLastEndDateStr(filterPageByAverageVO.getType());
+        String lastYearStartDate = getStartDateStr(filterPageByAverageVO.getType(), Integer.valueOf(year) - 1);
+        String lastYearEndDate = getEndDateStr(filterPageByAverageVO.getType(), Integer.valueOf(year) - 1);
+        filterPageByAverageVO.setHospitalId(hospitalId);
+        filterPageByAverageVO.setUserId(Long.valueOf(userId));
+        filterPageByAverageVO.setStartDate(startDate);
+        filterPageByAverageVO.setEndDate(endDate);
+        filterPageByAverageVO.setLastStartDate(lastStartDate);
+        filterPageByAverageVO.setLastEndDate(lastEndDate);
+        filterPageByAverageVO.setLastYearStartDate(lastYearStartDate);
+        filterPageByAverageVO.setLastYearEndDate(lastYearEndDate);
+    }
+}

+ 33 - 40
src/main/java/com/diagbot/facade/ModelHospitalFacade.java

@@ -33,6 +33,8 @@ public class ModelHospitalFacade extends ModelHospitalServiceImpl {
     ModelHospitalService modelHospitalService;
     ModelHospitalService modelHospitalService;
     @Autowired
     @Autowired
     MedicalRecordFacade medicalRecordFacade;
     MedicalRecordFacade medicalRecordFacade;
+    @Autowired
+    QcAbnormalFacade qcAbnormalFacade;
 
 
     /**
     /**
      *
      *
@@ -62,51 +64,42 @@ public class ModelHospitalFacade extends ModelHospitalServiceImpl {
         return  modelHospitalData;
         return  modelHospitalData;
     }
     }
 
 
+    /**
+     * 先查询qc_model_hospital表, 把该医院数据模块的数据全删, 在重新添加,更新med_medical_record
+     * 得到的qc_model_hospital的id更新到med_medical_record表的modeId,再把qc_abnormal的状态更行。
+     * @param modelHospitalUpdataVO
+     * @return
+     */
     public Boolean updataModelHospitals(ModelHospitalUpdataVO modelHospitalUpdataVO) {
     public Boolean updataModelHospitals(ModelHospitalUpdataVO modelHospitalUpdataVO) {
+        //把该医院数据模块的数据全删
         QueryWrapper<ModelHospital> queryModelHospital = new QueryWrapper<>();
         QueryWrapper<ModelHospital> queryModelHospital = new QueryWrapper<>();
         queryModelHospital.eq("is_deleted", IsDeleteEnum.N.getKey())
         queryModelHospital.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .ne("id",modelHospitalUpdataVO.getId()==null? -1:modelHospitalUpdataVO.getId())
-                .eq("hospital_model_name",modelHospitalUpdataVO.getHospitalModelName());
-        int sum = modelHospitalService.count(queryModelHospital);
-        if(sum != 0){
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该名称已存在");
-        }
-        boolean res= false;
-        QueryWrapper<ModelHospital> modelHospitalQuery = new QueryWrapper<>();
-        modelHospitalQuery.eq("id",modelHospitalUpdataVO.getId())
-                .eq("is_deleted", IsDeleteEnum.N.getKey());
-        ModelHospital data = modelHospitalService.getOne(modelHospitalQuery);
+                .eq("hospital_id", modelHospitalUpdataVO.getHospitalId())
+                .ne("id", modelHospitalUpdataVO.getId() == null ? -1 : modelHospitalUpdataVO.getId())
+                .eq("hospital_model_name", modelHospitalUpdataVO.getHospitalModelName());
+        modelHospitalService.remove(queryModelHospital);
+
+        boolean res = false;
         Date date = DateUtil.now();
         Date date = DateUtil.now();
-        if(data!=null){
-            ModelHospital modelHospitals  = new ModelHospital();
-            BeanUtil.copyProperties(modelHospitalUpdataVO,modelHospitals);
-            modelHospitals.setGmtModified(date);
-            res = modelHospitalService.updateById(modelHospitals);
-            if(res) {
-                UpdateWrapper<MedicalRecord> medicalRecordData = new UpdateWrapper<>();
-                medicalRecordData.eq("rec_title", modelHospitalUpdataVO.getHospitalModelName())
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", modelHospitalUpdataVO.getHospitalId())
-                        .set("mode_id", modelHospitals.getId())
-                        .set("gmt_create",date);
-                medicalRecordFacade.update(medicalRecordData);
-            }
-        }else {
-            ModelHospital modelHospitalDatas = new ModelHospital();
-            BeanUtil.copyProperties(modelHospitalUpdataVO,modelHospitalDatas);
-            modelHospitalDatas.setGmtCreate(date);
-            modelHospitalDatas.setGmtModified(date);
-            res= modelHospitalService.save(modelHospitalDatas);
-            if(res) {
-                UpdateWrapper<MedicalRecord> medicalRecordData = new UpdateWrapper<>();
-                medicalRecordData.eq("rec_title", modelHospitalUpdataVO.getHospitalModelName())
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", modelHospitalUpdataVO.getHospitalId())
-                        .set("mode_id", modelHospitalDatas.getId())
-                        .set("gmt_create",date);
-                medicalRecordFacade.update(medicalRecordData);
-            }
+        //保存数据
+        ModelHospital modelHospitalDatas = new ModelHospital();
+        BeanUtil.copyProperties(modelHospitalUpdataVO, modelHospitalDatas);
+        modelHospitalDatas.setGmtCreate(date);
+        modelHospitalDatas.setGmtModified(date);
+        res = modelHospitalService.save(modelHospitalDatas);
+        if (res) {
+            UpdateWrapper<MedicalRecord> medicalRecordData = new UpdateWrapper<>();
+            medicalRecordData.eq("rec_title", modelHospitalUpdataVO.getHospitalModelName())
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("hospital_id", modelHospitalUpdataVO.getHospitalId())
+                    .set("mode_id", modelHospitalDatas.getId())
+                    .set("gmt_modified", date);
+            //更新med_medical_record表的modeId
+            medicalRecordFacade.update(medicalRecordData);
+            //更新异常数据状态
+            qcAbnormalFacade.saveQcAnnormalNameAll(modelHospitalUpdataVO.getQcAbnormalName());
         }
         }
+        /* }*/
 
 
         return res;
         return res;
     }
     }

+ 60 - 0
src/main/java/com/diagbot/facade/QcAbnormalFacade.java

@@ -1,19 +1,27 @@
 package com.diagbot.facade;
 package com.diagbot.facade;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.QcAbnormalDTO;
 import com.diagbot.dto.QcAbnormalDTO;
+import com.diagbot.dto.QcAbnormalModeDTO;
+import com.diagbot.dto.QcModeAllDTO;
+import com.diagbot.entity.ModelHospital;
 import com.diagbot.entity.QcAbnormal;
 import com.diagbot.entity.QcAbnormal;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.QcAbnormalServiceImpl;
 import com.diagbot.service.impl.QcAbnormalServiceImpl;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.QcAbnormalDelVO;
 import com.diagbot.vo.QcAbnormalDelVO;
+import com.diagbot.vo.QcAbnormalModeVO;
+import com.diagbot.vo.QcAbnormalSaveNameVO;
 import com.diagbot.vo.QcAbnormalSaveVO;
 import com.diagbot.vo.QcAbnormalSaveVO;
 import com.diagbot.vo.QcAbnormalVO;
 import com.diagbot.vo.QcAbnormalVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
+import java.util.List;
+
 /**
 /**
  * @Description:
  * @Description:
  * @author: gaodm
  * @author: gaodm
@@ -24,6 +32,10 @@ public class QcAbnormalFacade extends QcAbnormalServiceImpl {
 
 
     @Autowired
     @Autowired
     private FilterFacade filterFacade;
     private FilterFacade filterFacade;
+    @Autowired
+    QcModeFacade qcModeFacade;
+    @Autowired
+    ModelHospitalFacade modelHospitalFacade;
     /**
     /**
      * 查询异常数据监控信息
      * 查询异常数据监控信息
      *
      *
@@ -73,4 +85,52 @@ public class QcAbnormalFacade extends QcAbnormalServiceImpl {
                 .set("modifier", SysUserUtils.getCurrentPrincipleID())
                 .set("modifier", SysUserUtils.getCurrentPrincipleID())
         );
         );
     }
     }
+    /**
+     * 根据异常异常描述和异常类型 更新所有异常异常描一样的数据。
+     *
+     * @param qcAbnormalSaveNameVO 异常数据监控信息更新参数
+     * @return 是否成功
+     */
+    public Boolean saveQcAnnormalNameAll(QcAbnormalSaveNameVO qcAbnormalSaveNameVO) {
+
+        boolean res = false;
+            res = this.update(new UpdateWrapper<QcAbnormal>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                    .eq("type", 1)//异常类型(1:数据模块 2:质控类型 3:XML结构)
+                    .eq("description", qcAbnormalSaveNameVO.getDescription())
+                    .set("status", qcAbnormalSaveNameVO.getStatus())
+                    .set("gmt_modified", DateUtil.now())
+                    .set("modifier", SysUserUtils.getCurrentPrincipleID())
+            );
+            //最后更新备注
+            res = this.update(new UpdateWrapper<QcAbnormal>()
+                    .eq("id", qcAbnormalSaveNameVO.getId())
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .set("remark", qcAbnormalSaveNameVO.getRemark())
+            );
+        return res;
+    }
+
+
+    public QcAbnormalModeDTO getQcAnnormalMode(QcAbnormalModeVO qcAbnormalModeVO) {
+        QcAbnormalModeDTO data = new QcAbnormalModeDTO();
+
+        QueryWrapper<ModelHospital> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                .eq("hospital_model_name", qcAbnormalModeVO.getDescription());
+        ModelHospital modeHospital = modelHospitalFacade.getOne(queryWrapper);
+        List<QcModeAllDTO> dataMode = qcModeFacade.getModeAll();
+        data.setQcModeDatas(dataMode);
+        data.setDescription(qcAbnormalModeVO.getDescription());
+        if(modeHospital==null){
+            data.setModeId(0L);
+            data.setModeMame("");
+        }else {
+            data.setModeId(modeHospital.getStandModelId());
+            data.setModeMame(modeHospital.getStandModelName());
+        }
+        return data;
+    }
 }
 }

+ 1 - 1
src/main/java/com/diagbot/facade/QcModeFacade.java

@@ -36,7 +36,7 @@ public class QcModeFacade extends QcModeServiceImpl {
 
 
         for (int i = 0; i < qcModeList.size(); i++) {
         for (int i = 0; i < qcModeList.size(); i++) {
             String key = qcModeList.get(i).getName();
             String key = qcModeList.get(i).getName();
-            if (!pageData.containsKey(qcModeList.get(i).getName()) && !"病程信息".equals(key)) {
+            if (!pageData.containsKey(key) && !"病程信息".equals(key)) {
                 qcModeList.remove(i--);
                 qcModeList.remove(i--);
             }
             }
         }
         }

+ 11 - 0
src/main/java/com/diagbot/facade/QcTypeCasesEntryFacade.java

@@ -0,0 +1,11 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.QcTypeCasesEntryServiceImpl;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/5/26 16:20
+ */
+public class QcTypeCasesEntryFacade extends QcTypeCasesEntryServiceImpl {
+}

+ 237 - 10
src/main/java/com/diagbot/facade/QcTypeFacade.java

@@ -1,21 +1,248 @@
 package com.diagbot.facade;
 package com.diagbot.facade;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.diagbot.MrqcSysApplication;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcCasesEntrySimpleDTO;
+import com.diagbot.dto.QcTypeDTO;
+import com.diagbot.dto.QcTypePageDTO;
+import com.diagbot.entity.CommonParam;
 import com.diagbot.entity.QcType;
 import com.diagbot.entity.QcType;
+import com.diagbot.entity.QcTypeCasesEntry;
+import com.diagbot.enums.InsertOrUpdateEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.QcTypeCasesEntryServiceImpl;
 import com.diagbot.service.impl.QcTypeServiceImpl;
 import com.diagbot.service.impl.QcTypeServiceImpl;
-import org.springframework.boot.SpringApplication;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.DeleteQcTypeVO;
+import com.diagbot.vo.QcEntryHospitalVO;
+import com.diagbot.vo.QcTypeCasesEntryVO;
+import com.diagbot.vo.QcTypeIndexVO;
+import com.diagbot.vo.QcTypePageVO;
+import com.diagbot.vo.QcTypeSaveVO;
+import com.diagbot.vo.QcTypeVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
 
 
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
 @Component
 @Component
 public class QcTypeFacade extends QcTypeServiceImpl {
 public class QcTypeFacade extends QcTypeServiceImpl {
 
 
-    public Long saveT(QcType qcType){
-        this.baseMapper.insert(qcType);
-        QueryWrapper<QcType> qWrapper =new QueryWrapper<>();
-        qWrapper.eq("name",qcType.getName());
-        qWrapper.eq("hospital_id", qcType.getHospitalId());
-        QcType entity=this.baseMapper.selectOne(qWrapper);
-        return entity.getId();
+
+    @Autowired
+    @Qualifier("qcTypeCasesEntryServiceImpl")
+    QcTypeCasesEntryServiceImpl qcTypeCasesEntryService;
+    @Autowired
+    QcCasesEntryFacade qcCasesEntryFacade;
+
+    /**
+     * 保存
+     *
+     * @param qcTypeSaveVO
+     */
+    public void saveOrUpdate(QcTypeSaveVO qcTypeSaveVO) {
+        CommonParam param = initCommonParam();
+        qcTypeSaveVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        // 保存主表
+        saveQcType(qcTypeSaveVO, param);
+        // 保存质控类型和质控条目映射关系
+        saveQcTypeCasesEntry(qcTypeSaveVO, param);
+    }
+
+    /**
+     * 初始化参数
+     *
+     * @return
+     */
+    public CommonParam initCommonParam() {
+        CommonParam param = new CommonParam();
+        String person = SysUserUtils.getCurrentPrincipleID();
+        param.setNow(DateUtil.now());
+        param.setPerson(person);
+        param.setInsertOrUpdate(InsertOrUpdateEnum.Insert.getKey());
+        return param;
+    }
+
+    /**
+     * 保存映射关系
+     *
+     * @param qcTypeSaveVO
+     * @param param
+     */
+    public void saveQcTypeCasesEntry(QcTypeSaveVO qcTypeSaveVO, CommonParam param) {
+        Date now = param.getNow();
+        String person = param.getPerson();
+        // 先删除原明细(物理删除)
+        qcTypeCasesEntryService.remove(new QueryWrapper<QcTypeCasesEntry>()
+                .eq("type_id", qcTypeSaveVO.getId())
+        );
+        // 再插入新明细
+        List<QcTypeCasesEntryVO> qcTypeCasesEntryVOList = qcTypeSaveVO.getQcTypeCasesEntryVOList();
+        if (ListUtil.isNotEmpty(qcTypeCasesEntryVOList)) {
+            List<QcTypeCasesEntry> saveQcTypeCasesEntry = new ArrayList<>();
+            for (QcTypeCasesEntryVO mapping : qcTypeCasesEntryVOList) {
+                QcTypeCasesEntry bean = new QcTypeCasesEntry();
+                bean.setCaseEntryId(mapping.getCaseEntryId());
+                bean.setCreator(person);
+                bean.setGmtCreate(now);
+                bean.setModifier(person);
+                bean.setGmtModified(now);
+                bean.setTypeId(qcTypeSaveVO.getId());
+                saveQcTypeCasesEntry.add(bean);
+            }
+            qcTypeCasesEntryService.saveBatch(saveQcTypeCasesEntry);
+        }
+    }
+
+    /**
+     * 保存主表
+     *
+     * @param qcTypeSaveVO
+     * @param param
+     */
+    public void saveQcType(QcTypeSaveVO qcTypeSaveVO, CommonParam param) {
+        QcType qcType = new QcType();
+        Long id = qcTypeSaveVO.getId();
+
+        // 保存主表
+        if (qcTypeSaveVO.getId() != null) {
+            qcType = this.getOne(new QueryWrapper<QcType>()
+                    .eq("id", id)
+                    .eq("hospital_id", qcTypeSaveVO.getHospitalId())
+                    .eq("is_deleted", IsDeleteEnum.N.getKey()), false);
+            if (qcType == null) { //校验
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前质控类型不存在【id=" + id + "】");
+            }
+            param.setInsertOrUpdate(InsertOrUpdateEnum.Update.getKey());
+        }
+        BeanUtil.copyProperties(qcTypeSaveVO, qcType);
+        Integer count = this.count(new QueryWrapper<QcType>()
+                .eq("name", qcTypeSaveVO.getName())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", qcTypeSaveVO.getHospitalId())
+                .ne("id", id == null ? -1 : id));
+        // 质控类型hospitalId、name唯一
+        if (count > 0) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "质控类型已存在");
+        }
+        if (InsertOrUpdateEnum.Insert.getKey() == param.getInsertOrUpdate()) {
+            qcType.setCreator(param.getPerson()); //创建人
+            qcType.setGmtCreate(param.getNow());//创建时间
+        }
+        qcType.setGmtModified(param.getNow());//修改时间
+        qcType.setModifier(param.getPerson());//修改人
+        this.saveOrUpdate(qcType);
+        qcTypeSaveVO.setId(qcType.getId());
+    }
+
+    /**
+     * 标签列表
+     *
+     * @param qcTypePageVO
+     * @return
+     */
+    public IPage<QcTypePageDTO> getListFac(QcTypePageVO qcTypePageVO) {
+        qcTypePageVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        IPage<QcTypePageDTO> res = this.getList(qcTypePageVO);
+        return res;
+    }
+
+    /**
+     * 新增时质控条目分组信息
+     *
+     * @param qcEntryHospitalVO
+     * @return
+     */
+    public Map<String, List<QcCasesEntrySimpleDTO>> getEntryByHospital(@RequestBody QcEntryHospitalVO qcEntryHospitalVO) {
+        qcEntryHospitalVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        List<QcCasesEntrySimpleDTO> qcCasesEntrySimpleDTOList = qcCasesEntryFacade.getEntryByHospital(qcEntryHospitalVO);
+        return EntityUtil.makeEntityListMap(qcCasesEntrySimpleDTOList, "modeName");
     }
     }
-}
+
+    /**
+     * 检索
+     *
+     * @param qcTypeIndexVO
+     * @return
+     */
+    public List<QcCasesEntrySimpleDTO> indexFac(QcTypeIndexVO qcTypeIndexVO) {
+        qcTypeIndexVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        List<QcCasesEntrySimpleDTO> res = qcCasesEntryFacade.index(qcTypeIndexVO);
+        return res;
+    }
+
+    /**
+     * 根据参数返回质控类型内容
+     *
+     * @param qcTypeVO 获取质控类型内容参数
+     * @return 标签内容
+     */
+    public QcTypeDTO getById(QcTypeVO qcTypeVO) {
+        QcTypeDTO qcTypeDTO = new QcTypeDTO();
+        qcTypeVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        QcType qcType = this.getOne(new QueryWrapper<QcType>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", qcTypeVO.getHospitalId())
+                .eq("id", qcTypeVO.getId()), false
+        );
+        if (qcType == null) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                    "当前质控类型不存在或已删除【id=" + qcTypeVO.getId() + "】");
+        }
+        BeanUtil.copyProperties(qcType, qcTypeDTO);
+        List<QcCasesEntrySimpleDTO> list = qcTypeCasesEntryService.getByTypeId(qcTypeVO);
+        Map<String, List<QcCasesEntrySimpleDTO>> entryMap = EntityUtil.makeEntityListMap(list, "modeName");
+        qcTypeDTO.setEntryMap(entryMap);
+        return qcTypeDTO;
+    }
+
+    /**
+     * 根据id删除质控类型
+     *
+     * @param deleteQcTypeVO
+     * @return
+     */
+    public Boolean deleteByIdsFac(DeleteQcTypeVO deleteQcTypeVO) {
+        Date now = DateUtil.now();
+        String person = SysUserUtils.getCurrentPrincipleID();
+        // 更新主表
+        Boolean res =
+                this.update(new UpdateWrapper<QcType>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                        .in("id", deleteQcTypeVO.getIds())
+                        .set("is_deleted", IsDeleteEnum.Y.getKey())
+                        .set("gmt_modified", now)
+                        .set("modifier", person)
+                );
+
+        if (!res){
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
+        // 删除明细表
+        if (ListUtil.isNotEmpty(deleteQcTypeVO.getIds())) {
+            qcTypeCasesEntryService.remove(new QueryWrapper<QcTypeCasesEntry>()
+                    .in("type_id", deleteQcTypeVO.getIds())
+            );
+        }
+        return true;
+    }
+
+}

+ 85 - 44
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -185,8 +185,79 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         qcresultInfo.setModifier(useId.toString());
         qcresultInfo.setModifier(useId.toString());
         this.save(qcresultInfo);
         this.save(qcresultInfo);
         //更新质控评分明细信息
         //更新质控评分明细信息
-        //逻辑删除记录
-        qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
+        switch (algorithmVO.getType()) {
+            //自动评分
+            case 0:
+                //删除记录
+                qcresultDetailServiceImpl.remove(new QueryWrapper<QcresultDetail>()
+                        .eq("hospital_id", analyzeVO.getHospitalId())
+                        .eq("behospital_code", analyzeVO.getBehospitalCode()));
+                //批量插入新的数据
+                List<QcresultDetail> qcresultDetailList = new ArrayList<>();
+                List<QcResultAlgVO> qcResultAlgVORes = algorithmVO.getQcResultAlgVOList();
+                if (ListUtil.isNotEmpty(qcResultAlgVORes)) {
+                    for (QcResultAlgVO qcResultAlgVO : qcResultAlgVORes) {
+                        QcresultDetail qcresultDetail = new QcresultDetail();
+                        BeanUtil.copyProperties(qcResultAlgVO, qcresultDetail);
+                        qcresultDetail.setHospitalId(analyzeVO.getHospitalId());
+                        qcresultDetail.setBehospitalCode(analyzeVO.getBehospitalCode());
+                        qcresultDetail.setGradeType(1);
+                        qcresultDetail.setOptType(1);
+                        qcresultDetail.setGmtCreate(now);
+                        qcresultDetail.setCreator(useId.toString());
+                        qcresultDetail.setGmtModified(now);
+                        qcresultDetail.setModifier(useId.toString());
+                        qcresultDetail.setInfo(StringUtil.isNotBlank(qcResultAlgVO.getInfo()) ? qcResultAlgVO.getInfo() : "");
+                        qcresultDetailList.add(qcresultDetail);
+                    }
+                    qcresultDetailServiceImpl.saveBatch(qcresultDetailList);
+                }
+                break;
+            case 1:
+                //新增条目
+                QcresultDetail qcresultDetailAdd = new QcresultDetail();
+                BeanUtil.copyProperties(algorithmVO.getOptResultAlgVO(), qcresultDetailAdd);
+                qcresultDetailAdd.setGradeType(2);
+                qcresultDetailAdd.setOptType(1);
+                qcresultDetailAdd.setHospitalId(analyzeVO.getHospitalId());
+                qcresultDetailAdd.setBehospitalCode(analyzeVO.getBehospitalCode());
+                qcresultDetailAdd.setGmtCreate(now);
+                qcresultDetailAdd.setCreator(useId.toString());
+                qcresultDetailAdd.setGmtModified(now);
+                qcresultDetailAdd.setModifier(useId.toString());
+                qcresultDetailServiceImpl.save(qcresultDetailAdd);
+                break;
+            case 2:
+                //删除条目
+                qcresultDetailServiceImpl.remove(new QueryWrapper<QcresultDetail>()
+                        .eq("id", algorithmVO.getOptResultAlgVO().getId())
+                        .eq("hospital_id", analyzeVO.getHospitalId())
+                        .eq("behospital_code", analyzeVO.getBehospitalCode())
+                );
+                break;
+            case 3:
+                //修改条目
+                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("msg", algorithmVO.getOptResultAlgVO().getMsg())
+                        .set("score", algorithmVO.getOptResultAlgVO().getScore())
+                        .set("opt_type", 3)
+                        .set("modifier", useId)
+                        .set("gmt_modified", now)
+                );
+                break;
+            default:
+                /* DO NOTHING */
+                break;
+        }
+
+        //质控模块评分数据
+        //统一为长兴的算法
+        //逻辑删除数据
+        medQcresultCasesService.update(new UpdateWrapper<MedQcresultCases>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", analyzeVO.getHospitalId())
                 .eq("hospital_id", analyzeVO.getHospitalId())
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
@@ -194,49 +265,19 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                 .set("modifier", useId)
                 .set("modifier", useId)
                 .set("gmt_modified", now));
                 .set("gmt_modified", now));
         //批量插入新的数据
         //批量插入新的数据
-        List<QcresultDetail> qcresultDetailList = new ArrayList<>();
-        List<QcResultAlgVO> qcResultAlgVORes = algorithmVO.getQcResultAlgVOList();
-        if (ListUtil.isNotEmpty(qcResultAlgVORes)) {
-            for (QcResultAlgVO qcResultAlgVO : qcResultAlgVORes) {
-                QcresultDetail qcresultDetail = new QcresultDetail();
-                BeanUtil.copyProperties(qcResultAlgVO, qcresultDetail);
-                qcresultDetail.setHospitalId(analyzeVO.getHospitalId());
-                qcresultDetail.setBehospitalCode(analyzeVO.getBehospitalCode());
-                qcresultDetail.setGmtCreate(now);
-                qcresultDetail.setCreator(useId.toString());
-                qcresultDetail.setGmtModified(now);
-                qcresultDetail.setModifier(useId.toString());
-                qcresultDetail.setInfo(StringUtil.isNotBlank(qcResultAlgVO.getInfo()) ? qcResultAlgVO.getInfo() : "");
-                qcresultDetailList.add(qcresultDetail);
-            }
-            qcresultDetailServiceImpl.saveBatch(qcresultDetailList);
-        }
-        //长兴的数据
-        if (algorithmVO.getHospitalId().equals(1L)) {
-            //质控模块评分数据
-            //逻辑删除数据
-            medQcresultCasesService.update(new UpdateWrapper<MedQcresultCases>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", analyzeVO.getHospitalId())
-                    .eq("behospital_code", analyzeVO.getBehospitalCode())
-                    .set("is_deleted", IsDeleteEnum.Y.getKey())
-                    .set("modifier", useId)
-                    .set("gmt_modified", now));
-            //批量插入新的数据
-            List<MedQcresultCases> medQcresultCasesList = new ArrayList<>();
-            List<MedQcresultCasesVO> medQcresultCasesVOList = algorithmVO.getMedQcresultCasesVOList();
-            if (ListUtil.isNotEmpty(medQcresultCasesVOList)) {
-                for (MedQcresultCasesVO medQcresultCasesVO : medQcresultCasesVOList) {
-                    MedQcresultCases medQcresultCases = new MedQcresultCases();
-                    BeanUtil.copyProperties(medQcresultCasesVO, medQcresultCases);
-                    medQcresultCases.setGmtCreate(now);
-                    medQcresultCases.setCreator(useId.toString());
-                    medQcresultCases.setGmtModified(now);
-                    medQcresultCases.setModifier(useId.toString());
-                    medQcresultCasesList.add(medQcresultCases);
-                }
-                medQcresultCasesService.saveBatch(medQcresultCasesList);
+        List<MedQcresultCases> medQcresultCasesList = new ArrayList<>();
+        List<MedQcresultCasesVO> medQcresultCasesVOList = algorithmVO.getMedQcresultCasesVOList();
+        if (ListUtil.isNotEmpty(medQcresultCasesVOList)) {
+            for (MedQcresultCasesVO medQcresultCasesVO : medQcresultCasesVOList) {
+                MedQcresultCases medQcresultCases = new MedQcresultCases();
+                BeanUtil.copyProperties(medQcresultCasesVO, medQcresultCases);
+                medQcresultCases.setGmtCreate(now);
+                medQcresultCases.setCreator(useId.toString());
+                medQcresultCases.setGmtModified(now);
+                medQcresultCases.setModifier(useId.toString());
+                medQcresultCasesList.add(medQcresultCases);
             }
             }
+            medQcresultCasesService.saveBatch(medQcresultCasesList);
         }
         }
         return now;
         return now;
     }
     }

+ 71 - 32
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.ExportExcelDTO;
+import com.diagbot.dto.HomePageNumDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.NumDTO;
@@ -11,14 +13,14 @@ import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.vo.AnalyzeCodeVO;
 import com.diagbot.vo.AnalyzeCodeVO;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.BehospitalPageVO;
 import com.diagbot.vo.BehospitalPageVO;
+import com.diagbot.vo.ExportQcresultVO;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterVO;
 import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.HomePageFilterVO;
-import org.apache.ibatis.annotations.Param;
 import com.diagbot.vo.TaskVO;
 import com.diagbot.vo.TaskVO;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -39,82 +41,90 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
 
 
     /**
     /**
-     * 缺陷排行列表统计
+     * 各科室缺陷占比-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> resultStatistics(FilterVO filterVO);
+    public List<NumDTO> entryByDept(FilterVO filterVO);
 
 
     /**
     /**
-     * 各科室缺陷占比
+     * 质控结果缺陷总数查询
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> resultStatisticsByDept(FilterVO filterVO);
+    public int getTotleResultNum(FilterVO filterVO);
+
+    public List<BehospitalInfo> getNoGrade(TaskVO taskVO);
+
+    IPage<BehospitalInfoDTO> getPageByDept(BehospitalPageVO behospitalPageVO);
+
+    IPage<BehospitalInfoDTO> getPageByPerson(BehospitalPageVO behospitalPageVO);
 
 
     /**
     /**
-     * 缺陷排行列表统计-百分比未计算
+     * 出院总人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> resultStatistics2(FilterVO filterVO);
+    public int leaveHosCount(FilterVO filterVO);
 
 
     /**
     /**
-     * 各科室缺陷占比-百分比未计算
+     * 新生儿出院人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> resultStatisticsByDept2(FilterVO filterVO);
+    public int newBornCount(FilterVO filterVO);
 
 
     /**
     /**
-     * 缺陷总数
+     * 死亡人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public int getTotleResultNum(FilterVO filterVO);
-
-    public List<BehospitalInfo> getNoGrade(TaskVO taskVO);
-
-    IPage<BehospitalInfoDTO> getPageByDept(BehospitalPageVO behospitalPageVO);
+    public int deathCount(FilterVO filterVO);
 
 
-    IPage<BehospitalInfoDTO> getPageByPerson(BehospitalPageVO behospitalPageVO);
+    /**
+     * 手术人数统计-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationCount(FilterVO filterVO);
 
 
     /**
     /**
-     * 病案首页相关病历数统计
+     * 出院总人数统计-科室-首页
      *
      *
-     * @param homePageFilterVO
+     * @param filterVO
      * @return
      * @return
      */
      */
-    public int homePageCount(HomePageFilterVO homePageFilterVO);
+    public List<NumDTO> leaveHosCountByDept(FilterVO filterVO);
 
 
     /**
     /**
-     * 手术病历数统计
+     * 新生儿出院人数统计-科室-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public int homePageCountForOperation(FilterVO filterVO);
+    public List<NumDTO> newBornCountByDept(FilterVO filterVO);
 
 
     /**
     /**
-     * 按科室统计病案首页病历数
+     * 死亡人数统计-科室-首页
      *
      *
-     * @param homePageFilterVO
+     * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> homePageCountByDept(HomePageFilterVO homePageFilterVO);
+    public List<NumDTO> deathCountByDept(FilterVO filterVO);
 
 
     /**
     /**
-     * 按科室统计病案首页手术病历数
+     * 手术人数统计-科室-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> homePageCountForOperationByDept(FilterVO filterVO);
+    public List<NumDTO> operationCountByDept(FilterVO filterVO);
 
 
     /**
     /**
      * 各科室缺陷占比排行(分页)
      * 各科室缺陷占比排行(分页)
@@ -138,7 +148,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param filterOrderVO
      * @param filterOrderVO
      * @return
      * @return
      */
      */
-    public List<LevelStatisticsDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO);
+    public List<HomePageNumDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO);
 
 
     /**
     /**
      * 各科室缺陷占比(主任医生)
      * 各科室缺陷占比(主任医生)
@@ -154,7 +164,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param filterOrderByDeptVO
      * @param filterOrderByDeptVO
      * @return
      * @return
      */
      */
-    public List<LevelStatisticsDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
+    public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
 
 
     /**
     /**
      * 科室缺陷占比-科室(分页)
      * 科室缺陷占比-科室(分页)
@@ -165,8 +175,37 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public IPage<DeptNumDTO> resultStatisticsByDeptAndDoctorPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
     public IPage<DeptNumDTO> resultStatisticsByDeptAndDoctorPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
 
     /**
     /**
-     * 根据两个主键-批量修改
-     * @param list
+     * 各科室缺陷占比(组合)-全院-根据内外科系统统计
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public List<LevelStatisticsDTO> levelStatisticsByDeptClass(FilterOrderVO filterOrderVO);
+
+    /**
+     * 各科室缺陷占比(组合)-全院-根据内外科系统统计(上级科室允许为空)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public List<LevelStatisticsDTO> levelStatisticsByDeptClass2(FilterOrderVO filterOrderVO);
+
+
+    List<ExportExcelDTO> exportExcel();
+
+    /**
+     * 质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresult(ExportQcresultVO exportQcresultVO);
+
+    /**
+     * 科室质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
      */
      */
-    public void updateBatchByKey(List<BehospitalInfo> list);
+    public List<ExportExcelDTO> exportQcresultByDept(ExportQcresultVO exportQcresultVO);
 }
 }

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

@@ -3,16 +3,14 @@ package com.diagbot.mapper;
 import com.diagbot.entity.MedCrisisInfo;
 import com.diagbot.entity.MedCrisisInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 
-import java.util.List;
-
 /**
 /**
  * <p>
  * <p>
  * 危急值信息 Mapper 接口
  * 危急值信息 Mapper 接口
  * </p>
  * </p>
  *
  *
  * @author zhoutg
  * @author zhoutg
- * @since 2020-05-28
+ * @since 2020-06-02
  */
  */
 public interface MedCrisisInfoMapper extends BaseMapper<MedCrisisInfo> {
 public interface MedCrisisInfoMapper extends BaseMapper<MedCrisisInfo> {
-    public void updateBatchByKey(List<MedCrisisInfo> list);
+
 }
 }

+ 8 - 1
src/main/java/com/diagbot/mapper/QcCasesEntryMapper.java

@@ -1,11 +1,14 @@
 package com.diagbot.mapper;
 package com.diagbot.mapper;
 
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.diagbot.dto.QcCasesEntryDTO;
 import com.diagbot.dto.QcCasesEntryDTO;
+import com.diagbot.dto.QcCasesEntrySimpleDTO;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.entity.QcCasesEntry;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
+import com.diagbot.vo.QcEntryHospitalVO;
 import com.diagbot.vo.QcResultAlgQueryVO;
 import com.diagbot.vo.QcResultAlgQueryVO;
 import com.diagbot.vo.QcResultAlgVO;
 import com.diagbot.vo.QcResultAlgVO;
+import com.diagbot.vo.QcTypeIndexVO;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -22,4 +25,8 @@ public interface QcCasesEntryMapper extends BaseMapper<QcCasesEntry> {
     List<QcCasesEntryDTO> getQcCasesEntry(AnalyzeVO analyzeVO);
     List<QcCasesEntryDTO> getQcCasesEntry(AnalyzeVO analyzeVO);
 
 
     List<QcResultAlgVO> getQcResultAlgVO(QcResultAlgQueryVO qcResultAlgQueryVO);
     List<QcResultAlgVO> getQcResultAlgVO(QcResultAlgQueryVO qcResultAlgQueryVO);
+
+    List<QcCasesEntrySimpleDTO> index(QcTypeIndexVO qcTypeIndexVO);
+
+    List<QcCasesEntrySimpleDTO> getEntryByHospital(QcEntryHospitalVO qcEntryHospitalVO);
 }
 }

+ 5 - 0
src/main/java/com/diagbot/mapper/QcTypeCasesEntryMapper.java

@@ -1,7 +1,11 @@
 package com.diagbot.mapper;
 package com.diagbot.mapper;
 
 
+import com.diagbot.dto.QcCasesEntrySimpleDTO;
 import com.diagbot.entity.QcTypeCasesEntry;
 import com.diagbot.entity.QcTypeCasesEntry;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.QcTypeVO;
+
+import java.util.List;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
  */
 public interface QcTypeCasesEntryMapper extends BaseMapper<QcTypeCasesEntry> {
 public interface QcTypeCasesEntryMapper extends BaseMapper<QcTypeCasesEntry> {
 
 
+    List<QcCasesEntrySimpleDTO> getByTypeId(QcTypeVO qcTypeVO);
 }
 }

+ 10 - 0
src/main/java/com/diagbot/mapper/QcTypeMapper.java

@@ -1,7 +1,10 @@
 package com.diagbot.mapper;
 package com.diagbot.mapper;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcTypePageDTO;
 import com.diagbot.entity.QcType;
 import com.diagbot.entity.QcType;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.QcTypePageVO;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -13,4 +16,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
  */
 public interface QcTypeMapper extends BaseMapper<QcType> {
 public interface QcTypeMapper extends BaseMapper<QcType> {
 
 
+    /**
+     * 获取标签列表
+     *
+     * @param qcTypePageVO
+     * @return
+     */
+    IPage<QcTypePageDTO> getList(QcTypePageVO qcTypePageVO);
 }
 }

+ 49 - 6
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -3,7 +3,9 @@ package com.diagbot.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.AverageStatisticsDTO;
 import com.diagbot.dto.AverageStatisticsDTO;
+import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
 import com.diagbot.entity.QcresultInfo;
@@ -72,7 +74,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<AverageStatisticsDTO> getAverageScoreByDept(FilterVO filterVO);
+    public List<AverageStatisticsDTO> getAverageScore(FilterVO filterVO);
 
 
     /**
     /**
      * 按科室统计质控病历数
      * 按科室统计质控病历数
@@ -107,12 +109,12 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
     public IPage<NumDTO> entryCountGroupByCasePage(@Param("filterPageVO") FilterPageVO filterPageVO);
     public IPage<NumDTO> entryCountGroupByCasePage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
 
     /**
     /**
-     * 条目缺陷占比(分页)
+     * 缺陷详情(分页)
      *
      *
      * @param filterPageVO
      * @param filterPageVO
      * @return
      * @return
      */
      */
-    public IPage<NumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO);
+    public IPage<EntryNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
 
     /**
     /**
      * 各科室质控平均分(分页)
      * 各科室质控平均分(分页)
@@ -132,15 +134,56 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
 
 
     /**
     /**
      * 各模块缺陷占比-科室(分页)
      * 各模块缺陷占比-科室(分页)
+     *
+     * @param filterPageByDeptVO
+     * @return
+     */
+    public IPage<DeptNumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+
+    /**
+     * 缺陷详情-科室(分页)
+     *
      * @param filterPageByDeptVO
      * @param filterPageByDeptVO
      * @return
      * @return
      */
      */
-    public IPage<DeptNumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO")FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+
+    /**
+     * 条目缺陷占比(内页)
+     *
+     * @return
+     */
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
 
     /**
     /**
-     * 条目缺陷占比-科室(分页)
+     * 条目缺陷占比-科室(内页)
+     *
      * @param filterPageByDeptVO
      * @param filterPageByDeptVO
      * @return
      * @return
      */
      */
-    public IPage<DeptNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO")FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<DeptEntryNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+
+    /**
+     * 各科室质控平均分(首页)-根据内外科系统统计
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<AverageStatisticsDTO> getAverageScoreByDeptClass(FilterVO filterVO);
+
+    /**
+     * 单项否决缺陷占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO);
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 }
 }

+ 74 - 30
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.ExportExcelDTO;
+import com.diagbot.dto.HomePageNumDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.NumDTO;
@@ -11,14 +13,14 @@ import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.vo.AnalyzeCodeVO;
 import com.diagbot.vo.AnalyzeCodeVO;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.BehospitalPageVO;
 import com.diagbot.vo.BehospitalPageVO;
+import com.diagbot.vo.ExportQcresultVO;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterVO;
 import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.HomePageFilterVO;
-import org.apache.ibatis.annotations.Param;
 import com.diagbot.vo.TaskVO;
 import com.diagbot.vo.TaskVO;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -39,83 +41,91 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
 
 
     /**
     /**
-     * 缺陷排行列表统计
+     * 各科室缺陷占比-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> resultStatistics(FilterVO filterVO);
+    public List<NumDTO> entryByDept(FilterVO filterVO);
 
 
     /**
     /**
-     * 各科室缺陷占比
+     * 质控结果缺陷总数查询
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> resultStatisticsByDept(FilterVO filterVO);
+    public int getTotleResultNum(FilterVO filterVO);
+
+
+    public List<BehospitalInfo> getNoGrade(TaskVO taskVO);
+
+    IPage<BehospitalInfoDTO> getPageByDept(BehospitalPageVO behospitalPageVO);
+
+    IPage<BehospitalInfoDTO> getPageByPerson(BehospitalPageVO behospitalPageVO);
 
 
     /**
     /**
-     * 缺陷排行列表统计-百分比未计算
+     * 出院总人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> resultStatistics2(FilterVO filterVO);
+    public int leaveHosCount(FilterVO filterVO);
 
 
     /**
     /**
-     * 各科室缺陷占比-百分比未计算
+     * 新生儿出院人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> resultStatisticsByDept2(FilterVO filterVO);
+    public int newBornCount(FilterVO filterVO);
 
 
     /**
     /**
-     * 缺陷总数
+     * 死亡人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public int getTotleResultNum(FilterVO filterVO);
-
+    public int deathCount(FilterVO filterVO);
 
 
-    public List<BehospitalInfo> getNoGrade(TaskVO taskVO);
-
-    IPage<BehospitalInfoDTO> getPageByDept(BehospitalPageVO behospitalPageVO);
-
-    IPage<BehospitalInfoDTO> getPageByPerson(BehospitalPageVO behospitalPageVO);
+    /**
+     * 手术人数统计-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationCount(FilterVO filterVO);
 
 
     /**
     /**
-     * 病案首页相关病历数统计
+     * 出院总人数统计-科室-首页
      *
      *
-     * @param homePageFilterVO
+     * @param filterVO
      * @return
      * @return
      */
      */
-    public int homePageCount(HomePageFilterVO homePageFilterVO);
+    public List<NumDTO> leaveHosCountByDept(FilterVO filterVO);
 
 
     /**
     /**
-     * 手术病历数统计
+     * 新生儿出院人数统计-科室-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public int homePageCountForOperation(FilterVO filterVO);
+    public List<NumDTO> newBornCountByDept(FilterVO filterVO);
 
 
     /**
     /**
-     * 按科室统计病案首页病历数
+     * 死亡人数统计-科室-首页
      *
      *
-     * @param homePageFilterVO
+     * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> homePageCountByDept(HomePageFilterVO homePageFilterVO);
+    public List<NumDTO> deathCountByDept(FilterVO filterVO);
 
 
     /**
     /**
-     * 按科室统计病案首页手术病历数
+     * 手术人数统计-科室-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<NumDTO> homePageCountForOperationByDept(FilterVO filterVO);
+    public List<NumDTO> operationCountByDept(FilterVO filterVO);
 
 
     /**
     /**
      * 各科室缺陷占比排行(分页)
      * 各科室缺陷占比排行(分页)
@@ -139,7 +149,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterOrderVO
      * @param filterOrderVO
      * @return
      * @return
      */
      */
-    public List<LevelStatisticsDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO);
+    public List<HomePageNumDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO);
 
 
     /**
     /**
      * 各科室缺陷占比(主任医生)
      * 各科室缺陷占比(主任医生)
@@ -155,7 +165,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterOrderByDeptVO
      * @param filterOrderByDeptVO
      * @return
      * @return
      */
      */
-    public List<LevelStatisticsDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
+    public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
 
 
     /**
     /**
      * 缺陷明细-科室(分页)
      * 缺陷明细-科室(分页)
@@ -164,4 +174,38 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      * @return
      */
      */
     public IPage<DeptNumDTO> resultStatisticsByDeptAndDoctorPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
     public IPage<DeptNumDTO> resultStatisticsByDeptAndDoctorPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+
+    /**
+     * 各科室缺陷占比(组合)-全院-根据内外科系统统计
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public List<LevelStatisticsDTO> levelStatisticsByDeptClass(FilterOrderVO filterOrderVO);
+
+    /**
+     * 各科室缺陷占比(组合)-全院-根据内外科系统统计(上级科室允许为空)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public List<LevelStatisticsDTO> levelStatisticsByDeptClass2(FilterOrderVO filterOrderVO);
+
+    List<ExportExcelDTO> exportExcel();
+
+    /**
+     * 质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresult(ExportQcresultVO exportQcresultVO);
+
+    /**
+     * 科室质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresultByDept(ExportQcresultVO exportQcresultVO);
 }
 }

+ 1 - 1
src/main/java/com/diagbot/service/MedCrisisInfoService.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * </p>
  * </p>
  *
  *
  * @author zhoutg
  * @author zhoutg
- * @since 2020-05-28
+ * @since 2020-06-02
  */
  */
 public interface MedCrisisInfoService extends IService<MedCrisisInfo> {
 public interface MedCrisisInfoService extends IService<MedCrisisInfo> {
 
 

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

@@ -1,11 +1,14 @@
 package com.diagbot.service;
 package com.diagbot.service;
 
 
 import com.diagbot.dto.QcCasesEntryDTO;
 import com.diagbot.dto.QcCasesEntryDTO;
+import com.diagbot.dto.QcCasesEntrySimpleDTO;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.entity.QcCasesEntry;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
+import com.diagbot.vo.QcEntryHospitalVO;
 import com.diagbot.vo.QcResultAlgQueryVO;
 import com.diagbot.vo.QcResultAlgQueryVO;
 import com.diagbot.vo.QcResultAlgVO;
 import com.diagbot.vo.QcResultAlgVO;
+import com.diagbot.vo.QcTypeIndexVO;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -21,4 +24,8 @@ public interface QcCasesEntryService extends IService<QcCasesEntry> {
     List<QcCasesEntryDTO> getQcCasesEntry(AnalyzeVO analyzeVO);
     List<QcCasesEntryDTO> getQcCasesEntry(AnalyzeVO analyzeVO);
 
 
     List<QcResultAlgVO> getQcResultAlgVO(QcResultAlgQueryVO qcResultAlgQueryVO);
     List<QcResultAlgVO> getQcResultAlgVO(QcResultAlgQueryVO qcResultAlgQueryVO);
+
+    List<QcCasesEntrySimpleDTO> index(QcTypeIndexVO qcTypeIndexVO);
+
+    List<QcCasesEntrySimpleDTO> getEntryByHospital(QcEntryHospitalVO qcEntryHospitalVO);
 }
 }

+ 6 - 2
src/main/java/com/diagbot/service/QcTypeCasesEntryService.java

@@ -1,7 +1,11 @@
 package com.diagbot.service;
 package com.diagbot.service;
 
 
-import com.diagbot.entity.QcTypeCasesEntry;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.QcCasesEntrySimpleDTO;
+import com.diagbot.entity.QcTypeCasesEntry;
+import com.diagbot.vo.QcTypeVO;
+
+import java.util.List;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -12,5 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2020-04-13
  * @since 2020-04-13
  */
  */
 public interface QcTypeCasesEntryService extends IService<QcTypeCasesEntry> {
 public interface QcTypeCasesEntryService extends IService<QcTypeCasesEntry> {
-
+    List<QcCasesEntrySimpleDTO> getByTypeId(QcTypeVO qcTypeVO);
 }
 }

+ 5 - 1
src/main/java/com/diagbot/service/QcTypeService.java

@@ -1,7 +1,10 @@
 package com.diagbot.service;
 package com.diagbot.service;
 
 
-import com.diagbot.entity.QcType;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.QcTypePageDTO;
+import com.diagbot.entity.QcType;
+import com.diagbot.vo.QcTypePageVO;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
  */
 public interface QcTypeService extends IService<QcType> {
 public interface QcTypeService extends IService<QcType> {
 
 
+    IPage<QcTypePageDTO> getList(QcTypePageVO qcTypePageVO);
 }
 }

+ 48 - 5
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -3,7 +3,9 @@ package com.diagbot.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.dto.AverageStatisticsDTO;
 import com.diagbot.dto.AverageStatisticsDTO;
+import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
 import com.diagbot.entity.QcresultInfo;
@@ -73,7 +75,7 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    public List<AverageStatisticsDTO> getAverageScoreByDept(FilterVO filterVO);
+    public List<AverageStatisticsDTO> getAverageScore(FilterVO filterVO);
 
 
     /**
     /**
      * 按科室统计质控病历数
      * 按科室统计质控病历数
@@ -108,12 +110,12 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
     public IPage<NumDTO> entryCountGroupByCasePage(@Param("filterPageVO") FilterPageVO filterPageVO);
     public IPage<NumDTO> entryCountGroupByCasePage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
 
     /**
     /**
-     * 条目缺陷占比(分页)
+     * 缺陷详情(分页)
      *
      *
      * @param filterPageVO
      * @param filterPageVO
      * @return
      * @return
      */
      */
-    public IPage<NumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO);
+    public IPage<EntryNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
 
     /**
     /**
      * 各科室质控平均分(分页)
      * 各科室质控平均分(分页)
@@ -133,15 +135,56 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
 
 
     /**
     /**
      * 各模块缺陷占比-科室(分页)
      * 各模块缺陷占比-科室(分页)
+     *
      * @param filterPageByDeptVO
      * @param filterPageByDeptVO
      * @return
      * @return
      */
      */
     public IPage<DeptNumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
     public IPage<DeptNumDTO> entryCountGroupByCaseAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
 
 
     /**
     /**
-     * 条目缺陷占比-科室(分页)
+     * 缺陷详情-科室(分页)
+     *
+     * @param filterPageByDeptVO
+     * @return
+     */
+    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+
+    /**
+     * 条目缺陷占比(内页)
+     *
+     * @return
+     */
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO);
+
+    /**
+     * 条目缺陷占比-科室(内页)
+     *
      * @param filterPageByDeptVO
      * @param filterPageByDeptVO
      * @return
      * @return
      */
      */
-    public IPage<DeptNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO")FilterPageByDeptVO filterPageByDeptVO);
+    public IPage<DeptEntryNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+
+    /**
+     * 各科室质控平均分(首页)-根据内外科系统统计
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<AverageStatisticsDTO> getAverageScoreByDeptClass(FilterVO filterVO);
+
+    /**
+     * 单项否决缺陷占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO);
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 }
 }

+ 103 - 55
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.ExportExcelDTO;
+import com.diagbot.dto.HomePageNumDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.NumDTO;
@@ -13,14 +15,14 @@ import com.diagbot.service.BehospitalInfoService;
 import com.diagbot.vo.AnalyzeCodeVO;
 import com.diagbot.vo.AnalyzeCodeVO;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.BehospitalPageVO;
 import com.diagbot.vo.BehospitalPageVO;
+import com.diagbot.vo.ExportQcresultVO;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterVO;
 import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.HomePageFilterVO;
-import org.apache.ibatis.annotations.Param;
 import com.diagbot.vo.TaskVO;
 import com.diagbot.vo.TaskVO;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.List;
 import java.util.List;
@@ -52,117 +54,120 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     }
     }
 
 
     /**
     /**
-     * 缺陷排行列表统计
+     * 各科室缺陷占比-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<NumDTO> resultStatistics(FilterVO filterVO) {
-        return baseMapper.resultStatistics(filterVO);
+    public List<NumDTO> entryByDept(FilterVO filterVO) {
+        return baseMapper.entryByDept(filterVO);
     }
     }
 
 
     /**
     /**
-     * 各科室缺陷占比
+     * 质控结果缺陷总数查询
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<NumDTO> resultStatisticsByDept(FilterVO filterVO) {
-        return baseMapper.resultStatisticsByDept(filterVO);
+    public int getTotleResultNum(FilterVO filterVO) {
+        return baseMapper.getTotleResultNum(filterVO);
+    }
+
+    @Override
+    public List<BehospitalInfo> getNoGrade(TaskVO taskVO) {
+        return baseMapper.getNoGrade(taskVO);
+    }
+
+    @Override
+    public IPage<BehospitalInfoDTO> getPageByDept(BehospitalPageVO behospitalPageVO) {
+        return baseMapper.getPageByDept(behospitalPageVO);
+    }
+
+    @Override
+    public IPage<BehospitalInfoDTO> getPageByPerson(BehospitalPageVO behospitalPageVO) {
+        return baseMapper.getPageByPerson(behospitalPageVO);
     }
     }
 
 
     /**
     /**
-     * 缺陷排行列表统计-百分比未计算
+     * 出院总人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    @Override
-    public List<NumDTO> resultStatistics2(FilterVO filterVO) {
-        return baseMapper.resultStatistics2(filterVO);
+    public int leaveHosCount(FilterVO filterVO) {
+        return baseMapper.leaveHosCount(filterVO);
     }
     }
 
 
     /**
     /**
-     * 各科室缺陷占比-百分比未计算
+     * 新生儿出院人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    @Override
-    public List<NumDTO> resultStatisticsByDept2(FilterVO filterVO) {
-        return baseMapper.resultStatisticsByDept2(filterVO);
+    public int newBornCount(FilterVO filterVO) {
+        return baseMapper.newBornCount(filterVO);
     }
     }
 
 
     /**
     /**
-     * 缺陷总数
+     * 死亡人数统计-全院-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    @Override
-    public int getTotleResultNum(FilterVO filterVO) {
-        return baseMapper.getTotleResultNum(filterVO);
-    }
-
-    @Override
-    public List<BehospitalInfo> getNoGrade(TaskVO taskVO) {
-        return baseMapper.getNoGrade(taskVO);
+    public int deathCount(FilterVO filterVO) {
+        return baseMapper.deathCount(filterVO);
     }
     }
 
 
-    @Override
-    public IPage<BehospitalInfoDTO> getPageByDept(BehospitalPageVO behospitalPageVO) {
-        return baseMapper.getPageByDept(behospitalPageVO);
-    }
-
-    @Override
-    public IPage<BehospitalInfoDTO> getPageByPerson(BehospitalPageVO behospitalPageVO) {
-        return baseMapper.getPageByPerson(behospitalPageVO);
+    /**
+     * 手术人数统计-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationCount(FilterVO filterVO) {
+        return baseMapper.operationCount(filterVO);
     }
     }
 
 
     /**
     /**
-     * 病案首页相关病历数统计
+     * 出院总人数统计-科室-首页
      *
      *
-     * @param homePageFilterVO
+     * @param filterVO
      * @return
      * @return
      */
      */
-    @Override
-    public int homePageCount(HomePageFilterVO homePageFilterVO) {
-        return baseMapper.homePageCount(homePageFilterVO);
+    public List<NumDTO> leaveHosCountByDept(FilterVO filterVO) {
+        return baseMapper.leaveHosCountByDept(filterVO);
     }
     }
 
 
     /**
     /**
-     * 手术病历数统计
+     * 新生儿出院人数统计-科室-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    @Override
-    public int homePageCountForOperation(FilterVO filterVO) {
-        return baseMapper.homePageCountForOperation(filterVO);
+    public List<NumDTO> newBornCountByDept(FilterVO filterVO) {
+        return baseMapper.newBornCountByDept(filterVO);
     }
     }
 
 
     /**
     /**
-     * 按科室统计病案首页病历数
+     * 死亡人数统计-科室-首页
      *
      *
-     * @param homePageFilterVO
+     * @param filterVO
      * @return
      * @return
      */
      */
-    @Override
-    public List<NumDTO> homePageCountByDept(HomePageFilterVO homePageFilterVO) {
-        return baseMapper.homePageCountByDept(homePageFilterVO);
+    public List<NumDTO> deathCountByDept(FilterVO filterVO) {
+        return baseMapper.deathCountByDept(filterVO);
     }
     }
 
 
     /**
     /**
-     * 按科室统计病案首页手术病历数
+     * 手术人数统计-科室-首页
      *
      *
      * @param filterVO
      * @param filterVO
      * @return
      * @return
      */
      */
-    @Override
-    public List<NumDTO> homePageCountForOperationByDept(FilterVO filterVO) {
-        return baseMapper.homePageCountForOperationByDept(filterVO);
+    public List<NumDTO> operationCountByDept(FilterVO filterVO) {
+        return baseMapper.operationCountByDept(filterVO);
     }
     }
 
 
     /**
     /**
@@ -194,7 +199,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<LevelStatisticsDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO) {
+    public List<HomePageNumDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO) {
         return baseMapper.homePageLevelStatistics(filterOrderVO);
         return baseMapper.homePageLevelStatistics(filterOrderVO);
     }
     }
 
 
@@ -216,7 +221,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<LevelStatisticsDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
+    public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO) {
         return baseMapper.homePageLevelStatisticsByDept(filterOrderByDeptVO);
         return baseMapper.homePageLevelStatisticsByDept(filterOrderByDeptVO);
     }
     }
 
 
@@ -230,7 +235,50 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.resultStatisticsByDeptAndDoctorPage(filterPageByDeptVO);
         return baseMapper.resultStatisticsByDeptAndDoctorPage(filterPageByDeptVO);
     }
     }
 
 
-    public void updateBatchByKey(List<BehospitalInfo> list){
-        this.baseMapper.updateBatchByKey(list);
+    /**
+     * 各科室缺陷占比(组合)-全院-根据内外科系统统计
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    @Override
+    public List<LevelStatisticsDTO> levelStatisticsByDeptClass(FilterOrderVO filterOrderVO) {
+        return baseMapper.levelStatisticsByDeptClass(filterOrderVO);
+    }
+
+    /**
+     * 各科室缺陷占比(组合)-全院-根据内外科系统统计(上级科室允许为空)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    @Override
+    public List<LevelStatisticsDTO> levelStatisticsByDeptClass2(FilterOrderVO filterOrderVO) {
+        return baseMapper.levelStatisticsByDeptClass2(filterOrderVO);
+    }
+
+    @Override
+    public List<ExportExcelDTO> exportExcel() {
+        return baseMapper.exportExcel();
+    }
+
+    /**
+     * 质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresult(ExportQcresultVO exportQcresultVO) {
+        return baseMapper.exportQcresult(exportQcresultVO);
+    }
+
+    /**
+     * 科室质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresultByDept(ExportQcresultVO exportQcresultVO) {
+        return baseMapper.exportQcresultByDept(exportQcresultVO);
     }
     }
 }
 }

+ 66 - 0
src/main/java/com/diagbot/service/impl/ExcelExportStylerUserImpl.java

@@ -0,0 +1,66 @@
+package com.diagbot.service.impl;
+
+import cn.afterturn.easypoi.excel.export.styler.AbstractExcelExportStyler;
+import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Font;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+import org.apache.poi.ss.usermodel.Workbook;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/3 11:45
+ */
+public class ExcelExportStylerUserImpl extends AbstractExcelExportStyler implements IExcelExportStyler {
+    public ExcelExportStylerUserImpl(Workbook workbook) {
+        super.createStyles(workbook);
+    }
+
+    public CellStyle getTitleStyle(short color) {
+        CellStyle titleStyle = this.workbook.createCellStyle();
+        titleStyle.setAlignment(HorizontalAlignment.CENTER);
+        titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        titleStyle.setWrapText(true);
+        return titleStyle;
+    }
+
+    public CellStyle stringSeptailStyle(Workbook workbook, boolean isWarp) {
+        CellStyle style = workbook.createCellStyle();
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);
+        style.setDataFormat(STRING_FORMAT);
+        if (isWarp) {
+            style.setWrapText(true);
+        } else {
+            style.setAlignment(HorizontalAlignment.LEFT);
+        }
+
+        return style;
+    }
+
+    public CellStyle getHeaderStyle(short color) {
+        CellStyle titleStyle = this.workbook.createCellStyle();
+        Font font = this.workbook.createFont();
+        font.setFontHeightInPoints((short) 12);
+        titleStyle.setFont(font);
+        titleStyle.setAlignment(HorizontalAlignment.CENTER);
+        titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        return titleStyle;
+    }
+
+    public CellStyle stringNoneStyle(Workbook workbook, boolean isWarp) {
+        CellStyle style = workbook.createCellStyle();
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);
+        style.setDataFormat(STRING_FORMAT);
+        if (isWarp) {
+            style.setWrapText(true);
+        } else {
+            style.setAlignment(HorizontalAlignment.LEFT);
+        }
+
+        return style;
+    }
+}

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

@@ -6,19 +6,15 @@ import com.diagbot.service.MedCrisisInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import java.util.List;
-
 /**
 /**
  * <p>
  * <p>
  * 危急值信息 服务实现类
  * 危急值信息 服务实现类
  * </p>
  * </p>
  *
  *
  * @author zhoutg
  * @author zhoutg
- * @since 2020-05-28
+ * @since 2020-06-02
  */
  */
 @Service
 @Service
 public class MedCrisisInfoServiceImpl extends ServiceImpl<MedCrisisInfoMapper, MedCrisisInfo> implements MedCrisisInfoService {
 public class MedCrisisInfoServiceImpl extends ServiceImpl<MedCrisisInfoMapper, MedCrisisInfo> implements MedCrisisInfoService {
-    public void updateBatchByKey(List<MedCrisisInfo> list){
-        this.baseMapper.updateBatchByKey(list);
-    }
+
 }
 }

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

@@ -1,13 +1,16 @@
 package com.diagbot.service.impl;
 package com.diagbot.service.impl;
 
 
 import com.diagbot.dto.QcCasesEntryDTO;
 import com.diagbot.dto.QcCasesEntryDTO;
+import com.diagbot.dto.QcCasesEntrySimpleDTO;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.mapper.QcCasesEntryMapper;
 import com.diagbot.mapper.QcCasesEntryMapper;
 import com.diagbot.service.QcCasesEntryService;
 import com.diagbot.service.QcCasesEntryService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.vo.AnalyzeVO;
 import com.diagbot.vo.AnalyzeVO;
+import com.diagbot.vo.QcEntryHospitalVO;
 import com.diagbot.vo.QcResultAlgQueryVO;
 import com.diagbot.vo.QcResultAlgQueryVO;
 import com.diagbot.vo.QcResultAlgVO;
 import com.diagbot.vo.QcResultAlgVO;
+import com.diagbot.vo.QcTypeIndexVO;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.List;
 import java.util.List;
@@ -31,4 +34,14 @@ public class QcCasesEntryServiceImpl extends ServiceImpl<QcCasesEntryMapper, QcC
     public List<QcResultAlgVO> getQcResultAlgVO(QcResultAlgQueryVO qcResultAlgQueryVO){
     public List<QcResultAlgVO> getQcResultAlgVO(QcResultAlgQueryVO qcResultAlgQueryVO){
         return baseMapper.getQcResultAlgVO(qcResultAlgQueryVO);
         return baseMapper.getQcResultAlgVO(qcResultAlgQueryVO);
     }
     }
+
+    @Override
+    public List<QcCasesEntrySimpleDTO> index(QcTypeIndexVO qcTypeIndexVO) {
+        return baseMapper.index(qcTypeIndexVO);
+    }
+
+    @Override
+    public List<QcCasesEntrySimpleDTO> getEntryByHospital(QcEntryHospitalVO qcEntryHospitalVO) {
+        return baseMapper.getEntryByHospital(qcEntryHospitalVO);
+    }
 }
 }

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

@@ -1,11 +1,15 @@
 package com.diagbot.service.impl;
 package com.diagbot.service.impl;
 
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.QcCasesEntrySimpleDTO;
 import com.diagbot.entity.QcTypeCasesEntry;
 import com.diagbot.entity.QcTypeCasesEntry;
 import com.diagbot.mapper.QcTypeCasesEntryMapper;
 import com.diagbot.mapper.QcTypeCasesEntryMapper;
 import com.diagbot.service.QcTypeCasesEntryService;
 import com.diagbot.service.QcTypeCasesEntryService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.QcTypeVO;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.List;
+
 /**
 /**
  * <p>
  * <p>
  * 质控类型和质控条目关联表 服务实现类
  * 质控类型和质控条目关联表 服务实现类
@@ -16,5 +20,8 @@ import org.springframework.stereotype.Service;
  */
  */
 @Service
 @Service
 public class QcTypeCasesEntryServiceImpl extends ServiceImpl<QcTypeCasesEntryMapper, QcTypeCasesEntry> implements QcTypeCasesEntryService {
 public class QcTypeCasesEntryServiceImpl extends ServiceImpl<QcTypeCasesEntryMapper, QcTypeCasesEntry> implements QcTypeCasesEntryService {
-
+    @Override
+    public List<QcCasesEntrySimpleDTO> getByTypeId(QcTypeVO qcTypeVO) {
+        return baseMapper.getByTypeId(qcTypeVO);
+    }
 }
 }

+ 7 - 1
src/main/java/com/diagbot/service/impl/QcTypeServiceImpl.java

@@ -1,9 +1,12 @@
 package com.diagbot.service.impl;
 package com.diagbot.service.impl;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcTypePageDTO;
 import com.diagbot.entity.QcType;
 import com.diagbot.entity.QcType;
 import com.diagbot.mapper.QcTypeMapper;
 import com.diagbot.mapper.QcTypeMapper;
 import com.diagbot.service.QcTypeService;
 import com.diagbot.service.QcTypeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.QcTypePageVO;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 /**
 /**
@@ -16,5 +19,8 @@ import org.springframework.stereotype.Service;
  */
  */
 @Service
 @Service
 public class QcTypeServiceImpl extends ServiceImpl<QcTypeMapper, QcType> implements QcTypeService {
 public class QcTypeServiceImpl extends ServiceImpl<QcTypeMapper, QcType> implements QcTypeService {
-
+    @Override
+    public IPage<QcTypePageDTO> getList(QcTypePageVO qcTypePageVO) {
+        return baseMapper.getList(qcTypePageVO);
+    }
 }
 }

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

@@ -3,7 +3,9 @@ package com.diagbot.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.AverageStatisticsDTO;
 import com.diagbot.dto.AverageStatisticsDTO;
+import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
 import com.diagbot.entity.QcresultInfo;
@@ -93,8 +95,8 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<AverageStatisticsDTO> getAverageScoreByDept(FilterVO filterVO) {
-        return baseMapper.getAverageScoreByDept(filterVO);
+    public List<AverageStatisticsDTO> getAverageScore(FilterVO filterVO) {
+        return baseMapper.getAverageScore(filterVO);
     }
     }
 
 
     /**
     /**
@@ -142,13 +144,13 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     }
     }
 
 
     /**
     /**
-     * 条目缺陷占比(分页)
+     * 缺陷详情(分页)
      *
      *
      * @param filterPageVO
      * @param filterPageVO
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public IPage<NumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
+    public IPage<EntryNumDTO> entryCountGroupByEntryPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
         return baseMapper.entryCountGroupByEntryPage(filterPageVO);
         return baseMapper.entryCountGroupByEntryPage(filterPageVO);
     }
     }
 
 
@@ -186,13 +188,67 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     }
     }
 
 
     /**
     /**
-     * 条目缺陷占比-科室(分页)
+     * 缺陷详情-科室(分页)
      *
      *
      * @param filterPageByDeptVO
      * @param filterPageByDeptVO
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public IPage<DeptNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
+    public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
         return baseMapper.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
         return baseMapper.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
     }
     }
+
+    /**
+     * 条目缺陷占比(内页)
+     *
+     * @return
+     */
+    @Override
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
+        return baseMapper.entryGroupByEntryInnerPage(filterPageVO);
+    }
+
+    /**
+     * 条目缺陷占比-科室(内页)
+     *
+     * @param filterPageByDeptVO
+     * @return
+     */
+    @Override
+    public IPage<DeptEntryNumDTO> entryGroupByEntryAndDeptInnerPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO) {
+        return baseMapper.entryGroupByEntryAndDeptInnerPage(filterPageByDeptVO);
+    }
+
+    /**
+     * 各科室质控平均分(首页)-根据内外科系统统计
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<AverageStatisticsDTO> getAverageScoreByDeptClass(FilterVO filterVO) {
+        return baseMapper.getAverageScoreByDeptClass(filterVO);
+    }
+
+    /**
+     * 单项否决缺陷占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO) {
+        return baseMapper.entryRejectPercent(filterVO);
+    }
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO) {
+        return baseMapper.qcResultLevelPercent(filterVO);
+    }
 }
 }

+ 6 - 1
src/main/java/com/diagbot/task/BehospitalInfoAnalyzeTask.java

@@ -6,6 +6,7 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.SysTaskCronFacade;
 import com.diagbot.facade.SysTaskCronFacade;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.TaskVO;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
@@ -33,6 +34,8 @@ public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
 
 
     private SysTaskCron task001 = new SysTaskCron();
     private SysTaskCron task001 = new SysTaskCron();
 
 
+    private String param = "";
+
     @Autowired
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
     private BehospitalInfoFacade behospitalInfoFacade;
 
 
@@ -49,7 +52,8 @@ public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
                         && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task001.getIsUsed().equals(1)) {
                         && task001.getIsUsed().equals(1)) {
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
-                    behospitalInfoFacade.execute();
+                    TaskVO taskVO = new TaskVO();
+                    behospitalInfoFacade.execute(taskVO, param);
                 }
                 }
             }
             }
         }, new Trigger() {
         }, new Trigger() {
@@ -62,6 +66,7 @@ public class BehospitalInfoAnalyzeTask implements SchedulingConfigurer {
                 //2.2 合法性校验.
                 //2.2 合法性校验.
                 if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
                 if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
                     cron = task001.getCron();
                     cron = task001.getCron();
+                    param = task001.getParam();
                 }
                 }
                 CronTrigger trigger = new CronTrigger(cron);
                 CronTrigger trigger = new CronTrigger(cron);
                 return trigger.nextExecutionTime(triggerContext);
                 return trigger.nextExecutionTime(triggerContext);

+ 9 - 1
src/main/java/com/diagbot/task/TASK_CX.java

@@ -6,6 +6,7 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.SysTaskCronFacade;
 import com.diagbot.facade.SysTaskCronFacade;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.TaskVO;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
@@ -17,6 +18,7 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar;
 import org.springframework.scheduling.support.CronTrigger;
 import org.springframework.scheduling.support.CronTrigger;
 
 
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.Date;
 
 
 /**
 /**
@@ -33,6 +35,8 @@ public class TASK_CX implements SchedulingConfigurer {
 
 
     private SysTaskCron task = new SysTaskCron();
     private SysTaskCron task = new SysTaskCron();
 
 
+    private String param = "";
+
     @Autowired
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
     private BehospitalInfoFacade behospitalInfoFacade;
 
 
@@ -49,7 +53,10 @@ public class TASK_CX implements SchedulingConfigurer {
                         && task.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task.getIsDeleted().equals(IsDeleteEnum.N.getKey())
                         && task.getIsUsed().equals(1)) {
                         && task.getIsUsed().equals(1)) {
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
                     log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
-                    behospitalInfoFacade.execute2();
+                    TaskVO taskVO = new TaskVO();
+                    taskVO.setType(1); // 类型过滤(1:出院时间比当前时间早3天前的病历(例如:长兴病历))
+                    taskVO.setIndividuation(Arrays.asList(1)); //个性化需求【1:近3天不含当天的病历强制评分更新】
+                    behospitalInfoFacade.execute(taskVO, param);
                 }
                 }
             }
             }
         }, new Trigger() {
         }, new Trigger() {
@@ -63,6 +70,7 @@ public class TASK_CX implements SchedulingConfigurer {
                 //2.2 合法性校验.
                 //2.2 合法性校验.
                 if (null != task && StringUtil.isNotBlank(task.getCron())) {
                 if (null != task && StringUtil.isNotBlank(task.getCron())) {
                     cron = task.getCron();
                     cron = task.getCron();
+                    param = task.getParam();
                 }
                 }
                 CronTrigger trigger = new CronTrigger(cron);
                 CronTrigger trigger = new CronTrigger(cron);
                 return trigger.nextExecutionTime(triggerContext);
                 return trigger.nextExecutionTime(triggerContext);

+ 143 - 0
src/main/java/com/diagbot/util/ExcelUtils.java

@@ -0,0 +1,143 @@
+package com.diagbot.util;
+
+
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.ExcelExportStylerUserImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+/**
+ * @Description: excel 导入导出工具类
+ * @author: gaodm
+ * @time: 2020/6/2 19:18
+ */
+public class ExcelUtils {
+    public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
+                                   boolean isCreateHeader, HttpServletResponse response) {
+        ExportParams exportParams = new ExportParams(title, sheetName);
+        exportParams.setCreateHeadRows(isCreateHeader);
+        defaultExport(list, pojoClass, fileName, response, exportParams);
+    }
+
+    public static void exportExcelUser(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
+                                       HttpServletResponse response) {
+        ExportParams exportParams = new ExportParams(title, sheetName);
+        exportParams.setStyle(ExcelExportStylerUserImpl.class);
+        userExport(list, pojoClass, fileName, response, exportParams);
+    }
+
+    public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
+                                   HttpServletResponse response) {
+        defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName));
+    }
+
+    public static void exportExcel(List<Map<String, Object>> list, String fileName, HttpServletResponse response) {
+        defaultExport(list, fileName, response);
+    }
+
+    private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
+                                      ExportParams exportParams) {
+        Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
+        if (workbook != null) {
+            ;
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    private static void userExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
+                                      ExportParams exportParams) {
+        Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
+        if (workbook != null) {
+            Sheet sheet = workbook.getSheetAt(0);
+            //列宽设置
+            sheet.setColumnWidth(8, 256*20);
+            sheet.setColumnWidth(9, 256*50);
+            int rowNum = sheet.getLastRowNum();
+            Row row = sheet.getRow(0);
+            for (int i = 1; i <= rowNum; i++) {
+                row = sheet.getRow(i);
+                row.setHeightInPoints(12.8f);
+            }
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) {
+        try {
+            response.setCharacterEncoding("UTF-8");
+            response.setHeader("content-Type", "application/vnd.ms-excel");
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
+            workbook.write(response.getOutputStream());
+        } catch (IOException e) {
+            // throw new NormalException(e.getMessage());
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "导出Excel异常");
+        }
+    }
+
+    private static void defaultExport(List<Map<String, Object>> list, String fileName, HttpServletResponse response) {
+        Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF);
+        if (workbook != null) {
+            ;
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    public static <T> List<T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class<T> pojoClass) {
+        if (StringUtils.isBlank(filePath)) {
+            return null;
+        }
+        ImportParams params = new ImportParams();
+        params.setTitleRows(titleRows);
+        params.setHeadRows(headerRows);
+        List<T> list = null;
+        try {
+            list = ExcelImportUtil.importExcel(new File(filePath), pojoClass, params);
+        } catch (NoSuchElementException e) {
+            // throw new NormalException("模板不能为空");
+        } catch (Exception e) {
+            e.printStackTrace();
+            // throw new NormalException(e.getMessage());
+        }
+        return list;
+    }
+
+    public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows,
+                                          Class<T> pojoClass) {
+        if (file == null) {
+            return null;
+        }
+        ImportParams params = new ImportParams();
+        params.setTitleRows(titleRows);
+        params.setHeadRows(headerRows);
+        List<T> list = null;
+        try {
+            list = ExcelImportUtil.importExcel(file.getInputStream(), pojoClass, params);
+        } catch (NoSuchElementException e) {
+            // throw new NormalException("excel文件不能为空");
+        } catch (Exception e) {
+            // throw new NormalException(e.getMessage());
+            System.out.println(e.getMessage());
+        }
+        return list;
+    }
+
+}

+ 3 - 0
src/main/java/com/diagbot/vo/AnalyzeVO.java

@@ -18,4 +18,7 @@ public class AnalyzeVO {
     private Boolean isTask = false;
     private Boolean isTask = false;
     @ApiModelProperty(hidden = true)
     @ApiModelProperty(hidden = true)
     private Long modeId;
     private Long modeId;
+    // 是否使用CRF缓存(false: 不使用缓存,true:使用缓存)
+    @ApiModelProperty(hidden = true)
+    private boolean useCrfCache;
 }
 }

+ 12 - 0
src/main/java/com/diagbot/vo/BehospitalPageVO.java

@@ -80,4 +80,16 @@ public class BehospitalPageVO extends Page implements Serializable {
     private Long userId;
     private Long userId;
 
 
     private Long doctorCode;
     private Long doctorCode;
+
+    /**
+     * 统计维度 1-本月,2-本年
+     */
+    private Integer statisticsType;
+
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    @ApiModelProperty(hidden = true)
+    private String isPlacefile;
 }
 }

+ 42 - 0
src/main/java/com/diagbot/vo/DataImportVO.java

@@ -0,0 +1,42 @@
+package com.diagbot.vo;
+
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.entity.HomePage;
+import com.diagbot.entity.MedCrisisInfo;
+import com.diagbot.entity.MedicalRecord;
+import com.diagbot.entity.MedicalRecordContent;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/4/14 9:53
+ */
+@Data
+public class DataImportVO {
+    // 医院ID
+    @NotNull(message = "医院ID不能为空")
+    private Long hospitalId;
+    // 病历信息
+    private List<BehospitalInfo> behospitalInfoList;
+    // 危急值信息
+    private List<MedCrisisInfo> medCrisisInfoList;
+    // 病人医嘱
+    private List<DoctorAdvice> doctorAdviceList;
+    // 病案首页诊断
+    private List<HomeDiagnoseInfo> homeDiagnoseInfoList;
+    // 病案首页
+    private List<HomePage> homePageList;
+    // 病案首页手术信息
+    private List<HomeOperationInfo> homeOperationInfoList;
+    // 文书信息
+    private List<MedicalRecord> medicalRecordList;
+    // 文书明细信息
+    private List<MedicalRecordContent> medicalRecordContentList;
+}

+ 19 - 0
src/main/java/com/diagbot/vo/DeleteQcTypeVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: ztg
+ * @time: 2019/1/28 15:45
+ */
+@Getter
+@Setter
+public class DeleteQcTypeVO {
+    @NotEmpty(message = "ids不能为空")
+    private List<Long> ids;
+}

+ 30 - 0
src/main/java/com/diagbot/vo/ExportQcresultVO.java

@@ -0,0 +1,30 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/6/2 20:09
+ */
+@Getter
+@Setter
+public class ExportQcresultVO {
+    private Date leaveHosDateStart;
+    private Date leaveHosDateEnd;
+    @ApiModelProperty(hidden = true)
+    private String hospitalId;
+    @ApiModelProperty(hidden = true)
+    private Long userId;
+
+    private String behospitalCode;
+    private String level;
+    private String doctorName;
+    private String doctorCode;
+    private String deptId;
+    private String name;
+}

+ 19 - 7
src/main/java/com/diagbot/vo/FilterPageVO.java

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
+import javax.validation.constraints.NotNull;
+
 /**
 /**
  * @Description:
  * @Description:
  * @Author:zhaops
  * @Author:zhaops
@@ -16,20 +18,15 @@ public class FilterPageVO extends Page {
     /**
     /**
      * 统计维度 1-本月,2-本年
      * 统计维度 1-本月,2-本年
      */
      */
+    @NotNull(message = "请输入本年或本月")
     private Integer type;
     private Integer type;
-    /**
-     * 时间类型 1-本月/本年,2-上月/去年,3-去年本月/去年
-     */
-    private Integer dateType;
     /**
     /**
      * 起始时间
      * 起始时间
      */
      */
-    @ApiModelProperty(hidden = true)
     private String startDate;
     private String startDate;
     /**
     /**
      * 结束时间
      * 结束时间
      */
      */
-    @ApiModelProperty(hidden = true)
     private String endDate;
     private String endDate;
     /**
     /**
      * 医院id
      * 医院id
@@ -52,4 +49,19 @@ public class FilterPageVO extends Page {
      * 模块id:243=病案首页
      * 模块id:243=病案首页
      */
      */
     private Long casesId;
     private Long casesId;
-}
+
+    /**
+     * 模块名称
+     */
+    private String casesName;
+
+    /**
+     * 单项否决
+     */
+    private Integer isReject;
+
+    /**
+     * 规则类型(0:无,1:空项,2:错误)
+     */
+    private Integer ruleType;
+}

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

@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
+import javax.validation.constraints.NotNull;
+
 /**
 /**
  * @Description:
  * @Description:
  * @Author:zhaops
  * @Author:zhaops
@@ -15,16 +17,15 @@ public class FilterVO {
     /**
     /**
      * 统计维度 1-本月,2-本年
      * 统计维度 1-本月,2-本年
      */
      */
+    @NotNull(message = "请输入本年或本月")
     private Integer type;
     private Integer type;
     /**
     /**
      * 起始时间
      * 起始时间
      */
      */
-    @ApiModelProperty(hidden = true)
     private String startDate;
     private String startDate;
     /**
     /**
      * 结束时间
      * 结束时间
      */
      */
-    @ApiModelProperty(hidden = true)
     private String endDate;
     private String endDate;
     /**
     /**
      * 医院id
      * 医院id
@@ -39,4 +40,11 @@ public class FilterVO {
 
 
     @ApiModelProperty(hidden = true)
     @ApiModelProperty(hidden = true)
     private Long userId;
     private Long userId;
+
+    /**
+     * 科室分类
+     */
+    private String deptClass;
+
+    private String level;
 }
 }

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

@@ -1,23 +0,0 @@
-package com.diagbot.vo;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @Author:zhaops
- * @time: 2020/5/6 11:29
- */
-@Getter
-@Setter
-public class HomePageFilterVO extends FilterVO {
-    /**
-     * 死亡
-     */
-    private Integer death;
-
-    /**
-     * 新生儿
-     */
-    private Integer newBorn;
-}

+ 9 - 5
src/main/java/com/diagbot/vo/ModelHospitalUpdataVO.java

@@ -3,6 +3,9 @@ package com.diagbot.vo;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
 /**
 /**
  * @author wangfeng
  * @author wangfeng
  * @Description:
  * @Description:
@@ -12,18 +15,19 @@ import lombok.Setter;
 @Getter
 @Getter
 public class ModelHospitalUpdataVO {
 public class ModelHospitalUpdataVO {
 
 
-
     private Long id;
     private Long id;
-
+    @NotNull(message = "请输入医院Id")
     private Long hospitalId;
     private Long hospitalId;
-
+    @NotBlank(message = "请输入医院数据模块名")
     private String hospitalModelName;
     private String hospitalModelName;
-
+    //@NotNull(message = "请输入数据模块Id")
     private Long standModelId;
     private Long standModelId;
-
+    //@NotBlank(message = "请输入数据模块名")
     private String standModelName;
     private String standModelName;
     /**
     /**
      * 备注
      * 备注
      */
      */
     private String remark;
     private String remark;
+
+    private QcAbnormalSaveNameVO qcAbnormalName;
 }
 }

+ 22 - 0
src/main/java/com/diagbot/vo/QcAbnormalModeVO.java

@@ -0,0 +1,22 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-06-03 10:56
+ */
+@Setter
+@Getter
+public class QcAbnormalModeVO {
+    /**
+     * 异常描述
+     */
+    @NotBlank(message = "请输入异常数据说明")
+    private String description;
+
+}

+ 25 - 0
src/main/java/com/diagbot/vo/QcAbnormalSaveNameVO.java

@@ -0,0 +1,25 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-05-27 13:49
+ */
+@Setter
+@Getter
+public class QcAbnormalSaveNameVO {
+    @NotNull(message = "请输入Id")
+    private  Long id;
+    @NotBlank(message = "请输入异常描述")
+    private  String description;
+    @NotNull(message = "请输入处理状态")
+    private  Integer status;
+    private  String remark;
+
+}

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

@@ -1,14 +1,11 @@
 package com.diagbot.vo;
 package com.diagbot.vo;
 
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.enums.SysTypeEnum;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.util.SysUserUtils;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
-import javax.validation.constraints.NotNull;
-
 /**
 /**
  * @author wangfeng
  * @author wangfeng
  * @Description:
  * @Description:
@@ -24,4 +21,5 @@ public class QcCasesEntryHospitalVO extends Page {
     private String name;
     private String name;
     private Integer isReject;
     private Integer isReject;
     private Integer isUsed;
     private Integer isUsed;
+    private Integer ruleType;
 }
 }

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

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/29 15:09
+ */
+@Getter
+@Setter
+public class QcEntryHospitalVO {
+    // 医院id
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+}

+ 15 - 0
src/main/java/com/diagbot/vo/QcTypeCasesEntryVO.java

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Data
+public class QcTypeCasesEntryVO {
+
+    // 质控条目id
+    private Long caseEntryId;
+}

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

@@ -0,0 +1,24 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/29 15:09
+ */
+@Getter
+@Setter
+public class QcTypeIndexVO {
+    // 界面输入
+    private String input;
+    // 医院id
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+    // 过滤caseEntryId
+    private List<Long> notIds;
+}

+ 22 - 0
src/main/java/com/diagbot/vo/QcTypePageVO.java

@@ -0,0 +1,22 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 质控类型列表入参
+ * @Author: ztg
+ * @Date: 2018/12/13 10:07
+ */
+@Getter
+@Setter
+public class QcTypePageVO extends Page {
+
+    // 名称
+    private String name;
+    // 医院id
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+}

+ 26 - 0
src/main/java/com/diagbot/vo/QcTypeSaveVO.java

@@ -0,0 +1,26 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: 质控类型保存入参
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Data
+public class QcTypeSaveVO {
+
+    // 主键
+    private Long id;
+    // 医院ID
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+    // 质控类型名称
+    private String name;
+    // 质控类型和质控条目关联信息
+    private List<QcTypeCasesEntryVO> qcTypeCasesEntryVOList = new ArrayList<>();
+}

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

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2018/8/6 10:16
+ */
+@Getter
+@Setter
+public class QcTypeVO {
+    private Long id;
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+}

+ 0 - 0
src/main/java/com/diagbot/vo/QueryVo.java


Some files were not shown because too many files changed in this diff