Sfoglia il codice sorgente

Merge commit '70ea559023bef75c8520e594b7378d2bd39b1115' into pre

linfutong 2 anni fa
parent
commit
84cb0cc7b8
100 ha cambiato i file con 4356 aggiunte e 481 eliminazioni
  1. 1 1
      ArcFace64.dat
  2. 5 0
      pom.xml
  3. 22 0
      release/2023-03-10 发版说明.md
  4. 35 0
      release/2023-03-31 发版说明.md
  5. 15 0
      release/2023-04-18 发版说明.md
  6. BIN
      release/img/v3.3.1_20230320.png
  7. 1 1
      release/remark.md
  8. 1 31
      release/sql/db_sql_v2.1-hotfix.sql
  9. 40 0
      release/sql/db_sql_v2.3.3.1.sql
  10. 62 0
      release/sql/db_sql_v2.3.sql
  11. 169 0
      release/sql/db_sql_v2.4.sql
  12. 1 0
      zd-api/pom.xml
  13. 11 1
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/FaceCompare.java
  14. 10 0
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/RemoteFaceService.java
  15. 6 0
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/fallback/RemoteFaceFallbackFactory.java
  16. 8 11
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/speaker/entity/PlayBatchVo.java
  17. 24 0
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/xxp/feign/RemoteXxpService.java
  18. 25 0
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/xxp/feign/fallback/RemoteXxpFallBack.java
  19. 2 1
      zd-api/zd-algorithm-api/src/main/resources/META-INF/spring.factories
  20. 61 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java
  21. 122 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSysUserInfo.java
  22. 238 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteDutyService.java
  23. 20 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteLaboratoryService.java
  24. 13 6
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteStudentsService.java
  25. 146 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteDutyFailback.java
  26. 23 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteLaboratoryFallbackFactory.java
  27. 13 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteStudentsFallbackFactory.java
  28. 31 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/ClassifyDetailVO.java
  29. 28 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/ClassifyVO.java
  30. 11 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/HardwareCVO.java
  31. 51 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabSecurityApplyVo.java
  32. 95 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabXxpClassifyVo.java
  33. 160 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/XxpInspectionVo.java
  34. 107 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/XxpUserAuthVo.java
  35. 2 1
      zd-api/zd-laboratory-api/src/main/java/resources/META-INF/spring.factories
  36. 17 0
      zd-api/zd-security-api/pom.xml
  37. 38 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckClapBo.java
  38. 32 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckHazardBo.java
  39. 64 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckPlanBo.java
  40. 47 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckRectifyBo.java
  41. 33 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckTestBo.java
  42. 40 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/dto/CheckHazardDto.java
  43. 16 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/dto/CheckRectifyDto.java
  44. 44 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/dto/UploadDto.java
  45. 17 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/feign/RemoteCheckTestService.java
  46. 15 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/feign/factory/RemoteCheckTestFallback.java
  47. 17 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/vo/CheckClapVo.java
  48. 39 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/vo/CheckHazardVo.java
  49. 26 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/vo/CheckRectifyVo.java
  50. 44 0
      zd-api/zd-security-api/src/main/java/com/zd/security/api/vo/CheckTestVo.java
  51. 5 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteUserService.java
  52. 5 1
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteUserFallback.java
  53. 73 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysLogoConfigVO.java
  54. 10 0
      zd-auth/pom.xml
  55. 35 0
      zd-common/common-core/src/main/java/com/zd/common/core/exception/ParamException.java
  56. 0 1
      zd-common/common-core/src/main/java/com/zd/common/core/mybatisplus/MybatisPlusGenerator.java
  57. 20 0
      zd-common/common-core/src/main/java/com/zd/common/core/redis/RedisService.java
  58. 20 0
      zd-common/common-core/src/main/java/com/zd/common/core/redis/RedisServiceImpl.java
  59. 27 0
      zd-common/common-core/src/main/java/com/zd/common/core/utils/DateUtils.java
  60. 383 0
      zd-common/common-core/src/main/java/com/zd/common/core/utils/ParamCheckUtils.java
  61. 82 0
      zd-common/common-core/src/main/java/com/zd/common/core/web/controller/AbstractController.java
  62. 3 0
      zd-common/common-core/src/main/java/com/zd/common/core/web/controller/BaseController.java
  63. 1 1
      zd-common/common-core/src/main/resources/code-generator.properties
  64. 18 8
      zd-common/common-swagger/src/main/java/com/zd/common/swagger/config/Knife4jConfiguration.java
  65. 6 0
      zd-model/src/main/java/com/zd/model/constant/ApplicationConstants.java
  66. 10 0
      zd-model/src/main/java/com/zd/model/constant/BaseConstants.java
  67. 0 1
      zd-model/src/main/java/com/zd/model/domain/R.java
  68. 34 0
      zd-model/src/main/java/com/zd/model/domain/per/PerPrefix.java
  69. 26 0
      zd-model/src/main/java/com/zd/model/entity/SysDept.java
  70. 20 0
      zd-model/src/main/java/com/zd/model/entity/SysUser.java
  71. 2 1
      zd-model/src/main/java/com/zd/model/enums/HardwareTypeEnum.java
  72. 4 2
      zd-model/src/main/java/com/zd/model/page/PageDomain.java
  73. 30 0
      zd-model/src/main/java/com/zd/model/page/PageQuery.java
  74. 1 0
      zd-model/src/main/resources/application.yml
  75. 1 0
      zd-modules/pom.xml
  76. 10 0
      zd-modules/zd-airbottle/pom.xml
  77. 16 0
      zd-modules/zd-algorithm/pom.xml
  78. 106 20
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/controller/FaceApi.java
  79. 1 0
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/service/FaceService.java
  80. 56 4
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/controller/SignInCheckController.java
  81. 59 0
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/domain/AlgorithmResponseResult.java
  82. 239 305
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/serivce/CheckService.java
  83. 0 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/serivce/FireImageService.java
  84. 19 15
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/utils/HttpUtils.java
  85. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
  86. 6 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/onvif/impl/ONVIFServerIMpl.java
  87. 5 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/onvif/ONVIFController.java
  88. 50 45
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/monitor/HardwareDeviceMonitor.java
  89. 6 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/rfid/mapper/HardwareRfidMapper.java
  90. 9 4
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/rfid/service/impl/HardwareRfidServiceImpl.java
  91. 9 11
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/speaker/service/impl/SpeakerServiceImpl.java
  92. 13 0
      zd-modules/zd-algorithm/src/main/resources/mapper/rfid/HardwareRfidMapper.xml
  93. 16 0
      zd-modules/zd-base/pom.xml
  94. 34 0
      zd-modules/zd-base/src/main/java/com/zd/base/app/HexStrUtils.java
  95. 580 0
      zd-modules/zd-base/src/main/java/com/zd/base/app/controller/LabBoardApi.java
  96. 26 0
      zd-modules/zd-base/src/main/java/com/zd/base/app/domain/board/DutyPersonVo.java
  97. 213 0
      zd-modules/zd-base/src/main/java/com/zd/base/app/domain/board/LabXxpSubjectVo.java
  98. 16 0
      zd-modules/zd-base/src/main/java/com/zd/base/job/task/LabTask.java
  99. 2 0
      zd-modules/zd-bottle-parent/pom.xml
  100. 0 0
      zd-modules/zd-bottle-parent/zd-bottle/pom.xml

File diff suppressed because it is too large
+ 1 - 1
ArcFace64.dat


+ 5 - 0
pom.xml

@@ -308,6 +308,11 @@
                 <artifactId>zd-airbottle-api</artifactId>
                 <version>${zd.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.zd.security</groupId>
+                <artifactId>zd-security-api</artifactId>
+                <version>${zd.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 22 - 0
release/2023-03-10 发版说明.md

@@ -0,0 +1,22 @@
+## 版本发布实现功能
+
+基于 中国矿业大学环测学院 和 苏州大学的的服务更新及bug修改。
+
+### 优化及bug修复处理
+1, 化学品一体机更新升级:
+- 化学品入库、领用、归还处,称重录制视频提交报“视频录制出错,请返回重新操作”错解决处理;
+- 录制视频操作过快(6s内),应用程序卡顿、卡死处理;
+- 录制视频取消再进入,程序卡死无响应问题处理;
+
+2,RFID门禁添加和编辑页,添加端口号需求开发实现及优化;
+
+3,智能柜锁开锁失败,采集器更换开发对接实现;
+
+4,安全准入模块新楼层楼栋关联处理;
+
+5,小程序楼层楼栋问题处理;
+
+6,违规记录修复、一体机展示头像回显;
+
+7,钉钉告警更新,智能柜锁添加告警实现;
+

+ 35 - 0
release/2023-03-31 发版说明.md

@@ -0,0 +1,35 @@
+### 版本说明
+
+本版本为正常开发,服务更新迭代。
+
+### 版本周期
+
+2023-03-06 至 2023-03-31
+
+### 数据库脚本
+更新脚本: **[db_sql_v2.3](sql/db_sql_v2.3.sql)**
+
+### 需求/功能及优化内容
+1, 算法服务调用日志完善及代码优化;
+
+2,Apk管理维护功能优化
+
+3,预案录制视频流隐患代码优化;
+
+4,新增定时排风、预案实现更新
+1) 设置预案,新增电话/短信配置,预案自动关闭时长配置;
+2) 预警灯、喇叭等归类执行动作;
+3) 预案报警通知方式、自动关闭时间设置。执行动作喇叭硬件执行配置。(参考下方nacos配置)
+![img.png](img/v3.3.1_20230320.png)
+
+lab nacos配置更新:
+LOUDSPEAKER:
+- code: 0
+  describe: 开关状态:关闭
+  defaultStatus: true
+  commTypeEnums: Relay
+  cmd: "00"
+- code: 1
+  describe: 开关状态:打开
+  commTypeEnums: Relay
+  cmd: "01"

+ 15 - 0
release/2023-04-18 发版说明.md

@@ -0,0 +1,15 @@
+### 版本说明
+
+本版本为矿大全版本发布,服务更新迭代。
+
+### 版本周期
+
+2023-04-01 至 2023-04-18
+
+### 数据库脚本
+更新脚本: **[db_sql_v2.4](sql/db_sql_v2.4.sql)**
+
+### 需求/功能及优化内容
+1, 矿大优化版本;
+
+2,电子信息牌新需求开发

BIN
release/img/v3.3.1_20230320.png


+ 1 - 1
release/remark.md

@@ -15,7 +15,7 @@
 
 ## 版本发布说明
 描述本版本发布的新增产品需求、技术优化实现、Bug修复等内容及描述。
-内容只是关联服务及Web端代码新增及0修改。 
+内容只是关联服务及Web端代码新增及修改。 
 每发布一个版本都需添加发布版本说明。 说明参考如下:
 - **[2022-12-20 发版说明](2022-12-20%20发版说明.md)** 
 - **[2023-01-09 发版说明](2023-01-09%20发版说明.md)** 

+ 1 - 31
release/sql/db_sql_v2.1-hotfix.sql

@@ -1,4 +1,3 @@
-
 /************************************************/
 /*     更新表: sys_user    ****/
 /*     字段: nick_name  ****/
@@ -7,39 +6,10 @@
 /************************************************/
 ALTER TABLE sys_user MODIFY COLUMN nick_name VARCHAR(100);
 
-
-
 /************************************************/
 /*     更新表: lab_check_record_details    ****/
 /*     字段: jcx_id  ****/
 /*     添加人:xxf                    ****/
 /*     添加时间:2023-2-28                 ****/
 /************************************************/
-alter table lab_check_record_details modify column jcx_id varchar(50) COMMENT '检查项id';
-
-/************************************************/
-/*     更新表: lab_algorithm    ****/
-/*     字段: original_img  ****/
-/*     添加人:xxf                    ****/
-/*     添加时间:2023-3-6                 ****/
-/************************************************/
-ALTER TABLE lab_algorithm ADD original_img varchar(255) DEFAULT NULL COMMENT '原始图';
-
-/************************************************/
-/*     更新表: lab_algorithm    ****/
-/*     字段: original_img  ****/
-/*     添加人:xxf                    ****/
-/*     添加时间:2023-3-8                ****/
-/************************************************/
-ALTER TABLE lab_algorithm ADD resp_code bigint(20) DEFAULT NULL COMMENT '算法请求状态码';
-ALTER TABLE lab_algorithm ADD resp_data varchar(2000) DEFAULT NULL COMMENT '算法请求返回实体';
-ALTER TABLE lab_algorithm ADD update_time datetime DEFAULT NULL COMMENT '更新时间';
-
-/************************************************/
-/*     更新表: apk_upload    ****/
-/*     字段: file_data  ****/
-/*     添加人:xxf                    ****/
-/*     添加时间:2023-3-10                 ****/
-/************************************************/
-ALTER TABLE apk_upload ADD file_data varchar(255) DEFAULT NULL COMMENT '文件信息';
-ALTER TABLE apk_upload ADD apk_info varchar(800) DEFAULT NULL COMMENT '信息说明';
+alter table lab_check_record_details modify column jcx_id varchar(50) COMMENT '检查项id';

+ 40 - 0
release/sql/db_sql_v2.3.3.1.sql

@@ -0,0 +1,40 @@
+/************************************************/
+/*     定时排风表: lab_timed_exhaust    ****/
+/*     添加人:cyl                    ****/
+/*     添加时间:2023-4-6                 ****/
+/************************************************/
+CREATE TABLE `lab_timed_exhaust`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
+  `task_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务名称',
+  `exhaust_period` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '排风时段,json数据',
+  `execution_date_type` tinyint(1) NULL DEFAULT 0 COMMENT '执行日期类型,1是跳过节假日,0不跳过',
+  `execution_date` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行日期时间段,json数据',
+  `exhaust_type` tinyint(1) NULL DEFAULT 0 COMMENT '排风状态,1是启动,0是不启动',
+  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人(用于数据权限)',
+  `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 51 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时排风表' ROW_FORMAT = Dynamic;
+
+
+/************************************************/
+/*     定时排风关联实验室表: lab_timed_exhaust_joinsub    ****/
+/*     添加人:cyl                    ****/
+/*     添加时间:2023-4-6                 ****/
+/************************************************/
+CREATE TABLE `lab_timed_exhaust_joinsub`  (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
+  `timed_exhaust_id` bigint(20) NULL DEFAULT NULL COMMENT '定时排风主键',
+  `sub_id` bigint(20) NULL DEFAULT NULL COMMENT '实验室id',
+  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人(用于数据权限)',
+  `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 48 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时排风关联实验室表' ROW_FORMAT = Dynamic;
+

+ 62 - 0
release/sql/db_sql_v2.3.sql

@@ -0,0 +1,62 @@
+/************************************************/
+/*     更新表: lab_algorithm    ****/
+/*     字段: original_img  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-3-6                 ****/
+/************************************************/
+ALTER TABLE lab_algorithm ADD original_img varchar(100) DEFAULT NULL COMMENT '原始图';
+
+/************************************************/
+/*     更新表: lab_algorithm    ****/
+/*     字段: original_img  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-3-8                ****/
+/************************************************/
+ALTER TABLE lab_algorithm ADD resp_code bigint(20) DEFAULT NULL COMMENT '算法请求状态码';
+ALTER TABLE lab_algorithm ADD resp_data varchar(2000) DEFAULT NULL COMMENT '算法请求返回实体';
+ALTER TABLE lab_algorithm ADD update_time datetime DEFAULT NULL COMMENT '更新时间';
+
+/************************************************/
+/*     更新表: apk_upload    ****/
+/*     字段: file_data  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-3-10                 ****/
+/************************************************/
+ALTER TABLE apk_upload ADD file_data varchar(255) DEFAULT NULL COMMENT '文件信息';
+ALTER TABLE apk_upload ADD apk_info varchar(800) DEFAULT NULL COMMENT '信息说明';
+
+
+/************************************************/
+/*     更新表: sys_logo_config    ****/
+/*     字段: ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-3-27                 ****/
+/************************************************/
+alter table sys_logo_config ADD   return_time int(4) DEFAULT NULL COMMENT '返回时间';
+alter table sys_logo_config ADD   logout_time int(4) DEFAULT NULL COMMENT '注销时间';
+alter table sys_logo_config ADD   is_start int(1) DEFAULT NULL COMMENT '是否启用信息牌 0不启用 1启用';
+
+/************************************************/
+/*     更新表: lab_subject    ****/
+/*     字段:                  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-3-27                 ****/
+/************************************************/
+alter table lab_subject ADD   inspect_check_in VARCHAR(255) DEFAULT NULL COMMENT '巡查人员,穿戴检查项';
+alter table lab_subject ADD   inspect_skipped int(1) DEFAULT NULL COMMENT '巡查人员,穿戴检查可跳过(0 否,1 是)';
+alter table lab_subject ADD   inspect_check_count int(2)  DEFAULT NULL COMMENT '巡查人员,穿戴检查识别上限';
+alter table lab_subject ADD   inspect_sign_time int(4) DEFAULT NULL COMMENT '巡查人员,签到有效时间';
+alter table lab_subject ADD   details  text DEFAULT NULL COMMENT '实验室详情';
+alter table lab_subject ADD   hardware_type  int(2) DEFAULT NULL COMMENT '1海康 2电子信息牌 0无';
+
+/************************************************/
+/*     更新表: lab_risk_plan_level    ****/
+/*     字段:   ****/
+/*     添加人:hzw                   ****/
+/*     添加时间:2023-3-31                 ****/
+/************************************************/
+ALTER TABLE lab_risk_plan_level ADD alarm_type varchar(255) DEFAULT NULL COMMENT '报警类型(1电话 2短信)';
+ALTER TABLE lab_risk_plan_level ADD risk_auto_off int(11) DEFAULT NULL COMMENT '预案自动关闭时长(秒)';
+ALTER TABLE lab_risk_plan_level ADD alarm_type varchar(255) DEFAULT '1' COMMENT '报警类型(1电话 2短信)';
+ALTER TABLE lab_risk_plan_level ADD risk_auto_off int(11) DEFAULT '60' COMMENT '预案自动关闭时长(秒)';
+update lab_risk_plan_level set alarm_type = '1',risk_auto_off = '60';

+ 169 - 0
release/sql/db_sql_v2.4.sql

@@ -0,0 +1,169 @@
+/************************************************/
+/*     新增表: xxp_card_info    ****/
+/*     字段:                  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-4-18                 ****/
+/************************************************/
+CREATE TABLE `xxp_card_info` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
+  `card_name` varchar(50) DEFAULT NULL COMMENT '设备名称',
+  `card_num` varchar(50) DEFAULT NULL COMMENT '设备编号',
+  `college` varchar(50) DEFAULT NULL COMMENT '学院',
+  `college_id` bigint(20) DEFAULT NULL COMMENT '学院id',
+  `location` varchar(100) DEFAULT NULL COMMENT '位置',
+  `operate` int(2) DEFAULT NULL COMMENT '设备状态 1离线 2在线',
+  `auth_type` int(2) DEFAULT NULL COMMENT '授权方式(见字典)',
+  `auth_pwd` varchar(255) DEFAULT NULL COMMENT '授权密码',
+  `subject_id` bigint(20) DEFAULT NULL COMMENT '实验室id',
+  `subject_name` varchar(50) DEFAULT NULL COMMENT '实验室名称',
+  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门id',
+  `dept_name` varchar(50) DEFAULT NULL COMMENT '部门名称',
+  `is_start` int(2) DEFAULT NULL COMMENT '是否启用门锁 1启用 2禁用',
+  `user_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
+  `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
+  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
+  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='电子信息牌表';
+
+
+/************************************************/
+/*     新增表: xxp_classify    ****/
+/*     字段:                  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-4-18                 ****/
+/************************************************/
+CREATE TABLE `xxp_classify` (
+    `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `classify_name` varchar(50) DEFAULT NULL COMMENT '类目名称',
+    `classify_type` int(2) DEFAULT NULL COMMENT '1文字 2图片',
+    `sort` int(3) DEFAULT NULL COMMENT '排序',
+    `is_special` int(2) DEFAULT NULL COMMENT '是否特殊类目 1否 2 是',
+    `is_show` int(2) DEFAULT '2' COMMENT '是否展示 1展示 2不展示',
+    `show_colour` varchar(50) DEFAULT NULL COMMENT '展示颜色',
+    `user_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
+    `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
+    `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+    `update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
+    `update_time` datetime DEFAULT NULL COMMENT '修改时间',
+    PRIMARY KEY (`id`),
+    UNIQUE KEY `index_id` (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='安全信息类目表';
+
+
+/************************************************/
+/*     新增表: xxp_classify_detail    ****/
+/*     字段:                  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-4-18                 ****/
+/************************************************/
+CREATE TABLE `xxp_classify_detail` (
+   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
+   `info_classify_id` bigint(20) NOT NULL COMMENT '类目表主键',
+   `info_name` varchar(50) DEFAULT NULL COMMENT '信息名称 ',
+   `info_type` int(2) DEFAULT NULL COMMENT '类型 1文字 2图片',
+   `info_content` varchar(255) DEFAULT NULL COMMENT '内容',
+   `is_collective` int(2) DEFAULT '1' COMMENT '是否共有 1非公共 2公共',
+   `sort` int(3) DEFAULT NULL COMMENT '排序',
+   `user_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
+   `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
+   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+   `update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
+   `update_time` datetime DEFAULT NULL COMMENT '修改时间',
+   PRIMARY KEY (`id`),
+   UNIQUE KEY `index_id` (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='安全信息类目详情表';
+
+
+/************************************************/
+/*     新增表: xxp_classify_subject    ****/
+/*     字段:                  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-4-18                 ****/
+/************************************************/
+CREATE TABLE `xxp_classify_subject` (
+    `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '表的主键',
+    `subject_id` bigint(20) DEFAULT NULL COMMENT '实验室id',
+    `classify_id` bigint(20) DEFAULT NULL COMMENT '类目id',
+    `classify_detail_id` bigint(20) DEFAULT NULL COMMENT '详情id',
+    PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='实验室安全类目关系表';
+
+
+/************************************************/
+/*     新增表: xxp_duty    ****/
+/*     字段:                  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-4-18                 ****/
+/************************************************/
+CREATE TABLE `xxp_duty` (
+    `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '人员id',
+    `user_id` bigint(20) DEFAULT NULL,
+    `user_name` varchar(50) DEFAULT NULL COMMENT '人员姓名',
+    `user_phone` varchar(20) DEFAULT NULL COMMENT '人员电话',
+    `user_img` varchar(100) DEFAULT NULL COMMENT '头像',
+    `user_type` varchar(10) DEFAULT NULL COMMENT '人员类型 11老师 22学生',
+    `subject_id` bigint(20) DEFAULT NULL COMMENT '实验室id',
+    `subject_name` varchar(100) DEFAULT NULL,
+    `dept_id` bigint(20) DEFAULT NULL COMMENT '部门id',
+    `dept_name` varchar(50) DEFAULT NULL COMMENT '部门名称',
+    `college` varchar(50) DEFAULT NULL COMMENT '学院',
+    `duty_time` date DEFAULT NULL COMMENT '值班时间',
+    `create_by_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
+    `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
+    `create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
+    PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='值班表';
+
+
+
+/************************************************/
+/*     新增表: xxp_inspection    ****/
+/*     字段:                  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-4-18                 ****/
+/************************************************/
+CREATE TABLE `xxp_inspection` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `user_id` bigint(20) DEFAULT NULL COMMENT '人员id',
+  `user_name` varchar(50) DEFAULT NULL COMMENT '人员姓名',
+  `user_img` varchar(255) DEFAULT NULL COMMENT '头像',
+  `subject_id` bigint(20) DEFAULT NULL COMMENT '实验室id',
+  `subject_name` varchar(50) DEFAULT NULL COMMENT '实验室名称',
+  `sign_in` datetime DEFAULT NULL COMMENT '签到时间',
+  `sign_out` datetime DEFAULT NULL COMMENT '签退时间',
+  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门id',
+  `dept_name` varchar(50) DEFAULT NULL COMMENT '部门名称',
+  `residence_time` varchar(30) DEFAULT NULL COMMENT '停留时间',
+  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='巡查表';
+
+
+/************************************************/
+/*     新增表: xxp_user_auth    ****/
+/*     字段:                  ****/
+/*     添加人:xxf                    ****/
+/*     添加时间:2023-4-18                 ****/
+/************************************************/
+CREATE TABLE `xxp_user_auth` (
+     `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
+     `user_id` bigint(20) DEFAULT NULL COMMENT '人员id',
+     `user_name` varchar(50) DEFAULT NULL COMMENT '人员姓名',
+     `auth_type` varchar(50) DEFAULT NULL COMMENT '授权方式',
+     `user_type` varchar(10) DEFAULT NULL COMMENT '人员类型 11老师 22学生',
+     `subject_id` bigint(20) DEFAULT NULL COMMENT '实验室id',
+     `subject_name` varchar(60) DEFAULT NULL COMMENT '实验室名称',
+     `hardware_id` bigint(20) DEFAULT NULL COMMENT '硬件id',
+     `dept_id` bigint(20) DEFAULT NULL COMMENT '部门id',
+     `dept_name` varchar(50) DEFAULT NULL COMMENT '部门名称',
+     `finger` text COMMENT '指纹',
+     `user_password` varchar(255) DEFAULT NULL COMMENT '用户密码',
+     `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
+     `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+     `update_by` varchar(50) DEFAULT NULL COMMENT '修改人',
+     `update_time` datetime DEFAULT NULL COMMENT '修改时间',
+     `finger_key` varchar(50) DEFAULT NULL COMMENT '指纹位置',
+     PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='信息牌人员权限表';

+ 1 - 0
zd-api/pom.xml

@@ -20,6 +20,7 @@
         <module>zd-algorithm-api</module>
         <module>zd-airbottle-api</module>
         <module>zd-auth-api</module>
+        <module>zd-security-api</module>
     </modules>
 
     <dependencies>

+ 11 - 1
zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/FaceCompare.java

@@ -8,11 +8,13 @@ import io.swagger.annotations.ApiModelProperty;
  * @Date: 2021/10/12/17:54
  * @Description:
  */
-@ApiModel("人脸对比提交参数")
+@ApiModel("提交参数")
 public class FaceCompare {
     @ApiModelProperty("userId")
     private Long userId;
 
+    @ApiModelProperty("实验室ID")
+    private Long labId;
 
     @ApiModelProperty("特征码")
     private byte[] data;
@@ -33,4 +35,12 @@ public class FaceCompare {
     public void setData(byte[] data) {
         this.data = data;
     }
+
+    public Long getLabId() {
+        return labId;
+    }
+
+    public void setLabId(Long labId) {
+        this.labId = labId;
+    }
 }

+ 10 - 0
zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/RemoteFaceService.java

@@ -3,10 +3,12 @@ package com.zd.algorithm.api.face.feign;
 import com.zd.algorithm.api.face.feign.fallback.RemoteFaceFallbackFactory;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestPart;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -33,4 +35,12 @@ public interface RemoteFaceService {
      */
     @PostMapping(value = "/faceApi/compare")
     public R compare(@RequestBody FaceCompare faceCompare);
+
+    /**
+     * 多人人脸对比
+     * @param faceCompare
+     * @return
+     */
+    @PostMapping("/faceApi/multiCompare")
+    public ResultData multiFaceDetection(@RequestBody FaceCompare faceCompare);
 }

+ 6 - 0
zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/fallback/RemoteFaceFallbackFactory.java

@@ -3,6 +3,7 @@ package com.zd.algorithm.api.face.feign.fallback;
 import com.zd.algorithm.api.face.feign.FaceCompare;
 import com.zd.algorithm.api.face.feign.RemoteFaceService;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
@@ -38,6 +39,11 @@ public class RemoteFaceFallbackFactory implements FallbackFactory<RemoteFaceServ
             public R compare(FaceCompare faceCompare) {
                 return R.fail("人脸对比服务调用失败:" + throwable.getMessage());
             }
+
+            @Override
+            public ResultData multiFaceDetection(FaceCompare faceCompare) {
+                return ResultData.fail("多人脸对比服务调用失败:" + throwable.getMessage());
+            }
         };
     }
 }

+ 8 - 11
zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/speaker/entity/PlayBatchVo.java

@@ -1,9 +1,6 @@
 package com.zd.algorithm.api.speaker.entity;
 
 import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * @author 董高升
@@ -11,27 +8,27 @@ import org.slf4j.LoggerFactory;
  */
 public class PlayBatchVo {
     @ApiModelProperty(required = true, notes = "设备编号")
-    private String[] sns;
+    private String[] sn;
     @ApiModelProperty(required = true, notes = "方便对接时传递任务类型")
-    private String[] type;
+    private String type;
     @ApiModelProperty(required = true, notes = "任务名称")
     private String name;
     @ApiModelProperty(required = true, notes = "播放参数")
     private ParamVo params;
 
-    public String[] getSns() {
-        return sns;
+    public String[] getSn() {
+        return sn;
     }
 
-    public void setSns(String[] sns) {
-        this.sns = sns;
+    public void setSn(String[] sn) {
+        this.sn = sn;
     }
 
-    public String[] getType() {
+    public String getType() {
         return type;
     }
 
-    public void setType(String[] type) {
+    public void setType(String type) {
         this.type = type;
     }
 

+ 24 - 0
zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/xxp/feign/RemoteXxpService.java

@@ -0,0 +1,24 @@
+package com.zd.algorithm.api.xxp.feign;
+
+import com.zd.algorithm.api.alarm.feign.fallback.RemoteAlarmFallbackFactory;
+import com.zd.algorithm.api.xxp.feign.fallback.RemoteXxpFallBack;
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.domain.ResultData;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(contextId = "remoteXxpService", value = ApplicationConstants.ALGORITHM_SERVICE, fallbackFactory = RemoteXxpFallBack.class)
+public interface RemoteXxpService {
+    /**
+     * 通过实验室id获取信息类目列表
+     * @param deviceIds
+     * @param dpi
+     * @param page
+     * @param count
+     * @return
+     */
+    @GetMapping("/api/play/startList")
+    ResultData selectSubjectCameraList(@RequestParam("deviceIds") String deviceIds, @RequestParam("dpi") Integer dpi, @RequestParam("page") int page, @RequestParam("count") int count);
+
+}

+ 25 - 0
zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/xxp/feign/fallback/RemoteXxpFallBack.java

@@ -0,0 +1,25 @@
+package com.zd.algorithm.api.xxp.feign.fallback;
+
+import com.zd.algorithm.api.xxp.feign.RemoteXxpService;
+import com.zd.model.domain.ResultData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RemoteXxpFallBack implements FallbackFactory<RemoteXxpService> {
+
+    private static final Logger log = LoggerFactory.getLogger(RemoteXxpFallBack.class);
+
+    @Override
+    public RemoteXxpService create(Throwable cause) {
+        return new RemoteXxpService(){
+            @Override
+            public ResultData selectSubjectCameraList(String deviceIds, Integer dpi, int page, int count) {
+                log.error("获取实验室摄像头编号信息失败:{}", cause.getMessage());
+                return ResultData.fail("获取实验室摄像头编号信息失败:" + cause.getMessage());
+            }
+        };
+    }
+}

+ 2 - 1
zd-api/zd-algorithm-api/src/main/resources/META-INF/spring.factories

@@ -6,5 +6,6 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
   com.zd.algorithm.api.rfid.feign.fallback.RemoteRfidFallbackFactory,\
   com.zd.algorithm.api.smartlock.feign.fallback.RemoteSmartlockFallbackFactory,\
   com.zd.algorithm.api.speaker.feign.fallback.RemoteSpeakFallbackFactory,\
-  com.zd.algorithm.api.fire.feign.fallback.RemoteFireDeviceFallbackFactory
+  com.zd.algorithm.api.fire.feign.fallback.RemoteFireDeviceFallbackFactory,\
+  com.zd.algorithm.api.xxp.feign.fallback.RemoteXxpFallBack
 

+ 61 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java

@@ -2,6 +2,7 @@ package com.zd.laboratory.api.entity;
 
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import com.zd.laboratory.api.vo.ClassifyVO;
 import com.zd.laboratory.api.vo.HardwareCVO;
 import com.zd.laboratory.api.vo.LabRiskVO;
 import com.zd.laboratory.api.vo.SenseValVO;
@@ -64,6 +65,26 @@ public class LabSubjectControllerVO extends LabSubjectEntity {
     @ApiModelProperty("预案数据")
     private List<LabRiskVO> riskPlanList;
 
+    private List<ClassifyVO>  classifyList;
+
+    @ApiModelProperty("实验室详情")
+    private String details;
+
+    /***
+     * 关联的硬件 1海康 2电子信息牌
+     */
+    private Integer hardwareType;
+
+    /***
+     * 是否配置海康门禁
+     */
+    private Integer hKCount;
+
+    /***
+     * 是否配置电子信息牌
+     */
+    private Integer cardInfoCount;
+
     /**
      * 实验室类型ID
      */
@@ -418,4 +439,44 @@ public class LabSubjectControllerVO extends LabSubjectEntity {
     public void setRiskPlanList(List<LabRiskVO> riskPlanList) {
         this.riskPlanList = riskPlanList;
     }
+
+    public List<ClassifyVO> getClassifyList() {
+        return classifyList;
+    }
+
+    public void setClassifyList(List<ClassifyVO> classifyList) {
+        this.classifyList = classifyList;
+    }
+
+    public String getDetails() {
+        return details;
+    }
+
+    public void setDetails(String details) {
+        this.details = details;
+    }
+
+    public Integer getHardwareType() {
+        return hardwareType;
+    }
+
+    public void setHardwareType(Integer hardwareType) {
+        this.hardwareType = hardwareType;
+    }
+
+    public Integer gethKCount() {
+        return hKCount;
+    }
+
+    public void sethKCount(Integer hKCount) {
+        this.hKCount = hKCount;
+    }
+
+    public Integer getCardInfoCount() {
+        return cardInfoCount;
+    }
+
+    public void setCardInfoCount(Integer cardInfoCount) {
+        this.cardInfoCount = cardInfoCount;
+    }
 }

+ 122 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSysUserInfo.java

@@ -0,0 +1,122 @@
+package com.zd.laboratory.api.entity;
+
+import com.zd.model.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+
+/**
+ * 学生信息对象 lab_students_info
+ *
+ * @author zhoupan
+ * @date 2021-09-10
+ */
+@ApiModel("用户信息")
+public class LabSysUserInfo {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 学生ID(userId)
+     */
+    @Excel(name = "学生ID", readConverterExp = "u=serId")
+    @ApiModelProperty(value = "学生ID")
+    private Long userId;
+
+    /**
+     * 人脸特征
+     */
+    @ApiModelProperty(value = "人脸特征")
+    private byte[]  faceFeature;
+
+    /**
+     * 用户名称
+     */
+    @ApiModelProperty(value = "用户名称")
+    private String userName;
+
+    /**
+     * 用户类型
+     */
+    @ApiModelProperty(value = "用户类型")
+    private String userType;
+
+    /**
+     * 是否白名单
+     */
+    @ApiModelProperty(value = "是否白名单")
+    private Integer isWhite;
+
+
+    /**
+     * 是否值班人员
+     */
+    @ApiModelProperty(value = "是否值班人员")
+    private Integer isDutyUser;
+
+
+    /**
+     * 页面类型
+     */
+    @ApiModelProperty(value = "页面类型")
+    private Integer pageType;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public byte[] getFaceFeature() {
+        return faceFeature;
+    }
+
+    public void setFaceFeature(byte[] faceFeature) {
+        this.faceFeature = faceFeature;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    public Integer getIsWhite() {
+        return isWhite;
+    }
+
+    public void setIsWhite(Integer isWhite) {
+        this.isWhite = isWhite;
+    }
+
+    public Integer getPageType() {
+        return pageType;
+    }
+
+    public void setPageType(Integer pageType) {
+        this.pageType = pageType;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Integer getIsDutyUser() {
+        return isDutyUser;
+    }
+
+    public void setIsDutyUser(Integer isDutyUser) {
+        this.isDutyUser = isDutyUser;
+    }
+}

+ 238 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteDutyService.java

@@ -0,0 +1,238 @@
+package com.zd.laboratory.api.feign;
+
+import com.zd.laboratory.api.feign.fallback.RemoteDutyFailback;
+import com.zd.laboratory.api.vo.XxpInspectionVo;
+import com.zd.laboratory.api.vo.XxpUserAuthVo;
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.model.domain.ResultData;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 远程调用值班排班数据
+ * @author  donggaosheng
+ * @time 2023/03/24
+ */
+@FeignClient(contextId = "remoteDutyService", value = ApplicationConstants.LABORATORY_SERVICE, fallbackFactory = RemoteDutyFailback.class)
+public interface RemoteDutyService {
+    /**
+     * 通过实验室id当前时间查询值班人员
+     *
+     * @param labId
+     * @param dateTime
+     * @return
+     */
+    @GetMapping("/XxpDuty/api/selectDutyUser")
+    ResultData<List<Map<String, Object>>> selectDutyUser(@RequestParam("labId") Long labId, @RequestParam("dateTime") String dateTime);
+
+    /**
+     * 通过实验室id查询实验室信息
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/subject/getXxpSubjectInfo/{id}")
+    ResultData getXxpSubjectInfo(@PathVariable("id") Long id);
+
+    /***
+     * 通过实验室id获取信息类目列表
+     * @param id
+     * @return
+     */
+    @GetMapping("/XxpClassifyDet/classifyDetail/{id}")
+    ResultData classifyDetailSubjectById(@PathVariable("id") Long id);
+
+    /***
+     * 根据实验室id查询摄像头编号
+     * @param subId
+     * @return
+     */
+    @GetMapping("/hardware/getCameraBySubjectId")
+    ResultData getCameraBySubjectId(@RequestParam("subId") Long subId);
+
+    /**
+     * 根据实验室id获取实验室详情
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/subject/getSubjectDetails/{id}")
+    ResultData getSubjectDetails(@PathVariable("id") Long id);
+
+    /**
+     * 根据实验室id获取安全准入人员列表
+     *
+     * @param pageNumber
+     * @param pageSize
+     * @param subjectId
+     * @return
+     */
+    @GetMapping("/apply/app/securityApplyList")
+    ResultData securityApplyList(@RequestParam("subjectId") Long subjectId, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("pageSize") Integer pageSize);
+
+    /**
+     * 根据实验室获取签到未签退人员
+     *
+     * @param subjectId
+     * @return
+     */
+    @RequestMapping("/record/selectSubjectSignList")
+    ResultData selectSubjectSignList(@RequestParam("subjectId") Long subjectId);
+
+    /**
+     * 获取实验室所有值班人员的信息
+     *
+     * @param labId
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    @RequestMapping("/XxpDuty/api/selectDutyUserList")
+    ResultData<List<Map<String, Object>>> selectDutyUserList(@RequestParam("labId") Long labId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);
+
+    /**
+     * 根据实验室id和当前时间查询签到记录
+     *
+     * @param labId
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    @PostMapping("/XxpInspection/app/selectUserXxpInspectionList")
+    ResultData selectUserXxpInspectionList(@RequestParam("labId") Long labId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);
+
+    /**
+     * 根据一体机编号查询实验室编号
+     *
+     * @param num
+     * @return
+     */
+    @RequestMapping("/onemachine/getSubjectIdByNum/{num}")
+    ResultData querySubInfoByNumber(@PathVariable("num") String num);
+
+
+    /**
+     * 获取信息牌首页实验室的信息
+     */
+    @RequestMapping(value = "/subject/getSubjectName/{id}")
+    ResultData getSubjectName(@PathVariable("id") Long id);
+
+
+    /**
+     * 根据一体机编号查询实验室编号
+     *
+     * @param num
+     * @return
+     */
+    @RequestMapping("/XxpCardInfo/XxpCardInfoByCard/{num}")
+    ResultData XxpCardInfoByCard(@PathVariable("num") String num);
+
+
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     *
+     * @param labId
+     * @return
+     */
+    @RequestMapping("/apply/app/securityFingerList")
+    ResultData securityFingerList(@RequestParam("labId") Long labId);
+
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     *
+     * @param labId
+     * @return
+     */
+    @RequestMapping("/apply/app/securityNumList")
+    ResultData securityNumList(@RequestParam("labId") Long labId, @RequestParam("cardNum") String cardNum);
+
+
+    /**
+     * 指纹录入
+     * num 一体机编号
+     *
+     * @param xxpUserAuthVo
+     * @return
+     */
+    @RequestMapping("/XxpUserAuth/addUserAuth")
+    ResultData addUserAuth(@RequestBody XxpUserAuthVo xxpUserAuthVo);
+
+
+    /**
+     * 根据用户id查询指纹信息
+     *
+     * @param userId
+     * @return
+     */
+    @RequestMapping("/XxpUserAuth/getFingerByUserId")
+    ResultData getFingerByUserId(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId);
+
+    /**
+     * 根据用户id查询指纹信息
+     *
+     * @param id
+     * @return
+     */
+    @RequestMapping("/XxpUserAuth/deleteFingerById")
+    ResultData deleteFingerById(@RequestParam("id") Long id);
+
+
+    /**
+     * 验证密码是否正确
+     *
+     * @param num   电子班牌号码
+     * @param pwd       用户密码
+     * @param labId 实验室id
+     * @param userId    用户id
+     * @return
+     */
+    @RequestMapping("/XxpCardInfo/pwdValidate")
+    ResultData pwdValidate(@RequestParam("num") String num, @RequestParam("pwd") String pwd, @RequestParam("labId") Long labId, @RequestParam("userId") Long userId);
+
+    /**
+     * 判断是不是实验室管理员或者安全责任人
+     *
+     * @param labId
+     * @param userId
+     * @return
+     */
+    @GetMapping(value = "/subject/isAdminOrSafeUser/{labId}/{userId}")
+    ResultData isAdminOrSafeUser(@PathVariable("labId") Long labId, @PathVariable("userId") Long userId);
+
+    /**
+     * 添加巡查记录
+     * @param xxpInspectionVo
+     * @return
+     */
+    @PostMapping(value = "/XxpInspection/addInspection")
+    ResultData addInspection(@RequestBody XxpInspectionVo xxpInspectionVo);
+
+    /**
+     * 签退
+     * @param labId
+     * @param userId
+     * @return
+     */
+    @PostMapping("/XxpInspection/updateInspection")
+    ResultData updateInspection(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId);
+
+
+    @PostMapping("/XxpInspection/isSignInType")
+    ResultData isSignInType(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId);
+
+
+    /**
+     * Ai检测判断是否已签到
+     * @param labId
+     * @param userId
+     * @return
+     */
+    @PostMapping("/XxpInspection/isSignInspection")
+    ResultData isSignInspection(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId);
+
+
+}

+ 20 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteLaboratoryService.java

@@ -446,6 +446,18 @@ public interface RemoteLaboratoryService {
     public void checkSendMsgBeOverdue();
 
     /**
+     * 定时器定时每天 00:00 开始执行,把一天的排风任务全部存入redis里面去
+     */
+    @GetMapping("/timed/exhaust/automaticExhaust")
+    public AjaxResult timedExhaustTask();
+
+    /**
+     * 定时器定时每天 00:30 开始执行,定时清理90天以前的所有控制记录数据
+     */
+    @GetMapping("/control/timingClearMsg")
+    public AjaxResult timingClearMsg();
+
+    /**
      * 一体机logo修改通知
      */
     @ApiOperation(value = "一体机logo修改通知")
@@ -487,4 +499,12 @@ public interface RemoteLaboratoryService {
     @ApiOperation(value = "根据实验室id查询实验室位置信息")
     @PostMapping("/buildFloorLayout/getPositionBySubId")
     ResultData getPositionBySubId(@RequestParam("subIds") String subIds);
+
+    @ApiOperation(value = "根据用户id查询用户关联的白名单实验室")
+    @GetMapping("/whitelist/subWhiteList")
+    ResultData getWhiteSubList(@RequestParam("userId") Long userId);
+
+    @ApiOperation(value = "根据用户id查询用户关联的未过期的安全准入实验室")
+    @GetMapping("/apply/getApplySubList")
+    ResultData getApplySubList(@RequestParam("userId") Long userId);
 }

+ 13 - 6
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteStudentsService.java

@@ -1,17 +1,18 @@
 package com.zd.laboratory.api.feign;
 
 import com.zd.laboratory.api.entity.LabStudentsInfo;
+import com.zd.laboratory.api.entity.LabSysUserInfo;
 import com.zd.laboratory.api.feign.fallback.RemoteStudentsFallbackFactory;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.util.List;
+
 /**
  * 文件服务
  *
@@ -25,7 +26,7 @@ public interface RemoteStudentsService {
      * @return 结果
      */
     @GetMapping(value = "/studentinfo/{joinStudentsId}")
-    public R<LabStudentsInfo> getInfo(@PathVariable("joinStudentsId") Long id);
+    R<LabStudentsInfo> getInfo(@PathVariable("joinStudentsId") Long id);
 
     /**
      * 提交学生卡
@@ -33,5 +34,11 @@ public interface RemoteStudentsService {
      * @return
      */
     @PostMapping (value = "/studentinfo/commit/crad",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public R commitCard(@RequestPart("file") MultipartFile file);
+    R commitCard(@RequestPart("file") MultipartFile file);
+
+    @GetMapping(value = "/studentinfo/getFaceBySecuritySubjectId")
+    ResultData<List<LabSysUserInfo>> getFaceBySecuritySubjectId(@RequestParam("subjectId") Long subjectId);
+
+    @GetMapping("/user/getUserInfoByUserId")
+    public ResultData getUserInfoByUserId(@RequestParam("userId") Long userId);
 }

+ 146 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteDutyFailback.java

@@ -0,0 +1,146 @@
+package com.zd.laboratory.api.feign.fallback;
+
+import com.zd.laboratory.api.feign.RemoteDutyService;
+import com.zd.laboratory.api.vo.XxpInspectionVo;
+import com.zd.laboratory.api.vo.XxpUserAuthVo;
+import com.zd.model.domain.ResultData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 远程调用值班排班数据
+ * @author  donggaosheng
+ * @time 2023/03/24
+ */
+@Component
+public class RemoteDutyFailback implements FallbackFactory<RemoteDutyService> {
+
+    private static final Logger log = LoggerFactory.getLogger(RemoteDutyFailback.class);
+
+    @Override
+    public RemoteDutyService create(Throwable cause) {
+        log.error("用户服务调用失败:{}", cause.getMessage());
+        return new RemoteDutyService(){
+
+            @Override
+            public ResultData<List<Map<String, Object>>> selectDutyUser(Long labId, String dateTime) {
+                return ResultData.fail("获取值班人员列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData getXxpSubjectInfo(Long id) {
+                return ResultData.fail("获取信息牌首页实验室信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData classifyDetailSubjectById(Long id) {
+                return ResultData.fail("获取信息牌类目列表失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData getCameraBySubjectId(Long subId) {
+                return ResultData.fail("获取实验室摄像头编号信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData getSubjectDetails(Long id) {
+                return ResultData.fail("获取实验室详情信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData securityApplyList(Long subjectId,Integer pageNumber, Integer pageSize) {
+                return ResultData.fail("获取安全准入人员列表信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData selectSubjectSignList(Long subjectId) {
+                return ResultData.fail("获取签到人员列表信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData<List<Map<String, Object>>> selectDutyUserList(Long labId, String startTime, String endTime) {
+                return ResultData.fail("获取值班人员列表信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData selectUserXxpInspectionList(Long labId, String startTime, String endTime) {
+                return ResultData.fail("获取巡查记录列表信息失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData querySubInfoByNumber(String num) {
+                return ResultData.fail("根据一体机编号获取实验室失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData getSubjectName(Long id) {
+                return ResultData.fail("获取实验室名称失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData XxpCardInfoByCard(String num) {
+                return ResultData.fail("根据电子信息牌编号获取实验室失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData securityFingerList(Long labId) {
+                return ResultData.fail("电子信息牌获取准入人员的指纹信息列表:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData securityNumList(Long labId,String cardNum) {
+                return ResultData.fail("电子信息牌获取准入人员的指纹信息列表:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData addUserAuth(XxpUserAuthVo xxpUserAuthVo) {
+                return ResultData.fail("指纹录入失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData getFingerByUserId(Long labId,Long userId) {
+                return ResultData.fail("根据用户获取指纹列表失败:" + cause.getMessage());
+             }
+
+            @Override
+            public ResultData deleteFingerById(Long id) {
+                return ResultData.fail("删除指纹失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData pwdValidate(String num, String pwd, Long labId, Long userId) {
+                return ResultData.fail("密码对比失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData isAdminOrSafeUser(Long labId, Long userId) {
+                return ResultData.fail("判断是否是实验室安全责任人实验室负责人:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData addInspection(XxpInspectionVo xxpInspectionVo) {
+                return ResultData.fail("添加巡查记录失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData updateInspection(Long labId, Long userId) {
+                return ResultData.fail("修改巡查记录失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData isSignInType(Long labId, Long userId) {
+                return ResultData.fail("获取签到方式失败:" + cause.getMessage());
+            }
+
+            @Override
+            public ResultData isSignInspection(Long labId, Long userId) {
+                return ResultData.fail("Ai检测判断是否已签到:" + cause.getMessage());
+            }
+        };
+    }
+}

+ 23 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteLaboratoryFallbackFactory.java

@@ -408,6 +408,19 @@ public class RemoteLaboratoryFallbackFactory implements FallbackFactory<RemoteLa
                 throw new RuntimeException("安全检查隐患项未整改逾期通知" + cause.getMessage());
             }
 
+            /**
+             * 定时器定时每天 00:00 开始执行,把一天的排风任务全部存入redis里面去
+             */
+            @Override
+            public AjaxResult timedExhaustTask() {
+                throw new RuntimeException("定时排风执行失败:" + cause.getMessage());
+            }
+
+            @Override
+            public AjaxResult timingClearMsg() {
+                throw new RuntimeException("定时清理消息失败:" + cause.getMessage());
+            }
+
             @Override
             public void logoNotice() {
                 throw new RuntimeException("logo通知失败" + cause.getMessage());
@@ -447,6 +460,16 @@ public class RemoteLaboratoryFallbackFactory implements FallbackFactory<RemoteLa
             public ResultData getPositionBySubId(String subIds) {
                 return ResultData.fail("查询实验室位置信息失败!"+ cause.getMessage());
             }
+
+            @Override
+            public ResultData getWhiteSubList(Long userId) {
+                return ResultData.fail("根据用户id查询用户关联的白名单实验室失败!"+ cause.getMessage());
+            }
+
+            @Override
+            public ResultData getApplySubList(Long userId) {
+                return ResultData.fail("根据用户id查询用户关联的安全准入实验室失败!"+ cause.getMessage());
+            }
         };
     }
 }

+ 13 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteStudentsFallbackFactory.java

@@ -3,6 +3,7 @@ package com.zd.laboratory.api.feign.fallback;
 import com.zd.laboratory.api.entity.LabStudentsInfo;
 import com.zd.laboratory.api.feign.RemoteStudentsService;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
@@ -10,6 +11,8 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.util.List;
+
 /**
  * 文件服务降级处理
  *
@@ -31,6 +34,16 @@ public class RemoteStudentsFallbackFactory implements FallbackFactory<RemoteStud
             public R commitCard(MultipartFile file) {
                 return R.fail("学生卡上传调用失败:" + throwable.getMessage());
             }
+
+            @Override
+            public ResultData getFaceBySecuritySubjectId(Long subjectId) {
+                return ResultData.fail("根据实验室获取用户人脸信息失败"+throwable.getMessage());
+            }
+
+            @Override
+            public ResultData getUserInfoByUserId(Long userId) {
+                return ResultData.fail("获取用户基本信息失败"+throwable.getMessage());
+            }
         };
     }
 }

+ 31 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/ClassifyDetailVO.java

@@ -0,0 +1,31 @@
+package com.zd.laboratory.api.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: xxf
+ * @Date: 2023/03/29/11:14
+ * @Description:
+ */
+@Data
+public class ClassifyDetailVO {
+
+    /** 主键 */
+    private Long id;
+
+    /** 类目表主键 */
+
+    private Long infoClassifyId;
+
+    /** 信息名称  */
+    private String infoName;
+
+
+    /** 类型 1文字 2图片*/
+    private Integer infoType;
+
+    /** 内容 */
+    private String infoContent;
+
+
+}

+ 28 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/ClassifyVO.java

@@ -0,0 +1,28 @@
+package com.zd.laboratory.api.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Author: xxf
+ * @Date: 2023/03/29/11:06
+ * @Description:
+ */
+@Data
+public class ClassifyVO {
+
+    /** 主键 */
+    private Long id;
+
+    /** 类目名称 */
+    private String classifyName;
+
+    /** 类目类型 1文字 2图片 */
+    private Integer classifyType;
+
+    /**公共类目**/
+    private List<ClassifyDetailVO> publicList;
+    /***私有类目**/
+    private List<ClassifyDetailVO> privateList;
+}

+ 11 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/HardwareCVO.java

@@ -40,6 +40,9 @@ public class HardwareCVO extends BaseHardware {
 
     @ApiModelProperty(value = "是否灭火主机")
     private Integer isPcfire;
+
+    @ApiModelProperty(value = "控制记录的id,参考字典表")
+    private Integer triggerModes;
     /**
      * 设备类型
      *
@@ -98,4 +101,12 @@ public class HardwareCVO extends BaseHardware {
     public void setIsPcfire(Integer isPcfire) {
         this.isPcfire = isPcfire;
     }
+
+    public Integer getTriggerModes() {
+        return triggerModes;
+    }
+
+    public void setTriggerModes(Integer triggerModes) {
+        this.triggerModes = triggerModes;
+    }
 }

+ 51 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabSecurityApplyVo.java

@@ -0,0 +1,51 @@
+package com.zd.laboratory.api.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: donggaosheng
+ * @Date: 2023/03/27
+ * @Description: 用于展示一体机首页信息牌
+ */
+public class LabSecurityApplyVo {
+    @ApiModelProperty(value = "类目名称")
+    private String userName;
+    @ApiModelProperty(value = "工号卡号")
+    private String jobNumber;
+    @ApiModelProperty(value = "图像")
+    private String avatar;
+    @ApiModelProperty(value = "准入期限")
+    private String validEndTime;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getJobNumber() {
+        return jobNumber;
+    }
+
+    public void setJobNumber(String jobNumber) {
+        this.jobNumber = jobNumber;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getValidEndTime() {
+        return validEndTime;
+    }
+
+    public void setValidEndTime(String validEndTime) {
+        this.validEndTime = validEndTime;
+    }
+}

+ 95 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/LabXxpClassifyVo.java

@@ -0,0 +1,95 @@
+package com.zd.laboratory.api.vo;
+
+import com.zd.model.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * @Author: donggaosheng
+ * @Date: 2023/03/27
+ * @Description: 用于展示一体机首页信息牌
+ */
+public class LabXxpClassifyVo {
+    /** 类目名称 */
+    @ApiModelProperty(value = "类目名称")
+    private String classifyName;
+    /** 类目类型 1文字 2图片 */
+    @ApiModelProperty(value = "类目名称")
+    private Integer classifyType;
+    /** 排序 */
+    @Excel(name = "排序")
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    /** 是否特殊类目 1否 2 是   */
+    @ApiModelProperty(value = "是否特殊类目")
+    private Integer isSpecial;
+
+    /** 是否展示 1展示 2不展示   */
+    @ApiModelProperty(value = "是否展示")
+    private Integer isShow;
+
+    /** 类目颜色   */
+    @ApiModelProperty(value = "类目颜色 ")
+    private String showColour;
+
+    @ApiModelProperty(value = "类目内容")
+    private List<String> classifyList;
+
+    public String getClassifyName() {
+        return classifyName;
+    }
+
+    public void setClassifyName(String classifyName) {
+        this.classifyName = classifyName;
+    }
+
+    public Integer getClassifyType() {
+        return classifyType;
+    }
+
+    public void setClassifyType(Integer classifyType) {
+        this.classifyType = classifyType;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    public Integer getIsSpecial() {
+        return isSpecial;
+    }
+
+    public void setIsSpecial(Integer isSpecial) {
+        this.isSpecial = isSpecial;
+    }
+
+    public Integer getIsShow() {
+        return isShow;
+    }
+
+    public void setIsShow(Integer isShow) {
+        this.isShow = isShow;
+    }
+
+    public String getShowColour() {
+        return showColour;
+    }
+
+    public void setShowColour(String showColour) {
+        this.showColour = showColour;
+    }
+
+    public List<String> getClassifyList() {
+        return classifyList;
+    }
+
+    public void setClassifyList(List<String> classifyList) {
+        this.classifyList = classifyList;
+    }
+}

+ 160 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/XxpInspectionVo.java

@@ -0,0 +1,160 @@
+package com.zd.laboratory.api.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.model.annotation.Excel;
+import com.zd.model.entity.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import sun.util.resources.ga.LocaleNames_ga;
+
+import java.util.Date;
+
+/**
+ * 巡查表 对象 xxp_inspection
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+@ApiModel("巡查信息")
+@Data
+@Accessors(chain = true)
+@ToString(callSuper = true)
+public class XxpInspectionVo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 人员id
+     */
+    @ApiModelProperty(value = "人员id",required = true)
+    private Long userId;
+
+    /**
+     * 人员姓名
+     */
+    @ApiModelProperty(value = "人员姓名")
+    private String userName;
+
+    /**
+     * 实验室id
+     */
+    @Excel(name = "实验室id")
+    @ApiModelProperty(value = "实验室id")
+    private Long  subjectId;
+
+
+    /**
+     * 实验室id
+     */
+    @Excel(name = "传参用实验室id")
+    @ApiModelProperty(value = "传参用实验室id")
+    private Long  labId;
+
+    /**
+     * 实验室名称
+     */
+    @Excel(name = "实验室名称")
+    @ApiModelProperty(value = "实验室名称")
+    private String subjectName;
+
+    /**
+     * 签到时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "签到时间 ")
+    private Date signIn;
+
+    /**
+     * 签退时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "签退时间 ")
+    private Date signOut;
+
+    /**
+     * 部门id
+     */
+    @ApiModelProperty(value = "部门id ")
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @ApiModelProperty(value = "部门名称 ")
+    private String deptName;
+
+    /**
+     * 停留时间
+     */
+    @ApiModelProperty(value = "停留时间 ")
+    private String residenceTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /***
+     * 开始时间
+     */
+    private String beginTime;
+
+    /***
+     * 结束时间
+     */
+    private String endTime;
+
+    /**
+     * 信息牌编号
+     */
+    private String num;
+
+    @Override
+    public Long getUserId() {
+        return userId;
+    }
+
+    @Override
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    @Override
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    @Override
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @Override
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    @Override
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    @Override
+    public String getDeptName() {
+        return deptName;
+    }
+
+    @Override
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+}

+ 107 - 0
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/XxpUserAuthVo.java

@@ -0,0 +1,107 @@
+package com.zd.laboratory.api.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.model.entity.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 信息牌人员权限表 对象 xxp_user_auth
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+@ApiModel("信息牌人员权限")
+public class XxpUserAuthVo {
+    /**
+     * 人员id
+     */
+    @ApiModelProperty(value = "人员id", required = true)
+    private Long userId;
+
+    /**
+     * 人员姓名
+     */
+    @ApiModelProperty(value = "人员姓名", required = true)
+    private String userName;
+
+    /**
+     * 设备编号
+     */
+    @ApiModelProperty(value = "设备编号", required = true)
+    private String num;
+
+    /**
+     * 人员类型
+     */
+    @ApiModelProperty(value = "人员类型", required = true)
+    private String userType;
+
+    /**
+     * 指纹
+     */
+    @ApiModelProperty(value = "指纹 ", required = true)
+    private String finger;
+
+    /**
+     * 指纹位置
+     */
+    @ApiModelProperty(value = "指纹位置 ", required = true)
+    private String fingerKey;
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    public String getFinger() {
+        return finger;
+    }
+
+    public void setFinger(String finger) {
+        this.finger = finger;
+    }
+
+    public String getFingerKey() {
+        return fingerKey;
+    }
+
+    public void setFingerKey(String fingerKey) {
+        this.fingerKey = fingerKey;
+    }
+}
+
+
+
+
+

+ 2 - 1
zd-api/zd-laboratory-api/src/main/java/resources/META-INF/spring.factories

@@ -1,5 +1,6 @@
 org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
   com.zd.laboratory.api.feign.fallback.RemoteLaboratoryFallbackFactory,\
   com.zd.laboratory.api.feign.fallback.RemoteMessageContentFallbackFactory,\
-  com.zd.laboratory.api.feign.fallback.RemoteSubQueryFallbackFactory
+  com.zd.laboratory.api.feign.fallback.RemoteSubQueryFallbackFactory,\
+  com.zd.laboratory.api.feign.fallback.RemoteDutyFailback
 

+ 17 - 0
zd-api/zd-security-api/pom.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>zd-api</artifactId>
+        <groupId>com.zd</groupId>
+        <version>3.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.zd.security</groupId>
+    <artifactId>zd-security-api</artifactId>
+    <packaging>jar</packaging>
+    <description>实验室安全模块api</description>
+
+</project>

+ 38 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckClapBo.java

@@ -0,0 +1,38 @@
+package com.zd.security.api.bo;
+
+import com.zd.model.page.PageQuery;
+import com.zd.security.api.dto.UploadDto;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Controller
+ * <p>随手拍</p>
+ * @author cyl
+ * @date 2023/4/20
+ */
+@Data
+public class CheckClapBo extends PageQuery implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("组合搜索条件")
+    private String searchValue;
+
+    @ApiModelProperty("整改状态,0是待整改,1是已整改,2是暂无法整改")
+    private Integer rectifyStatus;
+
+    @ApiModelProperty("学院id")
+    private Long deptId;
+
+    @ApiModelProperty("实验室id")
+    private Long subId;
+
+
+    @ApiModelProperty("上传照片")
+    private List <UploadDto> imgDtoList = new ArrayList <>();
+}

+ 32 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckHazardBo.java

@@ -0,0 +1,32 @@
+package com.zd.security.api.bo;
+
+import com.zd.model.page.PageQuery;
+import com.zd.security.api.dto.CheckHazardDto;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>隐患类</p>
+ *
+ * @author cyl
+ * @version 1.0
+ * @date 04/19/2023
+ */
+@Data
+public class CheckHazardBo extends PageQuery implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("巡查管理id")
+    private Long checkManageId;
+
+    @ApiModelProperty("隐患类别:1是院校巡查,2是自查")
+    private Integer hazardType;
+
+    @ApiModelProperty("隐患类数据列表")
+    private List <CheckHazardDto> checkHazardDtoList = new ArrayList <>();
+}

+ 64 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckPlanBo.java

@@ -0,0 +1,64 @@
+package com.zd.security.api.bo;
+
+import com.zd.model.page.PageQuery;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 检查计划业务表
+ * </p>
+ *
+ * @author hzw
+ * @since 2023-04-19
+ */
+@Data
+@ApiModel(value = "CheckPlanBo对象", description = "检查计划业务表")
+public class CheckPlanBo extends PageQuery implements Serializable {
+
+    private static final long serialVersionUID = -8423906903586415207L;
+
+    @ApiModelProperty("主键id")
+    private Long id;
+
+    @ApiModelProperty("计划标题")
+    private String title;
+
+    @ApiModelProperty("检查类型(1校院巡查 2实验室自查)")
+    private Integer checkType;
+
+    @ApiModelProperty("检查状态(1未开始 2进行中 3已结束)")
+    private Integer checkStatus;
+
+    @ApiModelProperty("检查进度")
+    private String checkSchedule;
+
+    @ApiModelProperty("检查范围(1全校 2学院 3实验室)")
+    private Integer checkRange;
+
+    @ApiModelProperty("检查实验室ids")
+    private String checkIds;
+
+    @ApiModelProperty("实验室数量")
+    private Integer subjectNum;
+
+    @ApiModelProperty("周期开始时间")
+    private LocalDateTime cycleStartTime;
+
+    @ApiModelProperty("周期结束时间")
+    private LocalDateTime cycleEndTime;
+
+    @ApiModelProperty("检查要求")
+    private String checkDemand;
+
+    @ApiModelProperty("巡查组id")
+    private Long checkGroupId;
+
+    @ApiModelProperty("是否删除(0否 1是)")
+    private Boolean isDeleted;
+
+}

+ 47 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckRectifyBo.java

@@ -0,0 +1,47 @@
+package com.zd.security.api.bo;
+
+import com.zd.model.page.PageQuery;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * Controller
+ *
+ * @author cyl
+ * @date 2023/4/20
+ */
+@Data
+public class CheckRectifyBo extends PageQuery implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("主键id")
+    private Long id;
+
+    @ApiModelProperty("隐患表id")
+    private Long checkHazardId;
+
+    @ApiModelProperty("整改结果1是已整改,0是暂无法整改")
+    private Integer rectifyResult;
+
+    @ApiModelProperty("整改措施")
+    private String rectifyMeasure;
+
+    @ApiModelProperty("审核结果1是通过,0是驳回")
+    private Integer examineResult;
+
+    @ApiModelProperty("审核意见")
+    private String examineOpinion;
+
+    @ApiModelProperty("审核人id")
+    private Long reviewedBy;
+
+    @ApiModelProperty("审核人姓名")
+    private String reviewedName;
+
+    @ApiModelProperty("审核时间")
+    private LocalDateTime reviewedTime;
+}

+ 33 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/bo/CheckTestBo.java

@@ -0,0 +1,33 @@
+package com.zd.security.api.bo;
+
+import com.zd.model.page.PageQuery;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>检查测试类</p>
+ *
+ * @author linft
+ * @version 1.0
+ * @date 04/14/2023
+ */
+@Data
+public class CheckTestBo extends PageQuery implements Serializable {
+    private static final long serialVersionUID = -5528470228203101771L;
+
+    private Long testId;
+
+    @ApiModelProperty("测试名称")
+    private String testName;
+
+    @ApiModelProperty("描述")
+    private String testDesc;
+
+    @ApiModelProperty("类型:0-默认,1-检查1,2-检查2,3-检查3")
+    private Integer testType;
+
+    @ApiModelProperty("状态:0-不可用,1-可用")
+    private Boolean state;
+}

+ 40 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/dto/CheckHazardDto.java

@@ -0,0 +1,40 @@
+package com.zd.security.api.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>隐患类</p>
+ *
+ * @author cyl
+ * @version 1.0
+ * @date 04/19/2023
+ */
+@Data
+public class CheckHazardDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("主键id")
+    private Long id;
+
+    @ApiModelProperty("隐患级别,1重大隐患,2是一般隐患,3管理问题")
+    private Integer hazardLevel;
+
+    @ApiModelProperty("检查项目")
+    private String hazardCheckPro;
+
+    @ApiModelProperty("检查要点")
+    private String hazardCheckPoint;
+
+    @ApiModelProperty("隐患描述")
+    private String hazardDescribe;
+
+    @ApiModelProperty("上传文件")
+    private List <UploadDto> uploadDtoList = new ArrayList <>();
+
+}

+ 16 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/dto/CheckRectifyDto.java

@@ -0,0 +1,16 @@
+package com.zd.security.api.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Controller
+ * <p>整改类</p>
+ * @author cyl
+ * @date 2023/4/20
+ */
+@Data
+public class CheckRectifyDto implements Serializable {
+
+}

+ 44 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/dto/UploadDto.java

@@ -0,0 +1,44 @@
+package com.zd.security.api.dto;
+
+import com.zd.model.page.PageQuery;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 安全检查上传业务类
+ * </p>
+ *
+ * @author hzw
+ * @since 2023-04-19
+ */
+@Data
+@ApiModel(value = "UploadBo对象", description = "安全检查上传业务")
+public class UploadDto extends PageQuery implements Serializable {
+
+    private static final long serialVersionUID = -8194206803487524992L;
+
+    @ApiModelProperty("主键id")
+    private Long id;
+
+    @ApiModelProperty("keyId")
+    private Long keyId;
+
+    @ApiModelProperty("文件url")
+    private String fileUrl;
+
+    @ApiModelProperty("文件名称")
+    private String fileName;
+
+    @ApiModelProperty("文件类型(1文件,2图片)")
+    private Integer fileType;
+
+    @ApiModelProperty("来源(1巡查计划,2隐患,3整改,4随手拍)")
+    private Integer source;
+
+    @ApiModelProperty("是否删除(0否 1是)")
+    private Boolean isDeleted;
+}

+ 17 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/feign/RemoteCheckTestService.java

@@ -0,0 +1,17 @@
+package com.zd.security.api.feign;
+
+import com.zd.model.constant.ApplicationConstants;
+import com.zd.security.api.feign.factory.RemoteCheckTestFallback;
+import org.springframework.cloud.openfeign.FeignClient;
+
+/**
+ * <p>检查测试类</p>
+ *
+ * @author linft
+ * @version 1.0
+ * @date 04/14/2023
+ */
+@FeignClient(contextId = "remoteCheckTestService", value = ApplicationConstants.SECURITY_SERVICE, fallbackFactory = RemoteCheckTestFallback.class)
+public interface RemoteCheckTestService {
+
+}

+ 15 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/feign/factory/RemoteCheckTestFallback.java

@@ -0,0 +1,15 @@
+package com.zd.security.api.feign.factory;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * <p>检查测试类</p>
+ *
+ * @author linft
+ * @version 1.0
+ * @date 04/14/2023
+ */
+@Component
+public class RemoteCheckTestFallback {
+
+}

+ 17 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/vo/CheckClapVo.java

@@ -0,0 +1,17 @@
+package com.zd.security.api.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Controller
+ *
+ * @author cyl
+ * @date 2023/4/20
+ */
+@Data
+public class CheckClapVo  implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+}

+ 39 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/vo/CheckHazardVo.java

@@ -0,0 +1,39 @@
+package com.zd.security.api.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>隐患类</p>
+ *
+ * @author cyl
+ * @version 1.0
+ * @date 04/19/2023
+ */
+@Data
+public class CheckHazardVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+//    @ApiModelProperty("隐患级别,1重大隐患,2是一般隐患,3管理问题")
+//    private Integer hazardLevel;
+//
+//    @ApiModelProperty("检查项目")
+//    private String hazardCheckPro;
+//
+//    @ApiModelProperty("检查要点")
+//    private String hazardCheckPoint;
+//
+//    @ApiModelProperty("隐患描述")
+//    private String hazardDescribe;
+
+    @ApiModelProperty("整改开始时间")
+    private String beginTime;
+
+    @ApiModelProperty("整改结束时间")
+    private String endTime;
+
+
+}

+ 26 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/vo/CheckRectifyVo.java

@@ -0,0 +1,26 @@
+package com.zd.security.api.vo;
+
+import com.zd.security.api.dto.CheckHazardDto;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+/**
+ * Controller
+ *
+ * @author cyl
+ * @date 2023/4/20
+ */
+@Data
+public class CheckRectifyVo implements Serializable {
+
+    @ApiModelProperty("隐患详情")
+    private CheckHazardDto checkHazardDto;
+
+    @ApiModelProperty("整改和审批流水线list")
+    private List <LinkedHashMap <String,Object>> checkRectifyMap = new ArrayList <>();
+}

+ 44 - 0
zd-api/zd-security-api/src/main/java/com/zd/security/api/vo/CheckTestVo.java

@@ -0,0 +1,44 @@
+package com.zd.security.api.vo;
+
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>检查测试类</p>
+ *
+ * @author linft
+ * @version 1.0
+ * @date 04/14/2023
+ */
+@Data
+public class CheckTestVo implements Serializable {
+    private static final long serialVersionUID = -401144841793356194L;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long testId;
+
+    @ApiModelProperty("测试名称")
+    private String testName;
+
+    @ApiModelProperty("描述")
+    private String testDesc;
+
+    @ApiModelProperty("类型:0-默认,1-检查1,2-检查2,3-检查3")
+    private Integer testType;
+
+    @ApiModelProperty("状态:0-不可用,1-可用")
+    private Boolean state;
+
+    @ApiModelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("更新时间")
+    private LocalDateTime updateTime;
+
+}

+ 5 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteUserService.java

@@ -4,6 +4,7 @@ import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.constant.SecurityConstants;
 import com.zd.model.domain.AjaxResult;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import com.zd.model.entity.LoginUser;
 import com.zd.model.entity.SysUser;
 import com.zd.system.api.feign.factory.RemoteUserFallback;
@@ -195,4 +196,8 @@ public interface RemoteUserService {
      */
     @RequestMapping("/user/getUserByPhone/{phone}")
     R<SysUser> getUserByPhone(@PathVariable("phone") String phone);
+
+
+    @GetMapping("/user/getUserMapInfoByUserId")
+    ResultData getUserMapInfoByUserId(@RequestParam("userId") Long userId);
 }

+ 5 - 1
zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteUserFallback.java

@@ -2,6 +2,7 @@ package com.zd.system.api.feign.factory;
 
 import com.zd.model.domain.AjaxResult;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import com.zd.model.entity.LoginUser;
 import com.zd.model.entity.SysUser;
 import com.zd.system.api.feign.RemoteUserService;
@@ -189,7 +190,10 @@ public class RemoteUserFallback implements FallbackFactory<RemoteUserService> {
                 return R.fail("根据电话查询用户信息失败:" + throwable.getMessage());
             }
 
-
+            @Override
+            public ResultData getUserMapInfoByUserId(Long userId) {
+                return ResultData.fail("查询用户信息失败:" + throwable.getMessage());
+            }
         };
     }
 }

+ 73 - 0
zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysLogoConfigVO.java

@@ -57,6 +57,79 @@ public class SysLogoConfigVO extends BaseEntity
     @Excel(name = "首页banner")
     @ApiModelProperty(value = "首页banner")
     private String homepageBanner;
+
+    /** 用户身份,11是教职工,22是学生 */
+    @Excel(name = "用户身份,11是教职工,22是学生")
+    @ApiModelProperty(value = "用户身份,11是教职工,22是学生")
+    private String userType;
+
+    @ApiModelProperty(value = "智能锁配置1是有,0是无")
+    private Integer smartLock;
+
+    @ApiModelProperty(value = "气瓶标签配置 1是有,0是无")
+    private Integer airBottle;
+
+    @ApiModelProperty(value = "返回时间")
+    private Integer returnTime;
+
+    @ApiModelProperty(value = "注销时间")
+    private Integer logoutTime;
+
+    @ApiModelProperty(value = "是否启用信息牌 0不启用 1启用")
+    private Integer isStart;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    public Integer getSmartLock() {
+        return smartLock;
+    }
+
+    public void setSmartLock(Integer smartLock) {
+        this.smartLock = smartLock;
+    }
+
+    public Integer getAirBottle() {
+        return airBottle;
+    }
+
+    public void setAirBottle(Integer airBottle) {
+        this.airBottle = airBottle;
+    }
+
+    public Integer getReturnTime() {
+        return returnTime;
+    }
+
+    public void setReturnTime(Integer returnTime) {
+        this.returnTime = returnTime;
+    }
+
+    public Integer getLogoutTime() {
+        return logoutTime;
+    }
+
+    public void setLogoutTime(Integer logoutTime) {
+        this.logoutTime = logoutTime;
+    }
+
+    public Integer getIsStart() {
+        return isStart;
+    }
+
+    public void setIsStart(Integer isStart) {
+        this.isStart = isStart;
+    }
+
     public void setId(Long id)
     {
         this.id = id;

+ 10 - 0
zd-auth/pom.xml

@@ -16,6 +16,16 @@
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>guava</artifactId>
+                    <groupId>com.google.guava</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>javassist</artifactId>
+                    <groupId>org.javassist</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <!-- SpringCloud Alibaba Nacos Config -->

+ 35 - 0
zd-common/common-core/src/main/java/com/zd/common/core/exception/ParamException.java

@@ -0,0 +1,35 @@
+package com.zd.common.core.exception;
+
+import com.zd.model.constant.HttpStatus;
+
+/**
+ * <p>参数异常类</p>
+ *
+ * @author: linft
+ * @date: 2020/11/2
+ * @since:
+ */
+public class ParamException extends RuntimeException {
+
+	private static final long serialVersionUID = 1L;
+
+	private Integer code;
+
+	public ParamException() {
+		super("参数异常");
+		this.code = HttpStatus.ERROR;
+	}
+
+	public ParamException(String message) {
+		super(message);
+		this.code = HttpStatus.ERROR;
+	}
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+}

+ 0 - 1
zd-common/common-core/src/main/java/com/zd/common/core/mybatisplus/MybatisPlusGenerator.java

@@ -89,7 +89,6 @@ public class MybatisPlusGenerator {
                         .disable(disableTemplateType)
                         .build()
                 )
-
                 // 策略配置
                 .strategyConfig(builder -> builder
                         .addInclude(tables)

+ 20 - 0
zd-common/common-core/src/main/java/com/zd/common/core/redis/RedisService.java

@@ -150,4 +150,24 @@ public interface RedisService {
      * @return 对象列表
      */
     public Collection<String> keys(final String pattern);
+
+    /**
+     * 加锁
+     * @param key
+     * @param second
+     */
+    boolean lock(String key, long second);
+
+    /**
+     * 解除
+     * @param key
+     * @return
+     */
+    boolean unLock(String key);
+
+    /**
+     * 是否存在锁
+     * @param key
+     */
+    boolean isExistLock(String key);
 }

+ 20 - 0
zd-common/common-core/src/main/java/com/zd/common/core/redis/RedisServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zd.common.core.redis;
 
+import com.zd.model.constant.BaseConstants;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.BoundSetOperations;
 import org.springframework.data.redis.core.HashOperations;
@@ -128,4 +129,23 @@ public class RedisServiceImpl implements RedisService {
     public Collection<String> keys(final String pattern) {
         return redisTemplate.keys(pattern);
     }
+
+    @Override
+    public boolean lock(String key, long second) {
+        return redisTemplate.opsForValue().setIfAbsent(BaseConstants.REDIS_LOCK + key, key, second, TimeUnit.SECONDS);
+    }
+
+    @Override
+    public boolean unLock(String key) {
+        return redisTemplate.delete(BaseConstants.REDIS_LOCK + key);
+    }
+
+    @Override
+    public boolean isExistLock(String key) {
+        Object obj = redisTemplate.opsForValue().get(BaseConstants.REDIS_LOCK + key);
+        if (obj != null) {
+            return Boolean.TRUE;
+        }
+        return Boolean.FALSE;
+    }
 }

+ 27 - 0
zd-common/common-core/src/main/java/com/zd/common/core/utils/DateUtils.java

@@ -6,8 +6,10 @@ import org.apache.commons.lang3.time.DateFormatUtils;
 import java.lang.management.ManagementFactory;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 时间工具类
@@ -146,4 +148,29 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         }
         return calendar.getTime();
     }
+
+
+    public static List<String> findDates(String beginTime, String endTime)
+            throws ParseException {
+        List<String> allDate = new ArrayList();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+        Date dBegin = sdf.parse(beginTime);
+        Date dEnd = sdf.parse(endTime);
+        allDate.add(sdf.format(dBegin));
+        Calendar calBegin = Calendar.getInstance();
+        // 使用给定的 Date 设置此 Calendar 的时间
+        calBegin.setTime(dBegin);
+        Calendar calEnd = Calendar.getInstance();
+        // 使用给定的 Date 设置此 Calendar 的时间
+        calEnd.setTime(dEnd);
+        // 测试此日期是否在指定日期之后
+        while (dEnd.after(calBegin.getTime())) {
+            // 根据日历的规则,为给定的日历字段添加或减去指定的时间量
+            calBegin.add(Calendar.DAY_OF_MONTH, 1);
+            allDate.add(sdf.format(calBegin.getTime()));
+        }
+        System.out.println("时间==" + allDate);
+        return allDate;
+    }
 }

+ 383 - 0
zd-common/common-core/src/main/java/com/zd/common/core/utils/ParamCheckUtils.java

@@ -0,0 +1,383 @@
+package com.zd.common.core.utils;
+
+import com.zd.common.core.exception.ParamException;
+import org.apache.poi.ss.formula.functions.T;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Predicate;
+import java.util.regex.Pattern;
+
+
+/**
+ * <p>参数检查类</p>
+ *
+ * @author: linft
+ * @date: 2023/4/14
+ * @since:
+ */
+public class ParamCheckUtils {
+
+	private static final Logger LOGGER = LoggerFactory.getLogger(ParamCheckUtils.class);
+
+	private static class LoadParamCheck{
+		private static final ParamCheckUtils PARAM_CHECK_UTILS = new ParamCheckUtils();
+	}
+
+	private ParamCheckUtils() {}
+
+	public static ParamCheck build() {
+		return LoadParamCheck.PARAM_CHECK_UTILS.new ParamCheck();
+	}
+
+	public static ParamCheck build(String msg) {
+		return LoadParamCheck.PARAM_CHECK_UTILS.new ParamCheck(msg);
+	}
+
+	private static void throwParamException(String message) {
+		throw new ParamException(message);
+	}
+
+	/**
+	 * 检查Object非空
+	 *
+	 * @param obj
+	 * @param message
+	 */
+	public static void notNull(Object obj, String message) {
+		if(null == obj)
+			throwParamException(message);
+	}
+
+	public class ParamCheck{
+
+		private String msg;
+
+		public ParamCheck() {}
+
+		public ParamCheck(String msg) {
+			this.msg = msg;
+		}
+
+		public void throwException(String message) {
+			throwParamException(message);
+		}
+
+		/**
+		 * 检查Object不为null,指定提示message
+		 *
+		 * @param obj
+		 * @param message
+		 * @return
+		 */
+		public ParamCheck notNull(Object obj, String message) {
+			if(null == obj)
+				throwParamException(message);
+			return this;
+		}
+
+		/**
+		 * 检查Object不为null
+		 *
+		 * @param obj
+		 * @return
+		 */
+		public ParamCheck notNull(Object obj) {
+			return notNull(obj,msg);
+		}
+
+		/**
+		 * 检查objList不为null
+		 *
+		 * @param objList
+		 * @return
+		 */
+		public ParamCheck notNull(List <? extends Object> objList) {
+			Predicate<List <?>> predicate = a->a.size()>0;
+			if(!predicate.test(objList)){
+				throwParamException(msg);
+			}
+			return this;
+		}
+
+		/**
+		 * 检查字符串不为空,指定提示msg
+		 *
+		 * @param str
+		 * @param message
+		 * @return
+		 */
+		public ParamCheck strNotEmpty(String str, String message) {
+			if(null == str || "".equals(str))
+				throwParamException(message);
+			return this;
+		}
+
+		/**
+		 * 检查字符串不为空,指定提示msg
+		 *
+		 * @param str
+		 * @return
+		 */
+		public ParamCheck strNotEmpty(String str) {
+			return strNotEmpty(str,msg);
+		}
+
+		/**
+		 * 检查参数int大于0,指定提示message
+		 *
+		 * @param param
+		 * @param message
+		 * @return
+		 */
+		public ParamCheck greaterThanZero(Integer param, String message) {
+			notNull(param, message);
+			if(param <= 0) {
+				throwParamException(message);
+			}
+			return this;
+		}
+
+		/**
+		 * 检查参数int大于0,指定提示message
+		 *
+		 * @param param
+		 * @return
+		 */
+		public ParamCheck greaterThanZero(Integer param) {
+			return greaterThanZero(param,msg);
+		}
+
+		/**
+		 * 检查数字类不为0,指定提示语message
+		 *
+		 * @param number
+		 * @param message
+		 * @return
+		 */
+		public ParamCheck notZero(Number number, String message) {
+			notNull(number, message);
+			if(number instanceof Byte) {
+				Byte bt = (Byte) number;
+				if(bt == 0)
+					throwParamException(message);
+			} else if(number instanceof Short) {
+				Short st = (Short) number;
+				if(st == 0)
+					throwParamException(message);
+			} else if(number instanceof Integer) {
+				Integer it = (Integer) number;
+				if(it == 0)
+					throwParamException(message);
+			} else if(number instanceof Long) {
+				Long lg = (Long) number;
+				if(lg == 0)
+					throwParamException(message);
+			} else if(number instanceof Double) {
+				Double de = (Double) number;
+				if(de == 0)
+					throwParamException(message);
+			} else if(number instanceof Float) {
+				Float ft = (Float) number;
+				if(ft == 0)
+					throwParamException(message);
+			} else {
+				LOGGER.error("该数据不在: Byte,Short,Integer,Long,Fload,Double中");
+				throwParamException("该数据不在: Byte,Short,Integer,Long,Fload,Double中");
+			}
+			return this;
+		}
+
+		/**
+		 * 检查数字类不为0
+		 *
+		 * @param number
+		 * @return
+		 */
+		public ParamCheck notZero(Number number) {
+			return notZero(number,msg);
+		}
+
+		/**
+		 * 检查Object[]不为空,指定提示语message
+		 *
+		 * @param arr
+		 * @param message
+		 * @return
+		 */
+		public ParamCheck arrNotEmpty(Object[] arr, String message) {
+			if(null == arr || arr.length == 0)
+				throwParamException(message);
+			return this;
+		}
+
+		/**
+		 * 检查Object[]不为空,指定提示语message
+		 *
+		 * @param arr
+		 * @return
+		 */
+		public ParamCheck arrNotEmpty(Object[] arr) {
+			return arrNotEmpty(arr,msg);
+		}
+
+		/**
+		 * 检查Collection不为空,指定提示语message
+		 *
+		 * @param collections
+		 * @param message
+		 * @return
+		 */
+		public ParamCheck collectionNotEmpty(Collection<?> collections, String message) {
+			if(null == collections || collections.size() == 0)
+				throwParamException(message);
+			return this;
+		}
+
+		/**
+		 * 检查Collection不为空
+		 *
+		 * @param collections
+		 * @return
+		 */
+		public ParamCheck collectionNotEmpty(Collection<?> collections) {
+			return collectionNotEmpty(collections,msg);
+		}
+
+		/**
+		 * 检查Map不为空,指定提示语message
+		 *
+		 * @param map
+		 * @param message
+		 * @return
+		 */
+		public ParamCheck mapNotEmpty(Map<?, ?> map, String message) {
+			if(null == map || map.size() == 0)
+				throwParamException(message);
+			return this;
+		}
+
+		/**
+		 * 检查Map不为空
+		 *
+		 * @param map
+		 * @return
+		 */
+		public ParamCheck mapNotEmpty(Map<?, ?> map) {
+			return mapNotEmpty(map,msg);
+		}
+
+		/**
+		 * 检查regex和str是否一致,指定提示语message
+		 *
+		 * @param regex
+		 * @param str
+		 * @param message
+		 * @return
+		 */
+		public ParamCheck strNotRegex(String regex, String str, String message) {
+			if(!Pattern.matches(regex, str))
+				throwParamException(message);
+			return this;
+		}
+
+		/**
+		 * 检查regex和str是否一致,指定提示语message
+		 *
+		 * @param regex
+		 * @param str
+		 * @return
+		 */
+		public ParamCheck strNotRegex(String regex, String str) {
+			return strNotRegex(regex,str,msg);
+		}
+
+		/**
+		 * 检查是否为Mail地址
+		 *
+		 * @param email
+		 * @return
+		 */
+		public ParamCheck isNotMail(String email) {
+			return isNotMail(email, this.msg);
+		}
+
+		/**
+		 * 检查是否为Mail地址,指定提示msg
+		 *
+		 * @param email
+		 * @param msg
+		 * @return
+		 */
+		public ParamCheck isNotMail(String email, String msg) {
+			Pattern p = Pattern.compile("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
+			if(!p.matcher(email).matches())
+				throwParamException(msg);
+			return this;
+		}
+
+		/**
+		 * 检查是否为手机号
+		 *
+		 * @param mobile
+		 * @return
+		 */
+		public ParamCheck isNotMobile(String mobile) {
+			return isNotMobile(mobile, this.msg);
+		}
+
+		/**
+		 * 检查是否为手机号,指定提示msg
+		 *
+		 * @param mobile
+		 * @param msg
+		 * @return
+		 */
+		public ParamCheck isNotMobile(String mobile,String msg) {
+			Pattern p = Pattern.compile("^1[3|4|5|6|7|8|9][0-9]\\d{8}$");
+			if(!p.matcher(mobile).matches())
+				throwParamException(msg);
+			return this;
+		}
+
+		/**
+		 * 检查参数是否为数字
+		 *
+		 * @param number
+		 * @return
+		 */
+		public ParamCheck isNotNumber(String number) {
+			return isNotNumber(number, this.msg);
+		}
+
+
+		/**
+		 * 检查参数是否为数字,指定提示msg
+		 *
+		 * @param number
+		 * @param msg
+		 * @return
+		 */
+		public ParamCheck isNotNumber(String number,String msg) {
+			Pattern p = Pattern.compile("^-?\\d+(\\.\\d+)?$");
+			if(!p.matcher(number).matches())
+				throwParamException(msg);
+			return this;
+		}
+
+		/**
+		 * 检查参数是否包含特殊字符
+		 *
+		 * @param str
+		 * @return
+		 */
+		public ParamCheck isNotSpecialChar(String str) {
+			Pattern p = Pattern.compile("[ _`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]|\n|\r|\t");
+			if(p.matcher(str).find())
+				throwParamException(msg);
+			return this;
+		}
+	}
+}

+ 82 - 0
zd-common/common-core/src/main/java/com/zd/common/core/web/controller/AbstractController.java

@@ -0,0 +1,82 @@
+package com.zd.common.core.web.controller;
+
+import com.zd.common.core.utils.ParamCheckUtils;
+import com.zd.model.constant.SecurityConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * <p>抽象控制类</p>
+ *
+ * @author: linft
+ * @date: 2020/11/3
+ * @since:
+ */
+public abstract class AbstractController {
+
+    protected final Logger log = LoggerFactory.getLogger(this.getClass());
+
+    protected ParamCheckUtils.ParamCheck paramCheck = ParamCheckUtils.build("参数异常!");
+
+    /**
+     * 获得request对象
+     * @return
+     */
+    public HttpServletRequest getRequest() {
+        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+        return request;
+    }
+
+    /**
+     * 获得response对象
+     *
+     * @return
+     */
+    public HttpServletResponse getResponse() {
+        HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+        return response;
+
+    }
+
+    /**
+     * 获取用户登录信息
+     * @return
+     */
+    /*protected LoginUser getUserLoginModel() {
+        String modelStr = getRequest().getHeader(BaseConstant.LOGIN_MODEL);
+        if(!StringUtils.isEmpty(modelStr)) {
+            return JSONObject.parseObject(modelStr, LoginModel.class);
+        }
+        return null;
+    }*/
+
+    /**
+     * 	获取当前登录用户的用户id
+     */
+    protected Long getCurrentUserId() {
+        // 设置用户信息到请求
+        String idStr = getRequest().getHeader(SecurityConstants.DETAILS_USER_ID);
+        if(StringUtils.isEmpty(idStr)) {
+            return null;
+        }
+        return Long.parseLong(idStr);
+    }
+
+    /**
+     * 	获取当前登录用户的用户id
+     */
+    protected String getCurrentUserName() {
+        // 设置用户信息到请求
+        String userName = getRequest().getHeader(SecurityConstants.DETAILS_USERNAME);
+        if(StringUtils.isEmpty(userName)) {
+            return null;
+        }
+        return userName;
+    }
+
+}

+ 3 - 0
zd-common/common-core/src/main/java/com/zd/common/core/web/controller/BaseController.java

@@ -4,6 +4,7 @@ import com.github.pagehelper.Page;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.page.PageMethod;
 import com.zd.common.core.utils.DateUtils;
+import com.zd.common.core.utils.ParamCheckUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.utils.sql.SqlUtil;
 import com.zd.common.core.web.page.TableSupport;
@@ -27,6 +28,8 @@ import java.util.List;
 public class BaseController<T> {
     protected final Logger logger = LoggerFactory.getLogger(this.getClass());
 
+    protected ParamCheckUtils.ParamCheck paramCheck = ParamCheckUtils.build("参数异常!");
+
     /**
      * 将前台传递过来的日期格式的字符串,自动转化为Date类型
      */

+ 1 - 1
zd-common/common-core/src/main/resources/code-generator.properties

@@ -3,4 +3,4 @@ mysql-url=jdbc:mysql://192.168.1.43:13306/cloud_data_v2?useUnicode=true&characte
 mysql-user=root
 mysql-pwd=root123456
 #作者
-author=
+author=linft

+ 18 - 8
zd-common/common-swagger/src/main/java/com/zd/common/swagger/config/Knife4jConfiguration.java

@@ -4,18 +4,16 @@ import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.ApiKey;
-import springfox.documentation.service.Contact;
-import springfox.documentation.service.SecurityScheme;
+import springfox.documentation.builders.*;
+import springfox.documentation.schema.ModelRef;
+import springfox.documentation.service.*;
 import springfox.documentation.spi.DocumentationType;
 import springfox.documentation.spring.web.plugins.Docket;
 import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
 
 /**
@@ -52,7 +50,8 @@ public class Knife4jConfiguration {
                 .apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage()))
                 .paths(PathSelectors.any())
                 .build()
-                .securitySchemes(Arrays.asList(securitySchemes()));
+                .securitySchemes(Arrays.asList(securitySchemes()))
+                .globalRequestParameters(this.getParameterList());
     }
 
     private SecurityScheme securitySchemes() {
@@ -67,4 +66,15 @@ public class Knife4jConfiguration {
                 .title(swaggerProperties.getTitle())
                 .build();
     }
+
+    /**
+     * 添加head参数配置
+     */
+    private List<RequestParameter> getParameterList() {
+        RequestParameterBuilder builder = new RequestParameterBuilder();
+        RequestParameter parameter = builder.name("Authorization").description("token").required(false).in("header").build();
+        List<RequestParameter> parameterList = new ArrayList<>(2);
+        parameterList.add(parameter);
+        return parameterList;
+    }
 }

+ 6 - 0
zd-model/src/main/java/com/zd/model/constant/ApplicationConstants.java

@@ -56,4 +56,10 @@ public interface ApplicationConstants {
      */
     String BOTTLE_SERVICE = "zd-bottle";
 
+
+    /**
+     * 安全服务
+     */
+    String SECURITY_SERVICE = "zd-security";
+
 }

+ 10 - 0
zd-model/src/main/java/com/zd/model/constant/BaseConstants.java

@@ -183,4 +183,14 @@ public interface BaseConstants {
      * 手机登录验证码有效期(分钟)
      */
     long CODE_EXPIRATION = 5;
+
+
+    String DELAY_QUEUE = "delayQueue";
+
+    String HOLIDAY_TIME = "holidayTime";
+
+    /**
+     * Redis前缀,需统一
+     */
+    String REDIS_LOCK = "redis_lock:";
 }

+ 0 - 1
zd-model/src/main/java/com/zd/model/domain/R.java

@@ -2,7 +2,6 @@ package com.zd.model.domain;
 
 
 import com.zd.model.constant.HttpStatus;
-
 import java.io.Serializable;
 
 /**

+ 34 - 0
zd-model/src/main/java/com/zd/model/domain/per/PerPrefix.java

@@ -579,6 +579,13 @@ public class PerPrefix {
      */
     public static final String BUSINESS_SUPPLIER_AUDIT = "audit:";
 
+    /**   ================================================定时排风权限=====================================     */
+    /**
+     * 实验室管理:定时排风
+     */
+    public static final String LABORATORY_EXHAUST = "laboratory:exhaust:";
+
+    public static final String LABORATORY_EXJOINSUB = "laboratory:exjoinsub:";
 
 
     /**
@@ -796,4 +803,31 @@ public class PerPrefix {
      * 海康授权日志
      */
     public static final String HAIKANG_USERLOG= "haikang:userLog:";
+
+    /**
+     * 电子信息牌安全类目
+     */
+    public static final String LABORATORY_CLASSIFY = "laboratory:classify:";
+
+    /**
+     * 电子信息牌安全类目详情
+     */
+    public static final String LABORATORY_CLASSIFY_DET = "laboratory:classifyDet:";
+
+    /**
+     * 电子信息牌巡查
+     */
+    public static final String LABORATORY_XXP_INSPECTION = "laboratory:xxpIns:";
+    /**
+     * 电子信息牌值班
+     */
+    public static final String LABORATORY_DUTY = "laboratory:duty:";
+    /**
+     * 电子信息牌信息
+     */
+    public static final String LABORATORY_CARDINFO = "laboratory:cardInfo:";
+    /**
+     * 电子信息牌人员前线
+     */
+    public static final String LABORATORY_XXPUSERAUTH= "laboratory:xxpUserAuth:";
 }

+ 26 - 0
zd-model/src/main/java/com/zd/model/entity/SysDept.java

@@ -94,6 +94,16 @@ public class SysDept extends BaseEntity {
     private Integer isLower;
 
     /**
+     * 1是部门,2是实验室
+     */
+    private Integer subOrDept;
+
+    /**
+     * 部门或者实验室id
+     */
+    private Integer subOrDeptId;
+
+    /**
      * 子部门
      */
     private List<SysDept> children = new ArrayList<SysDept>();
@@ -232,6 +242,22 @@ public class SysDept extends BaseEntity {
         this.isLower = isLower;
     }
 
+    public Integer getSubOrDept() {
+        return subOrDept;
+    }
+
+    public void setSubOrDept(Integer subOrDept) {
+        this.subOrDept = subOrDept;
+    }
+
+    public Integer getSubOrDeptId() {
+        return subOrDeptId;
+    }
+
+    public void setSubOrDeptId(Integer subOrDeptId) {
+        this.subOrDeptId = subOrDeptId;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 20 - 0
zd-model/src/main/java/com/zd/model/entity/SysUser.java

@@ -282,6 +282,10 @@ public class SysUser extends BaseEntity implements Serializable {
      * */
     private List<Long> deptIds;
 
+    private List<Long> subjectIds;
+
+    private List<String> dateList;
+
     private boolean include = false;
 
     private List<Object> permitMenus = new ArrayList<>();
@@ -724,4 +728,20 @@ public class SysUser extends BaseEntity implements Serializable {
     public void setCardNumSimple(String cardNumSimple) {
         this.cardNumSimple = cardNumSimple;
     }
+
+    public List<Long> getSubjectIds() {
+        return subjectIds;
+    }
+
+    public void setSubjectIds(List<Long> subjectIds) {
+        this.subjectIds = subjectIds;
+    }
+
+    public List<String> getDateList() {
+        return dateList;
+    }
+
+    public void setDateList(List<String> dateList) {
+        this.dateList = dateList;
+    }
 }

+ 2 - 1
zd-model/src/main/java/com/zd/model/enums/HardwareTypeEnum.java

@@ -22,7 +22,8 @@ public enum HardwareTypeEnum implements BaseEnum<Integer>, HardwareType {
     AI_ALARM(8, "智能报警器", ""),
     AI_CABINETLOCK(9, "智能柜锁", ""),
     AI_OUTFIRE(10, "一键灭火", ""),
-    HK_DOOR(11, "海康门禁", "");
+    HK_DOOR(11, "海康门禁", ""),
+    LOUDSPEAKER(12,"喇叭","");
 
 
     private final Integer code;

+ 4 - 2
zd-model/src/main/java/com/zd/model/page/PageDomain.java

@@ -2,6 +2,8 @@ package com.zd.model.page;
 
 import org.apache.commons.lang3.StringUtils;
 
+import java.util.Optional;
+
 /**
  * 分页数据
  *
@@ -36,7 +38,7 @@ public class PageDomain {
     }
 
     public Integer getPageNum() {
-        return pageNum;
+        return Optional.ofNullable(pageNum).orElse(1);
     }
 
     public void setPageNum(Integer pageNum) {
@@ -44,7 +46,7 @@ public class PageDomain {
     }
 
     public Integer getPageSize() {
-        return pageSize;
+        return Optional.ofNullable(pageSize).orElse(10);
     }
 
     public void setPageSize(Integer pageSize) {

+ 30 - 0
zd-model/src/main/java/com/zd/model/page/PageQuery.java

@@ -0,0 +1,30 @@
+package com.zd.model.page;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>MybatisPlus分页参数</p>
+ *
+ * @author: linft
+ * @date: 2023-04-14
+ */
+@Data
+@ApiModel("分页参数")
+public class PageQuery implements Serializable {
+    private static final long serialVersionUID = 367106536089714734L;
+
+    /**
+     * 当前页数
+     */
+    @ApiModelProperty("页码")
+    private Integer pageNum = 1;
+    /**
+     * 页显示数量
+     */
+    @ApiModelProperty("页大小")
+    private Integer pageSize = 10;
+}

+ 1 - 0
zd-model/src/main/resources/application.yml

@@ -11,5 +11,6 @@ service:
     exam: 9014
     algorithm: 9015
     bottle: 9016
+    security: 9017
     app: 9021
 

+ 1 - 0
zd-modules/pom.xml

@@ -20,6 +20,7 @@
         <module>zd-bottle-parent</module>
         <module>zd-algorithm</module>
         <module>zd-base</module>
+        <module>zd-security</module>
     </modules>
 
     <dependencies>

+ 10 - 0
zd-modules/zd-airbottle/pom.xml

@@ -17,6 +17,16 @@
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>javassist</artifactId>
+                    <groupId>org.javassist</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>guava</artifactId>
+                    <groupId>com.google.guava</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <!-- SpringCloud Alibaba Nacos Config -->

+ 16 - 0
zd-modules/zd-algorithm/pom.xml

@@ -23,6 +23,16 @@
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>javassist</artifactId>
+                    <groupId>org.javassist</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>guava</artifactId>
+                    <groupId>com.google.guava</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <!-- SpringCloud Alibaba Nacos Config -->
@@ -173,6 +183,12 @@
         <dependency>
             <groupId>com.zd.base</groupId>
             <artifactId>zd-base-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jsqlparser</artifactId>
+                    <groupId>com.github.jsqlparser</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>

+ 106 - 20
zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/controller/FaceApi.java

@@ -4,18 +4,21 @@ import com.arcsoft.face.FaceFeature;
 import com.arcsoft.face.FaceInfo;
 import com.arcsoft.face.toolkit.ImageInfo;
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
-import com.zd.alg.face.handle.FaceEngineFactory;
 import com.zd.alg.face.service.FaceService;
 import com.zd.alg.face.utils.FileUtil;
 import com.zd.algorithm.api.face.feign.FaceCompare;
+import com.zd.common.core.utils.DateUtils;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.common.swagger.config.Knife4jConfiguration;
 import com.zd.laboratory.api.entity.LabStudentsInfo;
+import com.zd.laboratory.api.entity.LabSysUserInfo;
+import com.zd.laboratory.api.feign.RemoteDutyService;
 import com.zd.laboratory.api.feign.RemoteStudentsService;
+import com.zd.model.constant.HttpStatus;
 import com.zd.model.domain.R;
 import com.zd.model.domain.ResultData;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import lombok.extern.flogger.Flogger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,6 +27,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.io.*;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Author: zhoupan
@@ -45,49 +49,136 @@ public class FaceApi {
     @Autowired
     RemoteStudentsService remoteStudentsService;
 
+    @Autowired
+    RemoteDutyService remoteDutyService;
+
 
     @ApiOperation("根据照片文件获取特征码")
     @PostMapping("/faceFeature")
     public ResultData faceFeature(@RequestParam("file") MultipartFile file) throws IOException {
         ImageInfo imageInfo;
-        File file1=null;
+        File file1 = null;
         try {
-            file1= FileUtil.multipartFileToFile(file);
+            file1 = FileUtil.multipartFileToFile(file);
             imageInfo = faceService.getImageInfo(file1);
         } finally {
-            if(file1!=null)
-            {
+            if (file1 != null) {
                 file1.delete();
             }
         }
         List<FaceInfo> faceInfos = faceService.faceDetect(imageInfo);
+        if(null==faceInfos || faceInfos.size()==0){
+            return ResultData.fail("识别中");
+        }
         FaceFeature faceFeature = faceService.faceFeature(imageInfo, faceInfos);
         return ResultData.success(faceFeature.getFeatureData());
     }
+
+
+    @ApiOperation("检测是否是人脸")
+    @PostMapping("/detectFaces")
+    public ResultData detectFaces(@RequestParam("file") MultipartFile file) throws IOException {
+        File fileToFile = null;
+        try {
+            fileToFile = FileUtil.multipartFileToFile(file);
+            ImageInfo  imageInfo = faceService.getImageInfo(fileToFile);
+            List<FaceInfo> faceInfos = faceService.faceDetect(imageInfo);
+            if(null==faceInfos || faceInfos.size()==0){
+                return ResultData.fail("请讲脸放到摄像头正中央!");
+            }
+            return ResultData.success(faceInfos);
+        } finally {
+            if (fileToFile != null) {
+                fileToFile.delete();
+            }
+        }
+    }
+
+
     /**
      * 人脸比较
+     *
      * @return
      */
     @ApiOperation("人脸比较")
     @PostMapping("/compare")
-    public ResultData faceDetection(@RequestBody FaceCompare faceCompare)
-    {
+    public ResultData faceDetection(@RequestBody FaceCompare faceCompare) {
         logger.info("====人脸比较====");
         R<LabStudentsInfo> info = remoteStudentsService.getInfo(faceCompare.getUserId());
-        if(info.getCode()==200&&info.getData()!=null)
-        {
+        if (info.getCode() == 200 && info.getData() != null) {
             logger.info("====人脸data组装====");
             FaceFeature target = new FaceFeature(info.getData().getFaceFeature());
             FaceFeature source = new FaceFeature(faceCompare.getData());
             Boolean compore = faceService.compore(target, source);
-            logger.info("====compore===="+compore);
-            return ResultData.result(compore,()->"人脸对比不符!");
-        }else
-        {
-            return ResultData.fail("未获取到对比数据!:"+info.getMsg());
+            logger.info("====compore====" + compore);
+            return ResultData.result(compore, () -> "人脸对比不符!");
+        } else {
+            return ResultData.fail("未获取到对比数据!:" + info.getMsg());
         }
     }
 
+
+    /**
+     * 人脸比较
+     *
+     * @return
+     */
+    @ApiOperation("人脸比较")
+    @PostMapping("/multiCompare")
+    public ResultData multiFaceDetection(@RequestBody FaceCompare faceCompare) {
+        logger.info("====人脸比较====");
+        Integer isDutyUser=0;
+        ResultData<List<LabSysUserInfo>> infoList = remoteStudentsService.getFaceBySecuritySubjectId(faceCompare.getLabId());
+        if (infoList.getCode() == 200 && infoList.getData() != null) {
+            logger.info("====人脸data组装====");
+            for(LabSysUserInfo info:infoList.getData()){
+                FaceFeature target = new FaceFeature(info.getFaceFeature());
+                FaceFeature source = new FaceFeature(faceCompare.getData());
+                Boolean compore = faceService.compore(target, source);
+                if(compore){
+                    String userType=info.getUserType();
+                    Integer isWhite=info.getIsWhite();
+                    if(StringUtils.isNull(userType)){
+                        return ResultData.fail("用户不存在!");
+                    }
+                    //如果是学生 或者白名单的老师 进二类页面
+                    if(userType.equals("22") || (userType.equals("11") && isWhite==0)){
+                        info.setPageType(2);
+                    }
+                    ResultData resultData =remoteDutyService.isAdminOrSafeUser(faceCompare.getLabId(),info.getUserId());
+                    //一类首页对应身份为白名单老师、实验室负责人、安全责任人
+                    if(Integer.parseInt(String.valueOf(resultData.getData()))>0 || (userType.equals("11") && isWhite==1)){
+                        info.setPageType(1);
+                    }
+                    info.setFaceFeature(null);
+                    String dateTime = DateUtils.getDate();
+                    ResultData dutyUserData = remoteDutyService.selectDutyUser(faceCompare.getLabId(),dateTime);
+                    //判断是否当天值班
+                    if(null==dutyUserData && dutyUserData.getCode()!= HttpStatus.SUCCESS){
+                        return ResultData.fail("获取值班人员识别!");
+                    }
+                    List<Map<String,Object>> dutyList= (List<Map<String, Object>>) dutyUserData.getData();
+                    for(Map<String,Object> dutyMap:dutyList){
+                        String userObj=String.valueOf(dutyMap.get("userId"));
+                        if(StringUtils.isNotEmpty(userObj) && StringUtils.isNotNull(userObj)){
+                            if(Long.parseLong(userObj)==info.getUserId()){
+                                isDutyUser=1;
+                                break;
+                            }
+                        }
+                    }
+                    info.setIsDutyUser(isDutyUser);
+                    logger.info("====compore====" +"对比成功用户ID:"+info.getUserId());
+                    return ResultData.success(info);
+                }
+            }
+            return ResultData.fail("未获取实验室安全准入人脸数据!");
+        } else {
+            return ResultData.fail("未获取实验室安全准入人脸数据!");
+        }
+    }
+
+
     //获取流文件
     private static void inputStreamToFile(InputStream ins, File file) {
         try {
@@ -103,9 +194,4 @@ public class FaceApi {
             e.printStackTrace();
         }
     }
-
-
-
-
-
 }

+ 1 - 0
zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/service/FaceService.java

@@ -40,6 +40,7 @@ public class FaceService {
     public List<FaceInfo> faceDetect(ImageInfo imageInfo) {
         List<FaceInfo> faceInfoList = new ArrayList<>();
         int errorCode = faceEngineFactory.initFaceEngineImage().detectFaces(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList);
+        System.out.println("errorCode:"+errorCode);
         Assert.isTrue(errorCode == ErrorInfo.MOK.getValue(), "人脸检测失败!");
         return faceInfoList;
     }

+ 56 - 4
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/controller/SignInCheckController.java

@@ -11,7 +11,10 @@ import com.zd.alg.forward.serivce.VideoCheckResultValidImpl;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.utils.Assert;
+import com.zd.common.core.utils.UUID;
 import com.zd.common.swagger.config.Knife4jConfiguration;
+import com.zd.model.constant.BaseConstants;
+import com.zd.model.constant.HttpStatus;
 import com.zd.model.domain.R;
 import com.zd.model.entity.Algorithm;
 import io.swagger.annotations.Api;
@@ -67,6 +70,11 @@ public class SignInCheckController {
     @ApiOperation(value = "进入项验证")
     @PostMapping("/{code}/{id}")
     public R checkIn(@ApiParam("进出记录ID") @PathVariable("id") Long id, @ApiParam("验证类型编码") @PathVariable("code") String code, @RequestParam("file") MultipartFile file) {
+        //检查签到
+        R result = checkSignInOrOut(id);
+        if (result.getCode() != HttpStatus.SUCCESS) {
+            return result;
+        }
         return checkService.checkAndCommit(code, file, id);
     }
 
@@ -81,10 +89,30 @@ public class SignInCheckController {
     public R checkInAll(@ApiParam("进出记录ID") @RequestParam("id") Long id,
                         @ApiParam("图片文件") @RequestParam("file") MultipartFile file,
                         @ApiParam("实验室ID") @RequestParam("subId") Long subId) {
+        //检查签到
+        R result = checkSignInOrOut(id);
+        if (result.getCode() != HttpStatus.SUCCESS) {
+            return result;
+        }
         return checkService.checkAndCommit(id, file, subId);
     }
 
 
+
+    /**
+     * 进入项验证:合并
+     *
+     * @param file 带验证图片
+     */
+    @ApiOperation(value = "进入项验证:合并,codes格式:1,2,3")
+    @PostMapping("/checkInXxpAll")
+    public R checkInXxpAll(@ApiParam("图片文件") @RequestParam("file") MultipartFile file,
+                        @ApiParam("实验室ID") @RequestParam("subId") Long subId) {
+
+        String id= UUID.fastUUID().toString();
+        return checkService.checkAndCommitXxp(id, file, subId);
+    }
+
     /**
      * 进入项验证:mock方法
      *
@@ -94,6 +122,11 @@ public class SignInCheckController {
     @ApiOperation(value = "进入项验证:mock方法")
     @PostMapping("/mock/{code}/{id}")
     public R checkInMock(@ApiParam("进出记录ID") @PathVariable("id") Long id, @ApiParam("验证类型编码") @PathVariable("code") String code, @RequestParam("file") MultipartFile file) {
+        //检查签到
+        R result = checkSignInOrOut(id);
+        if (result.getCode() != HttpStatus.SUCCESS) {
+            return result;
+        }
         return checkService.mockTest(code, file, id);
     }
 
@@ -127,11 +160,11 @@ public class SignInCheckController {
     @PostMapping("/alarmCallBack")
     public R fireCallBack(@RequestBody VideoRequestData videoRequestData) {
         Integer aid = videoRequestData.getAid();
-        if (aid!=null){
-            if (aid.equals(9610)){
-                logger.info("=====================>测试回调了。。。{}",videoRequestData.getAlgo_name());
+        if (aid != null) {
+            if (aid.equals(9610)) {
+                //logger.info("=====================>测试回调了。。。{}",videoRequestData.getAlgo_name());
                 checkService.sendAlarm(videoRequestData);
-            }else if (aid.equals(9690)){
+            } else if (aid.equals(9690)) {
                 checkService.playMp3();
             }
         }
@@ -163,4 +196,23 @@ public class SignInCheckController {
     public R checkFire(@ApiParam("图片文件") @RequestParam("file") MultipartFile file) {
         return R.ok(fireImageService.catchImage(file));
     }
+
+    /**
+     * 检查签到/签退
+     * @param id
+     * @return
+     */
+    private R checkSignInOrOut(Long id) {
+        //检查签到
+        Long value = redisService.getCacheObject(BaseConstants.SINGIN_id_KEY + id);
+        if (value != null) {
+            //刷新key
+            boolean expire = redisService.expire(BaseConstants.SINGIN_id_KEY + id, BaseConstants.SINGIN_OUT_TIME);
+            if (!expire) {
+                return R.fail(600, "签到&签出已超时,请刷卡重试!");
+            }
+            return R.ok();
+        }
+        return R.fail(600, "签到&签出已超时,请刷卡重试!");
+    }
 }

+ 59 - 0
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/domain/AlgorithmResponseResult.java

@@ -0,0 +1,59 @@
+package com.zd.alg.forward.domain;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>算法服务响应结果</p>
+ *
+ * @author linft
+ * @version 1.0
+ * @date 3/13/2023
+ */
+@Data
+public class AlgorithmResponseResult {
+
+    /**
+     * 响应code
+     */
+    private Long code;
+
+    /**
+     * 响应msg
+     */
+    private String message;
+
+    /**
+     * 是否验证通过
+     */
+    private Boolean isPass;
+
+
+    private String aid;
+
+    /**
+     * 识别cid
+     */
+    private String cid;
+
+    /**
+     * 识别图片
+     */
+    private String srcImage;
+
+    /**
+     * 响应识别图片
+     */
+    private String retImage;
+
+    /**
+     * 对象
+     */
+    private List<Object> objects;
+
+    /**
+     * 响应body
+     */
+    private String responseBody;
+}

+ 239 - 305
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/serivce/CheckService.java

@@ -3,7 +3,6 @@ package com.zd.alg.forward.serivce;
 import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.RandomUtil;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.zd.alg.forward.config.AlgorithmYml;
 import com.zd.alg.forward.domain.*;
@@ -23,6 +22,7 @@ import com.zd.common.core.utils.ServletUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.laboratory.api.feign.RemoteLaboratoryService;
 import com.zd.model.constant.BaseConstants;
+import com.zd.model.constant.HttpStatus;
 import com.zd.model.constant.SecurityConstants;
 import com.zd.model.domain.R;
 import com.zd.model.entity.Algorithm;
@@ -56,11 +56,6 @@ public class CheckService {
     Logger logger = LoggerFactory.getLogger(CheckService.class);
     @Resource(name = "restTemplateLocal")
     private RestTemplate restTemplateLocal;
-    /**
-     * 上传文件存储在本地的根路径
-     */
-    @Value("${file.path:/home/AIPIC}")
-    private String localFilePath;
 
     @Autowired
     private AlgorithmYml algorithmYml;
@@ -95,15 +90,9 @@ public class CheckService {
     public R checkAndCommit(Long id, MultipartFile file, Long subId) {
         try {
             int alarmNum = 0;
-            //========= 请求超时验证部分开始 ===========
-            //600 则代表退出验证流程 需要重新刷卡
-            R<Long> fail = getObjectR(id);
-            if (fail.getCode() != 200) {
-                return fail;
-            }
             //根据实验室id查询检查项
             R<Map<Object, Object>> subject = laboratoryService.getCheckInfo(subId);
-            if (subject.getCode() != 200) {
+            if (subject.getCode() != HttpStatus.SUCCESS) {
                 return subject;
             }
             Map<Object, Object> map = subject.getData();
@@ -114,8 +103,7 @@ public class CheckService {
             //上传原始图片
             String orgImgUrl = "";
             R<SysFile> r = remoteFileService.upload(file);
-            //logger.info("【调用算法服务】 原文件上传结果:"+JSONObject.toJSONString(r));
-            if (r.getCode() == 200) {
+            if (r.getCode() == HttpStatus.SUCCESS) {
                 orgImgUrl = r.getData().getUrl();
             }
             String labSkipped = "0";
@@ -139,59 +127,193 @@ public class CheckService {
                 //添加一条算法请求记录
                 R alg = insertRequestRecordLog(orgImgUrl, subId, checkValid);
                 logger.info("【调用算法服务】 添加算法调用日志,添加结果:"+JSONObject.toJSONString(alg));
+
+                //请求算法服务
                 ImgPostResponse<AnalysisReturnData> send = HttpUtils.sendV5(restTemplateLocal, files, algorithmYml);
-                //算法记录更新
+                AlgorithmResponseResult responseResult = getResponseResult(send);
+                //添加成功,更新算法日志记录
                 if (alg.getCode() == 200) {
-                    try {
-                        updateRequestRecordLog(alg.getData() != null?Long.valueOf(alg.getData()+""):null, send);
-                        logger.info("【调用算法服务】 更新算法调用日志");
-                    } catch (Exception e) {
-                        logger.error("【调用算法服务】 更新日志异常,异常信息",e);
-                    }
+                    updateRequestRecordLog(alg.getData() != null?Long.valueOf(alg.getData()+""):null, responseResult);
+                    logger.info("【调用算法服务】 更新算法调用日志记录");
                 }
                 //判断算法
-                if (send == null || send.getStatus_code() != 1000) {
+                if (responseResult.getCode() == 1000) {
+                    //通过
+                    if (responseResult.getIsPass()) {
+                        alarmNum++;
+                    } else {
+                        //不跳过
+                        if (StringUtils.isNotEmpty(labSkipped) && labSkipped.equals("1")) {
+                            //如果没有通过则次数加一
+                            //键为前缀+签到id +下划线+验证类型
+                            String key = BaseConstants.SINGIN_CHECK_JUMP_KEY  +id+ "_" + code;
+                            Long increment = redisTemplate.opsForValue().increment(key);
+                            redisService.expire(key, BaseConstants.SINGIN_OUT_TIME);
+                            if (increment != null && increment >= Integer.parseInt(labCheckCount)) {
+                                //黎晨这里让把跳过时状态码改为700,所以700的含义为检查失败并且跳过
+                                return R.fail(700, "符合跳过条件执行跳过");
+                            }
+                        }
+                        return R.fail(300, "算法识别未通过", code);
+                    }
+                    Boolean f = send.getStatus_code() == 1000;
+                    String msg = f ? "解析成功!" : "解析失败!";
+                    send(code, id, f, msg);
+                } else {
                     assert send != null;
                     logger.error("【调用算法服务】 算法服务调用失败,响应信息:"+ JSONObject.toJSONString(send));
                     return R.fail("算法服务错误,请重试!");
                 }
-                AnalysisReturnData data = send.getData();
-                Map<String, Object> result = (Map<String, Object>) data.getResult();
-                Map<String, Object> algorithmData = (Map<String, Object>) result.get("algorithm_data");
-                Map<String, Object> modelResult = (Map<String, Object>) result.get("model_data");
-                List<Map<String, Object>> objects = (List<Map<String, Object>>) modelResult.get("objects");
-                logger.info("【调用算法服务】 算法请求日志打印:算法ID:{},请求结果:{}", code, algorithmData.getOrDefault("is_alert", ""));
-                //通过
-                if (algorithmData.getOrDefault("is_alert", "").toString().equals("false") && !objects.isEmpty()) {
-                    alarmNum++;
-                } else {
-                    //不跳过
-                    if (StringUtils.isNotEmpty(labSkipped) && labSkipped.equals("1")) {
-                        //如果没有通过则次数加一
-                        //键为前缀+签到id +下划线+验证类型
-                        String key = BaseConstants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
-                        Long increment = redisTemplate.opsForValue().increment(key);
-                        redisService.expire(key, BaseConstants.SINGIN_OUT_TIME);
-                        if (increment != null && increment >= Integer.parseInt(labCheckCount)) {
-                            //黎晨这里让把跳过时状态码改为700,所以700的含义为检查失败并且跳过
-                            return R.fail(700, "符合跳过条件执行跳过");
+            }
+            if (alarmNum == checkItem.length) {
+                return R.ok();
+            }
+        } catch (Exception e) {
+            logger.error("【调用算法服务】 算法服务调用发生异常", e);
+        }
+        return R.fail();
+    }
+
+
+    /**
+     * 合并检查 三合一套餐
+     */
+    public R checkAndCommitXxp(String id, MultipartFile file, Long subId) {
+        try {
+            int alarmNum = 0;
+            //根据实验室id查询检查项
+            R<Map<Object, Object>> subject = laboratoryService.getCheckInfo(subId);
+            if (subject.getCode() != HttpStatus.SUCCESS) {
+                return subject;
+            }
+            Map<Object, Object> map = subject.getData();
+            Object labCheckInObj = map.get("inspectCheckIn");
+            if (StringUtils.isNull(labCheckInObj)) {
+                return R.fail(700, "未配置检查项");
+            }
+            //上传原始图片
+            String orgImgUrl = "";
+            R<SysFile> r = remoteFileService.upload(file);
+            if (r.getCode() == HttpStatus.SUCCESS) {
+                orgImgUrl = r.getData().getUrl();
+            }
+            String labSkipped = "0";
+            String labCheckCount = "2";
+            Object labSkippedObj = map.get("inspectSkipped");
+            if (StringUtils.isNotNull(labSkippedObj)) {
+                labSkipped = String.valueOf(labSkippedObj);
+            }
+            Object labCheckCountObj = map.get("inspectCheckCount");
+            if (StringUtils.isNotNull(labCheckCountObj)) {
+                labCheckCount = String.valueOf(labCheckCountObj);
+            }
+            String labCheckIn = String.valueOf(labCheckInObj);
+            String[] checkItem = labCheckIn.split(",");
+            File toFile = multipartFileToFile(file);
+            for (String code : checkItem) {
+                //========= 获取算法INFO ===========
+                AlgorithmYml.CheckValid checkValid = algorithmYml.getCheckValid(Integer.valueOf(code));
+                MultiValueMap<String, Object> params = getStringObjectMultiValueMap(checkValid, String.valueOf(id));
+                HttpEntity<MultiValueMap<String, Object>> files = getHttpEntityMap(toFile, params);
+                //添加一条算法请求记录
+                R alg = insertRequestRecordLog(orgImgUrl, subId, checkValid);
+                logger.info("【调用算法服务】 添加算法调用日志,添加结果:"+JSONObject.toJSONString(alg));
+
+                //请求算法服务
+                ImgPostResponse<AnalysisReturnData> send = HttpUtils.sendV5(restTemplateLocal, files, algorithmYml);
+                AlgorithmResponseResult responseResult = getResponseResult(send);
+                //添加成功,更新算法日志记录
+                if (alg.getCode() == 200) {
+                    updateRequestRecordLog(alg.getData() != null?Long.valueOf(alg.getData()+""):null, responseResult);
+                    logger.info("【调用算法服务】 更新算法调用日志记录");
+                }
+                //判断算法
+                if (responseResult.getCode() == 1000) {
+                    //通过
+                    if (responseResult.getIsPass()) {
+                        alarmNum++;
+                    } else {
+                        //不跳过
+                        if (StringUtils.isNotEmpty(labSkipped) && labSkipped.equals("1")) {
+                            //如果没有通过则次数加一
+                            //键为前缀+签到id +下划线+验证类型
+                            String key = BaseConstants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
+                            Long increment = redisTemplate.opsForValue().increment(key);
+                            redisService.expire(key, BaseConstants.SINGIN_OUT_TIME);
+                            if (increment != null && increment >= Integer.parseInt(labCheckCount)) {
+                                //黎晨这里让把跳过时状态码改为700,所以700的含义为检查失败并且跳过
+                                return R.fail(700, "符合跳过条件执行跳过");
+                            }
                         }
+                        return R.fail(300, "算法识别未通过", code);
                     }
-                    return R.fail(300, "算法识别未通过", code);
+                } else {
+                    assert send != null;
+                    //logger.error("【调用算法服务】 算法服务调用失败,响应信息:"+ JSONObject.toJSONString(send));
+                    return R.fail("算法服务错误,请重试!");
                 }
-                Boolean f = send.getStatus_code() == 1000;
-                String msg = f ? "解析成功!" : "解析失败!";
-                send(code, id, f, msg);
             }
             if (alarmNum == checkItem.length) {
                 return R.ok();
             }
         } catch (Exception e) {
-            logger.error("【算法服务异常】异常信息",e);
+            logger.error("【调用算法服务】 算法服务调用发生异常", e);
         }
         return R.fail();
     }
 
+
+    /**
+     * 获取响应结果
+     * @param send
+     * @return
+     */
+    private AlgorithmResponseResult getResponseResult(ImgPostResponse<AnalysisReturnData> send) {
+        AlgorithmResponseResult responseResult = new AlgorithmResponseResult();
+        if (send != null) {
+            responseResult.setCode(send.getStatus_code());
+            responseResult.setMessage(send.getMessage());
+            if (send.getStatus_code() == 1000 && send.getData() != null) {
+                AnalysisReturnData data = send.getData();
+                responseResult.setAid(data.getAid());
+                responseResult.setCid(data.getCid());
+                responseResult.setRetImage(data.getRet_image());
+                responseResult.setSrcImage(data.getSrc_image());
+                //检查结果
+                Map<String, Object> result = (Map<String, Object>) data.getResult();
+                Map<String, Object> algorithmData = (Map<String, Object>) result.get("algorithm_data");
+                Map<String, Object> modelResult = (Map<String, Object>) result.get("model_data");
+                List<Object> objects = (List<Object>) modelResult.get("objects");
+                //是否验证通过
+                //算法厂家技术人员前期要添加objects判断精准性,后面对接人员要让去掉对objects的判断
+                if (algorithmData.getOrDefault("is_alert", "").toString().equals("false") && !objects.isEmpty()) {
+                    //不报警,代表验证通过
+                    responseResult.setIsPass(Boolean.TRUE);
+                } else {
+                    //报警,代表不通过
+                    responseResult.setIsPass(Boolean.FALSE);
+                }
+                responseResult.setObjects(objects);
+                //存响应实体数据,去掉图片
+                data.setRet_image("");
+                data.setSrc_image("");
+                ImgPostResponse<AnalysisReturnData> response = new ImgPostResponse<>();
+                response.setData(data);
+                response.setStatus_code(send.getStatus_code());
+                response.setMessage(send.getMessage());
+                responseResult.setResponseBody(JSONObject.toJSONString(response));
+            } else {
+                responseResult.setResponseBody(JSONObject.toJSONString(send));
+            }
+        } else {
+            responseResult.setCode(0L);
+            responseResult.setMessage("算法服务未响应");
+            responseResult.setResponseBody("算法服务未响应");
+        }
+        logger.info("【调用算法服务】 算法服务请求结果:code = {}, message = {}, isPass = {}", responseResult.getCode(), responseResult.getMessage(), responseResult.getIsPass());
+        return responseResult;
+    }
+
     /**
      * 添加日志记录
      * @param fileUrl
@@ -213,96 +335,74 @@ public class CheckService {
     /**
      * 算法调用日志更新
      * @param id
-     * @param send
+     * @param responseResult
      */
-    private void updateRequestRecordLog(Long id,ImgPostResponse<AnalysisReturnData> send) {
-        Algorithm algorithm = new Algorithm();
-        algorithm.setId(id);
-        //请求成功
-        if (send != null && send.getStatus_code() == 1000) {
-            AnalysisReturnData data =  send.getData();
-            //识别后的图片
-            String picture = data.getRet_image();
-            String header = "data:image/jpeg;base64,"+picture;
-            MultipartFile multipartFile = Base64DecodedMultipartFile.base64ToMultipart(header);
-            R<SysFile> sysFileR = remoteFileService.upload(multipartFile);
-            String imageUrl = sysFileR.getData().getUrl();
-            algorithm.setAlgorithmResult(imageUrl);
-            //识别id
-            algorithm.setSignId(Long.parseLong(data.getCid()));
-            //是否报警
-            Map<String, Object> result =(Map<String, Object>)data.getResult();
-            Map<String, Object> algorithmData = (Map<String, Object>) result.get("algorithm_data");
-            Map<String, Object> modelResult = (Map<String, Object>) result.get("model_data");
-            List<Map<String, Object>> objects = (List<Map<String, Object>>) modelResult.get("objects");
-            if(algorithmData.getOrDefault("is_alert", "").toString().equals("false") && objects.size()>0){
-                algorithm.setIsAlarm(0);
-            }else{
-                algorithm.setIsAlarm(1);
+    private void updateRequestRecordLog(Long id, AlgorithmResponseResult responseResult) {
+        try {
+            Algorithm algorithm = new Algorithm();
+            algorithm.setId(id);
+            if (responseResult.getCode() == 1000) {
+                //识别后的图片
+                String picture = responseResult.getRetImage();
+                String header = "data:image/jpeg;base64," + picture;
+                MultipartFile multipartFile = Base64DecodedMultipartFile.base64ToMultipart(header);
+                R<SysFile> sysFileR = remoteFileService.upload(multipartFile);
+                String imageUrl = sysFileR.getData().getUrl();
+                algorithm.setAlgorithmResult(imageUrl);
+                //识别id
+                algorithm.setSignId(Long.parseLong(responseResult.getCid()));
+                //是否通过
+                algorithm.setIsAlarm(responseResult.getIsPass()?0:1);
+                algorithm.setStatus(1);
+
+            } else {
+                algorithm.setStatus(0);
             }
-            algorithm.setStatus(1);
-        } else {
-            algorithm.setStatus(0);
-        }
-        //存原始数据
-        AnalysisReturnData respData = send != null?send.getData():null;
-        if (respData != null) {
-            respData.setRet_image("Removed to save respBody");
-            respData.setSrc_image("Removed to save respBody");
-            ImgPostResponse<AnalysisReturnData> response = new ImgPostResponse<>();
-            response.setData(respData);
-            response.setStatus_code(send.getStatus_code());
-            response.setMessage(send.getMessage());
-            algorithm.setRespData(JSONObject.toJSONString(response));
-            algorithm.setRespCode(send.getStatus_code());
+            //存响应实体数据
+            algorithm.setRespData(responseResult.getResponseBody());
+            algorithm.setRespCode(responseResult.getCode());
+            algorithm.setUpdateTime(new Date());
+            //logger.info("【算法服务】 更新日志实体信息:"+JSONObject.toJSONString(algorithm));
+            laboratoryService.update(algorithm);
+        } catch (Exception e) {
+            logger.error("【调用算法服务】调用算法服务后,更新日志记录发生异常", e);
         }
-        algorithm.setUpdateTime(new Date());
-        //logger.info("【算法服务】 更新日志实体信息:"+JSONObject.toJSONString(algorithm));
-        laboratoryService.update(algorithm);
     }
 
     /**
      * @param id 进出记录ID
      */
     public R checkAndCommit(String code, MultipartFile file, Long id) {
-        //========= 请求超时验证部分开始 ===========
-        //600 则代表退出验证流程 需要重新刷卡
-        R<Long> fail = getObjectR(id);
-        if (fail.getCode() != 200) {
-            return fail;
+        //上传原始图片
+        String orgImgUrl = "";
+        R<SysFile> r = remoteFileService.upload(file);
+        if (r.getCode() == HttpStatus.SUCCESS) {
+            orgImgUrl = r.getData().getUrl();
         }
-        //========= 请求超时验证部分结束 ===========
         //========= 获取算法INFO ===========
         AlgorithmYml.CheckValid checkValid = algorithmYml.getCheckValid(Integer.valueOf(code));
-        //=========发送验证信息到算法服务开始
-        JSONObject send = null;
-        try {
-            send = send(file, checkValid, id);
-        } catch (Exception e) {
-            logger.error(e.getMessage());
-            e.printStackTrace();
+        //添加一条算法请求记录
+        R alg = insertRequestRecordLog(orgImgUrl, 0L, checkValid);
+        logger.info("【调用算法服务】 添加算法调用日志,添加结果:"+JSONObject.toJSONString(alg));
+
+        File toFile = multipartFileToFile(file);
+        //请求算法服务
+        MultiValueMap<String, Object> params = getStringObjectMultiValueMap(checkValid, String.valueOf(id));
+        HttpEntity<MultiValueMap<String, Object>> files = getHttpEntityMap(toFile, params);
+        ImgPostResponse<AnalysisReturnData> send = HttpUtils.sendV5(restTemplateLocal, files, algorithmYml);
+        AlgorithmResponseResult responseResult = getResponseResult(send);
+        //添加成功,更新算法日志记录
+        if (alg.getCode() == 200) {
+            updateRequestRecordLog(alg.getData() != null?Long.valueOf(alg.getData()+""):null, responseResult);
+            logger.info("【调用算法服务】 更新算法调用日志记录");
         }
-        //=========发送验证信息到算法服务结束
-        //=========算法服务返回结果验证开始
-        R apply = R.fail("算法服务错误,请重试!");
-        Boolean f = false;
-        try {
-            if (send == null || send.getInteger("status_code") != 1000L) {
-                apply = R.fail("算法服务错误,请重试!");
-                return apply;
-            }
-            Map<String, Object> result = null;
-            try {
-                result = send.getJSONObject("data").getJSONObject("result").getInnerMap();
-            } catch (Exception e) {
-                e.printStackTrace();
-                apply = R.fail("算法服务返回数据错误,请联系管理员!");
-                return apply;
-            }
-            //todo  获取 检测结果
-            apply = checkValid.getCheckResultValid().apply(result);
-            f = apply.getCode() == 200;
-            if (!f && algorithmYml.getJumpThreshold() != -1) {
+        //插入记录数据,异步请求远程接口
+        String msg = (responseResult.getCode() == 1000 && responseResult.getIsPass())?"解析成功":"解析失败";
+        send(code, id, responseResult.getIsPass(), msg);
+        //判断算法
+        if (responseResult.getCode() == 1000) {
+            boolean isPass = responseResult.getIsPass();
+            if (!isPass && algorithmYml.getJumpThreshold() != -1) {
                 //如果没有通过则次数加一
                 //键为前缀+签到id +下划线+验证类型
                 String key = BaseConstants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
@@ -310,47 +410,18 @@ public class CheckService {
                 redisService.expire(key, BaseConstants.SINGIN_OUT_TIME);
                 if (increment >= algorithmYml.getJumpThreshold()) {
                     //黎晨这里让把跳过时状态码改为700,所以700的含义为检查失败并且跳过
-                    apply.setCode(700);
+                    return R.fail(700,"算法服务错误,请重试!");
                 }
             }
-        } catch (Exception ex) {
-            ex.printStackTrace();
-            apply = R.fail("算法服务返回数据错误,请联系管理员!");
-            return apply;
-        } finally {
-           //无论成功失败,插入记录数据,异步请求远程接口
-            send(code, id, f, apply.getMsg());
-        }
-        //=========算法服务返回结果验证结束
-        logger.info(apply.toString());
-        if (apply.getCode() == 200) {
-            //加奖励分
-            // laboratoryService.addRecord();
-        }
-        return apply;
-    }
-
-    /**
-     * 三合一
-     *
-     * @param ids
-     * @param file
-     * @param codes
-     * @return
-     */
-    public R<Map<Object, String>> checkInAll(Long[] ids, MultipartFile file[], String codes) {
-        Map<Object, String> result = new HashMap<>();
-        String[] codesArrs = codes.split(",");
-        for (int i = 0; i < codesArrs.length; i++) {
-            R r = checkAndCommit(codesArrs[i], file[i], ids[i]);
-            AlgorithmYml.CheckValid checkValid = algorithmYml.getCheckValid(Integer.valueOf(codesArrs[i]));
-            result.put(checkValid.getAlgoId(), r.getMsg() == null ? "通过" : r.getMsg());
-
+            if (responseResult.getIsPass()) {
+                //加奖励分
+                // laboratoryService.addRecord();
+            }
+            return R.ok();
         }
-        return R.ok(result);
+        return R.fail("算法服务错误,请重试!");
     }
 
-
     public Algorithm Covert(Map<String, Object> data) {
         Algorithm algorithm = new Algorithm();
         algorithm.setAlgorithmType(data.get("type").toString());
@@ -363,23 +434,6 @@ public class CheckService {
         return algorithm;
     }
 
-    public Algorithm CovertV5(Map<String, Object> data) {
-        Algorithm algorithm = new Algorithm();
-        algorithm.setId(Long.valueOf(data.get("id").toString()));
-        algorithm.setAlgorithmType(data.get("type").toString());
-        algorithm.setAlgorithmResult(data.get("src_img").toString());
-        algorithm.setSubId(Long.valueOf(data.get("aid").toString()));
-        algorithm.setSignId(Long.valueOf(data.get("cid").toString()));
-        algorithm.setAlgorithmName(data.get("algorithmName").toString());
-        algorithm.setIsAlarm(Integer.parseInt(data.get("isAlarm").toString()));
-        algorithm.setOriginalImg(data.get("originalImg").toString());
-        algorithm.setRespData(data.get("requestData").toString());
-        algorithm.setUpdateTime(new Date());
-        algorithm.setStatus(0);
-        return algorithm;
-    }
-
-
     /**
      * @param algorithmResult
      * @param type
@@ -454,25 +508,8 @@ public class CheckService {
     }
 
 
-    private R<Long> getObjectR(Long id) {
-        Long subId = redisService.getCacheObject(BaseConstants.SINGIN_id_KEY + id);
-        if (subId == null) {
-            return R.fail(600, "签到&签出已超时,请重新刷卡重试!");
-        }
-        //刷新key
-        boolean expire = redisService.expire(BaseConstants.SINGIN_id_KEY + id, 120);
-        if (!expire) {
-            return R.fail(600, "签到&签出已超时,请重新刷卡重试!");
-        }
-        return R.ok(subId);
-    }
-
     //给黎晨用的模拟方法 他让给他mock个方法测试
     public R mockTest(String code, MultipartFile file, Long id) {
-        R<Long> objectR = getObjectR(id);
-        if (objectR.getCode() != 200) {
-            return objectR;
-        }
         //随机成功或失败
         Boolean f = RandomUtil.randomInt(0, 2) == 0;
         //无论成功失败,插入记录数据,异步请求远程接口
@@ -494,7 +531,6 @@ public class CheckService {
 
     }
 
-
     public void send(String code, Long id, Boolean f, String msg) {
         String token = Objects.requireNonNull(ServletUtils.getRequest()).getHeader(SecurityConstants.TOKEN_AUTHENTICATION);
         if (CharSequenceUtil.isBlank(token)) {
@@ -504,26 +540,6 @@ public class CheckService {
     }
 
     /**
-     * 获取算法请求地址
-     *
-     * @param checkValid
-     * @param id
-     * @return
-     */
-    private String getPostUrl(AlgorithmYml.CheckValid checkValid, Long id) {
-        //设置请求体,注意是LinkedMultiValueMap
-        MultiValueMap<String, Object> params = getStringObjectMultiValueMap(checkValid, String.valueOf(id));
-        Set<String> keySet = params.keySet();
-        StringBuffer stb = new StringBuffer();
-        for (String key : keySet) {
-            stb.append("&" + key + "=" + params.get(key).get(0).toString());
-        }
-        String paramUrl = algorithmYml.getImgPostUrl() + String.valueOf(stb).replaceFirst("&", "?");
-        logger.info(paramUrl);
-        return paramUrl;
-    }
-
-    /**
      * 图片算法请求参数
      *
      * @param file
@@ -531,17 +547,13 @@ public class CheckService {
      * @return
      * @throws IOException
      */
-
-    public JSONObject send(MultipartFile file, AlgorithmYml.CheckValid checkValid, Long id) throws IOException {
+    public JSONObject send(MultipartFile file, AlgorithmYml.CheckValid checkValid, Long id) {
         //设置请求头
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.MULTIPART_FORM_DATA);
-        File uploadFile = null;
         try {
-            // 文件本地存储收集
-            FileUploadUtils.upload(localFilePath, file);
             //MultipartFile 转为临时文件
-            uploadFile = multipartFileToFile(file);
+            File uploadFile = multipartFileToFile(file);
             //文件转为文件系统资源
             FileSystemResource fileSystemResource = new FileSystemResource(uploadFile);
             //设置请求体,注意是LinkedMultiValueMap
@@ -552,15 +564,13 @@ public class CheckService {
             //用HttpEntity封装整个请求报文
             HttpEntity<MultiValueMap<String, Object>> files = new HttpEntity<>(params, headers);
             String paramUrl = algorithmYml.getImgPostUrl();
-            logger.info(paramUrl);
+            //logger.info(paramUrl);
             JSONObject body = restTemplateLocal.postForObject(paramUrl, files, JSONObject.class);
-            logger.info(body.toJSONString());
+            //logger.info(body.toJSONString());
             return body;
-        } finally {
-            //删除临时文件
-//            if (uploadFile != null) {
-//                uploadFile.delete();
-//            }
+        } catch (Exception e){
+            logger.error("【算法服务】 send方法执行异常,异常信息:",e);
+            return null;
         }
     }
 
@@ -592,80 +602,4 @@ public class CheckService {
             return null;
         }
     }
-
-    /**
-     * 存储数据
-     *
-     * @param send
-     * @param checkValid
-     */
-    private R saveAlgorithm(ImgPostResponse<DataPostAnalysisRespDto> send, AlgorithmYml.CheckValid checkValid) {
-        DataPostAnalysisRespDto analysisRespDto = send.getData();
-        List<AnalysisData> analysisDatas = analysisRespDto.getAnalysisDatas();
-        if (!analysisDatas.isEmpty()) {
-            for (AnalysisData data : analysisDatas) {
-                String picture = data.getRet_image();
-                String header = "data:image/jpeg;base64," + picture;
-                MultipartFile multipartFile = Base64DecodedMultipartFile.base64ToMultipart(header);
-                R<SysFile> sysFileR = remoteFileService.upload(multipartFile);
-                String imageUrl = sysFileR.getData().getUrl();
-                Map<String, Object> result = (Map<String, Object>) data.getResult();
-                Map<String, Object> map = new HashMap<>();
-                Map<String, Object> algorithmData = (Map<String, Object>) result.get("algorithm_data");
-                Map<String, Object> modelResult = (Map<String, Object>) result.get("model_data");
-                List<Map<String, Object>> objects = (List<Map<String, Object>>) modelResult.get("objects");
-                if (algorithmData.getOrDefault("is_alert", "").toString().equals("false") && objects.size() > 0) {
-                    map.put("isAlarm", 0);
-                } else {
-                    map.put("isAlarm", 1);
-                }
-                map.put("did", checkValid.getDid());
-                map.put("aid", checkValid.getAlgoId());
-                map.put("src_img", imageUrl);
-                map.put("type", "image");
-                map.put("algorithmName", checkValid.getAlgorithmName());
-                return laboratoryService.saveData(Covert(map));
-            }
-        }
-        logger.error("接口数据返回异常");
-        throw new ServiceException("接口数据返回异常");
-    }
-
-
-    /**
-     * 存储数据
-     * @param send
-     * @param checkValid
-     */
-    private R saveAlgorithmV5(Long id,MultipartFile file,ImgPostResponse<AnalysisReturnData> send,AlgorithmYml.CheckValid checkValid){
-        String picture = send.getData().getRet_image();
-        String header = "data:image/jpeg;base64,"+picture;
-        MultipartFile multipartFile = Base64DecodedMultipartFile.base64ToMultipart(header);
-        R<SysFile> sysFileR = remoteFileService.upload(multipartFile);
-        String imageUrl = sysFileR.getData().getUrl();
-        logger.info("==================================imageUrl:"+imageUrl);
-        AnalysisReturnData data =  send.getData();
-        Map<String, Object> map =new HashMap<>();
-        Map<String, Object> result =(Map<String, Object>)data.getResult();
-        Map<String, Object> algorithmData = (Map<String, Object>) result.get("algorithm_data");
-        Map<String, Object> modelResult = (Map<String, Object>) result.get("model_data");
-        List<Map<String, Object>> objects = (List<Map<String, Object>>) modelResult.get("objects");
-        if(algorithmData.getOrDefault("is_alert", "").toString().equals("false") && objects.size()>0){
-            map.put("isAlarm", 0);
-        }else{
-            map.put("isAlarm", 1);
-        }
-        map.put("isAlarm", 1);
-        map.put("aid", data.getAid());
-        map.put("cid", data.getCid());
-        map.put("src_img", imageUrl);
-        //map.put("originalImg", originalUrl);
-        map.put("type", "image");
-        map.put("algorithmName", checkValid.getAlgorithmName());
-        map.put("id",id);
-        map.put("requestData", JSONObject.toJSONString(send));
-        logger.info("=======================map.tostring()"+map.toString());
-        return laboratoryService.saveAlgorithmData(CovertV5(map));
-       // return laboratoryService.update(CovertV5(map));
-    }
 }

+ 0 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/serivce/FireImageService.java

@@ -118,7 +118,6 @@ public class FireImageService {
             return;
         }
         DataPostAnalysisRespDto data = send.getData();
-
         List<AnalysisData> analysisDatas = data.getAnalysisDatas();
         AnalysisData analysisData = analysisDatas.get(0);
         int code = analysisData.getCode();

+ 19 - 15
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/utils/HttpUtils.java

@@ -52,15 +52,18 @@ public class HttpUtils {
         return new HttpEntity<>(form, headers);
     }
 
-    public static File multipartFileToFile(MultipartFile file) throws IOException {
-        String originalFilename = file.getOriginalFilename() == null ? "" : file.getOriginalFilename();
-        assert originalFilename!=null;
-        String[] filename = originalFilename.split("\\.");
-        File toFile = File.createTempFile(filename[0], "." + filename[1]);
-        file.transferTo(toFile);
-        //log.info("================>{}",toFile.getAbsoluteFile());
-        //toFile.deleteOnExit();//在jvm 退出时删除
-        return toFile;
+    public static File multipartFileToFile(MultipartFile file) {
+        try {
+            String originalFilename = file.getOriginalFilename() == null ? "" : file.getOriginalFilename();
+            assert originalFilename!=null;
+            String[] filename = originalFilename.split("\\.");
+            File toFile = File.createTempFile(filename[0], "." + filename[1]);
+            file.transferTo(toFile);
+            return toFile;
+        } catch (Exception e) {
+            log.error("【文件转换】 MultipartFile 转 File 异常");
+        }
+        return null;
     }
 
     /**
@@ -129,16 +132,17 @@ public class HttpUtils {
         return null;
     }
 
+    /**
+     * 调用算法服务
+     * @param restTemplate
+     * @param files
+     * @param algorithmYml
+     * @return
+     */
     public static ImgPostResponse<AnalysisReturnData> sendV5(RestTemplate restTemplate, HttpEntity<MultiValueMap<String, Object>> files, AlgorithmYml algorithmYml) {
         ParameterizedTypeReference<ImgPostResponse<AnalysisReturnData>> reference = new ParameterizedTypeReference<ImgPostResponse<AnalysisReturnData>>() {
         };
         ResponseEntity<ImgPostResponse<AnalysisReturnData>> response = restTemplate.exchange(algorithmYml.getImgPostUrl(), HttpMethod.POST, files, reference);
-        if (response.getStatusCode() != HttpStatus.OK) {
-            log.error("算法服务请求异常,请查看算服务器");
-        }
-        if (response.getBody() == null) {
-            log.error("算法服务接口返回异常");
-        }
         return response.getBody();
     }
 }

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java

@@ -409,7 +409,7 @@ public class SIPCommander implements ISIPCommander {
 				}
 			}
 			//验证1:获取码流
-			//content.append("a="+MediaStream.getMediaStreamA(dpi)+"\r\n");
+			//content.append("a="+MediaStream.getMe diaStreamA(dpi)+"\r\n");
 			content.append("y="+ssrcInfo.getSsrc()+"\r\n");//ssrc
 			//验证2:设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
 			content.append("f="+MediaStream.getMediaStreamF(dpi)+"\r\n");

+ 6 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/onvif/impl/ONVIFServerIMpl.java

@@ -12,11 +12,11 @@ import be.teletask.onvif.models.OnvifMediaProfile;
 import be.teletask.onvif.models.OnvifServices;
 import be.teletask.onvif.responses.OnvifResponse;
 import com.alibaba.fastjson.JSONObject;
-import com.zd.alg.iot.vmp.service.IStreamProxyService;
 import com.zd.alg.iot.vmp.media.zlm.dto.MediaServerItem;
 import com.zd.alg.iot.vmp.media.zlm.dto.StreamProxyItem;
 import com.zd.alg.iot.vmp.onvif.IONVIFServer;
 import com.zd.alg.iot.vmp.onvif.dto.ONVIFCallBack;
+import com.zd.alg.iot.vmp.service.IStreamProxyService;
 import okhttp3.FormBody;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
@@ -24,6 +24,7 @@ import okhttp3.Response;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.io.File;
@@ -42,6 +43,10 @@ public class ONVIFServerIMpl implements IONVIFServer {
 
     @Autowired
     private IStreamProxyService streamProxyService;
+    @Value("${file.path}")
+    private String rootPath;
+    @Value("${file.prefix}")
+    private String prefixPath;
 
     @Override
     public void search(int timeout, ONVIFCallBack<List<String>> callBack) {
@@ -188,8 +193,6 @@ public class ONVIFServerIMpl implements IONVIFServer {
         String separator= File.separator;
         SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
         String strTime=simpleDateFormat.format(new Date());
-        String rootPath="/home/upload";
-        String prefixPath="statics";
         String joinPath=separator+"record"+separator+param.get("app")+separator+param.get("stream")+separator+strTime+separator;
         String urlPath=rootPath+joinPath;
         String returnPath=prefixPath+joinPath;

+ 5 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/onvif/ONVIFController.java

@@ -171,7 +171,11 @@ public class ONVIFController {
                     resultData.setMsg("视频录制中无法重复录制!");
                 }else{
                     JSONObject object=onvifServer.startRecord(mediaServerItem,map);
-                    resultData.setCode(object.getInteger("code"));
+                    if(object.getInteger("code")==0){
+                        resultData.setCode(200);
+                    }else{
+                        resultData.setCode(object.getInteger("code"));
+                    }
                     resultData.setData(object.getString("result"));
                     resultData.setMsg(object.getString("msg"));
                 }

+ 50 - 45
zd-modules/zd-algorithm/src/main/java/com/zd/alg/monitor/HardwareDeviceMonitor.java

@@ -52,59 +52,64 @@ public class HardwareDeviceMonitor {
 
     @Scheduled(cron = "0 */9 * * * ?")
     public void checkPowerUse() {
-        if (dingTalkNotice != null && dingTalkNotice) {
-            log.info("【设备监听提醒】 开始执行检查..............");
-            ResultData result = remoteLabHardwareService.statistics();
-            if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
-                String jsonStr = JSONObject.toJSONString(result.getData());
-                JSONObject json = JSONObject.parseObject(jsonStr);
-                Integer offline = json.getInteger("powerSupplyOffline");
-                log.info("【设备监听提醒】 异常设备掉线数量:" + offline);
-                if (offline != null && offline > 0) {
-                    //获取离线列表
-                    ResultData data = remoteLabHardwareService.list("SWITCH", "OFFLINE");
-                    //log.info("【设备监听提醒】 获取异常列表:"+JSONObject.toJSONString(data));
-                    if (data != null && data.getCode() == HttpStatus.SUCCESS && data.getData() != null) {
-                        //log.info("【设备监听提醒】 异常设备列表信息:" + data.getData());
-                        String listStr = JSONObject.toJSONString(data.getData());
-                        List<Map<String, Object>> list = JSONObject.parseObject(listStr, List.class);
-                        if (list != null && list.size() > 0) {
-                            Map<String, String> map = new HashMap<>();
-                            for (Map m : list) {
-                                String code = (String) m.get("relayCode");
-                                if (!map.containsKey(code)) {
-                                    map.put(code, "---信息[名称:" +
-                                            "" + m.get("name") + ",所在学院:" + m.get("deptName") + ",所在实验室:" + m.get("subjectName") + "]\n");
-                                }
-                            }
-                            //封装消息
-                            if (!map.isEmpty()) {
-                                Set<String> code = map.keySet();
-                                StringBuffer buffer = new StringBuffer();
-                                buffer.append("系统接入继电器设备离线信息:\n");
-                                boolean isSend = Boolean.FALSE;
-                                for (String key : code) {
-                                    Integer num = redisService.getCacheObject(redisPrefix+key);
-                                    if (num != null && num > 2) {
-                                        buffer.append("继电器[" + key + "] " + map.get(key));
-                                        redisService.deleteObject(redisPrefix+key);
-                                        isSend = Boolean.TRUE;
-                                    } else {
-                                        int value = num == null ? 1:num+1;
-                                        redisService.setCacheObject(redisPrefix+key, value, expire, TimeUnit.MINUTES);
+        String lockKey = "electric-relay-monitor";
+        if (!redisService.isExistLock(lockKey)) {
+            //添加锁
+            redisService.lock(lockKey,180);
+            if (dingTalkNotice != null && dingTalkNotice) {
+                ResultData result = remoteLabHardwareService.statistics();
+                if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
+                    String jsonStr = JSONObject.toJSONString(result.getData());
+                    JSONObject json = JSONObject.parseObject(jsonStr);
+                    Integer offline = json.getInteger("powerSupplyOffline");
+                    log.info("【设备监听提醒】 继电器异常监控--掉线数量:" + offline);
+                    if (offline != null && offline > 0) {
+                        //获取离线列表
+                        ResultData data = remoteLabHardwareService.list("SWITCH", "OFFLINE");
+                        log.info("【设备监听提醒】 继电器异常监控--获取异常列表:" + JSONObject.toJSONString(data));
+                        if (data != null && data.getCode() == HttpStatus.SUCCESS && data.getData() != null) {
+                            //log.info("【设备监听提醒】 异常设备列表信息:" + data.getData());
+                            String listStr = JSONObject.toJSONString(data.getData());
+                            List<Map<String, Object>> list = JSONObject.parseObject(listStr, List.class);
+                            if (list != null && list.size() > 0) {
+                                Map<String, String> map = new HashMap<>();
+                                for (Map m : list) {
+                                    String code = (String) m.get("relayCode");
+                                    if (!map.containsKey(code)) {
+                                        map.put(code, "---信息[名称:" +
+                                                "" + m.get("name") + ",所在学院:" + m.get("deptName") + ",所在实验室:" + m.get("subjectName") + "]\n");
                                     }
                                 }
-                                //通知
-                                if (isSend) {
-                                    String msg = "{\"msgtype\": \"text\",\"text\": {\"content\":\"" + buffer.toString() + "\"}}";
-                                    DingTalkAlert.sendAlert(msg);
-                                    //log.info("【设备监听提醒】 钉钉通知响应:" + rs);
+                                //封装消息
+                                if (!map.isEmpty()) {
+                                    Set<String> code = map.keySet();
+                                    StringBuffer buffer = new StringBuffer();
+                                    buffer.append("系统接入继电器设备离线信息:\n");
+                                    boolean isSend = Boolean.FALSE;
+                                    for (String key : code) {
+                                        Integer num = redisService.getCacheObject(redisPrefix + key);
+                                        if (num != null && num > 2) {
+                                            buffer.append("继电器[" + key + "] " + map.get(key));
+                                            redisService.deleteObject(redisPrefix + key);
+                                            isSend = Boolean.TRUE;
+                                        } else {
+                                            int value = num == null ? 1 : num + 1;
+                                            redisService.setCacheObject(redisPrefix + key, value, expire, TimeUnit.MINUTES);
+                                        }
+                                    }
+                                    //通知
+                                    if (isSend) {
+                                        String resp = DingTalkAlert.sendAlert(buffer.toString());
+                                        log.info("【设备监听提醒】 继电器异常监控--钉钉通知响应:" + resp);
+                                    }
                                 }
                             }
                         }
                     }
                 }
             }
+            //释放锁
+            redisService.unLock(lockKey);
         }
     }
 }

+ 6 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/rfid/mapper/HardwareRfidMapper.java

@@ -1,19 +1,22 @@
 package com.zd.alg.rfid.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.zd.algorithm.api.rfid.domain.entity.HardwareRfid;
+import com.zd.algorithm.api.rfid.domain.vo.HardwareRfidVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 /**
-  * @创建人 hzw
-  * @描述
-  * @创建时间  2022/11/15
+ * @创建人 hzw
+ * @描述
+ * @创建时间 2022/11/15
  */
 @Mapper
 public interface HardwareRfidMapper extends BaseMapper<HardwareRfid> {
     int batchInsert(@Param("list") List<HardwareRfid> list);
 
+    Page<HardwareRfid> selectRfidInfo(@Param("page") Page<HardwareRfid> page, @Param("hardwareRfidVo") HardwareRfidVo hardwareRfidVo);
 }

+ 9 - 4
zd-modules/zd-algorithm/src/main/java/com/zd/alg/rfid/service/impl/HardwareRfidServiceImpl.java

@@ -84,14 +84,19 @@ public class HardwareRfidServiceImpl extends ServiceImpl<HardwareRfidMapper, Har
 
     @Override
     public Page<HardwareRfid> search(Page<HardwareRfid> page, HardwareRfidVo hardwareRfidVo) {
+        Page<HardwareRfid> hardwareRfidPage;
         if (StringUtils.isNotBlank(hardwareRfidVo.getSearchValue())) {
-            return baseMapper.selectPage(page, new LambdaQueryWrapper<HardwareRfid>().like(HardwareRfid::getHardwareNum, hardwareRfidVo.getSearchValue()).or().like(HardwareRfid::getDeptName, hardwareRfidVo.getSearchValue()).orderByDesc(HardwareRfid::getCreateTime));
+            hardwareRfidPage = baseMapper.selectRfidInfo(page, hardwareRfidVo);
+        } else {
+            HardwareRfid hardwareRfid = new HardwareRfid();
+            BeanUtils.copyProperties(hardwareRfidVo, hardwareRfid);
+            hardwareRfidPage = baseMapper.selectPage(page, new LambdaQueryWrapper<HardwareRfid>().setEntity(hardwareRfid).orderByDesc(HardwareRfid::getCreateTime));
         }
-        HardwareRfid hardwareRfid = new HardwareRfid();
-        BeanUtils.copyProperties(hardwareRfidVo, hardwareRfid);
-        Page<HardwareRfid> hardwareRfidPage = baseMapper.selectPage(page, new LambdaQueryWrapper<HardwareRfid>().setEntity(hardwareRfid).orderByDesc(HardwareRfid::getCreateTime));
         List<HardwareRfid> records = hardwareRfidPage.getRecords();
         try {
+            if (records.size() == 0) {
+                return hardwareRfidPage;
+            }
             StringBuffer sb = new StringBuffer();
             for (HardwareRfid record : records) {
                 if (sb.indexOf(String.valueOf(record.getSubjectId())) < 0) {

+ 9 - 11
zd-modules/zd-algorithm/src/main/java/com/zd/alg/speaker/service/impl/SpeakerServiceImpl.java

@@ -257,12 +257,10 @@ public class SpeakerServiceImpl implements ISpeakerService {
         return false;
     }
 
-    private List<UrlVo> getUrlList(String texts,Integer playNum) {
+    private List<UrlVo> getUrlList(String texts) {
         List<UrlVo> urlVoList = new ArrayList<>();
-        for(int i=0;i<playNum;i++){
-            UrlVo urlVo = new UrlVo(texts.substring(0, 1), texts);
-            urlVoList.add(urlVo);
-        }
+        UrlVo urlVo = new UrlVo(texts.substring(0, 1), texts);
+        urlVoList.add(urlVo);
         return urlVoList;
     }
 
@@ -306,7 +304,7 @@ public class SpeakerServiceImpl implements ISpeakerService {
     private void commonTextUrlVoice(String texts,List<PlayVo> playVoList,Integer playNum,Integer level) {
         for (PlayVo play : playVoList) {
             String deviceIp=play.getDeviceIp();
-            List<UrlVo> urlVoList = getUrlList(texts,playNum);
+            List<UrlVo> urlVoList = getUrlList(texts);
             if (null != play.getParams()) {
                 play.getParams().setTid(UUID.randomUUID().toString());
                 play.getParams().setUrls(urlVoList);
@@ -329,20 +327,20 @@ public class SpeakerServiceImpl implements ISpeakerService {
     private PlayBatchVo commonPatchTextUrlVoice(String texts,List<PlayVo> playVoList,Integer playNum,Integer level) {
         PlayBatchVo playBatchVo = new PlayBatchVo();
         BeanUtils.copyProperties(playVoList.get(0), playBatchVo);
-        List<UrlVo> urlVoList = getUrlList(texts,playNum);
+        List<UrlVo> urlVoList = getUrlList(texts);
         if (null != playBatchVo.getParams()) {
             playBatchVo.getParams().setTid(UUID.randomUUID().toString());
             playBatchVo.getParams().setUrls(urlVoList);
             playBatchVo.getParams().setUid(UUID.randomUUID().toString());
+            playBatchVo.getParams().setCount(playNum);
+            playBatchVo.getParams().setLevel(level);
         }
         List<String> snsList = new ArrayList<>();
-        List<String> reqList = new ArrayList<>();
         for (PlayVo playVo : playVoList) {
             snsList.add(playVo.getSn());
-            reqList.add("req");
         }
-        playBatchVo.setSns(snsList.toArray(new String[snsList.size()]));
-        playBatchVo.setType(reqList.toArray(new String[reqList.size()]));
+        playBatchVo.setSn(snsList.toArray(new String[snsList.size()]));
+        playBatchVo.setType("req");
         return playBatchVo;
     }
 

+ 13 - 0
zd-modules/zd-algorithm/src/main/resources/mapper/rfid/HardwareRfidMapper.xml

@@ -53,4 +53,17 @@
              #{item.updateTime,jdbcType=TIMESTAMP}, #{item.remark,jdbcType=VARCHAR})
         </foreach>
     </insert>
+
+    <select id="selectRfidInfo" resultType="com.zd.algorithm.api.rfid.domain.entity.HardwareRfid">
+        SELECT rfid.*
+        FROM `hardware_rfid` rfid
+        LEFT JOIN lab_subject ls ON rfid.subject_id = ls.id
+        <where>
+            <if test="hardwareRfidVo.searchValue != null">
+                rfid.hardware_num LIKE CONCAT('%',#{hardwareRfidVo.searchValue},'%') or
+                ls.`name` LIKE CONCAT('%',#{hardwareRfidVo.searchValue},'%')
+            </if>
+        </where>
+        ORDER BY rfid.create_time DESC
+    </select>
 </mapper>

+ 16 - 0
zd-modules/zd-base/pom.xml

@@ -18,6 +18,16 @@
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>javassist</artifactId>
+                    <groupId>org.javassist</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>guava</artifactId>
+                    <groupId>com.google.guava</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
@@ -44,6 +54,12 @@
         <dependency>
             <groupId>com.zd.swagger</groupId>
             <artifactId>common-swagger</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>guava</artifactId>
+                    <groupId>com.google.guava</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>

+ 34 - 0
zd-modules/zd-base/src/main/java/com/zd/base/app/HexStrUtils.java

@@ -0,0 +1,34 @@
+package com.zd.base.app;
+
+import java.io.ByteArrayOutputStream;
+
+/**
+ * hex 转换
+ * @author dgs
+ * @time 2023-04-11
+ */
+public class HexStrUtils {
+
+    private static String hexString = "0123456789ABCDEFabcdef";
+
+    public static String encode(String str) {
+        byte[] bytes = str.getBytes();
+        StringBuilder sb = new StringBuilder(bytes.length * 2);
+        //转换hex编码
+        for (byte b : bytes) {
+            sb.append(Integer.toHexString(b + 0x800).substring(1));
+        }
+        str = sb.toString();
+        return str;
+    }
+
+    //把hex编码转换为string
+    public static String decode(String bytes) {
+        bytes = bytes.toUpperCase();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream(bytes.length() / 2);
+        // 将每2位16进制整数组装成一个字节
+        for (int i = 0; i < bytes.length(); i += 2)
+            baos.write((hexString.indexOf(bytes.charAt(i)) << 4 | hexString.indexOf(bytes.charAt(i + 1))));
+        return new String(baos.toByteArray());
+    }
+}

+ 580 - 0
zd-modules/zd-base/src/main/java/com/zd/base/app/controller/LabBoardApi.java

@@ -0,0 +1,580 @@
+package com.zd.base.app.controller;
+
+import com.zd.algorithm.api.face.feign.FaceCompare;
+import com.zd.algorithm.api.face.feign.RemoteFaceService;
+import com.zd.algorithm.api.xxp.feign.RemoteXxpService;
+import com.zd.base.app.HexStrUtils;
+import com.zd.base.app.domain.board.DutyPersonVo;
+import com.zd.base.app.domain.board.LabXxpSubjectVo;
+import com.zd.common.core.utils.DateUtils;
+import com.zd.common.core.utils.FileConfigUtils;
+import com.zd.common.core.utils.StringUtils;
+import com.zd.laboratory.api.feign.RemoteDutyService;
+import com.zd.laboratory.api.vo.XxpInspectionVo;
+import com.zd.laboratory.api.vo.XxpUserAuthVo;
+import com.zd.model.constant.HttpStatus;
+import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
+import com.zd.system.api.feign.RemoteUserService;
+import com.zd.system.api.vo.SysLogoConfigVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @Author: donggaosheng
+ * @Date: 2023/03/24
+ * @Description:
+ */
+@RestController
+@RequestMapping("/app/board")
+@Api(tags = {"电子信息牌"})
+public class LabBoardApi {
+
+    private final Logger logger = LoggerFactory.getLogger(LabBoardApi.class);
+
+    @Autowired
+    private RemoteUserService remoteUserService;
+    @Autowired
+    private RemoteDutyService remoteDutyService;
+    @Autowired
+    private RemoteXxpService remoteXxpService;
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
+    @Autowired
+    private RemoteFaceService remoteFaceService;
+
+    /**
+     * 查询电子信息牌头部信息
+     */
+    @ApiOperation(value = "电子信息牌头部信息")
+    @GetMapping(value = "/topInfo")
+    public ResultData topInfo(@RequestParam Long labId) {
+        R<SysLogoConfigVO> sysLogo = remoteUserService.getConfigLogo();
+        Map<String, Object> map = new HashMap<>();
+        if (sysLogo == null || sysLogo.getCode() != 200) {
+            return ResultData.fail(500, "获取logo失败!");
+        }
+        SysLogoConfigVO logoConfigVo = sysLogo.getData();
+        if (logoConfigVo == null) {
+            return ResultData.fail(500, "获取logo失败!");
+        }
+        map.put("schoolName", logoConfigVo.getSchoolName());
+        map.put("circularLogo", fileConfigUtils.getFileDomainApp()+logoConfigVo.getRectangleLogo());
+        ResultData resultData=remoteDutyService.getSubjectName(labId);
+        if (resultData == null || resultData.getCode() != 200) {
+            return ResultData.fail(500, "获取实验室名称失败!");
+        }
+        map.put("subjectName", resultData.getData());
+        map.put("currentTime", DateUtils.parseDateToStr("YYYY_MM_DD HH:MM:SS",new Date()));
+        return ResultData.success(map);
+    }
+
+    /**
+     * 查询电子信息牌中部信息
+     */
+    @ApiOperation(value = "电子信息牌中部信息")
+    @GetMapping(value = "/middleInfo")
+    public ResultData middleInfo(@RequestParam Long labId) {
+        //查询实验室负责人和安全负责人
+        LabXxpSubjectVo vo = new LabXxpSubjectVo();
+        ResultData resultData = remoteDutyService.getXxpSubjectInfo(labId);
+        if (null == resultData || resultData.getCode() != 200) {
+            return ResultData.fail("获取实验室信息失败!");
+        }
+        Map<String, Object> map = (Map<String, Object>) resultData.getData();
+        if (null == map) {
+            return ResultData.fail("获取实验室信息失败!");
+        }
+        vo.setAdminName(String.valueOf(map.getOrDefault("adminName", "")));
+        vo.setAdminPhone(String.valueOf(map.getOrDefault("adminPhone", "")));
+        vo.setFiledColor(String.valueOf(map.getOrDefault("filedColor", "")));
+        vo.setQrCodeUrl(String.valueOf(map.getOrDefault("qrCode", "")));
+        vo.setBuildName(String.valueOf(map.getOrDefault("floorName", "")));
+        vo.setRoom(String.valueOf(map.getOrDefault("room", "")));
+        vo.setLevelName(String.valueOf(map.getOrDefault("levelName", "")));
+        vo.setTypeName(String.valueOf(map.getOrDefault("typeName", "")));
+        vo.setQrCodeUrl(String.valueOf(map.getOrDefault("qrCode", "")));
+        vo.setDeptName(String.valueOf(map.getOrDefault("deptName", "")));
+        String safeUser = String.valueOf(map.getOrDefault("safeUserNameAdminPhone", ""));
+        if (StringUtils.isNotEmpty(safeUser) && StringUtils.isNotNull(safeUser)) {
+            String splitStr[] = safeUser.split(",");
+            List<LabXxpSubjectVo.SafeUserVo> safeUserList = new ArrayList();
+            for (String split : splitStr) {
+                LabXxpSubjectVo.SafeUserVo safeUserVo = new LabXxpSubjectVo().new SafeUserVo();
+                if (StringUtils.isNotEmpty(split) && StringUtils.isNotNull(split)) {
+                    String[] nameAndPhone = split.split("@");
+                    safeUserVo.setSafeUserName(nameAndPhone[0]);
+                    safeUserVo.setSafeUserPhone(nameAndPhone[1]);
+                }
+                safeUserList.add(safeUserVo);
+            }
+            vo.setSafeUserVoList(safeUserList);
+        }
+        vo.setSubjectName(String.valueOf(map.getOrDefault("subjectName", "")));
+        vo.setInCheck((List<Map<String, String>>)map.get("checkIn"));
+        vo.setOutCheck((List<String>)map.get("checkOut"));
+        vo.setInspectInCheck((List<Map<String, String>>)map.get("inspectCheckIn"));
+        ResultData<LabXxpSubjectVo> xxpResultData= remoteDutyService.classifyDetailSubjectById(labId);
+        if(null==xxpResultData || xxpResultData.getCode()!=200){
+            return ResultData.fail("获取实验室信息类目失败!");
+        }
+        List<LabXxpSubjectVo> xxpSubjectVoList= (List<LabXxpSubjectVo>) xxpResultData.getData();
+        vo.setXxpSubjectVoList(xxpSubjectVoList);
+        return ResultData.success(vo);
+    }
+
+    /**
+     * 查询电子信息牌头部信息
+     */
+    @ApiOperation(value = "电子信息牌右侧信息")
+    @GetMapping(value = "/rightInfo")
+    public ResultData rightInfo(@RequestParam Long labId) {
+        Map<String, Object> map = new HashMap<>();
+        String dateTime = DateUtils.getDate();
+        ResultData<List<Map<String, Object>>> resultData = remoteDutyService.selectDutyUser(labId, dateTime);
+        if (null == resultData || resultData.getCode() != HttpStatus.SUCCESS) {
+            return ResultData.fail("值班人员获取失败!");
+        }
+        map.put("dutyUser", resultData.getData());
+        ResultData<List<Map<String, Object>>> signData = remoteDutyService.selectSubjectSignList(labId);
+        if(null==signData || signData.getCode()!=HttpStatus.SUCCESS){
+            return ResultData.fail("签到人员获取失败!");
+        }
+        map.put("tentativeUser", signData.getData());
+        ResultData securityData=remoteDutyService.securityApplyList(labId,1,10);
+        if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
+            return ResultData.fail("安全准入人员获取失败!");
+        }
+        map.put("securityUser", securityData.getData());
+        return ResultData.success(map);
+    }
+
+
+    @ApiOperation(value = "值班人员列表")
+    @GetMapping(value = "/dutyUserList")
+    public ResultData dutyUsrList(@RequestParam Long labId,@RequestParam String startTime) {
+        //处理当前实验,获取当前时间的这一周的开始时间和结束时间
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            Date newDate = sdf.parse(startTime);
+            List<Date> allDate = dateToWeek(newDate);
+            String startTimeStr = sdf.format(allDate.get(0));
+            String endTimeStr = sdf.format(allDate.get(6));
+            ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectDutyUserList(labId,startTimeStr,endTimeStr);
+            if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
+                return ResultData.fail("值班人员列表获取失败!");
+            }
+            //处理人员信息,根据一周的日期分组
+            return ResultData.success(groupPersonInfo(allDate,dutyData.getData(),sdf));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return ResultData.fail("日期格式有误,请联系管理员!!");
+//        ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectDutyUserList(labId,startTime,endTime);
+//        if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
+//            return ResultData.fail("值班人员列表获取失败!");
+//        }
+//        return ResultData.success(dutyData.getData());
+    }
+
+
+    @ApiOperation(value = "巡查人员列表")
+    @GetMapping(value = "/inspectUserList")
+    public ResultData inspectUserList(@RequestParam Long labId,@RequestParam String startTime) {
+        //处理当前实验,获取当前时间的这一周的开始时间和结束时间
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            Date newDate = sdf.parse(startTime);
+            List<Date> allDate = dateToWeek(newDate);
+            String startTimeStr = sdf.format(allDate.get(0));
+            String endTimeStr = sdf.format(allDate.get(6));
+            ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectUserXxpInspectionList(labId,startTimeStr,endTimeStr);
+            if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
+                return ResultData.fail("巡查人员列表获取失败!");
+            }
+            //处理人员信息,根据一周的日期分组
+            return ResultData.success(groupPersonInfo(allDate,dutyData.getData(),sdf));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return ResultData.fail("日期格式有误,请联系管理员!!");
+//        ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectUserXxpInspectionList(labId,startTime,endTime);
+//        if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
+//            return ResultData.fail("值班人员列表获取失败!");
+//        }
+//        return ResultData.success();
+    }
+
+    @ApiOperation(value = "实验室签到人员")
+    @GetMapping(value = "/signUserList")
+    public ResultData signUserList(@RequestParam Long labId) {
+        ResultData<List<Map<String, Object>>> signData = remoteDutyService.selectSubjectSignList(labId);
+        if(null==signData || signData.getCode()!=HttpStatus.SUCCESS){
+            return ResultData.fail("签到人员获取失败!");
+        }
+        return ResultData.success(signData.getData());
+    }
+
+    @ApiOperation(value = "安全准入人员列表")
+    @GetMapping(value = "/securityUserList")
+    public ResultData securityUserList(@RequestParam Long labId,@RequestParam Integer pageNumber,@RequestParam Integer pageSize) {
+        ResultData securityData=remoteDutyService.securityApplyList(labId,pageNumber,pageSize);
+        if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
+            return ResultData.fail("安全准入人员获取失败!");
+        }
+        return ResultData.success(securityData.getData());
+    }
+
+
+    /**
+     * 查询实验室简介信息
+     */
+    @ApiOperation(value = "实验室简介")
+    @GetMapping(value = "/labIntro")
+    public ResultData labIntro(@RequestParam Long labId) {
+        ResultData resultData= remoteDutyService.getSubjectDetails(labId);
+        return resultData;
+    }
+
+
+    /**
+     * 查询实验室视频监控列表信息
+     */
+    @ApiOperation(value = "视频监控")
+    @GetMapping(value = "/cameraBySubjectId")
+    public ResultData getCamera(@RequestParam Long labId) {
+        ResultData<String> resultData=remoteDutyService.getCameraBySubjectId(labId);
+        if(null==resultData || resultData.getCode()!=200){
+            return ResultData.fail("获取摄像头编号失败!");
+        }
+        ResultData data=remoteXxpService.selectSubjectCameraList(resultData.getData(),null,1,5000);
+        return data;
+    }
+
+
+    /**
+     * 查询实验室视频监控列表信息
+     */
+    @ApiOperation(value = "根据一体机编号获取实验室id")
+    @GetMapping(value = "/getSubjectIdByNum/{num}")
+    public ResultData getSubjectIdByNum(@PathVariable("num") String num) {
+        ResultData<String> resultData=remoteDutyService.querySubInfoByNumber(num);
+        R<SysLogoConfigVO> sysLogo = remoteUserService.getConfigLogo();
+        if(null==resultData || resultData.getCode()!=200){
+            return ResultData.fail("获取实验室编号失败!");
+        }
+        if (sysLogo == null || sysLogo.getCode() != 200) {
+            return ResultData.fail(500, "获取logo失败!");
+        }
+        Object subjectId=resultData.getData();
+        String isRelationGuard="2";
+        String authType="";
+        Map<String,Object> map= new HashMap<>();
+        if(StringUtils.isNull(subjectId)){
+            ResultData xxpMap=remoteDutyService.XxpCardInfoByCard(num);
+            Object obj=xxpMap.getData();
+            if (obj == null) {
+                return ResultData.fail("获取实验室编号失败!");
+            }
+            Map<String,Object> dataMap= (Map<String, Object>) xxpMap.getData();
+            subjectId=String.valueOf(dataMap.get("subjectId"));
+            isRelationGuard=String.valueOf(dataMap.get("isRelationGuard"));
+            authType=String.valueOf(dataMap.get("authType"));
+        }
+        map.put("labId",subjectId);
+        map.put("authType",authType);
+        map.put("isRelationGuard",isRelationGuard);
+        map.put("logoutTime",sysLogo.getData().getLogoutTime());
+        map.put("returnTime",sysLogo.getData().getReturnTime());
+        map.put("isStart",sysLogo.getData().getIsStart());
+        return ResultData.success(map);
+    }
+
+
+    //处理分组一周内的人员信息
+    public DutyPersonVo groupPersonInfo(List<Date> allDate,List<Map<String, Object>> personList,SimpleDateFormat sdf){
+        StringBuffer startTimeStr = new StringBuffer();
+        DutyPersonVo dutyPersonVo = new DutyPersonVo();
+        for(int i=0;i<allDate.size();i++){
+            if(i==0){
+                startTimeStr.append(sdf.format(allDate.get(i)));
+                Optional.ofNullable(personList).orElseGet(Collections::emptyList)
+                        .stream()
+                        .forEach(a->{
+                            if(startTimeStr.toString().equals(a.get("dutyTime"))){
+                                dutyPersonVo.getWeekday1().add(a);
+                            }
+                        });
+            }else if(i==1){
+                startTimeStr.append(sdf.format(allDate.get(i)));
+                Optional.ofNullable(personList).orElseGet(Collections::emptyList)
+                        .stream()
+                        .forEach(a->{
+                            if(startTimeStr.toString().equals(a.get("dutyTime"))){
+                                dutyPersonVo.getWeekday2().add(a);
+                            }
+                        });
+            }else if(i==2){
+                startTimeStr.append(sdf.format(allDate.get(i)));
+                Optional.ofNullable(personList).orElseGet(Collections::emptyList)
+                        .stream()
+                        .forEach(a->{
+                            if(startTimeStr.toString().equals(a.get("dutyTime"))){
+                                dutyPersonVo.getWeekday3().add(a);
+                            }
+                        });
+            }else if(i==3){
+                startTimeStr.append(sdf.format(allDate.get(i)));
+                Optional.ofNullable(personList).orElseGet(Collections::emptyList)
+                        .stream()
+                        .forEach(a->{
+                            if(startTimeStr.toString().equals(a.get("dutyTime"))){
+                                dutyPersonVo.getWeekday4().add(a);
+                            }
+                        });
+            }else if(i==4){
+                startTimeStr.append(sdf.format(allDate.get(i)));
+                Optional.ofNullable(personList).orElseGet(Collections::emptyList)
+                        .stream()
+                        .forEach(a->{
+                            if(startTimeStr.toString().equals(a.get("dutyTime"))){
+                                dutyPersonVo.getWeekday5().add(a);
+                            }
+                        });
+            }else if(i==5){
+                startTimeStr.append(sdf.format(allDate.get(i)));
+                Optional.ofNullable(personList).orElseGet(Collections::emptyList)
+                        .stream()
+                        .forEach(a->{
+                            if(startTimeStr.toString().equals(a.get("dutyTime"))){
+                                dutyPersonVo.getWeekday6().add(a);
+                            }
+                        });
+            }else if(i==6){
+                startTimeStr.append(sdf.format(allDate.get(i)));
+                Optional.ofNullable(personList).orElseGet(Collections::emptyList)
+                        .stream()
+                        .forEach(a->{
+                            if(startTimeStr.toString().equals(a.get("dutyTime"))){
+                                dutyPersonVo.getWeekday7().add(a);
+                            }
+                        });
+            }
+            startTimeStr.delete(0,startTimeStr.length());
+        }
+        return dutyPersonVo;
+    }
+
+    public List<Date> dateToWeek(Date mdate) {
+        List<Date> allDate = new ArrayList <>();
+        for(int i=0;i<7;i++){
+            Calendar   calendar = new GregorianCalendar();
+            calendar.setTime(mdate);
+            calendar.add(calendar.DATE,i); //把日期往后增加一天,整数  往后推,负数往前移动
+            allDate.add(calendar.getTime());//这个时间就是日期往后推一天的结果
+        }
+        return allDate;
+    }
+
+
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     * @param labId
+     * @return
+     */
+    @ApiOperation(value = "电子信息牌获取准入人员的指纹信息列表")
+    @GetMapping(value = "/getFingerList")
+    public ResultData getFingerList(@RequestParam("labId") Long labId) {
+        ResultData resultData=remoteDutyService.securityFingerList(labId);
+        return resultData;
+    }
+
+
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     * @param labId
+     * @return
+     */
+    @ApiOperation(value = "刷卡是否可以开门禁")
+    @GetMapping(value = "/getCardIsOpen")
+    public ResultData getCardIsOpen(@RequestParam("labId") Long labId,@RequestParam("cardNum") String cardNum) {
+        if(StringUtils.isNull(cardNum) || StringUtils.isEmpty(cardNum)){
+            return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
+        }
+        logger.info("转换前cardNum:"+cardNum);
+        cardNum= HexStrUtils.decode(cardNum);
+        logger.info("转换后cardNum:"+cardNum);
+        ResultData resultData=remoteDutyService.securityNumList(labId,cardNum);
+        if(resultData==null && resultData.getCode()!=HttpStatus.SUCCESS){
+            return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
+        }
+        Object resultObj=resultData.getData();
+        if(null==resultObj){
+            return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
+        }
+        return resultData;
+    }
+
+
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     * @param labId
+     * @return
+     */
+    @ApiOperation(value = "刷卡验证")
+    @GetMapping(value = "/cardValidate")
+    public ResultData cardValidate(@RequestParam("labId") Long labId,@RequestParam("cardNum") String cardNum) {
+        logger.info("转换前cardNum:"+cardNum);
+        if(StringUtils.isNull(cardNum) || StringUtils.isEmpty(cardNum)){
+            return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
+        }
+        cardNum= HexStrUtils.decode(cardNum);
+        logger.info("转换后cardNum:"+cardNum);
+        ResultData resultData=remoteDutyService.securityNumList(labId,cardNum);
+        if(resultData==null && resultData.getCode()!=HttpStatus.SUCCESS){
+            return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
+        }
+        Object resultObj=resultData.getData();
+        if(null==resultObj){
+            return ResultData.fail("未识别到身份信息,请联系管理人员录入卡号信息");
+        }
+        return resultData;
+    }
+
+
+    /**
+     * 电子信息牌指纹录入
+     * @param xxpUserAuthVo
+     * @return
+     */
+    @ApiOperation(value = "指纹录入")
+    @PostMapping(value = "/addUserFinger")
+    public ResultData addUserFinger(@RequestBody XxpUserAuthVo xxpUserAuthVo) {
+        ResultData resultData=remoteDutyService.addUserAuth(xxpUserAuthVo);
+        return resultData;
+    }
+
+
+    /**
+     * 根据用户查询指纹列表
+     * @param userId
+     * @return
+     */
+    @ApiOperation(value = "根据用户查询指纹列表")
+    @GetMapping(value = "/getFingerByUserId")
+    public ResultData getFingerByUserId(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId){
+        ResultData resultData=remoteDutyService.getFingerByUserId(labId,userId);
+        return resultData;
+    }
+
+
+    /**
+     * 根据id删除指纹
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id删除指纹")
+    @GetMapping(value = "/deleteFingerById")
+    public ResultData deleteFingerById(@RequestParam Long id){
+        ResultData resultData=remoteDutyService.deleteFingerById(id);
+        if(null==resultData || resultData.getCode()!=HttpStatus.SUCCESS){
+             return ResultData.fail("删除指纹失败");
+        }
+        return ResultData.success();
+    }
+
+    /**
+     * 密码验证
+     * @param num
+     * @param pwd
+     * @param labId
+     * @param userId
+     * @return
+     */
+    @ApiOperation(value = "密码验证")
+    @GetMapping(value = "/pwdValidate")
+    public ResultData pwdValidate(@RequestParam("num") String num,@RequestParam("pwd") String pwd,@RequestParam("labId") Long labId,@RequestParam("userId") Long userId){
+        return remoteDutyService.pwdValidate(num,pwd,labId,userId);
+    }
+
+    /**
+     * 大海里找鱼
+     * @param faceCompare
+     * @return
+     */
+    @ApiOperation(value = "人脸识别")
+    @PostMapping(value = "/multiFaceDetection")
+    public ResultData multiFaceDetection(@RequestBody FaceCompare faceCompare){
+        return remoteFaceService.multiFaceDetection(faceCompare);
+    }
+
+
+    /**
+     * 人脸识别获取特征值
+     * @param file
+     * @return
+     */
+    @ApiOperation(value = "人脸识别获取特征值")
+    @PostMapping(value = "/faceFeature")
+    public R<byte[]> faceFeature(@RequestParam("file") MultipartFile file){
+        return remoteFaceService.upload(file);
+    }
+
+
+    /**
+     * 人脸识别获取特征值
+     * @param xxpInspectionVo
+     * @return
+     */
+    @ApiOperation(value = "巡查签到")
+    @PostMapping(value = "/XxpInspection/addInspection/signIn")
+    public ResultData addInspection(@RequestBody XxpInspectionVo xxpInspectionVo){
+        ResultData resultData= remoteDutyService.addInspection(xxpInspectionVo);
+        return resultData;
+    }
+
+
+
+
+
+    /**
+     * 人脸识别获取特征值
+     * @param labId
+     * @return
+     */
+    @ApiOperation(value = "巡查签退")
+    @PostMapping(value = "/XxpInspection/addInspection/signOut")
+    public ResultData updateInspection(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId){
+        return remoteDutyService.updateInspection(labId,userId);
+    }
+
+    @ApiOperation(value = "判断是巡查签到还是准入签到 1巡查 2准入")
+    @PostMapping(value = "/XxpInspection/isSignInType")
+    public ResultData isSignInType(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId) {
+        return remoteDutyService.isSignInType(labId,userId);
+    }
+
+
+    /**
+     * Ai检测判断是否已签到
+     * @param labId
+     * @param userId
+     * @return
+     */
+    @ApiOperation(value = "Ai检测判断是否已签到")
+    @PostMapping(value = "/XxpInspection/isSignInspection")
+    public ResultData isSignInspection(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId){
+        ResultData resultData= remoteDutyService.isSignInspection(labId,userId);
+        return resultData;
+    }
+
+}

+ 26 - 0
zd-modules/zd-base/src/main/java/com/zd/base/app/domain/board/DutyPersonVo.java

@@ -0,0 +1,26 @@
+package com.zd.base.app.domain.board;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author cyl
+ * @date 2023/3/30
+ */
+@ApiModel("返回一周的人员信息")
+@Data
+public class DutyPersonVo {
+    List <Map <String, Object>> weekday1 = new ArrayList <>();
+    List <Map <String, Object>> weekday2 = new ArrayList <>();
+    List <Map <String, Object>> weekday3 = new ArrayList <>();
+    List <Map <String, Object>> weekday4 = new ArrayList <>();
+    List <Map <String, Object>> weekday5 = new ArrayList <>();
+    List <Map <String, Object>> weekday6 = new ArrayList <>();
+    List <Map <String, Object>> weekday7 = new ArrayList <>();
+}

+ 213 - 0
zd-modules/zd-base/src/main/java/com/zd/base/app/domain/board/LabXxpSubjectVo.java

@@ -0,0 +1,213 @@
+package com.zd.base.app.domain.board;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: donggaosheng
+ * @Date: 2023/03/27
+ * @Description:
+ */
+@ApiModel("信息牌首页展示")
+public class LabXxpSubjectVo {
+    @ApiModelProperty("负责人名称")
+    private String adminName;
+
+    @ApiModelProperty("负责人手机号")
+    private String adminPhone;
+
+    @ApiModelProperty("安全分级名称")
+    private String levelName;
+
+    @ApiModelProperty("楼栋名称")
+    private String buildName;
+
+    @ApiModelProperty("房间号")
+    private String room;
+
+    @ApiModelProperty("安全分级颜色编码")
+    private String filedColor;
+
+    @ApiModelProperty("安全分类名称")
+    private String typeName;
+
+    @ApiModelProperty(value = "二维码地址")
+    private String qrCodeUrl;
+
+    @ApiModelProperty(value = "二维码地址")
+    private String deptName;
+
+    @ApiModelProperty(value = "楼栋+房间号")
+    private String subjectName;
+
+    @ApiModelProperty("进入检查项")
+    private List<Map<String,String>> inCheck;
+
+    @ApiModelProperty("巡查进入检查项")
+    private List<Map<String,String>> inspectInCheck;
+
+    @ApiModelProperty("离开检查项")
+    private List<String> outCheck;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getBuildName() {
+        return buildName;
+    }
+
+    public void setBuildName(String buildName) {
+        this.buildName = buildName;
+    }
+
+    public String getRoom() {
+        return room;
+    }
+
+    public void setRoom(String room) {
+        this.room = room;
+    }
+
+    @ApiModel("安全责任人列表")
+    public class SafeUserVo {
+        @ApiModelProperty("安全负责人id")
+        private Integer id;
+        @ApiModelProperty("安全负责人名称")
+        private String safeUserName;
+        @ApiModelProperty("安全负责人电话")
+        private String safeUserPhone;
+
+        public Integer getId() {
+            return id;
+        }
+
+        public void setId(Integer id) {
+            this.id = id;
+        }
+
+        public String getSafeUserName() {
+            return safeUserName;
+        }
+
+        public void setSafeUserName(String safeUserName) {
+            this.safeUserName = safeUserName;
+        }
+
+        public String getSafeUserPhone() {
+            return safeUserPhone;
+        }
+
+        public void setSafeUserPhone(String safeUserPhone) {
+            this.safeUserPhone = safeUserPhone;
+        }
+    }
+
+    @ApiModelProperty(value = "二维码地址")
+    private List<SafeUserVo> safeUserVoList;
+    @ApiModelProperty(value = "信息牌类目")
+    private List<LabXxpSubjectVo> xxpSubjectVoList;
+
+    public List<SafeUserVo> getSafeUserVoList() {
+        return safeUserVoList;
+    }
+
+    public void setSafeUserVoList(List<SafeUserVo> safeUserVoList) {
+        this.safeUserVoList = safeUserVoList;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getAdminPhone() {
+        return adminPhone;
+    }
+
+    public void setAdminPhone(String adminPhone) {
+        this.adminPhone = adminPhone;
+    }
+
+    public String getLevelName() {
+        return levelName;
+    }
+
+    public void setLevelName(String levelName) {
+        this.levelName = levelName;
+    }
+
+    public String getFiledColor() {
+        return filedColor;
+    }
+
+    public void setFiledColor(String filedColor) {
+        this.filedColor = filedColor;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public String getQrCodeUrl() {
+        return qrCodeUrl;
+    }
+
+    public void setQrCodeUrl(String qrCodeUrl) {
+        this.qrCodeUrl = qrCodeUrl;
+    }
+
+    public List<LabXxpSubjectVo> getXxpSubjectVoList() {
+        return xxpSubjectVoList;
+    }
+
+    public void setXxpSubjectVoList(List<LabXxpSubjectVo> xxpSubjectVoList) {
+        this.xxpSubjectVoList = xxpSubjectVoList;
+    }
+
+    public List<Map<String, String>> getInCheck() {
+        return inCheck;
+    }
+
+    public void setInCheck(List<Map<String, String>> inCheck) {
+        this.inCheck = inCheck;
+    }
+
+    public List<Map<String, String>> getInspectInCheck() {
+        return inspectInCheck;
+    }
+
+    public void setInspectInCheck(List<Map<String, String>> inspectInCheck) {
+        this.inspectInCheck = inspectInCheck;
+    }
+
+    public List<String> getOutCheck() {
+        return outCheck;
+    }
+
+    public void setOutCheck(List<String> outCheck) {
+        this.outCheck = outCheck;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+}

+ 16 - 0
zd-modules/zd-base/src/main/java/com/zd/base/job/task/LabTask.java

@@ -62,4 +62,20 @@ public class LabTask {
      * 安全检查隐患项未整改逾期通知
      */
     public  void checkSendMsgBeOverdue(){remoteLaboratoryService.checkSendMsgBeOverdue();}
+
+
+    /**
+     * 定时器定时每天 00:00 开始执行,把一天的排风任务全部存入redis里面去
+     */
+    public void timedExhaustTask() {
+        remoteLaboratoryService.timedExhaustTask();
+    }
+
+
+    /**
+     * 定时器定时每天 00:30 开始执行,定时清理90天以前的所有控制记录数据
+     */
+    public void timingClearMsg() {
+        remoteLaboratoryService.timingClearMsg();
+    }
 }

+ 2 - 0
zd-modules/zd-bottle-parent/pom.xml

@@ -21,11 +21,13 @@
         <dependency>
             <groupId>com.zd.core</groupId>
             <artifactId>common-core</artifactId>
+            <version>3.1.0</version>
         </dependency>
 
         <dependency>
             <groupId>com.zd.swagger</groupId>
             <artifactId>common-swagger</artifactId>
+            <version>3.1.0</version>
         </dependency>
     </dependencies>
 </project>

+ 0 - 0
zd-modules/zd-bottle-parent/zd-bottle/pom.xml


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