Procházet zdrojové kódy

Merge branch 'dev/h5&log_20220506'

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
#	src/main/java/com/diagbot/mapper/QcresultInfoMapper.java
#	src/main/java/com/diagbot/service/QcresultInfoService.java
#	src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java
#	src/main/resources/mapper/QcresultInfoMapper.xml
songxinlu před 3 roky
rodič
revize
1d6b7abf26
59 změnil soubory, kde provedl 3278 přidání a 164 odebrání
  1. 180 0
      doc/048.20220506_v2.7.0_通用版_操作日志/qc_init_v2.7.0_通用版_操作日志.sql
  2. 7 1
      pom.xml
  3. 675 0
      src/main/java/com/diagbot/aop/LogAspect.java
  4. 12 0
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  5. 13 4
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  6. 26 0
      src/main/java/com/diagbot/dto/BehInfoForH5DTO.java
  7. 3 0
      src/main/java/com/diagbot/dto/GetAppealReviewDTO.java
  8. 24 0
      src/main/java/com/diagbot/dto/LevelPercentDTO.java
  9. 2 0
      src/main/java/com/diagbot/dto/QcCasesDTO.java
  10. 48 0
      src/main/java/com/diagbot/dto/SysLoginLogDTO.java
  11. 71 0
      src/main/java/com/diagbot/dto/SysOperationLogDTO.java
  12. 8 81
      src/main/java/com/diagbot/entity/SysHospitalSet.java
  13. 91 0
      src/main/java/com/diagbot/entity/SysLoginLog.java
  14. 121 0
      src/main/java/com/diagbot/entity/SysOperationLog.java
  15. 42 0
      src/main/java/com/diagbot/facade/LogManagementFacade.java
  16. 22 0
      src/main/java/com/diagbot/facade/LoginLogFacade.java
  17. 114 0
      src/main/java/com/diagbot/facade/OperationLogFacade.java
  18. 4 0
      src/main/java/com/diagbot/facade/QcCasesEntryHospitalFacade.java
  19. 4 0
      src/main/java/com/diagbot/facade/QcCasesFacade.java
  20. 126 0
      src/main/java/com/diagbot/facade/StatisticsForH5Facade.java
  21. 18 0
      src/main/java/com/diagbot/facade/SysHospitalSetFacade.java
  22. 11 2
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  23. 2 0
      src/main/java/com/diagbot/mapper/QcCasesEntryHospitalMapper.java
  24. 3 0
      src/main/java/com/diagbot/mapper/QcCasesMapper.java
  25. 10 3
      src/main/java/com/diagbot/mapper/QcresultInfoMapper.java
  26. 23 0
      src/main/java/com/diagbot/mapper/SysLoginLogMapper.java
  27. 23 0
      src/main/java/com/diagbot/mapper/SysOperationLogMapper.java
  28. 32 21
      src/main/java/com/diagbot/service/BehospitalInfoService.java
  29. 17 1
      src/main/java/com/diagbot/service/QcresultInfoService.java
  30. 16 0
      src/main/java/com/diagbot/service/SysLoginLogService.java
  31. 16 0
      src/main/java/com/diagbot/service/SysOperationLogService.java
  32. 35 20
      src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
  33. 28 5
      src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java
  34. 20 0
      src/main/java/com/diagbot/service/impl/SysLoginLogServiceImpl.java
  35. 20 0
      src/main/java/com/diagbot/service/impl/SysOperationLogServiceImpl.java
  36. 50 0
      src/main/java/com/diagbot/util/AddressUtils.java
  37. 179 0
      src/main/java/com/diagbot/util/HttpUtils.java
  38. 155 0
      src/main/java/com/diagbot/util/IpUtils.java
  39. 17 0
      src/main/java/com/diagbot/util/SysUserUtils.java
  40. 3 0
      src/main/java/com/diagbot/vo/AddAppealInfoApiVO.java
  41. 3 0
      src/main/java/com/diagbot/vo/AddAppealInfoVO.java
  42. 50 0
      src/main/java/com/diagbot/vo/BehInfoForH5VO.java
  43. 6 0
      src/main/java/com/diagbot/vo/GetAppealReviewVO.java
  44. 16 0
      src/main/java/com/diagbot/vo/HospitalIdVO.java
  45. 47 0
      src/main/java/com/diagbot/vo/SysLoginLogVO.java
  46. 53 0
      src/main/java/com/diagbot/vo/SysOperationLogVO.java
  47. 54 10
      src/main/java/com/diagbot/web/ConsoleByDeptExportController.java
  48. 52 10
      src/main/java/com/diagbot/web/ConsoleExportController.java
  49. 45 0
      src/main/java/com/diagbot/web/LogManagementController.java
  50. 13 5
      src/main/java/com/diagbot/web/MedAppealInfoController.java
  51. 27 0
      src/main/java/com/diagbot/web/QcTypeController.java
  52. 111 0
      src/main/java/com/diagbot/web/StatisticsForH5Controller.java
  53. 1 1
      src/main/resources/bootstrap.yml
  54. 120 0
      src/main/resources/mapper/BehospitalInfoMapper.xml
  55. 38 0
      src/main/resources/mapper/QcCasesEntryHospitalMapper.xml
  56. 19 0
      src/main/resources/mapper/QcCasesMapper.xml
  57. 226 0
      src/main/resources/mapper/QcresultInfoMapper.xml
  58. 52 0
      src/main/resources/mapper/SysLoginLogMapper.xml
  59. 74 0
      src/main/resources/mapper/SysOperationLogMapper.xml

+ 180 - 0
doc/048.20220506_v2.7.0_通用版_操作日志/qc_init_v2.7.0_通用版_操作日志.sql

@@ -0,0 +1,180 @@
+
+use `qc`;
+-- 执行前请看注意事项!
+-- 操作日志相关配置
+-- 注意
+
+SET @hospitalId =4;
+
+/**
+sys_login_log 系统登录日志表
+ */
+DROP TABLE IF EXISTS `sys_login_log`;
+CREATE TABLE `sys_login_log` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
+  `login_id` bigint(20) NOT NULL COMMENT '登录用户ID',
+  `login_name` varchar(64) NOT NULL COMMENT '登录用户名',
+  `login_date` datetime NOT NULL COMMENT '登录日期',
+  `login_ip` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录ip',
+  `login_address` varchar(64) DEFAULT NULL COMMENT '登录ip地址',
+  `login_browser` varchar(64) DEFAULT NULL COMMENT '浏览器',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(32) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(32) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=391 DEFAULT CHARSET=utf8 COMMENT='系统登录日志表';
+
+
+
+/**
+sys_operation_log 系统操作日志表
+ */
+DROP TABLE IF EXISTS `sys_operation_log`;
+CREATE TABLE `sys_operation_log` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
+  `operation_id` bigint(20) DEFAULT NULL COMMENT '操作人用户ID',
+  `operation_name` varchar(64) DEFAULT NULL COMMENT '操作人用户名',
+  `operation_date` datetime NOT NULL COMMENT '操作日期',
+  `operation_record` varchar(256) DEFAULT NULL COMMENT '操作记录',
+  `operation_ip` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT 'ip地址',
+  `operation_address` varchar(64) DEFAULT NULL COMMENT '操作地址',
+  `operation_method` varchar(256) NOT NULL COMMENT '操作方法',
+  `operation_way` varchar(32) NOT NULL COMMENT '操作请求方式',
+  `operation_url` varchar(256) NOT NULL COMMENT '操作url',
+  `operation_param` longtext COMMENT '操作参数',
+  `json_result` longtext COMMENT '返回参数',
+  `is_placefile` varchar(2) NOT NULL DEFAULT '0' COMMENT '是否归档(0:未归档,1:已归档)',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(32) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(32) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=25285 DEFAULT CHARSET=utf8 COMMENT='系统操作日志表';
+
+
+/**
+sys_menu 添加操作日志相关菜单
+ */
+
+INSERT INTO `sys_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ('130', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '日志管理', '-1', 'YH-RZGL', '1', '1', '17', '用户-日志管理');
+INSERT INTO `sys_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ('131', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '操作日志', '130', 'YH-RZGL-CZRZ', '1', '1', '1', '用户-日志管理-操作日志');
+INSERT INTO `sys_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ('132', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '登录日志', '130', 'YH-RZGL-DLRZ', '1', '1', '2', '用户-日志管理-登录日志');
+
+
+/**
+sys_role_menu 超级管理员添加操作日志相关菜单
+ */
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '130', '用户-日志管理');
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '131', '用户-日志管理-操作日志');
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '132', '用户-日志管理-登录日志');
+
+
+
+/**
+sys_hospital_set 医院配置表配置对应医院的日志信息模板
+ */
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改模块分值', '/qc/cases/saveQcCases', '修改#name模块分值为#score_new分', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改条目提示信息', '/qc/casesEntryHospital/updataQcCasesEntry', '修改#name条目提示信息为#msg_new', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '禁用用户', '/sys/user/disable', '修改#linkman用户状态为禁用', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '启用用户', '/sys/user/enable', '修改#linkman用户状态为启用', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改条目提示信息', '/qc/casesEntryHospital/updataQcCasesEntry', '修改#name条目分值为#score_new分', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改条目提示信息', '/qc/casesEntryHospital/updataQcCasesEntry', '修改#name条目类型为{\"key\":\"isReject_new\",\"0\":\"非单否\",\"1\":\"单否\"}', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改条目提示信息', '/qc/casesEntryHospital/updataQcCasesEntry', '修改#name条目启用状态为{\"key\":\"isUsed_new\",\"0\":\"未启用\",\"1\":\"启用\"}', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '新增质控类型', '/qc/qcType/add', '新增#name质控类型', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改质控类型', '/qc/qcType/update', '修改#name质控类型', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '复制质控类型', '/qc/qcType/copy', '复制#name质控类型', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '删除质控类型', '/qc/qcType/delete', '删除#name质控类型', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改角色权限', '/sys/role/saveRoleMenu', '修改#name角色权限', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改用户角色', '/sys/user/editUserRoles', '修改#linkman所属角色为#roles', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '质控评分', '/qc/behospitalInfo/analyze', '人工手动评分', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '修改用户科室', '/sys/user/editUserDepts', '修改#linkman所属科室为#depts', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/medicalCheckExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/homePageLevelExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/homePageLevelXYExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/entryGroupByEntryExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/levelExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/levelExport_TZ', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/getAverageDayNumExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/getAverageFeeExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/levelPercentGroupByDeptExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/entryCountGroupByEntryExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/entryCountGroupXYByEntryExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/entryCountGroupByCaseExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/entryStatisticsExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/qcResultShortPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/qcResultShortXYPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/leaveHosMrPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/qcCheckStatisticsExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/unModifyMRPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/medicalCheckInnerExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/unModifyMRStatisticsExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/reHos31DaysPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/hmImproveMRPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/qcCheckMRPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/qualityControlExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/homePageLevelExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/homePageLevelXYExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/entryCountGroupXYByExportDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/qcResultShortXYPageExportDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/entryGroupExportByDeptPage', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/entryGroupExportByDeptCase', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/entryGroupExportByDeptEntry', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/qcResultShortExportByDeptPage', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/levelExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/entryStatisticsExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/leaveHosMrPageExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/qcCheckStaExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/qcCheckMRPageExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/improveMRExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/reHos31DaysPageExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/unModifyMRSExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/unModifyMRPageExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/qualityControlExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/behospitalInfo/exportExcel', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/behospitalInfo/exportQcresult', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/behospitalInfo/exportQcresultByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/behospitalInfo/exportQcresultByPerson', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/behospitalInfo/exportQcresultByGroup', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/analysisDept/getEntryDefectImproveByDeptExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/analysisDept/getDefectImproveInnerByDeptExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/analysis/getQcClickByExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/analysis/getQcClickInnerPageByExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/analysis/getEntryDefectImproveByExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/analysis/getDefectImproveInnerByExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/consoleByDoctor/doctorAverageStatisticsExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/consoleByDoctor/doctorAverageLevelExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/consoleByDoctor/getDoctorDetailPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/consoleByDoctor/getDetailRecordListPageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/appealExamineInfo/getComplaintRecordExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/qc/appealExamineInfo/getAppealReviewExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/badQualifiedLevelPageXYExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/badUnQualifiedLevelPageXYExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/homeQualifiedPageOrLevelExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/homeUnQualifiedPageOrLevelExportByDept', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/badQualifiedLevelPagePageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/badUnQualifiedLevelPagePageExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/badQualifiedLevelPageXYExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/console/export/badUnQualifiedLevelPageXYExport', '导出#excelName', 'operationLog');
+INSERT INTO `sys_hospital_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @hospitalId, '导出', '/print/export/medicalCheckExportByDept', '导出#excelName', 'operationLog');
+
+
+
+/**
+med_appeal_info 申诉信息表添加申诉人姓名字段
+ */
+ALTER TABLE `med_appeal_info` ADD  `claimant_name` varchar(60) DEFAULT NULL COMMENT '申诉人姓名' AFTER `claimant_id`;
+
+/**
+med_appeal_examine_info 修改申诉审核表创建时间和修改时间默认为空
+ */
+ALTER TABLE `med_appeal_examine_info`
+MODIFY COLUMN `gmt_create` datetime DEFAULT NULL COMMENT '记录创建时间' AFTER `is_deleted`;
+ALTER TABLE `med_appeal_examine_info`
+MODIFY COLUMN `gmt_modified` datetime DEFAULT NULL COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改' AFTER `gmt_create`;

+ 7 - 1
pom.xml

@@ -38,6 +38,7 @@
         <easypoi.version>4.2.0</easypoi.version>
         <patchca.version>1.1.2</patchca.version>
         <hutool.version>5.0.7</hutool.version>
+        <bitwalker.version>1.21</bitwalker.version>
         <docker-maven-plugin.version>1.2.1</docker-maven-plugin.version>
         <docker.image.prefix>192.168.2.122:5000/diagbotcloud</docker.image.prefix>
         <registryUrl>http://192.168.2.122:5000/repository/diagbotcloud/</registryUrl>
@@ -231,7 +232,12 @@
             <version>6.2.0.jre8</version>
             <scope>runtime</scope>
         </dependency>
-
+        <!-- 解析客户端操作系统、浏览器等 -->
+        <dependency>
+            <groupId>eu.bitwalker</groupId>
+            <artifactId>UserAgentUtils</artifactId>
+            <version>${bitwalker.version}</version>
+        </dependency>
     </dependencies>
 
     <!-- 私有仓库 -->

+ 675 - 0
src/main/java/com/diagbot/aop/LogAspect.java

@@ -0,0 +1,675 @@
+package com.diagbot.aop;
+
+import com.alibaba.fastjson.JSONObject;
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.exceptions.JWTDecodeException;
+import com.auth0.jwt.interfaces.Claim;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import com.diagbot.dto.QcCasesDTO;
+import com.diagbot.dto.QcCasesEntryHospitalDTO;
+import com.diagbot.dto.SysLoginLogDTO;
+import com.diagbot.dto.SysOperationLogDTO;
+import com.diagbot.dto.SysRoleDTO;
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.entity.QcType;
+import com.diagbot.dto.SysUserRoleDTO;
+import com.diagbot.entity.SysHospitalSet;
+import com.diagbot.entity.SysRole;
+import com.diagbot.entity.SysUser;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.facade.LoginLogFacade;
+import com.diagbot.facade.OperationLogFacade;
+import com.diagbot.facade.SysHospitalSetFacade;
+import com.diagbot.util.AddressUtils;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.IpUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.DeleteQcTypeVO;
+import com.diagbot.vo.QcCasesEntryUpdataVO;
+import com.diagbot.vo.QcCasesSaveListVO;
+import com.diagbot.vo.SysRoleMenuSaveVO;
+import com.diagbot.vo.SysUserBaseVO;
+import com.diagbot.vo.SysUserDeptVO;
+import com.diagbot.vo.SysUserRoleVO;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import eu.bitwalker.useragentutils.UserAgent;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:日志记录处理
+ * @author: songxl
+ * @time: 2022/5/09 14:28
+ */
+
+@Aspect
+@Component
+public class LogAspect {
+    @Autowired
+    LoginLogFacade loginLogFacade;
+    @Autowired
+    SysHospitalSetFacade sysHospitalSetFacade;
+    @Autowired
+    OperationLogFacade operationLogFacade;
+
+    // 操作配置织入点
+    @Pointcut("execution(public * com.diagbot.web.*.*(..))" +
+            "&& !execution(public * com.diagbot.web.SysUserController.getJwt(..))" +
+            "&& !execution(public * com.diagbot.web.SysUserController.getCaptcha(..))" +
+            "&& !execution(public * com.diagbot.web.SysUserController.getJwtNoPass(..))" +
+            "&& !execution(public * com.diagbot.web.SysUserController.getHospitalMark(..))" +
+            "&& !execution(public * com.diagbot.web.SysUserController.midifyPassword(..))"
+    )
+    public void operPointCut() {
+    }
+
+    // 登录织入点
+    @Pointcut("execution(public * com.diagbot.web.SysUserController.getJwt(..))")
+    public void loginAfterReturning() {
+    }
+
+
+    /**
+     * 登录成功之后执行
+     *
+     * @param
+     */
+    @AfterReturning(pointcut = "loginAfterReturning()", returning = "jsonResult")
+    public void loginAfterReturning(JoinPoint joinPoint, Object jsonResult) {
+        loginLogHandle(joinPoint, jsonResult);
+    }
+
+    /**
+     * 操作之前执行
+     *
+     * @param
+     */
+    @Before(value = "operPointCut()")
+    public void operPointCut(JoinPoint joinPoint) {
+        operationLogHandler(joinPoint);
+    }
+
+    /**
+     * 操作日志处理类
+     *
+     * @param joinPoint
+     * @Return void
+     */
+    private void operationLogHandler(JoinPoint joinPoint) {
+
+        try {
+            //1.去sys_hospital_set表中拿所有需要进行操作日志记录的url
+            List<SysHospitalSet> hospitalSets = sysHospitalSetFacade
+                    .getHospitalSetByRemark(Long.parseLong(SysUserUtils.getCurrentHospitalID()), "operationLog");
+            if (ListUtil.isNotEmpty(hospitalSets)) {
+                havingOperation(hospitalSets, HttpUtils.getHttpServletRequest(), joinPoint);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 有包含操作日志配置的进行处理
+     *
+     * @param hospitalSets       操作日志配置
+     * @param httpServletRequest 请求
+     * @param joinPoint          入参
+     * @Return void
+     */
+    private void havingOperation(List<SysHospitalSet> hospitalSets, HttpServletRequest httpServletRequest, JoinPoint joinPoint) {
+
+        StringBuffer operationRecordBuffer = new StringBuffer();
+        //结果拼接容器
+        Map<String, Object> outMap = new HashMap<>();
+        initOutMap(outMap);
+        //1.判断该请求是否需要操作日志记录
+        hospitalSets.stream().forEach(hospitalSet -> {
+            if (matchers(hospitalSet.getCode(), httpServletRequest)) {
+                operationUrlHandler(outMap, HttpUtils.getHttpServletRequest().getRequestURI(), joinPoint);
+                //替换拼接结果
+                String operationRecord = makeOperationRecord(hospitalSet.getValue(), outMap);
+                if (!operationRecord.contains("#")) {
+                    operationRecordBuffer.append(operationRecord).append(";");
+                }
+
+                //                try {
+                //                    //由于两个对象大多结构不一样(例如:obj list),对比先不统一处理,放到case中每个方法单独处理
+                //                                        Object old = getOldOperation(HttpUtils.getHttpServletRequest().getRequestURI(), params);
+                //                                        Object[] args = joinPoint.getArgs();
+                //                                        if (args != null && args.length > 0){
+                //                                            for(int i = 0;i<args.length;i++){
+                //                                                //对比
+                //                                                comparePara(old, args[i]);
+                //                                            }
+                //
+                //                                        }
+                //                } catch (Exception e) {
+                //                    e.printStackTrace();
+                //                }
+            }
+
+        });
+        //保存操作记录
+        saveOperationLog(joinPoint, operationRecordBuffer.toString());
+    }
+
+    /**
+     * 一些常用结果装入map集合
+     *
+     * @param outMap
+     * @Return void
+     */
+    private void initOutMap(Map<String, Object> outMap) {
+        //添加excelName:获取前端要导出的文件名
+        if (StringUtil.isNotBlank(SysUserUtils.getExcelName())) {
+            try {
+                outMap.put("#excelName", URLDecoder.decode(SysUserUtils.getExcelName(), "UTF-8"));
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+        }
+        if (StringUtil.isNotBlank(SysUserUtils.getIsPlacefile())) {
+            outMap.put("#isPlacefile", SysUserUtils.getIsPlacefile());
+        }
+    }
+
+    /**
+     * 保存操作日志
+     *
+     * @param joinPoint
+     * @param operationRecord
+     * @Return void
+     */
+    private void saveOperationLog(JoinPoint joinPoint, String operationRecord) {
+
+        try {
+            if (StringUtil.isNotBlank(operationRecord)) {
+                SysOperationLogDTO operationLog = new SysOperationLogDTO();
+                Date date = new Date();
+                operationLog.setOperationDate(date);
+                operationLog.setGmtCreate(date);
+                operationLog.setOperationId(SysUserUtils.getCurrentPrincipleID());
+                try {
+                    SysUser sysUser = operationLogFacade.getSysUser(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
+                    if (sysUser != null) {
+                        operationLog.setOperationName(sysUser.getLinkman());
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                String ip = HttpUtils.getIpAddress();
+                if (IpUtils.isIPv4LiteralAddress(ip)) {
+                    operationLog.setOperationIp(ip);
+                } else {
+                    operationLog.setRemark("[非ipv4地址]:" + ip);
+                }
+
+                // 设置方法名称
+                String className = joinPoint.getTarget().getClass().getName();
+                String methodName = joinPoint.getSignature().getName();
+                operationLog.setOperationMethod(className + "." + methodName + "()");
+                // 设置请求方式
+                operationLog.setOperationWay(HttpUtils.getHttpServletRequest().getMethod());
+                operationLog.setOperationUrl(HttpUtils.getHttpServletRequest().getRequestURI());
+                // 处理设置注解上的参数
+                try {
+                    String params = getControllerMethodDescription(joinPoint);
+                    if (StringUtils.isNotBlank(params)) {
+                        operationLog.setOperationParam(params);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                operationLog.setIsPlacefile(SysUserUtils.getIsPlacefile() == null ? "0" : SysUserUtils.getIsPlacefile());
+                operationLog.setOperationRecord(operationRecord.substring(0, operationRecord.length() - 1));
+                operationLog.setHospitalId(SysUserUtils.getCurrentHospitalID());
+                operationLogFacade.getBaseMapper().addOperationRecord(operationLog);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 操作日志模板拼接
+     *
+     * @param value  数据库模板内容弄个
+     * @param outMap 拼接集合<占位符,替换值>
+     * @Return java.lang.String
+     */
+    private String makeOperationRecord(String value, Map<String, Object> outMap) {
+
+        if (StringUtil.isBlank(value) || outMap.keySet().size() == 0) {
+            return value;
+        }
+        //直接占位符替换
+        for (String key : outMap.keySet()) {
+            if (value.contains(key)) {
+                value = value.replaceAll(key, outMap.get(key) + "");
+            }
+        }
+        try {
+            //对通过入参的值为key获取value[针对统一url,根据入参的值不同,替换的内容也不同,把这些内容拼接到模板value中{"入参值1":"拼接结果1","入参值2":"拼接结果2","key":"入参名称"}]
+            value = transformModeValue(value, outMap);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return value;
+    }
+
+    /**
+     * 针对根据入参值不同取不同内容进行处理
+     * 根据入参的值不同,替换的内容也不同,把这些内容拼接到模板value中{"入参值1":"拼接结果1","入参值2":"拼接结果2","key":"入参名称"}
+     *
+     * @param value
+     * @param outMap
+     * @Return java.lang.String
+     */
+    private String transformModeValue(String value, Map<String, Object> outMap) {
+        while (value.contains("{") && value.contains("}")) {
+            String strParam = value.substring(value.indexOf("{"), value.indexOf("}") + 1);
+            JSONObject paramJSON = JSONObject.parseObject(strParam);
+            String temp = paramJSON.getString(outMap.get("#" + paramJSON.getString("key")) + "");
+            if (temp == null) {
+                temp = "#";
+            }
+            value = StringUtils.replace(value, strParam, temp);
+        }
+        return value;
+    }
+
+    private void comparePara(Object old, Object params, Map<String, Object> outMap) {
+        try {
+            //对比新旧数据变化
+            compareTwoClass(old, params, outMap);
+            //拼接操作结果
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    /**
+     * 两个对象进行比较
+     *
+     * @param class1
+     * @param class2
+     * @param outMap
+     * @Return void
+     */
+    public static void compareTwoClass(Object class1, Object class2, Map<String, Object> outMap) {
+
+        //获取对象的class
+        Class<?> clazz1 = class1.getClass();
+        Class<?> clazz2 = class2.getClass();
+        //获取对象的属性列表
+        Field[] field1 = clazz1.getDeclaredFields();
+        Field[] field2 = clazz2.getDeclaredFields();
+        List<String> fieldList1 = new ArrayList<>();
+        for (Field field : field1) {
+            fieldList1.add(field.getName());
+        }
+        for (Field field : field2) {
+            fieldList1.remove(field.getName());
+        }
+
+        //遍历属性列表field1
+        for (int i = 0; i < field1.length; i++) {
+            field1[i].setAccessible(true);
+            //遍历属性列表field2
+            for (int j = 0; j < field2.length; j++) {
+                //如果field1[i]属性名与field2[j]属性名内容相同
+                if (field1[i].getName().equals(field2[j].getName())) {
+                    field2[j].setAccessible(true);
+                    try {
+                        //如果field1[i]属性值与field2[j]属性值内容不相同
+                        if (!compareTwo(field1[i].get(class1), field2[j].get(class2))) {
+                            outMap.put("#" + field1[i].getName() + "_old", field1[i].get(class1));
+                            outMap.put("#" + field1[i].getName() + "_new", field2[j].get(class2));
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    break;
+                }
+            }
+            //把old中有的属性new中没有的加入map
+            if (fieldList1.contains(field1[i].getName())) {
+                try {
+                    outMap.put("#" + field1[i].getName(), field1[i].get(class1));
+                } catch (IllegalAccessException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+    }
+
+
+    //对比两个数据是否内容相同
+    public static boolean compareTwo(Object object1, Object object2) {
+
+        if (object1 == null && object2 == null) {
+            return true;
+        }
+        if (object1 == null && object2 != null) {
+            return false;
+        }
+        if (object1.equals(object2)) {
+            return true;
+        }
+        return false;
+    }
+
+    private Object getOldOperation(String requestURI, String params) {
+        switch (requestURI) {
+            case "/qc/cases/saveQcCases"://修改模块分值
+                if (StringUtil.isNotEmpty(params)) {
+                    //通过id获取模块名称以及目前分值
+                    JSONObject paramJSON = JSONObject.parseObject(params);
+                    QcCasesDTO old = operationLogFacade.getQcCasesById(paramJSON.getJSONArray("qcCasesSaveVOList")
+                            .getJSONObject(0).getString("id"));
+                    return old;
+                }
+                break;
+        }
+        return null;
+    }
+
+    /**
+     * 操作日志处理中心
+     *
+     * @param outMap
+     * @param requestURI
+     * @param joinPoint
+     * @Return void
+     */
+    private void operationUrlHandler(Map<String, Object> outMap, String requestURI, JoinPoint joinPoint) {
+
+        try {
+            Object[] args = joinPoint.getArgs();
+            switch (requestURI) {
+                case "/qc/cases/saveQcCases"://修改模块分值
+                    if (null != args && args.length >= 0) {
+                        //通过id获取模块名称以及目前分值
+                        if (args[0] instanceof QcCasesSaveListVO) {
+                            QcCasesSaveListVO qcCasesSaveListVO = (QcCasesSaveListVO) args[0];
+                            QcCasesDTO old = operationLogFacade.getQcCasesById(qcCasesSaveListVO.getQcCasesSaveVOList().get(0).getId() + "");
+                            compareTwoClass(old, qcCasesSaveListVO.getQcCasesSaveVOList().get(0), outMap);
+                        }
+                    }
+                    break;
+                case "/sys/user/disable"://禁用用户
+                    if (null != args && args.length >= 0) {
+                        //通过id获取用户具体信息
+                        if (args[0] instanceof SysUserBaseVO) {
+                            SysUserBaseVO sysUserBaseVO = (SysUserBaseVO) args[0];
+                            SysUser sysUser = operationLogFacade.getSysUser(sysUserBaseVO.getUserId());
+                            compareTwoClass(sysUser, sysUserBaseVO.getUserId(), outMap);
+                        }
+                    }
+                    break;
+                case "/sys/user/enable"://启用用户
+                    if (null != args && args.length >= 0) {
+                        //通过id获取用户具体信息
+                        if (args[0] instanceof SysUserBaseVO) {
+                            SysUserBaseVO sysUserBaseVO = (SysUserBaseVO) args[0];
+                            SysUser sysUser = operationLogFacade.getSysUser(sysUserBaseVO.getUserId());
+                            compareTwoClass(sysUser, sysUserBaseVO.getUserId(), outMap);
+                        }
+                    }
+                    break;
+                case "/sys/role/saveRoleMenu"://修改角色权限
+                    if (null != args && args.length >= 0) {
+                        //通过id获取角色信息
+                        if (args[0] instanceof SysRoleMenuSaveVO) {
+                            SysRoleMenuSaveVO sysRoleMenuSaveVO = (SysRoleMenuSaveVO) args[0];
+                            SysRole sysRole = operationLogFacade.getRoleMenu(sysRoleMenuSaveVO.getRoleId());
+                            compareTwoClass(sysRole, sysRoleMenuSaveVO, outMap);
+                        }
+                    }
+                    break;
+                case "/sys/user/editUserRoles"://修改用户角色
+                    if (null != args && args.length >= 0) {
+                        //通过id获取角色信息
+                        if (args[0] instanceof SysUserRoleVO) {
+                            SysUserRoleVO sysUserRoleVO = (SysUserRoleVO) args[0];
+                            SysUserRoleDTO sysUserRoleDTO = operationLogFacade.editUserRoles(sysUserRoleVO.getUserId());
+                            SysUser sysUser = operationLogFacade.getSysUser(sysUserRoleVO.getUserId());
+                            compareTwoClass(sysUser, sysUserRoleVO.getUserId(), outMap);
+                            if (ListUtil.isNotEmpty(sysUserRoleDTO.getSelRoles())) {
+                                if (ListUtil.isNotEmpty(sysUserRoleVO.getRoleIds())) {
+                                    List<Long> oldRoleIds = sysUserRoleDTO.getSelRoles().stream().map(SysRoleDTO::getId).collect(Collectors.toList());
+                                    List<Long> temp = new ArrayList<>(sysUserRoleVO.getRoleIds());
+                                    temp.removeAll(oldRoleIds);
+                                    if (ListUtil.isNotEmpty(temp)) {//角色被改动
+                                        List<SysRole> roles = operationLogFacade.getSysUserRoles(sysUserRoleVO.getRoleIds());
+                                        outMap.put("#roles", roles.stream().map(SysRole::getName).collect(Collectors.joining(",")));
+                                    } else if (sysUserRoleVO.getRoleIds().size() != oldRoleIds.size()) {//两次角色不一致
+                                        List<SysRole> roles = operationLogFacade.getSysUserRoles(sysUserRoleVO.getRoleIds());
+                                        outMap.put("#roles", roles.stream().map(SysRole::getName).collect(Collectors.joining(",")));
+                                    }
+                                } else {
+                                    outMap.put("#roles", "空");
+                                }
+                            } else {
+                                if (ListUtil.isNotEmpty(sysUserRoleVO.getRoleIds())) {//角色被改动
+                                    List<SysRole> roles = operationLogFacade.getSysUserRoles(sysUserRoleVO.getRoleIds());
+                                    outMap.put("#roles", roles.stream().map(SysRole::getName).collect(Collectors.joining(",")));
+                                }
+                            }
+                        }
+                    }
+                    break;
+                case "/sys/user/editUserDepts"://修改用户科室
+                    if (null != args && args.length >= 0) {
+                        //通过id获取角色信息
+                        if (args[0] instanceof SysUserDeptVO) {
+                            SysUserDeptVO sysUserDeptVO = (SysUserDeptVO) args[0];
+                            //获取用户现在的科室信息
+                            List<String> oldDeptIds = operationLogFacade.getUserDept(sysUserDeptVO.getUserId());
+                            SysUser sysUser = operationLogFacade.getSysUser(sysUserDeptVO.getUserId());
+                            compareTwoClass(sysUser, sysUserDeptVO.getUserId(), outMap);
+                            if (ListUtil.isNotEmpty(oldDeptIds)) {
+                                if (ListUtil.isNotEmpty(sysUserDeptVO.getDeptIds())) {
+                                    List<String> temp = new ArrayList<>(sysUserDeptVO.getDeptIds());
+                                    temp.removeAll(oldDeptIds);
+                                    if (ListUtil.isNotEmpty(temp)) {//科室被改动
+                                        List<BasDeptInfo> deptInfos = operationLogFacade.getSysDepts(sysUserDeptVO.getDeptIds());
+                                        outMap.put("#depts", deptInfos.stream().map(BasDeptInfo::getDeptName).collect(Collectors.joining(",")));
+                                    } else if (sysUserDeptVO.getDeptIds().size() != oldDeptIds.size()) {//两次科室不一致
+                                        List<BasDeptInfo> deptInfos = operationLogFacade.getSysDepts(sysUserDeptVO.getDeptIds());
+                                        outMap.put("#depts", deptInfos.stream().map(BasDeptInfo::getDeptName).collect(Collectors.joining(",")));
+                                    }
+                                } else {
+                                    outMap.put("#depts", "空");
+                                }
+                            } else {
+                                if (ListUtil.isNotEmpty(sysUserDeptVO.getDeptIds())) {//科室被改动
+                                    List<BasDeptInfo> deptInfos = operationLogFacade.getSysDepts(sysUserDeptVO.getDeptIds());
+                                    outMap.put("#depts", deptInfos.stream().map(BasDeptInfo::getDeptName).collect(Collectors.joining(",")));
+                                }
+                            }
+                        }
+                    }
+                    break;
+                case "/qc/casesEntryHospital/updataQcCasesEntry"://修改条目提示信息
+                    if (null != args && args.length >= 0) {
+                        //通过id获取模块名称以及目前分值
+                        if (args[0] instanceof QcCasesEntryUpdataVO) {
+                            QcCasesEntryUpdataVO qcCasesEntryUpdataVO = (QcCasesEntryUpdataVO) args[0];
+                            QcCasesEntryHospitalDTO qcCasesEntryHospitalDTO = operationLogFacade.getQcCasesEntryById(qcCasesEntryUpdataVO.getId());
+                            compareTwoClass(qcCasesEntryHospitalDTO, qcCasesEntryUpdataVO, outMap);
+                        }
+                    }
+                    break;
+                case "/qc/qcType/delete":
+                    if (null != args && args.length >= 0) {
+                        if (args[0] instanceof DeleteQcTypeVO) {
+                            DeleteQcTypeVO deleteQcTypeVO = (DeleteQcTypeVO) args[0];
+                            if (ListUtil.isNotEmpty(deleteQcTypeVO.getIds())) {
+                                QcType qcType = operationLogFacade.getQCTypeById(deleteQcTypeVO.getIds().get(0));
+                                compareTwoClass(qcType, new Object(), outMap);
+                            }
+                        }
+                    }
+                    break;
+                default:
+                    if (null != args && args.length >= 0) {
+                        for (Object o : args) {
+                            compareTwoClass(o, new Object(), outMap);
+                        }
+                    }
+                    break;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    /**
+     * @Description:获取请求的参数
+     * @Param: [joinPoint, logInformation]
+     * @return: void
+     * @Author: cy
+     * @Date: 2021/9/2
+     */
+    private String getControllerMethodDescription(JoinPoint joinPoint) {
+        Map<String, String[]> map = HttpUtils.getHttpServletRequest().getParameterMap();
+        if (MapUtils.isNotEmpty(map)) {
+            String params = JSONObject.toJSONString(map);
+            return params;
+        } else {
+            Object args = joinPoint.getArgs();
+            if (null != args) {
+                String params = argsArrayToString(joinPoint.getArgs());
+                return params;
+            }
+        }
+        return "";
+    }
+
+
+    /**
+     * 参数拼装
+     *
+     * @Description:
+     * @Param: [paramsArray]
+     * @return: java.lang.String
+     * @Author: cy
+     * @Date: 2021/9/2
+     */
+    private String argsArrayToString(Object[] paramsArray) {
+        String params = "";
+        if (paramsArray != null && paramsArray.length > 0) {
+            for (int i = 0; i < paramsArray.length; i++) {
+                if (null != (paramsArray[i])) {
+                    Object jsonObj = JSONObject.toJSONString(paramsArray[i]);
+                    params += jsonObj.toString() + " ";
+                }
+            }
+        }
+        return params.trim();
+    }
+
+    /**
+     * 登录日志处理
+     *
+     * @param joinPoint
+     * @param jsonResult
+     * @Return void
+     */
+    public void loginLogHandle(JoinPoint joinPoint, Object jsonResult) {
+        // 返回参数
+        if (null != jsonResult) {
+            ObjectMapper objectWriter = new ObjectMapper();
+            try {
+                String strResult = objectWriter.writeValueAsString(jsonResult);
+                JSONObject JSONResult = JSONObject.parseObject(strResult);
+                SysLoginLogDTO loginLog = new SysLoginLogDTO();
+                Date date = new Date();
+                loginLog.setLoginDate(date);
+                loginLog.setGmtCreate(date);
+                String token = JSONResult.getJSONObject("data").get("accessToken").toString();
+                DecodedJWT jwt = decodedJWT(token);
+                Map<String, Claim> claims = jwt.getClaims();
+                Claim claimUID = claims.get("user_id");
+                Claim claimUName = claims.get("user_name");
+                loginLog.setLoginId(claimUID.asLong());
+                loginLog.setLoginName(claimUName.asString());
+                loginLog.setLoginIp(HttpUtils.getIpAddress() == null ? "" : HttpUtils.getIpAddress());
+                UserAgent userAgent = UserAgent.parseUserAgentString(HttpUtils.getHttpServletRequest().getHeader("User-Agent"));
+                loginLog.setLoginAddress(AddressUtils.getRealAddressByIP(loginLog.getLoginIp()));
+                // 获取客户端浏览器
+                String browser = userAgent.getBrowser().getName();
+                loginLog.setLoginBrowser(browser);
+                String hospitalId = claims.get("hosp_id").asLong()+"";
+                loginLog.setHospitalId(hospitalId == null ? "0" : hospitalId);
+
+                //插入登录日志
+                loginLogFacade.getBaseMapper().addLoginLog(loginLog);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * token解析
+     *
+     * @param token
+     * @Return com.auth0.jwt.interfaces.DecodedJWT
+     */
+    public static DecodedJWT decodedJWT(String token) {
+
+        try {
+            DecodedJWT jwt = JWT.decode(token);
+            return jwt;
+        } catch (JWTDecodeException var2) {
+            var2.printStackTrace();
+            throw new CommonException(CommonErrorCode.ANALYZER_TOKEN_FAIL);
+        }
+    }
+
+    /**
+     * url比对
+     *
+     * @param url
+     * @param request
+     * @Return boolean
+     */
+    private boolean matchers(String url, HttpServletRequest request) {
+
+        AntPathRequestMatcher matcher = new AntPathRequestMatcher(url);
+        if (matcher.matches(request)) {
+            return true;
+        }
+        return false;
+    }
+}
+
+

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

@@ -115,6 +115,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/consoleByDept/entryCountGroupXYByEntryPageDept").permitAll()
                 .antMatchers("/consoleByDept/qcResultShortXYPageByDept").permitAll()
                 .antMatchers("/consoleByDept/badLevelXYPageByDept").permitAll()
+                .antMatchers("/print/export/badUnQualifiedLevelPageXYExportByDept").permitAll()
+                .antMatchers("/print/export/badQualifiedLevelPageXYExportByDept").permitAll()
                 .antMatchers("/console/leaveHosCount").permitAll()
                 .antMatchers("/console/medicalRecordIndicator").permitAll()
                 .antMatchers("/console/codingMonthly").permitAll()
@@ -179,6 +181,10 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/medicalCheckTitle").permitAll()
                 .antMatchers("/console/badLevelPage").permitAll()
                 .antMatchers("/console/badLevelXYPage").permitAll()
+                .antMatchers("/console/export/badUnQualifiedLevelPagePageExport").permitAll()
+                .antMatchers("/console/export/badQualifiedLevelPagePageExport").permitAll()
+                .antMatchers("/console/export/badUnQualifiedLevelPageXYExport").permitAll()
+                .antMatchers("/console/export/badQualifiedLevelPageXYExport").permitAll()
                 .antMatchers("/qc/medNurse/getMedNursePage").permitAll()
                 .antMatchers("/qc/medRecordOther/getMedRecordOtherPage").permitAll()
                 .antMatchers("/qc/medRecordOther/getMedRecordContentOther").permitAll()
@@ -252,6 +258,12 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qcView/data/*").permitAll()
                 .antMatchers("/medDefectFeedback/*").permitAll()
                 .antMatchers("/consoleByDoctor/**").permitAll()
+                .antMatchers("/qc/getDoctorDetail/**").permitAll()
+                .antMatchers("/h5/statistics/**").permitAll()
+                .antMatchers("/logManage/**").permitAll()
+                .antMatchers("/qc/qcType/add").permitAll()
+                .antMatchers("/qc/qcType/update").permitAll()
+                .antMatchers("/qc/qcType/copy").permitAll()
                 .antMatchers("/medNewsNotice/**").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();

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

@@ -171,7 +171,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/consoleByDept/qcResultShortXYPageByDept", request)
                 || matchers("/print/export/qcResultShortXYPageExportDept", request)
                 || matchers("/consoleByDept/badLevelXYPageByDept", request)
-                || matchers("/print/export/badLevelPageXYExportByDept", request)
+                || matchers("/print/export/badUnQualifiedLevelPageXYExportByDept", request)
+                || matchers("/print/export/badQualifiedLevelPageXYExportByDept", request)
                 || matchers("/console/leaveHosCount", request)
                 || matchers("/console/levelPercentGroupByDeptPage", request)
                 || matchers("/console/levelStatistics", request)
@@ -283,8 +284,10 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/export/medicalCheckInnerExport", request)
                 || matchers("/console/badLevelPage", request)
                 || matchers("/console/badLevelXYPage", request)
-                || matchers("/console/export/badLevelPagePageExport", request)
-                || matchers("/console/export/badLevelPageXYExport", request)
+                || matchers("/console/export/badUnQualifiedLevelPagePageExport", request)
+                || matchers("/console/export/badQualifiedLevelPagePageExport", request)
+                || matchers("/console/export/badUnQualifiedLevelPageXYExport", request)
+                || matchers("/console/export/badQualifiedLevelPageXYExport", request)
                 || matchers("/qc/medNurse/getMedNursePage", request)
                 || matchers("/qc/medRecordOther/getMedRecordOtherPage", request)
                 || matchers("/qc/medRecordOther/getMedRecordContentOther", request)
@@ -294,7 +297,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/bas/doctor/getList", request)
                 || matchers("/consoleByDept/homePageOrGoodLevelByDept", request)
                 || matchers("/print/export/homePageLevelExportByDept", request)
-                || matchers("/print/export/homePageOrLevelExportByDept", request)
+                || matchers("/print/export/homeUnQualifiedPageOrLevelExportByDept", request)
+                || matchers("/print/export/homeQualifiedPageOrLevelExportByDept", request)
                 || matchers("/print/export/entryGroupExportByDeptPage", request)
                 || matchers("/print/export/entryGroupExportByDeptCase", request)
                 || matchers("/print/export/entryGroupExportByDeptEntry", request)
@@ -376,6 +380,11 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qcView/data/*", request)
                 || matchers("/medDefectFeedback/*", request)
                 || matchers("/medNewsNotice/**", request)
+                || matchers("/h5/statistics/**", request)
+                || matchers("/logManage/**", request)
+                || matchers("/qc/qcType/add", request)
+                || matchers("/qc/qcType/update", request)
+                || matchers("/qc/qcType/copy", request)
                 || matchers("/", request)) {
             return true;
         }

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

@@ -0,0 +1,26 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 16:16
+ */
+@Data
+public class BehInfoForH5DTO {
+    private String name;
+    private String sex;
+    private String fileCode;
+    private String doctorId;
+    private String doctorName;
+    private String deptId;
+    private String deptName;
+    private String behospitalCode;
+    private Date leaveHospitalDate;
+    private Date behospitalDate;
+    private String LEVEL;
+    private Double deductScore;
+}

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

@@ -42,6 +42,9 @@ public class GetAppealReviewDTO {
     @ApiModelProperty(value = "病人住院序号")
     private String behospitalCode;
 
+    @ApiModelProperty(value = "病案号")
+    private String fileCode;
+
     @ApiModelProperty(value = "患者姓名")
     private String name;
 

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

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 17:17
+ */
+@Data
+public class LevelPercentDTO {
+    private String deptId;
+    private String deptName;
+    private Integer totleNum;
+    private Integer firstLevelNum;
+    private Integer secondLevelNum;
+    private Integer thirdLevelNum;
+    private Double firstPercent;
+    private Double secondPercent;
+    private Double thirdPercent;
+    private String firstPercentStr;
+    private String secondPercentStr;
+    private String thirdPercentStr;
+}

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

@@ -2,6 +2,7 @@ package com.diagbot.dto;
 
 import lombok.Getter;
 import lombok.Setter;
+import lombok.ToString;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
@@ -14,6 +15,7 @@ import java.util.Date;
  */
 @Getter
 @Setter
+@ToString
 public class QcCasesDTO {
     /**
      * 主键

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

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * @Description:
+ * @author: songxl
+ * @time: 2022/5/09 14:28
+ */
+@Getter
+@Setter
+@ApiModel("系统登录日志列表页-接口出参")
+public class SysLoginLogDTO implements Serializable {
+
+    private static final long serialVersionUID = 6123084820573676056L;
+
+
+    @ApiModelProperty(value = "登录用户ID")
+    private Long loginId;
+
+    @ApiModelProperty(value = "登录用户名")
+    private String loginName;
+
+    @ApiModelProperty(value = "登录日期")
+    private Date loginDate;
+
+    @ApiModelProperty(value = "登录ip")
+    private String loginIp;
+
+    @ApiModelProperty(value = "地区")
+    private String loginAddress;
+
+    @ApiModelProperty(value = "浏览器")
+    private String loginBrowser;
+
+    @ApiModelProperty(value = "创建日期")
+    private Date GmtCreate;
+
+    @ApiModelProperty(value = "医院id")
+    private String hospitalId;
+}

+ 71 - 0
src/main/java/com/diagbot/dto/SysOperationLogDTO.java

@@ -0,0 +1,71 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * @Description:
+ * @author: songxl
+ * @time: 2022/5/09 14:28
+ */
+@Getter
+@Setter
+@ApiModel("系统登录日志列表页-接口出参")
+public class SysOperationLogDTO implements Serializable {
+
+    private static final long serialVersionUID = -2781154978311006059L;
+
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "操作人用户ID")
+    private String operationId;
+
+    @ApiModelProperty(value = "操作人用户名")
+    private String operationName;
+
+    @ApiModelProperty(value = "操作日期")
+    private Date operationDate;
+
+    @ApiModelProperty(value = "操作记录")
+    private String operationRecord;
+
+    @ApiModelProperty(value = "ip地址")
+    private String operationIp;
+
+    @ApiModelProperty(value = "操作地址")
+    private String operationAddress;
+
+    @ApiModelProperty(value = "操作方法")
+    private String operationMethod;
+
+    @ApiModelProperty(value = "操作请求方式")
+    private String operationWay;
+
+    @ApiModelProperty(value = "操作url")
+    private String operationUrl;
+
+    @ApiModelProperty(value = "操作参数")
+    private String operationParam;
+
+    @ApiModelProperty(value = "返回参数")
+    private String jsonResult;
+
+    @ApiModelProperty(value = "记录创建时间")
+    private Date gmtCreate;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "是否归档(0:未归档,1:已归档)")
+    private String isPlacefile;
+
+    @ApiModelProperty(value = "医院id")
+    private String hospitalId;
+}

+ 8 - 81
src/main/java/com/diagbot/entity/SysHospitalSet.java

@@ -2,8 +2,11 @@ package com.diagbot.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
+import lombok.Getter;
+import lombok.Setter;
+
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * <p>
@@ -13,6 +16,8 @@ import java.io.Serializable;
  * @author zhoutg
  * @since 2020-07-06
  */
+@Getter
+@Setter
 public class SysHospitalSet implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -31,12 +36,12 @@ public class SysHospitalSet implements Serializable {
     /**
      * 记录创建时间
      */
-    private LocalDateTime gmtCreate;
+    private Date gmtCreate;
 
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
-    private LocalDateTime gmtModified;
+    private Date gmtModified;
 
     /**
      * 创建人,0表示无创建人值
@@ -70,84 +75,6 @@ public class SysHospitalSet implements Serializable {
      */
     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 LocalDateTime getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(LocalDateTime gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-    public LocalDateTime getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(LocalDateTime gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-    public Long getHospitalId() {
-        return hospitalId;
-    }
-
-    public void setHospitalId(Long hospitalId) {
-        this.hospitalId = hospitalId;
-    }
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
     @Override
     public String toString() {
         return "SysHospitalSet{" +

+ 91 - 0
src/main/java/com/diagbot/entity/SysLoginLog.java

@@ -0,0 +1,91 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统登录日志表
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2022-05-09
+ */
+@Getter
+@Setter
+public class SysLoginLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 登录用户ID
+     */
+    private Long loginId;
+
+    /**
+     * 登录用户名
+     */
+    private String loginName;
+
+    /**
+     * 登录日期
+     */
+    private Date loginDate;
+
+    /**
+     * 登录ip
+     */
+    private Long loginIp;
+
+    /**
+     * 登录ip地址
+     */
+    private String loginAddress;
+
+    /**
+     * 浏览器
+     */
+    private String loginBrowser;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 121 - 0
src/main/java/com/diagbot/entity/SysOperationLog.java

@@ -0,0 +1,121 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统操作日志表
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2022-05-09
+ */
+@Getter
+@Setter
+public class SysOperationLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 操作人用户ID
+     */
+    private Long operationId;
+
+    /**
+     * 操作人用户名
+     */
+    private String operationName;
+
+    /**
+     * 操作日期
+     */
+    private Date operationDate;
+
+    /**
+     * 操作记录
+     */
+    private String operationRecord;
+
+    /**
+     * ip地址
+     */
+    private Long operationIp;
+
+    /**
+     * 操作地址
+     */
+    private String operationAddress;
+
+    /**
+     * 操作方法
+     */
+    private String operationMethod;
+
+    /**
+     * 操作请求方式
+     */
+    private String operationWay;
+
+    /**
+     * 操作url
+     */
+    private String operationUrl;
+
+    /**
+     * 操作参数
+     */
+    private String operationParam;
+
+    /**
+     * 返回参数
+     */
+    private String jsonResult;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 42 - 0
src/main/java/com/diagbot/facade/LogManagementFacade.java

@@ -0,0 +1,42 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.SysLoginLogDTO;
+import com.diagbot.dto.SysOperationLogDTO;
+import com.diagbot.vo.SysLoginLogVO;
+import com.diagbot.vo.SysOperationLogVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:日志处理类
+ * @author: songxl
+ * @time: 2022/5/9 14:33
+ */
+@Component
+public class LogManagementFacade {
+    @Autowired
+    private LoginLogFacade loginLogFacade;
+    @Autowired
+    private OperationLogFacade operationLogFacade;
+
+    /**
+     *查看登录日志
+     *
+     * @param sysLoginLogVO
+     * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.SysLoginLogDTO>
+     */
+    public IPage<SysLoginLogDTO> getLoginLog(SysLoginLogVO sysLoginLogVO) {
+        return loginLogFacade.getLoginLog(sysLoginLogVO);
+    }
+
+    /**
+     *查看操作日志
+     *
+     * @param sysOperationLogVO
+     * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.SysOperationLogDTO>
+     */
+    public IPage<SysOperationLogDTO> getOperationLog(SysOperationLogVO sysOperationLogVO) {
+        return operationLogFacade.getOperationLog(sysOperationLogVO);
+    }
+}

+ 22 - 0
src/main/java/com/diagbot/facade/LoginLogFacade.java

@@ -0,0 +1,22 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.SysLoginLogDTO;
+import com.diagbot.service.impl.SysLoginLogServiceImpl;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.SysLoginLogVO;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:登录日志处理类
+ * @author: songxl
+ * @time: 2022/5/9 14:33
+ */
+@Component
+public class LoginLogFacade extends SysLoginLogServiceImpl {
+
+    public IPage<SysLoginLogDTO> getLoginLog(SysLoginLogVO sysLoginLogVO) {
+        sysLoginLogVO.setHospitalId(SysUserUtils.getCurrentHospitalID());
+        return this.getBaseMapper().getLoginLog(sysLoginLogVO);
+    }
+}

+ 114 - 0
src/main/java/com/diagbot/facade/OperationLogFacade.java

@@ -0,0 +1,114 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcCasesDTO;
+import com.diagbot.dto.QcCasesEntryHospitalDTO;
+import com.diagbot.dto.SysOperationLogDTO;
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.entity.QcType;
+import com.diagbot.dto.SysUserRoleDTO;
+import com.diagbot.entity.SysRole;
+import com.diagbot.entity.SysUser;
+import com.diagbot.entity.SysUserDept;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.SysOperationLogServiceImpl;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.SysOperationLogVO;
+import com.diagbot.vo.SysUserBaseVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+/**
+ * @Description:操作日志处理类
+ * @author: songxl
+ * @time: 2022/5/10 9:49
+ */
+@Component
+public class OperationLogFacade extends SysOperationLogServiceImpl {
+    @Autowired
+    QcCasesFacade qcCasesFacade;
+    @Autowired
+    QcCasesEntryHospitalFacade qcCasesEntryHospitalFacade;
+    @Autowired
+    QcTypeFacade qcTypeFacade;
+    @Autowired
+    SysUserFacade sysUserFacade;
+    @Autowired
+    SysUserDeptFacade sysUserDeptFacade;
+    @Autowired
+    BasDeptInfoFacade basDeptInfoFacade;
+
+    @Autowired
+    SysRoleFacade sysRoleFacade;
+
+    public IPage<SysOperationLogDTO> getOperationLog(SysOperationLogVO sysOperationLogVO) {
+        sysOperationLogVO.setHospitalId(SysUserUtils.getCurrentHospitalID());
+        return this.getBaseMapper().getOperationLog(sysOperationLogVO);
+    }
+
+    public QcCasesDTO getQcCasesById(String id) {
+        return qcCasesFacade.getQcCasesById(id, SysUserUtils.getCurrentHospitalID());
+    }
+
+    public SysUser getSysUser(Long id) {
+        return sysUserFacade.getBaseMapper().selectOne(new QueryWrapper<SysUser>()
+                .eq("id",id)
+                .eq("is_deleted", IsDeleteEnum.N.getKey()));
+    }
+
+    public SysRole getRoleMenu(Long roleId) {
+        return sysRoleFacade.getBaseMapper().selectOne(new QueryWrapper<SysRole>()
+                .eq("id",roleId)
+                .eq("is_deleted", IsDeleteEnum.N.getKey()));
+    }
+
+    public SysUserRoleDTO editUserRoles(Long userId) {
+        SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
+        sysUserBaseVO.setUserId(userId);
+        return sysUserFacade.getUserRoles(sysUserBaseVO);
+    }
+
+    public QcCasesEntryHospitalDTO getQcCasesEntryById(Long id) {
+        return qcCasesEntryHospitalFacade.getQcCasesEntryById(id);
+    }
+
+    public QcType getQCTypeById(Object id) {
+        return qcTypeFacade.getOne(new QueryWrapper<QcType>().eq("id",id));
+    }
+
+    public List<SysRole> getSysUserRoles(List<Long> roleIds) {
+        return sysRoleFacade.list(new QueryWrapper<SysRole>().in("id",roleIds).eq("is_deleted", IsDeleteEnum.N.getKey()));
+    }
+    /**
+     * 获取用户科室
+     *
+     * @param userId
+     * @Return java.util.List<java.lang.String>
+     */
+    public List<String> getUserDept(Long userId) {
+
+        return sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
+                .eq("user_id",userId)
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id",SysUserUtils.getCurrentHospitalID())
+        ).stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
+    }
+    /**
+     * 通过科室id获取科室
+     *
+     * @param deptIds
+     * @Return java.util.List<com.diagbot.entity.BasDeptInfo>
+     */
+    public List<BasDeptInfo> getSysDepts(List<String> deptIds) {
+
+        return basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id",SysUserUtils.getCurrentHospitalID())
+                .in("dept_id",deptIds));
+    }
+}

+ 4 - 0
src/main/java/com/diagbot/facade/QcCasesEntryHospitalFacade.java

@@ -95,4 +95,8 @@ public class QcCasesEntryHospitalFacade extends QcCasesEntryHospitalServiceImpl
         List<QcCasesEntryFindDTO> data = this.findQcCasesEntryAll(qcCasesEntryFindVO);
         return data;
     }
+
+    public QcCasesEntryHospitalDTO getQcCasesEntryById(Long id) {
+        return this.getBaseMapper().getQcCasesEntryById(id,SysUserUtils.getIsPlacefile(),SysUserUtils.getCurrentHospitalID());
+    }
 }

+ 4 - 0
src/main/java/com/diagbot/facade/QcCasesFacade.java

@@ -85,4 +85,8 @@ public class QcCasesFacade extends QcCasesServiceImpl {
         dataNew = BeanUtil.listCopyTo(data, QcCasesAllDTO.class);
         return dataNew;
     }
+
+    public QcCasesDTO getQcCasesById(String id, String currentHospitalID) {
+        return this.getBaseMapper().getQcCasesById(id,currentHospitalID);
+    }
 }

+ 126 - 0
src/main/java/com/diagbot/facade/StatisticsForH5Facade.java

@@ -0,0 +1,126 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.BasDeptInfoDTO;
+import com.diagbot.dto.BehInfoForH5DTO;
+import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
+import com.diagbot.dto.LevelPercentDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.BasDeptInfoVO;
+import com.diagbot.vo.BehInfoForH5VO;
+import com.diagbot.vo.FilterVO;
+import com.diagbot.vo.HospitalIdVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 10:40
+ */
+@Component
+public class StatisticsForH5Facade {
+    @Autowired
+    private QcresultInfoFacade qcresultInfoFacade;
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+    @Autowired
+    private BasDeptInfoFacade basDeptInfoFacade;
+
+    /**
+     * 单项否决占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<EntryNumDTO> entryRejectDistribution(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getHospitalId())) {
+            try {
+                String hospitalId = SysUserUtils.getCurrentHospitalID();
+                filterVO.setHospitalId(hospitalId);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+            }
+        }
+        if (StringUtil.isBlank(filterVO.getHospitalId())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+        }
+        List<EntryNumDTO> retList = qcresultInfoFacade.entryRejectPercent(filterVO);
+        return retList;
+    }
+
+    /**
+     * 病历等级占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<LevelPercentDTO> levelDistribution(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getHospitalId())) {
+            try {
+                String hospitalId = SysUserUtils.getCurrentHospitalID();
+                filterVO.setHospitalId(hospitalId);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+            }
+        }
+        List<LevelPercentDTO> retList = qcresultInfoFacade.levelPercentByDept(filterVO);
+        return retList;
+    }
+
+    /**
+     * 病历扣分大于等于5占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> deductGT5Distribution(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getHospitalId())) {
+            try {
+                String hospitalId = SysUserUtils.getCurrentHospitalID();
+                filterVO.setHospitalId(hospitalId);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+            }
+        }
+        List<DeptNumDTO> retList = qcresultInfoFacade.deductGT5ByDept(filterVO);
+        return retList;
+    }
+
+
+    /**
+     * 病历详情
+     *
+     * @param behInfoForH5VO
+     * @return
+     */
+    public IPage<BehInfoForH5DTO> getBehInfoPage(BehInfoForH5VO behInfoForH5VO) {
+        if (StringUtil.isBlank(behInfoForH5VO.getHospitalId())) {
+            try {
+                String hospitalId = SysUserUtils.getCurrentHospitalID();
+                behInfoForH5VO.setHospitalId(hospitalId);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+            }
+        }
+        IPage<BehInfoForH5DTO> page = behospitalInfoFacade.behospitalInfoForH5(behInfoForH5VO);
+        return page;
+    }
+
+    /**
+     * @param hospitalIdVO
+     * @return
+     */
+    public List<BasDeptInfoDTO> listForUser(HospitalIdVO hospitalIdVO) {
+        BasDeptInfoVO basDeptInfoVO = new BasDeptInfoVO();
+        basDeptInfoVO.setHospitalId(hospitalIdVO.getHospitalId());
+        List<BasDeptInfoDTO> basDeptInfoDTOList = basDeptInfoFacade.getList(basDeptInfoVO);
+        return basDeptInfoDTOList;
+    }
+}

+ 18 - 0
src/main/java/com/diagbot/facade/SysHospitalSetFacade.java

@@ -5,8 +5,11 @@ import com.diagbot.entity.SysHospitalSet;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.SysHospitalSetServiceImpl;
 import com.diagbot.util.StringUtil;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 /**
  * @Description:
  * @author: gaodm
@@ -44,4 +47,19 @@ public class SysHospitalSetFacade extends SysHospitalSetServiceImpl {
         }
         return res;
     }
+
+    /**
+     *获取remark相同的一些列配置
+     *
+     * @param hospitalId
+     * @param remark
+     * @Return java.util.List<com.diagbot.entity.SysHospitalSet>
+     */
+    @Cacheable(value = "cache", key = "'operationLog:hospId_'+#hospitalId")
+    public List<SysHospitalSet> getHospitalSetByRemark(Long hospitalId, String remark) {
+        return this.list(new QueryWrapper<SysHospitalSet>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId)
+                .eq("remark", remark));
+    }
 }

+ 11 - 2
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -788,7 +788,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     List<BehospitalInfoAgeDTO> getBehospitalInfoAge(Long hospitalId, List<String> behospitalCodes);
 
     /**
-     *  医生质控平均分页面统计
+     * 医生质控平均分页面统计
      *
      * @param doctorAverageStatisticsVO
      * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.DoctorAverageStatisticsDTO>
@@ -796,7 +796,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     IPage<DoctorAverageStatisticsDTO> doctorAverageStatistics(@Param("doctorAverageStatisticsVO") DoctorAverageStatisticsVO doctorAverageStatisticsVO);
 
     /**
-     *  医生质控平均分-患者列表(等级)
+     * 医生质控平均分-患者列表(等级)
      *
      * @param doctorAverageLevelVO
      * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.DoctorAverageLevelDTO>
@@ -818,6 +818,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(@Param("getDoctorDetailPageVO") GetDoctorDetailPageVO getDoctorDetailPageVO);
+
     /**
      * 获取缺陷数量对应的病历
      *
@@ -834,4 +835,12 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<ExportExcelDTO> getDetailRecordListExport(@Param("getDetailRecordListPageVO") GetDetailRecordListPageVO getDetailRecordListPageVO);
 
+    /**
+     * 病历详情(H5)
+     *
+     * @param behInfoForH5VO
+     * @return
+     */
+    IPage<BehInfoForH5DTO> behospitalInfoForH5(BehInfoForH5VO behInfoForH5VO);
+
 }

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

@@ -23,4 +23,6 @@ public interface QcCasesEntryHospitalMapper extends BaseMapper<QcCasesEntryHospi
     IPage<List<QcCasesEntryHospitalDTO>> getQcCasesEntryAlls(QcCasesEntryHospitalVO qcCasesEntryHospitalVO);
 
     List<QcCasesEntryFindDTO> findQcCasesEntryAll(QcCasesEntryFindVO qcCasesEntryFindVO);
+
+    QcCasesEntryHospitalDTO getQcCasesEntryById(Long id, String isPlacefile, String hospitalId);
 }

+ 3 - 0
src/main/java/com/diagbot/mapper/QcCasesMapper.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcCasesDTO;
 import com.diagbot.entity.QcCases;
 import com.diagbot.vo.QcCasesQueryVO;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -25,4 +26,6 @@ public interface QcCasesMapper extends BaseMapper<QcCases> {
      * @return
      */
     List<NumDTO> entryGroupByCase();
+
+    QcCasesDTO getQcCasesById(@Param("id") String id, @Param("hospitalId")String hospitalId);
 }

+ 10 - 3
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -78,7 +78,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      */
     public List<NumDTO> resultCountByDept(QcresultFilterVO qcresultFilterVO);
 
-    public List<Map<String,Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO);
+    public List<Map<String, Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO);
 
     /**
      * 各模块缺陷占比-按科室
@@ -164,14 +164,14 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      *
      * @return
      */
-    public Integer entryGroupByEntrySum(@Param("hospitalId") String hospitalId,@Param("isPlacefile") String isPlacefile,@Param("startDate") String startDate,@Param("endDate") String endDate);
+    public Integer entryGroupByEntrySum(@Param("hospitalId") String hospitalId, @Param("isPlacefile") String isPlacefile, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
     /**
      * 条目缺陷分值统计(内页)
      *
      * @return
      */
-    public List<EntryNumDTO> entryGroupByEntryScore(@Param("hospitalId") String hospitalId,@Param("isPlacefile") String isPlacefile, @Param("ids")Set<Long> ids);
+    public List<EntryNumDTO> entryGroupByEntryScore(@Param("hospitalId") String hospitalId, @Param("isPlacefile") String isPlacefile, @Param("ids") Set<Long> ids);
 
     /**
      * 条目缺陷占比-科室(内页)
@@ -211,4 +211,11 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @return
      */
     public IPage<QcCasesHistoryDTO> getMedQcresultResult(HistoryAnalyzePageVO historyAnalyzePageVO);
+    /**
+     * 病历扣分大于等于5占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> deductGT5ByDept(FilterVO filterVO);
 }

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

@@ -0,0 +1,23 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.SysLoginLogDTO;
+import com.diagbot.entity.SysLoginLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.SysLoginLogVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 系统登录日志表 Mapper 接口
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2022-05-09
+ */
+public interface SysLoginLogMapper extends BaseMapper<SysLoginLog> {
+
+    IPage<SysLoginLogDTO> getLoginLog(@Param("sysLoginLogVO") SysLoginLogVO sysLoginLogVO);
+
+    void addLoginLog(SysLoginLogDTO loginLog);
+}

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

@@ -0,0 +1,23 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.SysOperationLogDTO;
+import com.diagbot.entity.SysOperationLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.SysOperationLogVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 系统操作日志表 Mapper 接口
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2022-05-09
+ */
+public interface SysOperationLogMapper extends BaseMapper<SysOperationLog> {
+
+    IPage<SysOperationLogDTO> getOperationLog(@Param("sysOperationLogVO") SysOperationLogVO sysOperationLogVO);
+
+    void addOperationRecord(SysOperationLogDTO operationLog);
+}

+ 32 - 21
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -82,13 +82,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public int operationCount(FilterVO filterVO);
+
     /**
      * 病案管理指标(内页)
      *
      * @param timeVo
      * @return
      */
-    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo);
+    public Map<String, Object> getBaseIndex(MedIndexFilterVO timeVo);
 
     /**
      * 病案管理规则质控参数查询
@@ -96,7 +97,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterVO
      * @return
      */
-    public Map<String,Object> getCountByEntry( FilterVO filterVO);
+    public Map<String, Object> getCountByEntry(FilterVO filterVO);
 
     /**
      * 病案管理规则质控病历参数查询
@@ -104,9 +105,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterVO
      * @return
      */
-    public List<MedManageParamsDTO> getMedManageParams( FilterVO filterVO);
-
-
+    public List<MedManageParamsDTO> getMedManageParams(FilterVO filterVO);
 
 
     /**
@@ -191,7 +190,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public IPage<HomePageNumXYDTO> homePageLevelStatisticsXY(FilterOrderXYPageVO filterOrderXYPageVO);
 
 
-
     /**
      * 病历质控报表-扣分项
      *
@@ -225,8 +223,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<CaseScoreDTO> getQualityCaseSorceByDept(CaseScoreVO caseScoreVO);
 
 
-
-
     /**
      * 病历质控报表
      *
@@ -249,7 +245,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterOrderVO
      * @return
      */
-    public List<LevelStsByDeptDTO> levelStatisticsByDept( FilterOrderVO filterOrderVO);
+    public List<LevelStsByDeptDTO> levelStatisticsByDept(FilterOrderVO filterOrderVO);
 
     /**
      * 单条条目缺陷统计-首页
@@ -360,8 +356,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<EntryStasByDeptDTO> entryStatisticsByDept(EntryStatisticsVO entryStatisticsVO);
 
 
-
-
     /**
      * 非医嘱离院病人记录
      *
@@ -485,28 +479,31 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
 
     /**
      * 病历稽查表
+     *
      * @return
      */
-    IPage<MedicalCheckDTO>  getMedicalCheck(FilterMedicalCheckVO filterVO,@Param("casesEntryIds")List<Long> casesEntryIds);
+    IPage<MedicalCheckDTO> getMedicalCheck(FilterMedicalCheckVO filterVO, @Param("casesEntryIds") List<Long> casesEntryIds);
 
     /**
      * 病历稽查表
+     *
      * @return
      */
-    IPage<MedicalCheckDTO>  getMedicalChecks(FilterMedicalCheckVO filterVO,@Param("casesEntryIds")List<Long> casesEntryIds);
+    IPage<MedicalCheckDTO> getMedicalChecks(FilterMedicalCheckVO filterVO, @Param("casesEntryIds") List<Long> casesEntryIds);
 
     /**
      * 病历稽查表导出
+     *
      * @return
      */
-    List<MedicalCheckExportDTO>  getMedicalCheckExport(FilterMedicalCheckVO filterVO);
+    List<MedicalCheckExportDTO> getMedicalCheckExport(FilterMedicalCheckVO filterVO);
 
     /**
      * 病历稽查表导出-科室
+     *
      * @return
      */
-    List<MedicalDeptDTO>  medicalCheckExportByDept(FilterMedicalCheckVO filterVO);
-
+    List<MedicalDeptDTO> medicalCheckExportByDept(FilterMedicalCheckVO filterVO);
 
 
     /**
@@ -527,6 +524,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
 
     /**
      * 不合格数病历号(内页)
+     *
      * @param qcResultPageVO
      * @return
      */
@@ -557,6 +555,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 病案首页不合格/合格数病历详情页导出-科室
      *
@@ -566,7 +565,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<ExportExcelByDeptDTO> homePageOrLevelExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
 
-
     /**
      * 31天再入院详情页
      *
@@ -606,6 +604,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public IPage<QcResultShortDTO> hmImproveMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 病案首页改善率质控评分页-科室(内页)
      *
@@ -666,30 +665,42 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
 
     /**
      * 手术费,抗菌药物,手术和病理费等含有人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String, String>> selectOperationNum(@Param("filterVO")FilterVO filterVO);
+    public List<Map<String, String>> selectOperationNum(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 触发规则人数
+     *
      * @param filterVO
      * @return
      */
-    public Map<String,Long> triggeringRules(@Param("filterVO")FilterVO filterVO);
+    public Map<String, Long> triggeringRules(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 病案首页关联的出院病历
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO);
+    public List<Map<String, String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 首页恶性肿瘤人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> malignancy(@Param("filterVO") FilterVO filterVO);
+    public List<Map<String, String>> malignancy(@Param("filterVO") FilterVO filterVO);
+
+    /**
+     * 病历详情(H5)
+     *
+     * @param behInfoForH5VO
+     * @return
+     */
+    IPage<BehInfoForH5DTO> behospitalInfoForH5(BehInfoForH5VO behInfoForH5VO);
 
 }

+ 17 - 1
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -128,6 +128,14 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      */
     public IPage<QcResultPercentDTO> levelPercentGroupByDeptPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
+    /**
+     * 病历等级占比
+     *
+     * @param filterVO
+     * @return
+     */
+    List<LevelPercentDTO> levelPercentByDept(FilterVO filterVO);
+
     /**
      * 各模块缺陷占比-科室(分页)
      *
@@ -183,10 +191,18 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      */
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 
+    /**
+     * 病历扣分大于等于5占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> deductGT5ByDept(FilterVO filterVO);
+
     /**
      * 历史评分
      * @param historyAnalyzePageVO
      * @return
      */
     public IPage<QcCasesHistoryDTO> getMedQcresultResult(HistoryAnalyzePageVO historyAnalyzePageVO);
-}
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.SysLoginLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 系统登录日志表 服务类
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2022-05-09
+ */
+public interface SysLoginLogService extends IService<SysLoginLog> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.SysOperationLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 系统操作日志表 服务类
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2022-05-09
+ */
+public interface SysOperationLogService extends IService<SysOperationLog> {
+
+}

+ 35 - 20
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -4,17 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.*;
 import com.diagbot.entity.BehospitalInfo;
-import com.diagbot.entity.FilterRecordVO;
 import com.diagbot.mapper.BehospitalInfoMapper;
 import com.diagbot.service.BehospitalInfoService;
-import com.diagbot.util.ListUtil;
 import com.diagbot.vo.*;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -181,7 +178,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     public IPage<QcResultShortDTO> getOrGoodLevelByDept(QcResultPageVO qcResultPageVO) {
-        return  baseMapper.getIsGoodLevelByDept(qcResultPageVO);
+        return baseMapper.getIsGoodLevelByDept(qcResultPageVO);
     }
 
     /**
@@ -249,6 +246,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<QualityControlDTO> getQualitySorce(CaseScoreVO caseScoreVO) {
         return baseMapper.getQualitySorce(caseScoreVO);
     }
+
     /**
      * 病历质控报表-扣分数据
      *
@@ -507,6 +505,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         IPage<QcResultShortDTO> qcResultShortDTOIPage = baseMapper.leaveHosMRPage(qcResultShortPageVO);
         return qcResultShortDTOIPage;
     }
+
     /**
      * 离院病人质控评分详情页-科室
      *
@@ -576,7 +575,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     }
 
 
-
     /**
      * 条目缺陷质控评分详情页导出到excel
      *
@@ -858,6 +856,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return medicalCheckExport;
 
     }
+
     /**
      * 病历稽查表导出-科室
      *
@@ -939,6 +938,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.badLevelPagePageExport((qcResultShortPageVO));
     }
+
     /**
      * 病案首页不合格/合格数病历详情页导出-科室
      *
@@ -951,7 +951,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     }
 
 
-
     /**
      * 31天再入院详情页
      *
@@ -962,6 +961,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO) {
         return baseMapper.reHos31DaysPage(reBeHosPageVO);
     }
+
     /**
      * 31天再入院详情页-科室
      *
@@ -1047,7 +1047,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo) {
+    public Map<String, Object> getBaseIndex(MedIndexFilterVO timeVo) {
         return baseMapper.getBaseIndex(timeVo);
     }
 
@@ -1058,7 +1058,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public Map<String,Object> getCountByEntry( FilterVO filterVO) {
+    public Map<String, Object> getCountByEntry(FilterVO filterVO) {
         return baseMapper.getCountByEntry(filterVO);
     }
 
@@ -1069,7 +1069,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public  List<MedManageParamsDTO> getMedManageParams( FilterVO filterVO) {
+    public List<MedManageParamsDTO> getMedManageParams(FilterVO filterVO) {
         return baseMapper.getMedManageParams(filterVO);
     }
 
@@ -1083,6 +1083,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<QcResultShortDTO> qcCheckMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.qcCheckMRPage(qcResultShortPageVO);
     }
+
     /**
      * 质控核查质控评分页-科室(内页)
      *
@@ -1120,38 +1121,52 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     /**
      * 手术费,抗菌药物,手术和病理费等含有人数
      *
-     * @param  filterVO
+     * @param filterVO
      * @return
      */
-    public List<Map<String, String>> selectOperationNum(@Param("filterVO")FilterVO filterVO){
-        return  baseMapper.selectOperationNum(filterVO);
+    public List<Map<String, String>> selectOperationNum(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.selectOperationNum(filterVO);
 
     }
 
     /**
      * 触发规则人数
+     *
      * @param filterVO
      * @return
      */
-    public Map<String,Long> triggeringRules(@Param("filterVO")FilterVO filterVO){
-        return  baseMapper.triggeringRules(filterVO);
+    public Map<String, Long> triggeringRules(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.triggeringRules(filterVO);
     }
 
     /**
      * 病案首页关联的出院病历
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO){
-        return  baseMapper.getMedicalRecords(filterVO);
+    public List<Map<String, String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.getMedicalRecords(filterVO);
     }
 
     /**
      * 首页恶性肿瘤人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> malignancy(@Param("filterVO") FilterVO filterVO){
-        return  baseMapper.malignancy(filterVO);
+    public List<Map<String, String>> malignancy(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.malignancy(filterVO);
     }
+
+    /**
+     * 病历详情(H5)
+     *
+     * @param behInfoForH5VO
+     * @return
+     */
+    public IPage<BehInfoForH5DTO> behospitalInfoForH5(BehInfoForH5VO behInfoForH5VO) {
+        return baseMapper.behospitalInfoForH5(behInfoForH5VO);
+    }
+
 }

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

@@ -103,8 +103,9 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     public List<NumDTO> resultCountByDept(QcresultFilterVO qcresultFilterVO) {
         return baseMapper.resultCountByDept(qcresultFilterVO);
     }
+
     @Override
-    public List<Map<String,Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO){
+    public List<Map<String, Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO) {
         return baseMapper.resultMrCountByDept(qcresultFilterVO);
     }
 
@@ -174,6 +175,17 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
         return baseMapper.levelPercentGroupByDeptPage(filterPageVO);
     }
 
+    /**
+     * 病历等级占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<LevelPercentDTO> levelPercentByDept(FilterVO filterVO) {
+        return baseMapper.levelPercentByDept(filterVO);
+    }
+
     /**
      * 各模块缺陷占比-科室(分页)
      *
@@ -230,14 +242,14 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
         //缺陷分值
         String isPlacefile = filterPageVO.getIsPlacefile();
         List<EntryNumDTO> entryScore = new ArrayList<>();
-        entryScore = baseMapper.entryGroupByEntryScore(hospitalId,isPlacefile, ids);
+        entryScore = baseMapper.entryGroupByEntryScore(hospitalId, isPlacefile, ids);
         for (EntryNumDTO record : records) {
             for (EntryNumDTO entryNumDTO : entryScore) {
-                if(record.getId().equals(entryNumDTO.getId())){
-                 record.setScore(entryNumDTO.getScore());
-                    }
+                if (record.getId().equals(entryNumDTO.getId())) {
+                    record.setScore(entryNumDTO.getScore());
                 }
             }
+        }
         return entryNumDTOIPage;
     }
 
@@ -276,6 +288,7 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
 
     /**
      * 各科室甲/乙/丙级病历占比
+     *
      * @param filterVO
      * @return
      */
@@ -293,4 +306,14 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     public IPage<QcCasesHistoryDTO> getMedQcresultResult(HistoryAnalyzePageVO historyAnalyzePageVO){
         return baseMapper.getMedQcresultResult(historyAnalyzePageVO);
     }
+    /**
+     * 病历扣分大于等于5占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<DeptNumDTO> deductGT5ByDept(FilterVO filterVO) {
+        return baseMapper.deductGT5ByDept(filterVO);
+    }
 }

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.SysLoginLog;
+import com.diagbot.mapper.SysLoginLogMapper;
+import com.diagbot.service.SysLoginLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 系统登录日志表 服务实现类
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2022-05-09
+ */
+@Service
+public class SysLoginLogServiceImpl extends ServiceImpl<SysLoginLogMapper, SysLoginLog> implements SysLoginLogService {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.SysOperationLog;
+import com.diagbot.mapper.SysOperationLogMapper;
+import com.diagbot.service.SysOperationLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 系统操作日志表 服务实现类
+ * </p>
+ *
+ * @author zhanghang
+ * @since 2022-05-09
+ */
+@Service
+public class SysOperationLogServiceImpl extends ServiceImpl<SysOperationLogMapper, SysOperationLog> implements SysOperationLogService {
+
+}

+ 50 - 0
src/main/java/com/diagbot/util/AddressUtils.java

@@ -0,0 +1,50 @@
+package com.diagbot.util;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @Description:获取地址类
+ * @Author: cy
+ * @time: 2021/9/5 16:59
+ */
+
+public class AddressUtils {
+    private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
+
+    // IP地址查询
+    public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp";
+
+    // 未知地址
+    public static final String UNKNOWN = "未知地址";
+
+    public static String getRealAddressByIP(String ip) {
+        String address = UNKNOWN;
+        if(StringUtils.isBlank(ip)){
+            return UNKNOWN;
+        }
+        // 内网不查询
+        if (IpUtils.internalIp(ip)) {
+            return "内网IP";
+        }
+        try {
+            String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip + "&json=true");
+            if (StringUtil.isNotBlank(rspStr)) {
+                log.error("获取地理位置异常 {}", ip);
+                return UNKNOWN;
+            }
+            JSONObject obj = JSONObject.parseObject(rspStr);
+            String region = obj.getString("pro");
+            String city = obj.getString("city");
+            return String.format("%s %s", region, city);
+        } catch (Exception e) {
+            log.error("获取地理位置异常 {}", e);
+        }
+
+        return address;
+    }
+}
+
+

+ 179 - 0
src/main/java/com/diagbot/util/HttpUtils.java

@@ -0,0 +1,179 @@
+package com.diagbot.util;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.ConnectException;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Enumeration;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @Description: http请求功能工具类
+ * @author: gaodm
+ * @time: 2018/8/3 17:45
+ */
+@Slf4j
+public class HttpUtils {
+
+    /**
+     * 获取当前请求的HttpServletRequest实例
+     *
+     * @return
+     */
+    public static HttpServletRequest getHttpServletRequest() {
+        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+    }
+
+    /**
+     * 获取当前请求的请求头Map实例
+     *
+     * @return
+     */
+    public static Map<String, String> getHeaders() {
+        return getHeaders(getHttpServletRequest());
+    }
+
+    /**
+     * 获取当前请求的请求头Map实例中,键为key的值
+     *
+     * @param key
+     * @return
+     */
+    public static String getHeader(String key) {
+        return getHttpServletRequest().getHeader(key);
+    }
+
+    /**
+     * 获取当前请求的请求客户端的真实ip地址
+     *
+     * @return
+     */
+    public static String getIpAddress() {
+        // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址
+        return getIpAddress(getHttpServletRequest());
+    }
+
+    /**
+     * 根据HttpServletRequest获取请求头Map实例
+     *
+     * @param request
+     * @return
+     */
+    public static Map<String, String> getHeaders(HttpServletRequest request) {
+        Map<String, String> map = new LinkedHashMap<>();
+        Enumeration<String> enumeration = request.getHeaderNames();
+        while (enumeration.hasMoreElements()) {
+            String key = enumeration.nextElement();
+            String value = request.getHeader(key);
+            map.put(key, value);
+        }
+        return map;
+    }
+
+    /**
+     * 根据HttpServletRequest获取请求客户端的真实ip地址
+     *
+     * @param request
+     * @return
+     */
+    public static String getIpAddress(HttpServletRequest request) {
+        // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址
+        String ip = request.getHeader("X-Forwarded-For");
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("Proxy-Client-IP");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("WL-Proxy-Client-IP");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_CLIENT_IP");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("X-Real-IP");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+            }
+        } else if (ip.length() > 15) {
+            String[] ips = ip.split(",");
+            for (int index = 0; index < ips.length; index++) {
+                String strIp = (String) ips[index];
+                if (!("unknown".equalsIgnoreCase(strIp))) {
+                    ip = strIp;
+                    break;
+                }
+            }
+        }
+        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
+    }
+
+    /**
+     * 向指定 URL 发送POST方法的请求
+     *
+     * @param url   发送请求的 URL
+     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendPost(String url, String param) {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        StringBuilder result = new StringBuilder();
+        try {
+            String urlNameString = url;
+            log.debug("sendPost - {}", urlNameString);
+            URL realUrl = new URL(urlNameString);
+            URLConnection conn = realUrl.openConnection();
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            conn.setRequestProperty("Accept-Charset", "utf-8");
+            conn.setRequestProperty("contentType", "utf-8");
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            out = new PrintWriter(conn.getOutputStream());
+            out.print(param);
+            out.flush();
+            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result.append(line);
+            }
+            log.debug("recv - {}", result);
+        } catch (ConnectException e) {
+            log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
+        } catch (SocketTimeoutException e) {
+            log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
+        } catch (IOException e) {
+            log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
+        } catch (Exception e) {
+            log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
+        } finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
+            }
+        }
+        return result.toString();
+    }
+
+}

+ 155 - 0
src/main/java/com/diagbot/util/IpUtils.java

@@ -0,0 +1,155 @@
+package com.diagbot.util;
+
+import javax.servlet.http.HttpServletRequest;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+/**
+ * @Description:获取IP方法
+ * @Author: cy
+ * @time: 2021/9/5 17:00
+ */
+
+public class IpUtils {
+
+    private static final int INADDR4SZ = 4;
+    private static final int INADDR16SZ = 16;
+    private static final int INT16SZ = 2;
+
+    public static String getIpAddr(HttpServletRequest request) {
+        if (request == null) {
+            return "unknown";
+        }
+        String ip = request.getHeader("x-forwarded-for");
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getHeader("Proxy-Client-IP");
+        }
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getHeader("X-Forwarded-For");
+        }
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getHeader("WL-Proxy-Client-IP");
+        }
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getHeader("X-Real-IP");
+        }
+
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getRemoteAddr();
+        }
+
+        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
+    }
+
+    public static boolean internalIp(String ip) {
+        byte[] addr = textToNumericFormatV4(ip);
+        return internalIp(addr) || "127.0.0.1".equals(ip);
+    }
+
+    private static boolean internalIp(byte[] addr) {
+        if (null == addr || addr.length < 2) {
+            return true;
+        }
+        final byte b0 = addr[0];
+        final byte b1 = addr[1];
+        // 10.x.x.x/8
+        final byte SECTION_1 = 0x0A;
+        // 172.16.x.x/12
+        final byte SECTION_2 = (byte) 0xAC;
+        final byte SECTION_3 = (byte) 0x10;
+        final byte SECTION_4 = (byte) 0x1F;
+        // 192.168.x.x/16
+        final byte SECTION_5 = (byte) 0xC0;
+        final byte SECTION_6 = (byte) 0xA8;
+        switch (b0) {
+            case SECTION_1:
+                return true;
+            case SECTION_2:
+                if (b1 >= SECTION_3 && b1 <= SECTION_4) {
+                    return true;
+                }
+            case SECTION_5:
+                switch (b1) {
+                    case SECTION_6:
+                        return true;
+                }
+            default:
+                return false;
+        }
+    }
+
+    /**
+     * 将IPv4地址转换成字节
+     *
+     * @param src IPv4地址
+     * @return byte 字节
+     */
+    public static byte[] textToNumericFormatV4(String src)
+    {
+        byte[] res = new byte[INADDR4SZ];
+
+        long tmpValue = 0;
+        int currByte = 0;
+        boolean newOctet = true;
+
+        int len = src.length();
+        if (len == 0 || len > 15) {
+            return null;
+        }
+
+        for (int i = 0; i < len; i++) {
+            char c = src.charAt(i);
+            if (c == '.') {
+                if (newOctet || tmpValue < 0 || tmpValue > 0xff || currByte == 3) {
+                    return null;
+                }
+                res[currByte++] = (byte) (tmpValue & 0xff);
+                tmpValue = 0;
+                newOctet = true;
+            } else {
+                int digit = Character.digit(c, 10);
+                if (digit < 0) {
+                    return null;
+                }
+                tmpValue *= 10;
+                tmpValue += digit;
+                newOctet = false;
+            }
+        }
+        if (newOctet || tmpValue < 0 || tmpValue >= (1L << ((4 - currByte) * 8))) {
+            return null;
+        }
+        switch (currByte) {
+            case 0:
+                res[0] = (byte) ((tmpValue >> 24) & 0xff);
+            case 1:
+                res[1] = (byte) ((tmpValue >> 16) & 0xff);
+            case 2:
+                res[2] = (byte) ((tmpValue >>  8) & 0xff);
+            case 3:
+                res[3] = (byte) ((tmpValue >>  0) & 0xff);
+        }
+        return res;
+    }
+
+    public static String getHostIp() {
+        try {
+            return InetAddress.getLocalHost().getHostAddress();
+        } catch (UnknownHostException e) {
+        }
+        return "127.0.0.1";
+    }
+
+    public static String getHostName() {
+        try {
+            return InetAddress.getLocalHost().getHostName();
+        } catch (UnknownHostException e) {
+        }
+        return "未知";
+    }
+
+    public static boolean isIPv4LiteralAddress(String src) {
+        return textToNumericFormatV4(src) != null;
+    }
+
+}

+ 17 - 0
src/main/java/com/diagbot/util/SysUserUtils.java

@@ -114,5 +114,22 @@ public class SysUserUtils {
         }
         return hasRole;
     }
+    /**
+     * 获取当前请求的用户的当前系统id字符串
+     *
+     * @return
+     */
+    public static String getIsPlacefile() {
+        String currentSoftwareIdStr = HttpUtils.getHeader("isPlacefile");
+        return StringUtil.isNotBlank(currentSoftwareIdStr) && currentSoftwareIdStr.matches("[0-9]+") ? currentSoftwareIdStr : null;
+    }
 
+    /**
+     * 获取前端要导出的文件名
+     *
+     * @return
+     */
+    public static String getExcelName() {
+        return HttpUtils.getHeader("excelName");
+    }
 }

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

@@ -63,6 +63,9 @@ public class AddAppealInfoApiVO {
     @NotBlank(message = "申诉人工号不能为空")
     private String claimantId;
 
+    @ApiModelProperty(value = "申诉人姓名")
+    private String claimantName;
+
     @ApiModelProperty(value = "申诉类型(0:医生申诉|1:质控申诉)", required = true)
     @NotBlank(message = "申诉类型不能为空")
     private String appealType;

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

@@ -62,6 +62,9 @@ public class AddAppealInfoVO {
     @ApiModelProperty(value = "申诉人id")
     private String claimantId;
 
+    @ApiModelProperty(value = "申诉人姓名")
+    private String claimantName;
+
     @ApiModelProperty(value = "申诉类型(0:医生申诉|1:质控申诉)", required = true)
     @NotBlank(message = "申诉类型不能为空")
     private String appealType;

+ 50 - 0
src/main/java/com/diagbot/vo/BehInfoForH5VO.java

@@ -0,0 +1,50 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 16:10
+ */
+@Data
+public class BehInfoForH5VO extends Page {
+    private String deptId;
+    private String deptName;
+    private String hospitalId;
+
+    @NotBlank(message = "请输入起始时间")
+    private String startDate;
+    /**
+     * 结束时间
+     */
+    @NotBlank(message = "请输入结束时间")
+    private String endDate;
+
+    /**
+     * 评分等级
+     */
+    private String level;
+
+    /**
+     * 单项否决标志
+     */
+    private Integer isReject;
+    /**
+     * 条目id
+     */
+    private Long caseEntryId;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
+
+    /**
+     * 扣分
+     */
+    private Double deductScore;
+}

+ 6 - 0
src/main/java/com/diagbot/vo/GetAppealReviewVO.java

@@ -52,4 +52,10 @@ public class GetAppealReviewVO extends Page implements Serializable {
     @ApiModelProperty(value = "是否已归档(0:未归档,1:已归档)")
     private String isPlacefile;
 
+    @ApiModelProperty(value = "病案号")
+    private String fileCode;
+
+    @ApiModelProperty(value = "患者姓名")
+    private String patientName;
+
 }

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

@@ -0,0 +1,16 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/11 14:15
+ */
+@Data
+public class HospitalIdVO {
+    @NotNull(message = "请输入医院id")
+    private Long hospitalId;
+}

+ 47 - 0
src/main/java/com/diagbot/vo/SysLoginLogVO.java

@@ -0,0 +1,47 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+
+
+/**
+ * @Description:
+ * @author: songxl
+ * @time: 2022/5/09 14:28
+ */
+@Getter
+@Setter
+@ApiModel("系统登录日志列表页-接口入参")
+public class SysLoginLogVO extends Page implements Serializable {
+
+    private static final long serialVersionUID = -7393452900176171499L;
+
+    @ApiModelProperty(value = "登录用户名")
+    private String loginName;
+
+    @ApiModelProperty(value = "医院id", hidden = true)
+    private String hospitalId;
+
+    @ApiModelProperty(value = "ip地址")
+    private String loginIp;
+
+    /**
+     * 登录开始时间
+     */
+    @ApiModelProperty(value = "登录开始时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+    String startDate;
+
+    /**
+     * 登录结束时间
+     */
+    @ApiModelProperty(value = "登录结束时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+    String endDate;
+}

+ 53 - 0
src/main/java/com/diagbot/vo/SysOperationLogVO.java

@@ -0,0 +1,53 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+
+
+/**
+ * @Description:
+ * @author: songxl
+ * @time: 2022/5/09 14:28
+ */
+@Getter
+@Setter
+@ApiModel("操作日志列表页-接口入参")
+public class SysOperationLogVO extends Page implements Serializable {
+
+    private static final long serialVersionUID = -6958100906151636839L;
+
+    /**
+     * 操作用户
+     */
+    @ApiModelProperty(value = "操作用户")
+    String operationName;
+
+    @ApiModelProperty(value = "医院id", hidden = true)
+    private String hospitalId;
+    /**
+     * 操作开始时间
+     */
+    @ApiModelProperty(value = "操作开始时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+    String startDate;
+
+    /**
+     * 操作结束时间
+     */
+    @ApiModelProperty(value = "操作结束时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+    String endDate;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    @ApiModelProperty(value = "是否归档(0:未归档,1:已归档)")
+    private String isPlacefile = "0";
+
+}

+ 54 - 10
src/main/java/com/diagbot/web/ConsoleByDeptExportController.java

@@ -99,25 +99,69 @@ public class ConsoleByDeptExportController {
     }
 
     /**
-     * 病案首页不合格/合格数病历详情页科室导出-XY
+     * 病案首页合格数病历详情页科室导出-XY
      *
      * @param qcResultShortPageVO
      * @return
      */
-    @ApiOperation(value = "病案首页不合格/合格数病历详情页导出[by:cy]")
-    @PostMapping("/badLevelPageXYExportByDept")
-    @SysLogger("badLevelPageXYExportByDept")
-    public void badLevelPageXYExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortXYPageVO qcResultShortPageVO) {
+    @ApiOperation(value = "病案首页合格数病历详情页导出[by:cy]")
+    @PostMapping("/badQualifiedLevelPageXYExportByDept")
+    @SysLogger("badQualifiedLevelPageXYExportByDept")
+    public void badQualifiedLevelPageXYExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortXYPageVO qcResultShortPageVO) {
         consoleExportFacade.badLevelPageXYExport(response, qcResultShortPageVO);
     }
 
     /**
-     * 病案首页不合格/合格数病历详情页导出-科室
+     * 病案首页不合格数病历详情页科室导出-XY
      *
      * @param qcResultShortPageVO
      * @return
      */
-    @ApiOperation(value = "病案首页不合格/合格数病历详情页导出-科室[by:cy]",
+    @ApiOperation(value = "病案首页不合格数病历详情页导出[by:cy]")
+    @PostMapping("/badUnQualifiedLevelPageXYExportByDept")
+    @SysLogger("badUnQualifiedLevelPageXYExportByDept")
+    public void badUnQualifiedLevelPageXYExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortXYPageVO qcResultShortPageVO) {
+        consoleExportFacade.badLevelPageXYExport(response, qcResultShortPageVO);
+    }
+
+    /**
+     * 病案首页合格数病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页合格数病历详情页导出-科室[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "behDeptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +
+                    "mrStatus: 首页核查状态(1:已核查,0:未核查) <br>" +
+                    "chName: 病历核查人员 <br>" +
+                    "mrName: 首页核查人员 <br>" +
+                    "chTimeStart: 病历核查起始时间 <br>" +
+                    "chTimeEnd: 病历核查截止时间 <br>" +
+                    "mrTimeStart: 首页核查起始时间 <br>" +
+                    "mrTimeEnd: 首页核查截止时间 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "titleName: 是否合格数 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/homeQualifiedPageOrLevelExportByDept")
+    @SysLogger("homeQualifiedPageOrLevelExportByDept")
+    public void homeQualifiedPageOrLevelExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleByDeptExportFacade.homePageOrLevelExportByDept(response, qcResultShortPageVO);
+    }
+
+    /**
+     * 病案首页不合格数病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页不合格数病历详情页导出-科室[by:cy]",
             notes = "behospitalCode: 病历号<br>" +
                     "patName: 病人姓名 <br>" +
                     "behDeptName:科室名称 <br>" +
@@ -136,9 +180,9 @@ public class ConsoleByDeptExportController {
                     "endDate: 截止时间 <br>" +
                     "titleName: 是否合格数 <br>" +
                     "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
-    @PostMapping("/homePageOrLevelExportByDept")
-    @SysLogger("homePageOrLevelExportByDept")
-    public void homePageOrLevelExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+    @PostMapping("/homeUnQualifiedPageOrLevelExportByDept")
+    @SysLogger("homeUnQualifiedPageOrLevelExportByDept")
+    public void homeUnQualifiedPageOrLevelExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
         consoleByDeptExportFacade.homePageOrLevelExportByDept(response, qcResultShortPageVO);
     }
 

+ 52 - 10
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -381,12 +381,12 @@ public class ConsoleExportController {
     }
 
     /**
-     * 病案首页不合格/合格数病历详情页导出
+     * 病案首页合格数病历详情页导出
      *
      * @param qcResultShortPageVO
      * @return
      */
-    @ApiOperation(value = "病案首页不合格/合格数病历详情页导出[by:cy]",
+    @ApiOperation(value = "病案首页合格数病历详情页导出[by:cy]",
             notes = "behospitalCode: 病历号<br>" +
                     "patName: 病人姓名 <br>" +
                     "behDeptName:科室名称 <br>" +
@@ -404,26 +404,68 @@ public class ConsoleExportController {
                     "startDate: 起始时间 <br>" +
                     "endDate: 截止时间 <br>" +
                     "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
-    @PostMapping("/badLevelPagePageExport")
-    @SysLogger("badLevelPagePageExport")
-    public void badLevelPagePageExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+    @PostMapping("/badQualifiedLevelPagePageExport")
+    @SysLogger("badQualifiedLevelPagePageExport")
+    public void badQualifiedLevelPagePageExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleExportFacade.badLevelPagePageExport(response, qcResultShortPageVO);
+    }
+
+    /**
+     * 病案首页不合格数病历详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页不合格数病历详情页导出[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "behDeptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +
+                    "mrStatus: 首页核查状态(1:已核查,0:未核查) <br>" +
+                    "chName: 病历核查人员 <br>" +
+                    "mrName: 首页核查人员 <br>" +
+                    "chTimeStart: 病历核查起始时间 <br>" +
+                    "chTimeEnd: 病历核查截止时间 <br>" +
+                    "mrTimeStart: 首页核查起始时间 <br>" +
+                    "mrTimeEnd: 首页核查截止时间 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/badUnQualifiedLevelPagePageExport")
+    @SysLogger("badUnQualifiedLevelPagePageExport")
+    public void badUnQualifiedLevelPagePageExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
         consoleExportFacade.badLevelPagePageExport(response, qcResultShortPageVO);
     }
 
 
     /**
-     * 病案首页不合格/合格数病历详情页导出-XY
+     * 病案首页合格数病历详情页导出-XY
      *
      * @param qcResultShortPageVO
      * @return
      */
-    @ApiOperation(value = "病案首页不合格/合格数病历详情页导出[by:cy]")
-    @PostMapping("/badLevelPageXYExport")
-    @SysLogger("badLevelPageXYExport")
-    public void badLevelPageXYExport(HttpServletResponse response, @RequestBody @Valid QcResultShortXYPageVO qcResultShortPageVO) {
+    @ApiOperation(value = "病案首页合格数病历详情页导出[by:cy]")
+    @PostMapping("/badQualifiedLevelPageXYExport")
+    @SysLogger("badQualifiedLevelPageXYExport")
+    public void badQualifiedLevelPageXYExport(HttpServletResponse response, @RequestBody @Valid QcResultShortXYPageVO qcResultShortPageVO) {
         consoleExportFacade.badLevelPageXYExport(response, qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页不合格数病历详情页导出-XY
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页不合格数病历详情页导出[by:cy]")
+    @PostMapping("/badUnQualifiedLevelPageXYExport")
+    @SysLogger("badUnQualifiedLevelPageXYExport")
+    public void badUnQualifiedLevelPageXYExport(HttpServletResponse response, @RequestBody @Valid QcResultShortXYPageVO qcResultShortPageVO) {
+        consoleExportFacade.badLevelPageXYExport(response, qcResultShortPageVO);
+    }
 
     /**
      * 稽查病历详情页导出

+ 45 - 0
src/main/java/com/diagbot/web/LogManagementController.java

@@ -0,0 +1,45 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysLoginLogDTO;
+import com.diagbot.dto.SysOperationLogDTO;
+import com.diagbot.facade.LogManagementFacade;
+import com.diagbot.vo.SysLoginLogVO;
+import com.diagbot.vo.SysOperationLogVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * @Description: 日志管理API
+ * @author: songxl
+ * @time: 2022/5/09 14:28
+ */
+@RestController
+@Api(value = "日志管理API", tags = { "日志管理API" })
+@RequestMapping("/logManage")
+public class LogManagementController {
+    @Autowired
+    private LogManagementFacade logManagementFacade;
+
+
+    @ApiOperation(value = "查看登录日志[by:songxl]")
+    @PostMapping("/loginLogPage")
+    public RespDTO<IPage<SysLoginLogDTO>> loginLogPage(@RequestBody SysLoginLogVO sysLoginLogVO) {
+        return RespDTO.onSuc(logManagementFacade.getLoginLog(sysLoginLogVO));
+    }
+
+    @ApiOperation(value = "查看操作日志[by:songxl]")
+    @PostMapping("/operationLogPage")
+    public RespDTO<IPage<SysOperationLogDTO>> operationLogPage(@RequestBody SysOperationLogVO sysOperationLogVO) {
+        return RespDTO.onSuc(logManagementFacade.getOperationLog(sysOperationLogVO));
+    }
+
+
+}

+ 13 - 5
src/main/java/com/diagbot/web/MedAppealInfoController.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.MedAppealInfoServiceClientFacade;
 import com.diagbot.dto.*;
+import com.diagbot.entity.SysUser;
 import com.diagbot.entity.SysUserRole;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.facade.SysHospitalSetFacade;
@@ -62,7 +63,14 @@ public class MedAppealInfoController {
     @Transactional
     public RespDTO<Boolean> addAppealInfo(@RequestBody @Valid AddAppealInfoVO addAppealInfoVO) {
         addAppealInfoVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
-        addAppealInfoVO.setClaimantId(SysUserUtils.getCurrentPrincipleID());
+        //对内申诉接口如果没有传申诉人,就自己获取
+        if(StringUtil.isBlank(addAppealInfoVO.getClaimantId())){
+            addAppealInfoVO.setClaimantId(SysUserUtils.getCurrentPrincipleID());
+            SysUser user = sysUserFacade.getById(SysUserUtils.getCurrentPrincipleID());
+            if(user!=null){
+                addAppealInfoVO.setClaimantName(user.getLinkman());
+            }
+        }
         //获取操作流节点
         String mapping = sysHospitalSetFacade.getValue(Long.parseLong(SysUserUtils.getCurrentHospitalID()), "work_flow_node_mapping");
         //获取是否是单人操作开关
@@ -91,10 +99,10 @@ public class MedAppealInfoController {
             addAppealInfoVO.setWorkFlowNodeId(mapJSON.getLong("addAppealInfo"));
         }
         //通过医生id获取医生的用户id
-        Long userId = sysUserFacade.getUserId(addAppealInfoApiVO.getClaimantId(), addAppealInfoApiVO.getHospitalId());
-        if (userId != null) {
-            addAppealInfoVO.setClaimantId(userId+"");
-        }
+//        Long userId = sysUserFacade.getUserId(addAppealInfoApiVO.getClaimantId(), addAppealInfoApiVO.getHospitalId());
+//        if (userId != null) {
+//            addAppealInfoVO.setClaimantId(userId+"");
+//        }
         //获取是否是单人操作开关
         String single_appeal_falg = sysHospitalSetFacade.getValue(addAppealInfoApiVO.getHospitalId(), "single_appeal_falg");
         if(StringUtil.isNotEmpty(single_appeal_falg)) {

+ 27 - 0
src/main/java/com/diagbot/web/QcTypeController.java

@@ -54,6 +54,33 @@ public class QcTypeController {
         qcTypeFacade.saveOrUpdate(qcTypeSaveVO);
         return RespDTO.onSuc(true);
     }
+    @ApiOperation(value = "质控类型-新增[by:gaodm]",
+            notes = "")
+    @PostMapping("/add")
+    @SysLogger("add")
+    @Transactional
+    public RespDTO<Boolean> add(@RequestBody QcTypeSaveVO qcTypeSaveVO) {
+        qcTypeFacade.saveOrUpdate(qcTypeSaveVO);
+        return RespDTO.onSuc(true);
+    }
+    @ApiOperation(value = "质控类型-更新[by:gaodm]",
+            notes = "")
+    @PostMapping("/update")
+    @SysLogger("update")
+    @Transactional
+    public RespDTO<Boolean> update(@RequestBody QcTypeSaveVO qcTypeSaveVO) {
+        qcTypeFacade.saveOrUpdate(qcTypeSaveVO);
+        return RespDTO.onSuc(true);
+    }
+    @ApiOperation(value = "质控类型-复制[by:gaodm]",
+            notes = "")
+    @PostMapping("/copy")
+    @SysLogger("copy")
+    @Transactional
+    public RespDTO<Boolean> copy(@RequestBody QcTypeSaveVO qcTypeSaveVO) {
+        qcTypeFacade.saveOrUpdate(qcTypeSaveVO);
+        return RespDTO.onSuc(true);
+    }
 
     @ApiOperation(value = "分页列表[by:gaodm]",
             notes = "    // 名称\n" +

+ 111 - 0
src/main/java/com/diagbot/web/StatisticsForH5Controller.java

@@ -0,0 +1,111 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.BasDeptInfoDTO;
+import com.diagbot.dto.BehInfoForH5DTO;
+import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
+import com.diagbot.dto.LevelPercentDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.StatisticsForH5Facade;
+import com.diagbot.vo.BehInfoForH5VO;
+import com.diagbot.vo.FilterVO;
+import com.diagbot.vo.HospitalIdVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 15:24
+ */
+@RequestMapping("/h5/statistics")
+@RestController
+@Api(value = "H5数据统计相关API", tags = { "H5数据统计相关API" })
+@SuppressWarnings("unchecked")
+public class StatisticsForH5Controller {
+    @Autowired
+    StatisticsForH5Facade statisticsForH5Facade;
+
+    @ApiOperation(value = "单项否决占比[by:zhaops]",
+            notes = "startDate: 统计时间(起始时间)<br>" +
+                    "endDate: 统计时间(截止时间)<br>" +
+                    "hospitalId: 医院id<br>" +
+                    "deptName: 科室名称<br>" +
+                    "deptId: 科室id<br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/entryRejectDistribution")
+    @SysLogger("entryRejectDistribution")
+    public RespDTO<List<EntryNumDTO>> entryRejectDistribution(@RequestBody @Valid FilterVO filterVO) {
+        List<EntryNumDTO> data = statisticsForH5Facade.entryRejectDistribution(filterVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "病历等级占比[by:zhaops]",
+            notes = "startDate: 统计时间(起始时间)<br>" +
+                    "endDate: 统计时间(截止时间)<br>" +
+                    "hospitalId: 医院id<br>" +
+                    "deptName: 科室名称<br>" +
+                    "deptId: 科室id<br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/levelDistribution")
+    @SysLogger("levelDistribution")
+    public RespDTO<List<LevelPercentDTO>> levelDistribution(@RequestBody @Valid FilterVO filterVO) {
+        List<LevelPercentDTO> data = statisticsForH5Facade.levelDistribution(filterVO);
+        return RespDTO.onSuc(data);
+    }
+
+
+    @ApiOperation(value = "病历扣分大于等于5占比[by:zhaops]",
+            notes = "startDate: 统计时间(起始时间)<br>" +
+                    "endDate: 统计时间(截止时间)<br>" +
+                    "hospitalId: 医院id<br>" +
+                    "deptName: 科室名称<br>" +
+                    "deptId: 科室id<br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/deductGT5Distribution")
+    @SysLogger("deductGT5Distribution")
+    public RespDTO<List<DeptNumDTO>> deductGT5Distribution(@RequestBody @Valid FilterVO filterVO) {
+        List<DeptNumDTO> data = statisticsForH5Facade.deductGT5Distribution(filterVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "病历详情[by:zhaops]",
+            notes = "startDate: 统计时间(起始时间)<br>" +
+                    "endDate: 统计时间(截止时间)<br>" +
+                    "hospitalId: 医院id<br>" +
+                    "deptName: 科室名称<br>" +
+                    "deptId: 科室id<br>" +
+                    "level: 评分等级<br>" +
+                    "isReject: 单项否决标志<br>" +
+                    "caseEntryId: 条目id<br>" +
+                    "deductScore: 扣分值(5)<br>" +
+                    "orders:排序<br>" +
+                    "orders.asc:排序方式(true-正序,false-反序)<br>" +
+                    "orders.column:排序列名 例:1、leaveHospitalDate;2、指定顺序排序 field( level, '甲','乙','丙')<br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/getBehInfoPage")
+    @SysLogger("getBehInfoPage")
+    public RespDTO<IPage<BehInfoForH5DTO>> getBehInfoPage(@RequestBody @Valid BehInfoForH5VO behInfoForH5VO) {
+        IPage<BehInfoForH5DTO> data = statisticsForH5Facade.getBehInfoPage(behInfoForH5VO);
+        return RespDTO.onSuc(data);
+    }
+
+
+    @ApiOperation(value = "获取病历质控一览下医院科室下拉列表信息[by:zhaops]",
+            notes = "hospitalId: 医院id")
+    @PostMapping("/getDeptList")
+    @SysLogger("getDeptList")
+    public RespDTO<List<BasDeptInfoDTO>> getDeptList(@RequestBody HospitalIdVO hospitalIdVO) {
+        return RespDTO.onSuc(statisticsForH5Facade.listForUser(hospitalIdVO));
+    }
+}

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -2,7 +2,7 @@ spring:
   application:
     name: mrqc-sys
   profiles:
-    active: pre
+    active: local
   main:
     allow-bean-definition-overriding: true
 

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

@@ -21438,4 +21438,124 @@
         )m
     </select>
 
+    <!--病历详情-->
+    <select id="behospitalInfoForH5" parameterType="com.diagbot.vo.BehInfoForH5VO" resultType="com.diagbot.dto.BehInfoForH5DTO">
+        SELECT
+        k1.name AS name,
+        k1.sex AS sex,
+        k1.file_code AS fileCode,
+        k1.doctor_id AS doctorId,
+        k1.doctor_name AS doctorName,
+        k1.beh_dept_id AS deptId,
+        k1.beh_dept_name AS deptName,
+        k1.behospital_code AS behospitalCode,
+        k1.leave_hospital_date AS leaveHospitalDate,
+        k1.behospital_date AS behospitalDate,
+        k2.`level` AS LEVEL,
+        k5.totleScore-k2.score_res AS deductScore
+        FROM
+        (
+        SELECT
+        a.*
+        FROM
+        med_behospital_info a
+        WHERE
+        a.is_deleted = 'N'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        ) k1
+        LEFT JOIN ( SELECT b.* FROM med_qcresult_info b
+        WHERE
+        b.is_deleted = 'N'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND b.hospital_id = #{hospitalId}
+        </if>
+        ) k2 ON k1.hospital_id = k2.hospital_id
+        AND k1.behospital_code = k2.behospital_code
+        LEFT JOIN (
+        SELECT
+        c.*
+        FROM
+        med_qcresult_detail c
+        WHERE
+        c.is_deleted = 'N'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND c.hospital_id = #{hospitalId}
+        </if>
+        ) k3 ON k1.hospital_id = k3.hospital_id
+        AND k1.behospital_code = k3.behospital_code
+        LEFT JOIN ( SELECT d.* FROM med_home_page d
+        WHERE
+        d.is_deleted = 'N'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND d.hospital_id = #{hospitalId}
+        </if>
+        ) k4 ON k1.hospital_id = k4.hospital_id
+        AND k1.behospital_code = k4.behospital_code
+        LEFT JOIN (
+        SELECT
+        hospital_id,
+        CASE
+        `value`
+        WHEN 0 THEN
+        120
+        WHEN 1 THEN
+        100
+        END AS totleScore
+        FROM
+        `sys_hospital_set`
+        WHERE
+        is_deleted = 'N'
+        AND CODE = 'score_type'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND hospital_id = #{hospitalId}
+        </if>
+        ) k5 ON k1.hospital_id = k5.hospital_id
+        WHERE
+        1 = 1
+        AND k2.id is not null
+        <if test="isReject != null ">
+            AND k3.is_reject = #{isReject}
+        </if>
+        <if test="caseEntryId != null ">
+            AND k3.cases_entry_id =#{caseEntryId}
+        </if>
+        <if test="level != null and level != ''">
+            AND  k2.`level` =#{level}
+        </if>
+        <if test="deductScore != null">
+            AND k5.totleScore-k2.score_res>=#{deductScore}
+        </if>
+        GROUP BY
+        k1.hospital_id,
+        k1.behospital_code
+    </select>
+
 </mapper>

+ 38 - 0
src/main/resources/mapper/QcCasesEntryHospitalMapper.xml

@@ -137,4 +137,42 @@
         </if>
         )
     </select>
+    <select id="getQcCasesEntryById" resultType="com.diagbot.dto.QcCasesEntryHospitalDTO">
+        select
+        b.id as id,
+        a.cases_id as casesId,
+        a.cases_name As casesName,
+        a.name as name,
+        b.msg As msg,
+        <choose>
+            <when test='isPlacefile == "0"'>
+                b.score_run AS score,
+            </when>
+            <otherwise>
+                b.score AS score,
+            </otherwise>
+        </choose>
+        <choose>
+            <when test='isPlacefile == "0"'>
+                b.is_used_run AS isUsed,
+            </when>
+            <otherwise>
+                b.is_used AS isUsed,
+            </otherwise>
+        </choose>
+        b.is_reject As isReject,
+        a.rule_type
+        from
+        qc_cases_entry a
+        join qc_cases_entry_hospital b
+        on a.id = b.cases_entry_id
+        where a.is_deleted = "N"
+        AND b.is_deleted = "N"
+        <if test="hospitalId != null and hospitalId != ''">
+            AND b.hospital_id = #{hospitalId}
+        </if>
+        <if test="id != null">
+            AND b.id = #{id}
+        </if>
+    </select>
 </mapper>

+ 19 - 0
src/main/resources/mapper/QcCasesMapper.xml

@@ -50,4 +50,23 @@
         a.id,
         a.`name`
     </select>
+    <select id="getQcCasesById" resultType="com.diagbot.dto.QcCasesDTO">
+        SELECT
+        qch.*,
+        qc.`name` AS NAME,
+        qc.prefix AS prefix
+        FROM
+        `qc_cases_hospital` qch,
+        qc_cases qc
+        WHERE
+        qch.cases_id = qc.id
+        AND qch.is_deleted = 'N'
+        AND qc.is_deleted = 'N'
+        <if test="id != null and id != ''">
+            and qch.id = #{id}
+        </if>
+        <if test="hospitalId != null and hospitalId != ''">
+            and qch.hospital_id = #{hospitalId}
+        </if>
+    </select>
 </mapper>

+ 226 - 0
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -748,6 +748,12 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -796,6 +802,12 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -816,6 +828,7 @@
         ORDER BY
         percent DESC
     </select>
+
     <!-- 各科室质控平均分(首页) -->
     <select id="getAverageScore" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.AverageStatisticsDTO">
         select
@@ -2138,6 +2151,73 @@
         ROUND( sum( c.`level` = '丙' )/ count(*)* 100, 2 ) DESC) t
     </select>
 
+
+    <!-- 按科室统计质控病历数(分页) -->
+    <select id="levelPercentByDept" resultType="com.diagbot.dto.LevelPercentDTO">
+        SELECT t.*
+        FROM
+        (SELECT
+        a.beh_dept_id AS deptId,
+        a.beh_dept_name AS deptName,
+        count(*) AS totleNum,
+        sum( c.`level` = '甲' ) AS firstLevelNum,
+        sum( c.`level` = '乙' ) AS secondLevelNum,
+        sum( c.`level` = '丙' ) AS thirdLevelNum,
+        ROUND( sum( c.`level` = '甲' )/ count(*), 4 ) AS firstPercent,
+        ROUND( sum( c.`level` = '乙' )/ count(*), 4 ) AS sencondPercent,
+        ROUND( sum( c.`level` = '丙' )/ count(*), 4 ) AS thirdPercent,
+        concat( ROUND( sum( c.`level` = '甲' )/ count(*)* 100, 2 ), '%' ) AS firstPercentStr,
+        concat( ROUND( sum( c.`level` = '乙' )/ count(*)* 100, 2 ), '%' ) AS sencondPercentStr,
+        concat( ROUND( sum( c.`level` = '丙' )/ count(*)* 100, 2 ), '%' ) AS thirdPercentStr
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="level != null and level != ''">
+            AND c.`level` = #{level}
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name
+        order by totleNum DESC,
+                 firstPercent DESC,
+                 sencondPercent DESC,
+                 thirdPercent DESC) t
+    </select>
+
     <!-- 按模块统计质控缺陷数-科室(分页) -->
     <select id="entryCountGroupByCaseAndDeptPage" resultType="com.diagbot.dto.NumDTO">
         SELECT
@@ -2519,4 +2599,150 @@
                 ) a
             LEFT JOIN sys_user b ON a.modifier = b.id
     </select>
+
+    <!--病历扣分大于等于5分占比(H5)-->
+    <select id="deductGT5ByDept" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
+        SELECT
+        k1.deptId,
+        k1.deptName,
+        k1.num,
+        k2.totleNum,
+        Round( k1.num / k2.totleNum, 4 ) AS percent,
+        CONCAT( Round( k1.num / k2.totleNum * 100, 2 ), '%' ) AS percentStr
+        FROM
+        (
+        SELECT
+        t1.beh_dept_id AS deptId,
+        t1.beh_dept_name AS deptName,
+        count(*) AS num
+        FROM
+        (
+        SELECT
+        a.*,
+        b.score_res
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.behospital_code = b.behospital_code
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        ) t1,
+        (
+        SELECT
+        `value`,
+        hospital_id,
+        CASE
+        `value`
+        WHEN 0 THEN
+        120
+        WHEN 1 THEN
+        100
+        END AS totleScore
+        FROM
+        `sys_hospital_set`
+        WHERE
+        CODE = 'score_type'
+        AND hospital_id = '5'
+        ) t2
+        WHERE
+        t2.totleScore - t1.score_res >= 5
+        GROUP BY
+        t1.beh_dept_id,
+        t1.beh_dept_name
+        ) k1,
+        (
+        SELECT
+        count(*) AS totleNum
+        FROM
+        (
+        SELECT
+        a.*,
+        b.score_res
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.behospital_code = b.behospital_code
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        ) t1,
+        (
+        SELECT
+        `value`,
+        hospital_id,
+        CASE
+        `value`
+        WHEN 0 THEN
+        120
+        WHEN 1 THEN
+        100
+        END AS totleScore
+        FROM
+        `sys_hospital_set`
+        WHERE
+        CODE = 'score_type'
+        AND hospital_id = '5'
+        ) t2
+        WHERE
+        t2.totleScore - t1.score_res >= 5
+        ) k2
+        ORDER BY
+        percent DESC
+    </select>
+
 </mapper>

+ 52 - 0
src/main/resources/mapper/SysLoginLogMapper.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.SysLoginLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysLoginLog">
+        <id column="id" property="id" />
+        <result column="login_id" property="loginId" />
+        <result column="login_name" property="loginName" />
+        <result column="login_date" property="loginDate" />
+        <result column="login_ip" property="loginIp" />
+        <result column="login_address" property="loginAddress" />
+        <result column="login_browser" property="loginBrowser" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="remark" property="remark" />
+    </resultMap>
+    <insert id="addLoginLog">
+        insert into sys_login_log(login_id,login_name,login_date,login_ip,login_address,login_browser,gmt_create,hospital_id)
+        values (#{loginId},#{loginName},#{loginDate},INET_ATON(#{loginIp}),#{loginAddress},#{loginBrowser},#{gmtCreate},#{hospitalId})
+    </insert>
+    <select id="getLoginLog" resultType="com.diagbot.dto.SysLoginLogDTO">
+        select
+        a.login_id as loginId,
+        a.login_name as loginName,
+        a.login_date as loginDate,
+        INET_NTOA(a.login_ip) as loginIp,
+        a.login_address as loginAddress,
+        a.login_browser as loginBrowser
+        from sys_login_log a
+        where
+        1 = 1
+        <if test="sysLoginLogVO.hospitalId != null and sysLoginLogVO.hospitalId != ''">
+            AND a.hospital_id = #{sysLoginLogVO.hospitalId}
+        </if>
+        <if test="sysLoginLogVO.loginName != null and sysLoginLogVO.loginName != ''">
+            AND a.login_name like CONCAT('%',#{sysLoginLogVO.loginName},'%')
+        </if>
+        <if test="sysLoginLogVO.loginIp != null and sysLoginLogVO.loginIp != ''">
+            AND INET_NTOA(a.login_ip) like CONCAT('%',#{sysLoginLogVO.loginIp},'%')
+        </if>
+        <if test="sysLoginLogVO.startDate != null and sysLoginLogVO.endDate != null">
+            <![CDATA[ AND a.login_date >= #{sysLoginLogVO.startDate}]]>
+            <![CDATA[ AND a.login_date <= #{sysLoginLogVO.endDate}]]>
+        </if>
+        order by a.login_date desc
+    </select>
+
+</mapper>

+ 74 - 0
src/main/resources/mapper/SysOperationLogMapper.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.SysOperationLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysOperationLog">
+        <id column="id" property="id" />
+        <result column="operation_id" property="operationId" />
+        <result column="operation_name" property="operationName" />
+        <result column="operation_date" property="operationDate" />
+        <result column="operation_record" property="operationRecord" />
+        <result column="operation_ip" property="operationIp" />
+        <result column="operation_address" property="operationAddress" />
+        <result column="operation_method" property="operationMethod" />
+        <result column="operation_way" property="operationWay" />
+        <result column="operation_url" property="operationUrl" />
+        <result column="operation_param" property="operationParam" />
+        <result column="json_result" property="jsonResult" />
+        <result column="is_placefile" property="isPlacefile" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="remark" property="remark" />
+    </resultMap>
+    <insert id="addOperationRecord">
+        insert into
+        sys_operation_log(operation_id,operation_name,operation_date,operation_ip,operation_address,operation_method,operation_way,operation_url,operation_param,json_result,gmt_create,remark,operation_record,is_placefile,hospital_id)
+        values (#{operationId},#{operationName},#{operationDate},
+        <choose>
+            <when test="operationIp != null || operationIp = !''">
+                INET_ATON(#{operationIp}),
+            </when>
+            <otherwise>#{operationIp}),</otherwise>
+        </choose>
+        #{operationAddress},#{operationMethod},#{operationWay},#{operationUrl},#{operationParam},#{jsonResult},#{gmtCreate},#{remark},#{operationRecord},#{isPlacefile},#{hospitalId})
+    </insert>
+    <select id="getOperationLog" resultType="com.diagbot.dto.SysOperationLogDTO">
+        SELECT
+        a.id,
+        a.operation_id AS operationId,
+        a.operation_name AS operationName,
+        a.operation_date AS operationDate,
+        a.operation_method AS operationMethod,
+        a.operation_way AS operationWay,
+        a.operation_url AS operationUrl,
+        a.operation_param AS operationParam,
+        a.operation_record AS operationRecord,
+        INET_NTOA(a.operation_ip) AS operationIp,
+        a.operation_address AS operationAddress,
+        a.is_placefile AS isPlacefile,
+        a.json_result AS jsonResult
+        FROM
+        sys_operation_log a
+        where
+        1 = 1
+        <if test="sysOperationLogVO.hospitalId != null and sysOperationLogVO.hospitalId != ''">
+            AND a.hospital_id = #{sysOperationLogVO.hospitalId}
+        </if>
+        <if test="sysOperationLogVO.operationName != null and sysOperationLogVO.operationName != ''">
+            AND a.operation_name like CONCAT('%',#{sysOperationLogVO.operationName},'%')
+        </if>
+        <if test="sysOperationLogVO.isPlacefile != null and sysOperationLogVO.isPlacefile != ''">
+            AND a.is_placefile = #{sysOperationLogVO.isPlacefile}
+        </if>
+        <if test="sysOperationLogVO.startDate != null and sysOperationLogVO.endDate != null">
+            <![CDATA[ AND a.operation_date >= #{sysOperationLogVO.startDate}]]>
+            <![CDATA[ AND a.operation_date <= #{sysOperationLogVO.endDate}]]>
+        </if>
+        order by a.operation_date desc
+    </select>
+
+</mapper>