Explorar el Código

安全信息牌代码合并

linfutong hace 2 años
padre
commit
ac4e663df1
Se han modificado 100 ficheros con 4231 adiciones y 251 borrados
  1. 11 1
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/FaceCompare.java
  2. 10 0
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/RemoteFaceService.java
  3. 6 0
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/face/feign/fallback/RemoteFaceFallbackFactory.java
  4. 24 0
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/xxp/feign/RemoteXxpService.java
  5. 25 0
      zd-api/zd-algorithm-api/src/main/java/com/zd/algorithm/api/xxp/feign/fallback/RemoteXxpFallBack.java
  6. 2 1
      zd-api/zd-algorithm-api/src/main/resources/META-INF/spring.factories
  7. 61 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSubjectControllerVO.java
  8. 122 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/entity/LabSysUserInfo.java
  9. 141 25
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteDutyService.java
  10. 8 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteLaboratoryService.java
  11. 13 6
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteStudentsService.java
  12. 68 6
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteDutyFailback.java
  13. 10 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteLaboratoryFallbackFactory.java
  14. 13 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteStudentsFallbackFactory.java
  15. 31 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/ClassifyDetailVO.java
  16. 28 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/ClassifyVO.java
  17. 160 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/XxpInspectionVo.java
  18. 107 0
      zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/vo/XxpUserAuthVo.java
  19. 2 1
      zd-api/zd-laboratory-api/src/main/java/resources/META-INF/spring.factories
  20. 5 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/RemoteUserService.java
  21. 5 1
      zd-api/zd-system-api/src/main/java/com/zd/system/api/feign/factory/RemoteUserFallback.java
  22. 73 0
      zd-api/zd-system-api/src/main/java/com/zd/system/api/vo/SysLogoConfigVO.java
  23. 20 0
      zd-common/common-core/src/main/java/com/zd/common/core/redis/RedisService.java
  24. 20 0
      zd-common/common-core/src/main/java/com/zd/common/core/redis/RedisServiceImpl.java
  25. 0 1
      zd-model/src/main/java/com/zd/model/domain/R.java
  26. 4 0
      zd-model/src/main/java/com/zd/model/domain/per/PerPrefix.java
  27. 20 0
      zd-model/src/main/java/com/zd/model/entity/SysUser.java
  28. 82 20
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/controller/FaceApi.java
  29. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/utils/FileUtil.java
  30. 16 0
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/controller/SignInCheckController.java
  31. 90 0
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/serivce/CheckService.java
  32. 3 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java
  33. 6 6
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
  34. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMHttpHookListener.java
  35. 50 43
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/monitor/HardwareDeviceMonitor.java
  36. 0 6
      zd-modules/zd-base/pom.xml
  37. 2 2
      zd-modules/zd-base/src/main/java/com/zd/base/ZdBaseApplicaion.java
  38. 34 0
      zd-modules/zd-base/src/main/java/com/zd/base/app/HexStrUtils.java
  39. 385 24
      zd-modules/zd-base/src/main/java/com/zd/base/app/controller/LabBoardApi.java
  40. 26 0
      zd-modules/zd-base/src/main/java/com/zd/base/app/domain/board/DutyPersonVo.java
  41. 45 1
      zd-modules/zd-base/src/main/java/com/zd/base/app/domain/board/LabXxpSubjectVo.java
  42. 40 0
      zd-modules/zd-modules-laboratory/pom.xml
  43. 127 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecurityApplyController.java
  44. 20 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecuritySubjectmaterialController.java
  45. 16 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabStudentsInfoController.java
  46. 11 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubMangerV2Controller.java
  47. 12 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubjectAccessRecordController.java
  48. 21 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubjectController.java
  49. 14 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabWhitelistController.java
  50. 183 19
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpCardInfoController.java
  51. 117 7
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyController.java
  52. 25 5
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyDetailedController.java
  53. 57 4
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpDutyController.java
  54. 189 5
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpInspectionController.java
  55. 256 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpUserAuthController.java
  56. 122 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabSubject.java
  57. 53 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/SubDiyVO.java
  58. 13 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpCardInfo.java
  59. 13 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassify.java
  60. 4 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifyDetail.java
  61. 61 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifySubject.java
  62. 9 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpInspection.java
  63. 181 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpUserAuth.java
  64. 10 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSecurityApplyVO.java
  65. 12 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSecurityMaterialDataVO.java
  66. 12 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSecuritySubjectmaterialVO.java
  67. 11 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSubjectVO.java
  68. 17 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/XxpClassifyDetailVO.java
  69. 34 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/XxpInspectionVO.java
  70. 14 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabCheckOptionMapper.java
  71. 1 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabHardwareStateMapper.java
  72. 23 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSecurityApplyMapper.java
  73. 8 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabStudentsInfoMapper.java
  74. 9 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSubjectAccessRecordMapper.java
  75. 31 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSubjectMapper.java
  76. 3 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabWhiteJoinSublistMapper.java
  77. 2 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabWhitelistMapper.java
  78. 25 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpCardInfoMapper.java
  79. 9 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpClassifyDetailedMapper.java
  80. 72 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpClassifySubjectMapper.java
  81. 30 24
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpDutyMapper.java
  82. 48 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpInspectionMapper.java
  83. 84 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpUserAuthMapper.java
  84. 60 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/controller/OneMachineController.java
  85. 24 14
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/service/OneMachineService.java
  86. 23 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabSecurityApplyService.java
  87. 9 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabStudentsInfoService.java
  88. 8 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabSubjectAccessRecordService.java
  89. 35 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabSubjectService.java
  90. 2 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabWhitelistService.java
  91. 23 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpCardInfoService.java
  92. 9 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifyDetailedService.java
  93. 7 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifyService.java
  94. 73 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifySubjectService.java
  95. 12 7
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpDutyService.java
  96. 50 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpInspectionService.java
  97. 106 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpUserAuthService.java
  98. 33 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecurityApplyServiceImpl.java
  99. 29 1
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecuritySubjectmaterialServiceImpl.java
  100. 0 0
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabStudentsInfoServiceImpl.java

+ 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
  * @Date: 2021/10/12/17:54
  * @Description:
  * @Description:
  */
  */
-@ApiModel("人脸对比提交参数")
+@ApiModel("提交参数")
 public class FaceCompare {
 public class FaceCompare {
     @ApiModelProperty("userId")
     @ApiModelProperty("userId")
     private Long userId;
     private Long userId;
 
 
+    @ApiModelProperty("实验室ID")
+    private Long labId;
 
 
     @ApiModelProperty("特征码")
     @ApiModelProperty("特征码")
     private byte[] data;
     private byte[] data;
@@ -33,4 +35,12 @@ public class FaceCompare {
     public void setData(byte[] data) {
     public void setData(byte[] data) {
         this.data = 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.algorithm.api.face.feign.fallback.RemoteFaceFallbackFactory;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 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.bind.annotation.RequestPart;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
@@ -33,4 +35,12 @@ public interface RemoteFaceService {
      */
      */
     @PostMapping(value = "/faceApi/compare")
     @PostMapping(value = "/faceApi/compare")
     public R compare(@RequestBody FaceCompare faceCompare);
     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.FaceCompare;
 import com.zd.algorithm.api.face.feign.RemoteFaceService;
 import com.zd.algorithm.api.face.feign.RemoteFaceService;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
@@ -38,6 +39,11 @@ public class RemoteFaceFallbackFactory implements FallbackFactory<RemoteFaceServ
             public R compare(FaceCompare faceCompare) {
             public R compare(FaceCompare faceCompare) {
                 return R.fail("人脸对比服务调用失败:" + throwable.getMessage());
                 return R.fail("人脸对比服务调用失败:" + throwable.getMessage());
             }
             }
+
+            @Override
+            public ResultData multiFaceDetection(FaceCompare faceCompare) {
+                return ResultData.fail("多人脸对比服务调用失败:" + throwable.getMessage());
+            }
         };
         };
     }
     }
 }
 }

+ 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.rfid.feign.fallback.RemoteRfidFallbackFactory,\
   com.zd.algorithm.api.smartlock.feign.fallback.RemoteSmartlockFallbackFactory,\
   com.zd.algorithm.api.smartlock.feign.fallback.RemoteSmartlockFallbackFactory,\
   com.zd.algorithm.api.speaker.feign.fallback.RemoteSpeakFallbackFactory,\
   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.fasterxml.jackson.annotation.JsonInclude;
+import com.zd.laboratory.api.vo.ClassifyVO;
 import com.zd.laboratory.api.vo.HardwareCVO;
 import com.zd.laboratory.api.vo.HardwareCVO;
 import com.zd.laboratory.api.vo.LabRiskVO;
 import com.zd.laboratory.api.vo.LabRiskVO;
 import com.zd.laboratory.api.vo.SenseValVO;
 import com.zd.laboratory.api.vo.SenseValVO;
@@ -64,6 +65,26 @@ public class LabSubjectControllerVO extends LabSubjectEntity {
     @ApiModelProperty("预案数据")
     @ApiModelProperty("预案数据")
     private List<LabRiskVO> riskPlanList;
     private List<LabRiskVO> riskPlanList;
 
 
+    private List<ClassifyVO>  classifyList;
+
+    @ApiModelProperty("实验室详情")
+    private String details;
+
+    /***
+     * 关联的硬件 1海康 2电子信息牌
+     */
+    private Integer hardwareType;
+
+    /***
+     * 是否配置海康门禁
+     */
+    private Integer hKCount;
+
+    /***
+     * 是否配置电子信息牌
+     */
+    private Integer cardInfoCount;
+
     /**
     /**
      * 实验室类型ID
      * 实验室类型ID
      */
      */
@@ -418,4 +439,44 @@ public class LabSubjectControllerVO extends LabSubjectEntity {
     public void setRiskPlanList(List<LabRiskVO> riskPlanList) {
     public void setRiskPlanList(List<LabRiskVO> riskPlanList) {
         this.riskPlanList = 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;
+    }
+}

+ 141 - 25
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/RemoteDutyService.java

@@ -1,13 +1,13 @@
 package com.zd.laboratory.api.feign;
 package com.zd.laboratory.api.feign;
 
 
 import com.zd.laboratory.api.feign.fallback.RemoteDutyFailback;
 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.constant.ApplicationConstants;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
-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.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -17,19 +17,21 @@ import java.util.Map;
  * @author  donggaosheng
  * @author  donggaosheng
  * @time 2023/03/24
  * @time 2023/03/24
  */
  */
-@FeignClient(contextId = "remoteDutyService", value = ApplicationConstants.XXP_SERVICE, fallbackFactory = RemoteDutyFailback.class)
+@FeignClient(contextId = "remoteDutyService", value = ApplicationConstants.LABORATORY_SERVICE, fallbackFactory = RemoteDutyFailback.class)
 public interface RemoteDutyService {
 public interface RemoteDutyService {
     /**
     /**
      * 通过实验室id当前时间查询值班人员
      * 通过实验室id当前时间查询值班人员
+     *
      * @param labId
      * @param labId
      * @param dateTime
      * @param dateTime
      * @return
      * @return
      */
      */
     @GetMapping("/XxpDuty/api/selectDutyUser")
     @GetMapping("/XxpDuty/api/selectDutyUser")
-    ResultData<List<Map<String, Object>>> selectDutyUser(Long labId, String dateTime);
+    ResultData<List<Map<String, Object>>> selectDutyUser(@RequestParam("labId") Long labId, @RequestParam("dateTime") String dateTime);
 
 
     /**
     /**
      * 通过实验室id查询实验室信息
      * 通过实验室id查询实验室信息
+     *
      * @param id
      * @param id
      * @return
      * @return
      */
      */
@@ -44,27 +46,17 @@ public interface RemoteDutyService {
     @GetMapping("/XxpClassifyDet/classifyDetail/{id}")
     @GetMapping("/XxpClassifyDet/classifyDetail/{id}")
     ResultData classifyDetailSubjectById(@PathVariable("id") Long id);
     ResultData classifyDetailSubjectById(@PathVariable("id") Long id);
 
 
-    /**
-     * 通过实验室id获取信息类目列表
-     * @param deviceIds
-     * @param dpi
-     * @param page
-     * @param count
-     * @return
-     */
-    @GetMapping("/api/play/startList")
-    ResultData selectSubjectCameraList(String deviceIds, Integer dpi, int page, int count);
-
     /***
     /***
      * 根据实验室id查询摄像头编号
      * 根据实验室id查询摄像头编号
      * @param subId
      * @param subId
      * @return
      * @return
      */
      */
     @GetMapping("/hardware/getCameraBySubjectId")
     @GetMapping("/hardware/getCameraBySubjectId")
-    ResultData getCameraBySubjectId(Long subId);
+    ResultData getCameraBySubjectId(@RequestParam("subId") Long subId);
 
 
     /**
     /**
      * 根据实验室id获取实验室详情
      * 根据实验室id获取实验室详情
+     *
      * @param id
      * @param id
      * @return
      * @return
      */
      */
@@ -73,39 +65,163 @@ public interface RemoteDutyService {
 
 
     /**
     /**
      * 根据实验室id获取安全准入人员列表
      * 根据实验室id获取安全准入人员列表
+     *
      * @param pageNumber
      * @param pageNumber
      * @param pageSize
      * @param pageSize
      * @param subjectId
      * @param subjectId
      * @return
      * @return
      */
      */
     @GetMapping("/apply/app/securityApplyList")
     @GetMapping("/apply/app/securityApplyList")
-    ResultData securityApplyList(Integer pageNumber,Integer pageSize,Long subjectId);
+    ResultData securityApplyList(@RequestParam("subjectId") Long subjectId, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("pageSize") Integer pageSize);
 
 
     /**
     /**
      * 根据实验室获取签到未签退人员
      * 根据实验室获取签到未签退人员
+     *
      * @param subjectId
      * @param subjectId
      * @return
      * @return
      */
      */
     @RequestMapping("/record/selectSubjectSignList")
     @RequestMapping("/record/selectSubjectSignList")
-    ResultData selectSubjectSignList(Long subjectId);
+    ResultData selectSubjectSignList(@RequestParam("subjectId") Long subjectId);
 
 
     /**
     /**
      * 获取实验室所有值班人员的信息
      * 获取实验室所有值班人员的信息
+     *
      * @param labId
      * @param labId
      * @param startTime
      * @param startTime
      * @param endTime
      * @param endTime
      * @return
      * @return
      */
      */
-    @RequestMapping("/api/selectDutyUserList")
-    ResultData<List<Map<String,Object>>> selectDutyUserList(Long labId,String startTime,String endTime);
+    @RequestMapping("/XxpDuty/api/selectDutyUserList")
+    ResultData<List<Map<String, Object>>> selectDutyUserList(@RequestParam("labId") Long labId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);
 
 
     /**
     /**
      * 根据实验室id和当前时间查询签到记录
      * 根据实验室id和当前时间查询签到记录
+     *
      * @param labId
      * @param labId
      * @param startTime
      * @param startTime
      * @param endTime
      * @param endTime
      * @return
      * @return
      */
      */
-    @PostMapping("/app/selectUserXxpInspectionList")
-    public ResultData selectUserXxpInspectionList(Long labId,String startTime,String endTime);
-}
+    @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);
+
+    }

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

@@ -499,4 +499,12 @@ public interface RemoteLaboratoryService {
     @ApiOperation(value = "根据实验室id查询实验室位置信息")
     @ApiOperation(value = "根据实验室id查询实验室位置信息")
     @PostMapping("/buildFloorLayout/getPositionBySubId")
     @PostMapping("/buildFloorLayout/getPositionBySubId")
     ResultData getPositionBySubId(@RequestParam("subIds") String subIds);
     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;
 package com.zd.laboratory.api.feign;
 
 
 import com.zd.laboratory.api.entity.LabStudentsInfo;
 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.laboratory.api.feign.fallback.RemoteStudentsFallbackFactory;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
 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 org.springframework.web.multipart.MultipartFile;
 
 
+import java.util.List;
+
 /**
 /**
  * 文件服务
  * 文件服务
  *
  *
@@ -25,7 +26,7 @@ public interface RemoteStudentsService {
      * @return 结果
      * @return 结果
      */
      */
     @GetMapping(value = "/studentinfo/{joinStudentsId}")
     @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
      * @return
      */
      */
     @PostMapping (value = "/studentinfo/commit/crad",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @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);
 }
 }

+ 68 - 6
zd-api/zd-laboratory-api/src/main/java/com/zd/laboratory/api/feign/fallback/RemoteDutyFailback.java

@@ -1,6 +1,8 @@
 package com.zd.laboratory.api.feign.fallback;
 package com.zd.laboratory.api.feign.fallback;
 
 
 import com.zd.laboratory.api.feign.RemoteDutyService;
 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 com.zd.model.domain.ResultData;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
@@ -41,11 +43,6 @@ public class RemoteDutyFailback implements FallbackFactory<RemoteDutyService> {
             }
             }
 
 
             @Override
             @Override
-            public ResultData selectSubjectCameraList(String deviceIds, Integer dpi, int page, int count) {
-                return ResultData.fail("获取实验室摄像头列表信息失败:" + cause.getMessage());
-            }
-
-            @Override
             public ResultData getCameraBySubjectId(Long subId) {
             public ResultData getCameraBySubjectId(Long subId) {
                 return ResultData.fail("获取实验室摄像头编号信息失败:" + cause.getMessage());
                 return ResultData.fail("获取实验室摄像头编号信息失败:" + cause.getMessage());
             }
             }
@@ -56,7 +53,7 @@ public class RemoteDutyFailback implements FallbackFactory<RemoteDutyService> {
             }
             }
 
 
             @Override
             @Override
-            public ResultData securityApplyList(Integer pageNumber, Integer pageSize, Long subjectId) {
+            public ResultData securityApplyList(Long subjectId,Integer pageNumber, Integer pageSize) {
                 return ResultData.fail("获取安全准入人员列表信息失败:" + cause.getMessage());
                 return ResultData.fail("获取安全准入人员列表信息失败:" + cause.getMessage());
             }
             }
 
 
@@ -74,6 +71,71 @@ public class RemoteDutyFailback implements FallbackFactory<RemoteDutyService> {
             public ResultData selectUserXxpInspectionList(Long labId, String startTime, String endTime) {
             public ResultData selectUserXxpInspectionList(Long labId, String startTime, String endTime) {
                 return ResultData.fail("获取巡查记录列表信息失败:" + cause.getMessage());
                 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());
+            }
         };
         };
     }
     }
 }
 }

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

@@ -460,6 +460,16 @@ public class RemoteLaboratoryFallbackFactory implements FallbackFactory<RemoteLa
             public ResultData getPositionBySubId(String subIds) {
             public ResultData getPositionBySubId(String subIds) {
                 return ResultData.fail("查询实验室位置信息失败!"+ cause.getMessage());
                 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.entity.LabStudentsInfo;
 import com.zd.laboratory.api.feign.RemoteStudentsService;
 import com.zd.laboratory.api.feign.RemoteStudentsService;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
 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.bind.annotation.PathVariable;
 import org.springframework.web.multipart.MultipartFile;
 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) {
             public R commitCard(MultipartFile file) {
                 return R.fail("学生卡上传调用失败:" + throwable.getMessage());
                 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;
+}

+ 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=\
 org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
   com.zd.laboratory.api.feign.fallback.RemoteLaboratoryFallbackFactory,\
   com.zd.laboratory.api.feign.fallback.RemoteLaboratoryFallbackFactory,\
   com.zd.laboratory.api.feign.fallback.RemoteMessageContentFallbackFactory,\
   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
 
 

+ 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.constant.SecurityConstants;
 import com.zd.model.domain.AjaxResult;
 import com.zd.model.domain.AjaxResult;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import com.zd.model.entity.LoginUser;
 import com.zd.model.entity.LoginUser;
 import com.zd.model.entity.SysUser;
 import com.zd.model.entity.SysUser;
 import com.zd.system.api.feign.factory.RemoteUserFallback;
 import com.zd.system.api.feign.factory.RemoteUserFallback;
@@ -195,4 +196,8 @@ public interface RemoteUserService {
      */
      */
     @RequestMapping("/user/getUserByPhone/{phone}")
     @RequestMapping("/user/getUserByPhone/{phone}")
     R<SysUser> getUserByPhone(@PathVariable("phone") String 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.AjaxResult;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import com.zd.model.entity.LoginUser;
 import com.zd.model.entity.LoginUser;
 import com.zd.model.entity.SysUser;
 import com.zd.model.entity.SysUser;
 import com.zd.system.api.feign.RemoteUserService;
 import com.zd.system.api.feign.RemoteUserService;
@@ -189,7 +190,10 @@ public class RemoteUserFallback implements FallbackFactory<RemoteUserService> {
                 return R.fail("根据电话查询用户信息失败:" + throwable.getMessage());
                 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")
     @Excel(name = "首页banner")
     @ApiModelProperty(value = "首页banner")
     @ApiModelProperty(value = "首页banner")
     private String homepageBanner;
     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)
     public void setId(Long id)
     {
     {
         this.id = id;
         this.id = id;

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

@@ -150,4 +150,24 @@ public interface RedisService {
      * @return 对象列表
      * @return 对象列表
      */
      */
     public Collection<String> keys(final String pattern);
     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;
 package com.zd.common.core.redis;
 
 
+import com.zd.model.constant.BaseConstants;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.BoundSetOperations;
 import org.springframework.data.redis.core.BoundSetOperations;
 import org.springframework.data.redis.core.HashOperations;
 import org.springframework.data.redis.core.HashOperations;
@@ -128,4 +129,23 @@ public class RedisServiceImpl implements RedisService {
     public Collection<String> keys(final String pattern) {
     public Collection<String> keys(final String pattern) {
         return redisTemplate.keys(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;
+    }
 }
 }

+ 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 com.zd.model.constant.HttpStatus;
-
 import java.io.Serializable;
 import java.io.Serializable;
 
 
 /**
 /**

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

@@ -826,4 +826,8 @@ public class PerPrefix {
      * 电子信息牌信息
      * 电子信息牌信息
      */
      */
     public static final String LABORATORY_CARDINFO = "laboratory:cardInfo:";
     public static final String LABORATORY_CARDINFO = "laboratory:cardInfo:";
+    /**
+     * 电子信息牌人员前线
+     */
+    public static final String LABORATORY_XXPUSERAUTH= "laboratory:xxpUserAuth:";
 }
 }

+ 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> deptIds;
 
 
+    private List<Long> subjectIds;
+
+    private List<String> dateList;
+
     private boolean include = false;
     private boolean include = false;
 
 
     private List<Object> permitMenus = new ArrayList<>();
     private List<Object> permitMenus = new ArrayList<>();
@@ -724,4 +728,20 @@ public class SysUser extends BaseEntity implements Serializable {
     public void setCardNumSimple(String cardNumSimple) {
     public void setCardNumSimple(String cardNumSimple) {
         this.cardNumSimple = 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;
+    }
 }
 }

+ 82 - 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.FaceInfo;
 import com.arcsoft.face.toolkit.ImageInfo;
 import com.arcsoft.face.toolkit.ImageInfo;
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
 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.service.FaceService;
 import com.zd.alg.face.utils.FileUtil;
 import com.zd.alg.face.utils.FileUtil;
 import com.zd.algorithm.api.face.feign.FaceCompare;
 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.common.swagger.config.Knife4jConfiguration;
 import com.zd.laboratory.api.entity.LabStudentsInfo;
 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.laboratory.api.feign.RemoteStudentsService;
+import com.zd.model.constant.HttpStatus;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
-import lombok.extern.flogger.Flogger;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,6 +27,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 
 import java.io.*;
 import java.io.*;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * @Author: zhoupan
  * @Author: zhoupan
@@ -45,49 +49,112 @@ public class FaceApi {
     @Autowired
     @Autowired
     RemoteStudentsService remoteStudentsService;
     RemoteStudentsService remoteStudentsService;
 
 
+    @Autowired
+    RemoteDutyService remoteDutyService;
+
 
 
     @ApiOperation("根据照片文件获取特征码")
     @ApiOperation("根据照片文件获取特征码")
     @PostMapping("/faceFeature")
     @PostMapping("/faceFeature")
     public ResultData faceFeature(@RequestParam("file") MultipartFile file) throws IOException {
     public ResultData faceFeature(@RequestParam("file") MultipartFile file) throws IOException {
         ImageInfo imageInfo;
         ImageInfo imageInfo;
-        File file1=null;
+        File file1 = null;
         try {
         try {
-            file1= FileUtil.multipartFileToFile(file);
+            file1 = FileUtil.multipartFileToFile(file);
             imageInfo = faceService.getImageInfo(file1);
             imageInfo = faceService.getImageInfo(file1);
         } finally {
         } finally {
-            if(file1!=null)
-            {
+            if (file1 != null) {
                 file1.delete();
                 file1.delete();
             }
             }
         }
         }
         List<FaceInfo> faceInfos = faceService.faceDetect(imageInfo);
         List<FaceInfo> faceInfos = faceService.faceDetect(imageInfo);
+        if(null==faceInfos || faceInfos.size()==0){
+            return ResultData.fail("识别中");
+        }
         FaceFeature faceFeature = faceService.faceFeature(imageInfo, faceInfos);
         FaceFeature faceFeature = faceService.faceFeature(imageInfo, faceInfos);
         return ResultData.success(faceFeature.getFeatureData());
         return ResultData.success(faceFeature.getFeatureData());
     }
     }
+
     /**
     /**
      * 人脸比较
      * 人脸比较
+     *
      * @return
      * @return
      */
      */
     @ApiOperation("人脸比较")
     @ApiOperation("人脸比较")
     @PostMapping("/compare")
     @PostMapping("/compare")
-    public ResultData faceDetection(@RequestBody FaceCompare faceCompare)
-    {
+    public ResultData faceDetection(@RequestBody FaceCompare faceCompare) {
         logger.info("====人脸比较====");
         logger.info("====人脸比较====");
         R<LabStudentsInfo> info = remoteStudentsService.getInfo(faceCompare.getUserId());
         R<LabStudentsInfo> info = remoteStudentsService.getInfo(faceCompare.getUserId());
-        if(info.getCode()==200&&info.getData()!=null)
-        {
+        if (info.getCode() == 200 && info.getData() != null) {
             logger.info("====人脸data组装====");
             logger.info("====人脸data组装====");
             FaceFeature target = new FaceFeature(info.getData().getFaceFeature());
             FaceFeature target = new FaceFeature(info.getData().getFaceFeature());
             FaceFeature source = new FaceFeature(faceCompare.getData());
             FaceFeature source = new FaceFeature(faceCompare.getData());
             Boolean compore = faceService.compore(target, source);
             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(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) {
     private static void inputStreamToFile(InputStream ins, File file) {
         try {
         try {
@@ -103,9 +170,4 @@ public class FaceApi {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
     }
     }
-
-
-
-
-
 }
 }

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/utils/FileUtil.java

@@ -18,7 +18,7 @@ public class FileUtil {
 
 
         String originalFilename = file.getOriginalFilename();
         String originalFilename = file.getOriginalFilename();
         String[] filename = originalFilename.split("\\.");
         String[] filename = originalFilename.split("\\.");
-        toFile=File.createTempFile(filename[0], filename[1]);
+        toFile=File.createTempFile(filename[0], "." +filename[1]);
         file.transferTo(toFile);
         file.transferTo(toFile);
 //        toFile.deleteOnExit();//在jvm 退出时删除
 //        toFile.deleteOnExit();//在jvm 退出时删除
         return toFile;
         return toFile;

+ 16 - 0
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/controller/SignInCheckController.java

@@ -11,6 +11,7 @@ import com.zd.alg.forward.serivce.VideoCheckResultValidImpl;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.utils.Assert;
 import com.zd.common.core.utils.Assert;
+import com.zd.common.core.utils.UUID;
 import com.zd.common.swagger.config.Knife4jConfiguration;
 import com.zd.common.swagger.config.Knife4jConfiguration;
 import com.zd.model.constant.BaseConstants;
 import com.zd.model.constant.BaseConstants;
 import com.zd.model.constant.HttpStatus;
 import com.zd.model.constant.HttpStatus;
@@ -97,6 +98,21 @@ public class SignInCheckController {
     }
     }
 
 
 
 
+
+    /**
+     * 进入项验证:合并
+     *
+     * @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方法
      * 进入项验证:mock方法
      *
      *

+ 90 - 0
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/serivce/CheckService.java

@@ -217,6 +217,96 @@ public class CheckService {
     }
     }
 
 
     /**
     /**
+     * 合并检查 三合一套餐
+     */
+    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));
+                //添加一条算法请求记录
+                R alg = insertRequestRecordLog(orgImgUrl, subId, checkValid);
+                logger.info("【调用算法服务】 添加算法调用日志,添加结果:"+JSONObject.toJSONString(alg));
+                MultiValueMap<String, Object> params = getStringObjectMultiValueMap(checkValid, String.valueOf(id));
+                HttpEntity<MultiValueMap<String, Object>> files = getHttpEntityMap(toFile,"image", params);
+                ImgPostResponse<AnalysisReturnData> send = HttpUtils.sendV5(restTemplateLocal, files, algorithmYml);
+                //算法记录更新
+                if (alg.getCode() == 200) {
+                    updateRequestRecordLogV5(alg.getData() != null?Long.valueOf(alg.getData()+""):null, send);
+                    logger.info("【调用算法服务V5】 更新算法调用日志记录");
+                }
+                //判断算法
+                if (send.getStatus_code() == 1000) {
+                    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, "符合跳过条件执行跳过");
+                            }
+                        }
+                        return R.fail(300, "算法识别未通过", code);
+                    }
+                } else {
+                    assert send != null;
+                    //logger.error("【调用算法服务】 算法服务调用失败,响应信息:"+ JSONObject.toJSONString(send));
+                    return R.fail("算法服务错误,请重试!");
+                }
+            }
+            if (alarmNum == checkItem.length) {
+                return R.ok();
+            }
+        } catch (Exception e) {
+            logger.error("【调用算法服务】 算法服务调用发生异常", e);
+        }
+        return R.fail();
+    }
+
+    /**
      * 算法V6平台参数
      * 算法V6平台参数
      * @param checkValid
      * @param checkValid
      * @param extension
      * @param extension

+ 3 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java

@@ -91,7 +91,7 @@ public interface ISIPCommander {
 	 * @param device  视频设备
 	 * @param device  视频设备
 	 * @param channelId  预览通道
 	 * @param channelId  预览通道
 	 */
 	 */
-	void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent,Integer dpi);
+	void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
 
 
 	/**
 	/**
 	 * 请求回放视频流
 	 * 请求回放视频流
@@ -101,7 +101,7 @@ public interface ISIPCommander {
 	 * @param startTime 开始时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param startTime 开始时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 */
 	 */
-	void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInf, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent,Integer dpi);
+	void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInf, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
 
 
 	/**
 	/**
 	 * 请求历史媒体下载
 	 * 请求历史媒体下载
@@ -112,7 +112,7 @@ public interface ISIPCommander {
 	 * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param downloadSpeed 下载倍速参数
 	 * @param downloadSpeed 下载倍速参数
 	 */
 	 */
-	void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent,Integer dpi);
+	void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
 
 
 	/**
 	/**
 	 * 视频流停止
 	 * 视频流停止

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

@@ -338,7 +338,7 @@ public class SIPCommander implements ISIPCommander {
 	  * @param errorEvent sip错误订阅
 	  * @param errorEvent sip错误订阅
 	  */
 	  */
 	@Override
 	@Override
-	public void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent, Integer dpi) {
+	public void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent) {
 		String streamId = ssrcInfo.getStreamId();
 		String streamId = ssrcInfo.getStreamId();
 		try {
 		try {
 			if (device == null) return;
 			if (device == null) return;
@@ -412,7 +412,7 @@ public class SIPCommander implements ISIPCommander {
 			//content.append("a="+MediaStream.getMe diaStreamA(dpi)+"\r\n");
 			//content.append("a="+MediaStream.getMe diaStreamA(dpi)+"\r\n");
 			content.append("y="+ssrcInfo.getSsrc()+"\r\n");//ssrc
 			content.append("y="+ssrcInfo.getSsrc()+"\r\n");//ssrc
 			//验证2:设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
 			//验证2:设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
-			content.append("f="+MediaStream.getMediaStreamF(dpi)+"\r\n");
+			content.append("f="+MediaStream.getMediaStreamF(null)+"\r\n");
 			logger.info("【RTSP实时视频流请求】 请求参数:\r\n"+content.toString());
 			logger.info("【RTSP实时视频流请求】 请求参数:\r\n"+content.toString());
 			String tm = Long.toString(System.currentTimeMillis());
 			String tm = Long.toString(System.currentTimeMillis());
 
 
@@ -444,7 +444,7 @@ public class SIPCommander implements ISIPCommander {
 	 */
 	 */
 	@Override
 	@Override
 	public void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event
 	public void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event
-			, SipSubscribe.Event errorEvent, Integer dpi) {
+			, SipSubscribe.Event errorEvent) {
 		try {
 		try {
 			logger.info("{} 分配的ZLM为: {} [{}:{}]", ssrcInfo.getStreamId(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 			logger.info("{} 分配的ZLM为: {} [{}:{}]", ssrcInfo.getStreamId(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 			// 添加订阅
 			// 添加订阅
@@ -518,7 +518,7 @@ public class SIPCommander implements ISIPCommander {
 			}
 			}
 	        content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc
 	        content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc
 			//设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
 			//设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
-			content.append("f="+MediaStream.getMediaStreamF(dpi)+"\r\n");
+			content.append("f="+MediaStream.getMediaStreamF(null)+"\r\n");
 			String tm = Long.toString(System.currentTimeMillis());
 			String tm = Long.toString(System.currentTimeMillis());
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
 					: udpSipProvider.getNewCallId();
 					: udpSipProvider.getNewCallId();
@@ -545,7 +545,7 @@ public class SIPCommander implements ISIPCommander {
 	 */
 	 */
 	@Override
 	@Override
 	public void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event
 	public void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event
-			, SipSubscribe.Event errorEvent, Integer dpi) {
+			, SipSubscribe.Event errorEvent) {
 		try {
 		try {
 			logger.info("{} 分配的ZLM为: {} [{}:{}]", ssrcInfo.getStreamId(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 			logger.info("{} 分配的ZLM为: {} [{}:{}]", ssrcInfo.getStreamId(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 
 
@@ -621,7 +621,7 @@ public class SIPCommander implements ISIPCommander {
 
 
 	        content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc
 	        content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc
 			//设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
 			//设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
-			content.append("f="+MediaStream.getMediaStreamF(dpi)+"\r\n");
+			content.append("f="+MediaStream.getMediaStreamF(null)+"\r\n");
 			String tm = Long.toString(System.currentTimeMillis());
 			String tm = Long.toString(System.currentTimeMillis());
 
 
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMHttpHookListener.java

@@ -266,9 +266,7 @@ public class ZLMHttpHookListener {
 			if (mediaInfo != null) {
 			if (mediaInfo != null) {
 				subscribe.response(mediaInfo, json);
 				subscribe.response(mediaInfo, json);
 			}
 			}
-
 		}
 		}
-
 		// 流消失移除redis play
 		// 流消失移除redis play
 		String app = json.getString("app");
 		String app = json.getString("app");
 		String streamId = json.getString("stream");
 		String streamId = json.getString("stream");
@@ -304,7 +302,6 @@ public class ZLMHttpHookListener {
 				}
 				}
 			}
 			}
 		}
 		}
-
 		JSONObject ret = new JSONObject();
 		JSONObject ret = new JSONObject();
 		ret.put("code", 0);
 		ret.put("code", 0);
 		ret.put("msg", "success");
 		ret.put("msg", "success");

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

@@ -52,57 +52,64 @@ public class HardwareDeviceMonitor {
 
 
     @Scheduled(cron = "0 */9 * * * ?")
     @Scheduled(cron = "0 */9 * * * ?")
     public void checkPowerUse() {
     public void checkPowerUse() {
-        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 (!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 resp = DingTalkAlert.sendAlert(buffer.toString());
-                                    log.info("【设备监听提醒】 继电器异常监控--钉钉通知响应:" + resp);
+                                //封装消息
+                                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);
         }
         }
     }
     }
 }
 }

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

@@ -147,12 +147,6 @@
             <groupId>com.zd.algorithm</groupId>
             <groupId>com.zd.algorithm</groupId>
             <artifactId>zd-algorithm-api</artifactId>
             <artifactId>zd-algorithm-api</artifactId>
         </dependency>
         </dependency>
-        <dependency>
-            <groupId>com.zd.system</groupId>
-            <artifactId>zd-xxp-api</artifactId>
-            <version>3.1.0</version>
-            <scope>compile</scope>
-        </dependency>
     </dependencies>
     </dependencies>
 
 
     <build>
     <build>

+ 2 - 2
zd-modules/zd-base/src/main/java/com/zd/base/ZdBaseApplicaion.java

@@ -15,8 +15,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @SpringBootApplication
 @SpringBootApplication
 @EnableScheduling
 @EnableScheduling
 @ComponentScan(basePackages = BaseConstants.BASE_PACKAGE)
 @ComponentScan(basePackages = BaseConstants.BASE_PACKAGE)
-public class ZdBaseApplicaion {
+public class ZdBaseApplication {
     public static void main(String[] args) {
     public static void main(String[] args) {
-        ZdStartApplication.run(ApplicationConstants.BASE_SERVICE, ZdBaseApplicaion.class, args);
+        ZdStartApplication.run(ApplicationConstants.BASE_SERVICE, ZdBaseApplication.class, args);
     }
     }
 }
 }

+ 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());
+    }
+}

+ 385 - 24
zd-modules/zd-base/src/main/java/com/zd/base/app/controller/LabBoardApi.java

@@ -1,10 +1,17 @@
 package com.zd.base.app.controller;
 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.base.app.domain.board.LabXxpSubjectVo;
-import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.DateUtils;
+import com.zd.common.core.utils.FileConfigUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.laboratory.api.feign.RemoteDutyService;
 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.constant.HttpStatus;
 import com.zd.model.domain.R;
 import com.zd.model.domain.R;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
@@ -12,12 +19,14 @@ import com.zd.system.api.feign.RemoteUserService;
 import com.zd.system.api.vo.SysLogoConfigVO;
 import com.zd.system.api.vo.SysLogoConfigVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
 
 
 /**
 /**
@@ -30,12 +39,18 @@ import java.util.*;
 @Api(tags = {"电子信息牌"})
 @Api(tags = {"电子信息牌"})
 public class LabBoardApi {
 public class LabBoardApi {
 
 
+    private final Logger logger = LoggerFactory.getLogger(LabBoardApi.class);
+
     @Autowired
     @Autowired
     private RemoteUserService remoteUserService;
     private RemoteUserService remoteUserService;
     @Autowired
     @Autowired
     private RemoteDutyService remoteDutyService;
     private RemoteDutyService remoteDutyService;
     @Autowired
     @Autowired
-    private TokenService tokenService;
+    private RemoteXxpService remoteXxpService;
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
+    @Autowired
+    private RemoteFaceService remoteFaceService;
 
 
     /**
     /**
      * 查询电子信息牌头部信息
      * 查询电子信息牌头部信息
@@ -53,10 +68,14 @@ public class LabBoardApi {
             return ResultData.fail(500, "获取logo失败!");
             return ResultData.fail(500, "获取logo失败!");
         }
         }
         map.put("schoolName", logoConfigVo.getSchoolName());
         map.put("schoolName", logoConfigVo.getSchoolName());
-        map.put("circularLogo", logoConfigVo.getCircularLogo());
-        map.put("circularLogo", logoConfigVo.getCircularLogo());
-        map.put("currentTime", new Date());
-        return null;
+        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);
     }
     }
 
 
     /**
     /**
@@ -68,7 +87,7 @@ public class LabBoardApi {
         //查询实验室负责人和安全负责人
         //查询实验室负责人和安全负责人
         LabXxpSubjectVo vo = new LabXxpSubjectVo();
         LabXxpSubjectVo vo = new LabXxpSubjectVo();
         ResultData resultData = remoteDutyService.getXxpSubjectInfo(labId);
         ResultData resultData = remoteDutyService.getXxpSubjectInfo(labId);
-        if (null != resultData || resultData.getCode() != 200) {
+        if (null == resultData || resultData.getCode() != 200) {
             return ResultData.fail("获取实验室信息失败!");
             return ResultData.fail("获取实验室信息失败!");
         }
         }
         Map<String, Object> map = (Map<String, Object>) resultData.getData();
         Map<String, Object> map = (Map<String, Object>) resultData.getData();
@@ -98,6 +117,10 @@ public class LabBoardApi {
             }
             }
             vo.setSafeUserVoList(safeUserList);
             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);
         ResultData<LabXxpSubjectVo> xxpResultData= remoteDutyService.classifyDetailSubjectById(labId);
         if(null==xxpResultData || xxpResultData.getCode()!=200){
         if(null==xxpResultData || xxpResultData.getCode()!=200){
             return ResultData.fail("获取实验室信息类目失败!");
             return ResultData.fail("获取实验室信息类目失败!");
@@ -125,7 +148,7 @@ public class LabBoardApi {
             return ResultData.fail("签到人员获取失败!");
             return ResultData.fail("签到人员获取失败!");
         }
         }
         map.put("tentativeUser", signData.getData());
         map.put("tentativeUser", signData.getData());
-        ResultData securityData=remoteDutyService.securityApplyList(1,10,labId);
+        ResultData securityData=remoteDutyService.securityApplyList(labId,1,10);
         if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
         if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
             return ResultData.fail("安全准入人员获取失败!");
             return ResultData.fail("安全准入人员获取失败!");
         }
         }
@@ -136,20 +159,57 @@ public class LabBoardApi {
 
 
     @ApiOperation(value = "值班人员列表")
     @ApiOperation(value = "值班人员列表")
     @GetMapping(value = "/dutyUserList")
     @GetMapping(value = "/dutyUserList")
-    public ResultData dutyUsrList(@RequestParam Long labId,@RequestParam String startTime,@RequestParam String endTime) {
-        ResultData<List<Map<String, Object>>> dutyData=remoteDutyService.selectDutyUserList(labId,startTime,endTime);
-        if(null==dutyData || dutyData.getCode()!=HttpStatus.SUCCESS){
-            return ResultData.fail("值班人员列表获取失败!");
+    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.success(dutyData.getData());
+        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 = "巡查人员列表")
     @ApiOperation(value = "巡查人员列表")
-    @GetMapping(value = "/signUserList")
-    public ResultData signUserList(@RequestParam String startTime,@RequestParam String endTime,@RequestParam Long labId) {
-
-        return ResultData.success();
+    @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 = "实验室签到人员")
     @ApiOperation(value = "实验室签到人员")
@@ -164,8 +224,8 @@ public class LabBoardApi {
 
 
     @ApiOperation(value = "安全准入人员列表")
     @ApiOperation(value = "安全准入人员列表")
     @GetMapping(value = "/securityUserList")
     @GetMapping(value = "/securityUserList")
-    public ResultData securityUserList(@RequestParam Integer pageNumber,@RequestParam Integer pageSize,@RequestParam Long labId) {
-        ResultData securityData=remoteDutyService.securityApplyList(pageNumber,pageSize,labId);
+    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){
         if(null==securityData || securityData.getCode()!=HttpStatus.SUCCESS){
             return ResultData.fail("安全准入人员获取失败!");
             return ResultData.fail("安全准入人员获取失败!");
         }
         }
@@ -194,7 +254,308 @@ public class LabBoardApi {
         if(null==resultData || resultData.getCode()!=200){
         if(null==resultData || resultData.getCode()!=200){
             return ResultData.fail("获取摄像头编号失败!");
             return ResultData.fail("获取摄像头编号失败!");
         }
         }
-        ResultData data=remoteDutyService.selectSubjectCameraList(resultData.getData(),null,1,5000);
+        ResultData data=remoteXxpService.selectSubjectCameraList(resultData.getData(),null,1,5000);
         return data;
         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);
+    }
+
 }
 }

+ 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 <>();
+}

+ 45 - 1
zd-modules/zd-base/src/main/java/com/zd/base/app/domain/board/LabXxpSubjectVo.java

@@ -1,10 +1,10 @@
 package com.zd.base.app.domain.board;
 package com.zd.base.app.domain.board;
 
 
-import com.zd.model.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * @Author: donggaosheng
  * @Author: donggaosheng
@@ -34,6 +34,18 @@ public class LabXxpSubjectVo {
     @ApiModelProperty(value = "二维码地址")
     @ApiModelProperty(value = "二维码地址")
     private String deptName;
     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() {
     public String getDeptName() {
         return deptName;
         return deptName;
     }
     }
@@ -144,4 +156,36 @@ public class LabXxpSubjectVo {
     public void setXxpSubjectVoList(List<LabXxpSubjectVo> xxpSubjectVoList) {
     public void setXxpSubjectVoList(List<LabXxpSubjectVo> xxpSubjectVoList) {
         this.xxpSubjectVoList = 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;
+    }
 }
 }

+ 40 - 0
zd-modules/zd-modules-laboratory/pom.xml

@@ -17,6 +17,12 @@
         <dependency>
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>javassist</artifactId>
+                    <groupId>org.javassist</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         </dependency>
 
 
         <!-- SpringCloud Alibaba Nacos Config -->
         <!-- SpringCloud Alibaba Nacos Config -->
@@ -34,12 +40,24 @@
         <dependency>
         <dependency>
             <groupId>com.zd.core</groupId>
             <groupId>com.zd.core</groupId>
             <artifactId>common-core</artifactId>
             <artifactId>common-core</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>mybatis-spring</artifactId>
+                    <groupId>org.mybatis</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         </dependency>
 
 
         <!-- zd Common Swagger -->
         <!-- zd Common Swagger -->
         <dependency>
         <dependency>
             <groupId>com.zd.swagger</groupId>
             <groupId>com.zd.swagger</groupId>
             <artifactId>common-swagger</artifactId>
             <artifactId>common-swagger</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>guava</artifactId>
+                    <groupId>com.google.guava</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         </dependency>
 
 
         <!--mqtt客户端链接服务-->
         <!--mqtt客户端链接服务-->
@@ -60,6 +78,12 @@
             <groupId>com.deepoove</groupId>
             <groupId>com.deepoove</groupId>
             <artifactId>poi-tl</artifactId>
             <artifactId>poi-tl</artifactId>
             <version>1.10.2</version>
             <version>1.10.2</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>xml-apis</artifactId>
+                    <groupId>xml-apis</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         </dependency>
         <!--jsonp解析html-->
         <!--jsonp解析html-->
         <dependency>
         <dependency>
@@ -97,6 +121,22 @@
         <dependency>
         <dependency>
             <groupId>com.baomidou</groupId>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>mybatis</artifactId>
+                    <groupId>org.mybatis</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>jsqlparser</artifactId>
+                    <groupId>com.github.jsqlparser</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>net.coobird</groupId>
+            <artifactId>thumbnailator</artifactId>
+            <version>0.4.8</version>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>io.netty</groupId>
             <groupId>io.netty</groupId>

+ 127 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecurityApplyController.java

@@ -32,6 +32,8 @@ import com.zd.system.api.feign.RemoteUserService;
 import com.zd.model.entity.SysUser;
 import com.zd.model.entity.SysUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -53,6 +55,8 @@ import java.net.URL;
 @RequestMapping("/apply")
 @RequestMapping("/apply")
 public class LabSecurityApplyController extends BaseController
 public class LabSecurityApplyController extends BaseController
 {
 {
+    private final Logger logger = LoggerFactory.getLogger(LabSecurityApplyController.class);
+
     @Autowired
     @Autowired
     private ILabSecurityApplyService labSecurityApplyService;
     private ILabSecurityApplyService labSecurityApplyService;
 
 
@@ -80,6 +84,22 @@ public class LabSecurityApplyController extends BaseController
     @Autowired
     @Autowired
     private ILabWhitelistService labWhitelistService;
     private ILabWhitelistService labWhitelistService;
 
 
+    @Autowired
+    private IXxpDutyService xxpDutyService;
+
+
+    /**
+     * @param labSecurityApplyVO
+     * @return
+     */
+    @RequestMapping("/test")
+    public TableDataInfo<LabSecurityApplyVO> test(LabSecurityApplyVO labSecurityApplyVO)
+    {
+        startPage();
+        List<LabSecurityApplyVO> list = labSecurityApplyService.selectLabSecurityApplyList(labSecurityApplyVO);
+        return getDataTable(list);
+    }
+
     /**
     /**
      * 查询安全准入申请列表
      * 查询安全准入申请列表
      */
      */
@@ -795,10 +815,116 @@ public class LabSecurityApplyController extends BaseController
      */
      */
     @RequestMapping("/app/securityApplyList")
     @RequestMapping("/app/securityApplyList")
     @ApiOperation(value = "查询安全准入申请列表")
     @ApiOperation(value = "查询安全准入申请列表")
-    public ResultData appList(Integer pageNumber,Integer pageSize,Long subjectId)
+    public ResultData appList(Long subjectId,Integer pageNumber,Integer pageSize)
     {
     {
         startPage(pageNumber,pageSize);
         startPage(pageNumber,pageSize);
         List<Map<String,Object>> list = labSecurityApplyService.selectLabSecurityApply(subjectId);
         List<Map<String,Object>> list = labSecurityApplyService.selectLabSecurityApply(subjectId);
+        for(Map<String,Object> map:list){
+            if(StringUtils.isNotNull(map.get("avatar"))){
+                String avatar=fileConfigUtils.getFileDomainApp() + map.get("avatar");
+                map.put("avatar",avatar);
+            }
+        }
+        return ResultData.success(list);
+    }
+
+    /***
+     * 未过期的安全准入-值班使用
+     * @param userId
+     * @return
+     */
+    @RequestMapping("/getApplySubList")
+    @ApiOperation(value = "查询安全准入未过期列表")
+    public ResultData getUserApplySubList(Long userId)
+    {
+        LabSecurityApply securityApply = new LabSecurityApply();
+        securityApply.setUserId(userId);
+        List<LabSecurityApply> list = labSecurityApplyService.selectValidApply(securityApply);
         return ResultData.success(list);
         return ResultData.success(list);
     }
     }
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     * @param labId
+     * @return
+     */
+    @RequestMapping("/app/securityFingerList")
+    public ResultData securityFingerList(Long labId) {
+        List<Map<String, Object>> list = labSecurityApplyService.selectSecurityFingerList(labId);
+        for (Map<String, Object> map : list) {
+            map.put("isDutyUser", 0);
+            Long userId = Long.parseLong(map.get("userId") + "");
+            String userType = String.valueOf(map.get("userType"));
+            String isWhite = String.valueOf(map.get("isWhite"));
+            //如果是学生 或者白名单的老师 进二类页面
+            if (userType.equals("22") || (userType.equals("11") && isWhite.equals("0"))) {
+                map.put("pageType", 2);
+            }
+            int number = iLabSubjectService.isAdminOrSafeUser(labId, userId);
+            //一类首页对应身份为白名单老师、实验室负责人、安全责任人
+            if (number > 0 || (userType.equals("11") && isWhite.equals("1"))) {
+                map.put("pageType", 1);
+            }
+            String dateTime = DateUtils.getDate();
+            List<Map<String, Object>> dutyList = xxpDutyService.selectDutyUser(labId, dateTime);
+            //判断是否当天值班
+            for (Map<String, Object> dutyMap : dutyList) {
+                String userObj = String.valueOf(dutyMap.get("userId"));
+                if (StringUtils.isNotEmpty(userObj) && StringUtils.isNotNull(userObj)) {
+                    if (Long.parseLong(userObj) == userId) {
+                        map.put("isDutyUser", 1);
+                        break;
+                    }
+                }
+            }
+        }
+        return ResultData.success(list);
+    }
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     * @param labId
+     * @return
+     */
+    @RequestMapping("/app/securityNumList")
+    public ResultData securityNumList(Long labId,String cardNum)
+    {
+        cardNum=cardNum.replaceAll("\\s*|\r|\n|\t","");
+        List<Map<String,Object>> list = labSecurityApplyService.selectSecurityCardList(labId);
+        for(Map<String,Object> map:list){
+            map.put("isDutyUser",0);
+            if(StringUtils.isNotNull(map.get("cardNum"))){
+                String decryptCard=DESUtils.decrypt(String.valueOf(map.get("cardNum")));
+                logger.info("decryptCard卡号解密:"+decryptCard);
+                if(cardNum.equals(decryptCard)){
+                    String userType=String.valueOf(map.get("userType"));
+                    Long userId=Long.parseLong(String.valueOf(map.get("userId")));
+                    String isWhite=String.valueOf(map.get("isWhite"));
+                    //如果是学生 或者白名单的老师 进二类页面
+                    if(userType.equals("22") || (userType.equals("11") && isWhite.equals("0"))){
+                        map.put("pageType",2);
+                    }
+                    int num=iLabSubjectService.isAdminOrSafeUser(labId,userId);
+                    //一类首页对应身份为白名单老师、实验室负责人、安全责任人
+                    if(num>0 || (userType.equals("11") && isWhite.equals("1"))){
+                        map.put("pageType",1);
+                    }
+                    String dateTime = DateUtils.getDate();
+                    //判断是否当天值班
+                    List<Map<String,Object>> dutyList=xxpDutyService.selectDutyUser(labId,dateTime);
+                    for(Map<String,Object> dutyMap:dutyList){
+                        String userObj=String.valueOf(dutyMap.get("userId"));
+                        if(StringUtils.isNotEmpty(userObj) && StringUtils.isNotNull(userObj)){
+                            if(Long.parseLong(userObj)==userId){
+                                map.put("isDutyUser",1);
+                                break;
+                            }
+                        }
+                    }
+                    map.remove("cardNum");
+                    map.remove("isWhite");
+                    return ResultData.success(map);
+                }
+            }
+        }
+        return ResultData.success();
+    }
 }
 }

+ 20 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecuritySubjectmaterialController.java

@@ -4,6 +4,9 @@ import java.util.*;
 import java.io.IOException;
 import java.io.IOException;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 
 
+import com.zd.common.core.utils.StringUtils;
+import com.zd.laboratory.domain.XxpCardInfo;
+import com.zd.laboratory.service.IXxpCardInfoService;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
@@ -54,6 +57,9 @@ public class LabSecuritySubjectmaterialController extends BaseController
     private ILabSecurityMaterialDataService labSecurityMaterialDataService;
     private ILabSecurityMaterialDataService labSecurityMaterialDataService;
 
 
     @Autowired
     @Autowired
+    private IXxpCardInfoService xxpCardInfoService;
+
+    @Autowired
     private TokenService tokenService;
     private TokenService tokenService;
 
 
     /**
     /**
@@ -147,17 +153,30 @@ public class LabSecuritySubjectmaterialController extends BaseController
      * @return
      * @return
      */
      */
     @GetMapping("/listData")
     @GetMapping("/listData")
-    public ResultData  listData() {
+    public ResultData  listData(LabSecurityMaterialDataVO materialDataVO) {
         Map<String,Object> map = new HashMap<String,Object>();
         Map<String,Object> map = new HashMap<String,Object>();
          List<LabSecurityMaterialDataVO> listTeacher= labSecurityMaterialDataService.selectTemplateTeacherList();
          List<LabSecurityMaterialDataVO> listTeacher= labSecurityMaterialDataService.selectTemplateTeacherList();
          List<LabSecurityMaterialDataVO> listStudent= labSecurityMaterialDataService.selectTemplateStudentList();
          List<LabSecurityMaterialDataVO> listStudent= labSecurityMaterialDataService.selectTemplateStudentList();
 
 
+         //查询实验室下的电子信息牌
+        XxpCardInfo cardInfo = new XxpCardInfo();;
+        if(StringUtils.isNotNull(materialDataVO.getSubjectId())){
+            cardInfo.setSubjectId(materialDataVO.getSubjectId());
+            List<XxpCardInfo> cardInfoList = xxpCardInfoService.selectXxpCardInfoList(cardInfo);
+            if(cardInfoList.size()>0){
+                cardInfo = cardInfoList.get(0);
+            }
+        }
+
+
+
         /* //教职工模板
         /* //教职工模板
         List<LabSecuritySubjectmaterialVO> listTeacher=  labSecuritySubjectmaterialService.selectTeacherList();
         List<LabSecuritySubjectmaterialVO> listTeacher=  labSecuritySubjectmaterialService.selectTeacherList();
         //学生模板
         //学生模板
         List<LabSecuritySubjectmaterialVO> listStudent=  labSecuritySubjectmaterialService.selectStudentList();*/
         List<LabSecuritySubjectmaterialVO> listStudent=  labSecuritySubjectmaterialService.selectStudentList();*/
         map.put("listTeacher",listTeacher);
         map.put("listTeacher",listTeacher);
         map.put("listStudent",listStudent);
         map.put("listStudent",listStudent);
+        map.put("cardInfo",cardInfo);
         return ResultData.success(map);
         return ResultData.success(map);
     }
     }
 
 

+ 16 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabStudentsInfoController.java

@@ -7,6 +7,8 @@ import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.utils.SecurityUtils;
 import com.zd.common.core.utils.SecurityUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.common.core.web.controller.BaseController;
+import com.zd.laboratory.api.entity.LabSysUserInfo;
+import com.zd.laboratory.api.feign.RemoteMessageContentService;
 import com.zd.laboratory.domain.dto.LabStudentsInfoAuditDTO;
 import com.zd.laboratory.domain.dto.LabStudentsInfoAuditDTO;
 import com.zd.laboratory.domain.vo.LabStudentsInfoVO;
 import com.zd.laboratory.domain.vo.LabStudentsInfoVO;
 import com.zd.laboratory.service.ILabStudentsInfoService;
 import com.zd.laboratory.service.ILabStudentsInfoService;
@@ -14,6 +16,7 @@ import com.zd.model.domain.R;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.domain.per.PerPrefix;
+import com.zd.model.entity.SysFile;
 import com.zd.model.enums.AuditStatusEnum;
 import com.zd.model.enums.AuditStatusEnum;
 import com.zd.model.page.TableDataInfo;
 import com.zd.model.page.TableDataInfo;
 import com.zd.system.api.entity.LabStudentsInfo;
 import com.zd.system.api.entity.LabStudentsInfo;
@@ -46,6 +49,8 @@ public class LabStudentsInfoController extends BaseController {
 
 
     @Autowired
     @Autowired
     private RemoteFaceService remoteFaceService;
     private RemoteFaceService remoteFaceService;
+    @Autowired
+    private RemoteMessageContentService remoteMessageContentService;
 
 
     /**
     /**
      * 查询学生信息列表
      * 查询学生信息列表
@@ -204,4 +209,15 @@ public class LabStudentsInfoController extends BaseController {
         return ResultData.success(labStudentsInfoService.selectLabStudentsInfoByJoinStudentsId(SecurityUtils.getUserId()));
         return ResultData.success(labStudentsInfoService.selectLabStudentsInfoByJoinStudentsId(SecurityUtils.getUserId()));
     }
     }
 
 
+
+    /**
+     * 获取学生登录用户信息
+     */
+    @ApiOperation(value = "获取安全实验室安全人员的人脸信息")
+    @RequestMapping(value = "/getFaceBySecuritySubjectId")
+    public ResultData<List<LabSysUserInfo>> getFaceBySecuritySubjectId(Long subjectId) {
+        List<LabSysUserInfo> labSysUserInfoList= labStudentsInfoService.selectLabStudentsInfoBySubjectId(subjectId);
+        return ResultData.success(labSysUserInfoList);
+    }
+
 }
 }

+ 11 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubMangerV2Controller.java

@@ -4,6 +4,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.common.swagger.config.Knife4jConfiguration;
 import com.zd.common.swagger.config.Knife4jConfiguration;
+import com.zd.laboratory.api.vo.ClassifyVO;
 import com.zd.laboratory.domain.AdminWranCount;
 import com.zd.laboratory.domain.AdminWranCount;
 import com.zd.laboratory.domain.LabSubject;
 import com.zd.laboratory.domain.LabSubject;
 import com.zd.laboratory.domain.SubDiyVO;
 import com.zd.laboratory.domain.SubDiyVO;
@@ -11,6 +12,7 @@ import com.zd.laboratory.domain.dto.LabSubListQuery;
 import com.zd.laboratory.domain.vo.LabRiskPlanAbnormalLogVO;
 import com.zd.laboratory.domain.vo.LabRiskPlanAbnormalLogVO;
 import com.zd.laboratory.service.ILabRiskPlanAbnormalLogService;
 import com.zd.laboratory.service.ILabRiskPlanAbnormalLogService;
 import com.zd.laboratory.service.ILabSubjectService;
 import com.zd.laboratory.service.ILabSubjectService;
+import com.zd.laboratory.service.impl.LabSubjectManagerService;
 import com.zd.laboratory.service.impl.SubQueryManager;
 import com.zd.laboratory.service.impl.SubQueryManager;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
 import com.zd.model.entity.SubQueryConfig;
 import com.zd.model.entity.SubQueryConfig;
@@ -44,6 +46,9 @@ public class LabSubMangerV2Controller extends BaseController {
     @Autowired
     @Autowired
     private ILabRiskPlanAbnormalLogService labRiskPlanAbnormalLogService;
     private ILabRiskPlanAbnormalLogService labRiskPlanAbnormalLogService;
 
 
+    @Autowired
+    LabSubjectManagerService subjectManagerService;
+
     /**
     /**
      * 查询实验室控制数据列表- 数据权限(包括负责人) 小程序我的实验室
      * 查询实验室控制数据列表- 数据权限(包括负责人) 小程序我的实验室
      */
      */
@@ -80,6 +85,12 @@ public class LabSubMangerV2Controller extends BaseController {
     @PostMapping("/diy/{id}/common")
     @PostMapping("/diy/{id}/common")
     public ResultData<List<SubDiyVO>> querySubCListVO(@PathVariable("id") Long id, @RequestBody SubQueryConfig subQueryConfig) {
     public ResultData<List<SubDiyVO>> querySubCListVO(@PathVariable("id") Long id, @RequestBody SubQueryConfig subQueryConfig) {
         List<SubDiyVO> subDiyVOList = subQueryManager.querySubs(subQueryConfig, id);
         List<SubDiyVO> subDiyVOList = subQueryManager.querySubs(subQueryConfig, id);
+        if(subDiyVOList.size()>0){
+            //安全类目信息查询
+            subDiyVOList.get(0).setClassifyList(subjectManagerService.getSubClassify(id));
+            //实验室二维码
+            subDiyVOList.get(0).getSafeInfo().setQrCodeUrl(subDiyVOList.get(0).getRoom()==null?"":id + "-" + subDiyVOList.get(0).getRoom());
+        }
         return ResultData.success(subDiyVOList);
         return ResultData.success(subDiyVOList);
     }
     }
 
 

+ 12 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubjectAccessRecordController.java

@@ -5,6 +5,8 @@ import java.io.IOException;
 import java.util.Map;
 import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 
 
+import com.zd.common.core.utils.FileConfigUtils;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.domain.per.PerPrefix;
@@ -34,6 +36,8 @@ import com.zd.model.page.TableDataInfo;
 public class LabSubjectAccessRecordController extends BaseController {
 public class LabSubjectAccessRecordController extends BaseController {
     @Autowired
     @Autowired
     private ILabSubjectAccessRecordService labSubjectAccessRecordService;
     private ILabSubjectAccessRecordService labSubjectAccessRecordService;
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
 
 
     /**
     /**
      * 查询实验室进出记录列表
      * 查询实验室进出记录列表
@@ -153,6 +157,13 @@ public class LabSubjectAccessRecordController extends BaseController {
     /*************************************************/
     /*************************************************/
     @RequestMapping("/selectSubjectSignList")
     @RequestMapping("/selectSubjectSignList")
     public ResultData selectSubjectSignList(Long subjectId) {
     public ResultData selectSubjectSignList(Long subjectId) {
-        return ResultData.success(labSubjectAccessRecordService.selectSubjectSignList(subjectId));
+        List<Map<String,Object>> mapSignList=labSubjectAccessRecordService.selectSubjectSignList(subjectId);
+        for(Map<String,Object> map:mapSignList){
+            if(StringUtils.isNotNull(map.get("avatar"))){
+               String avatar=fileConfigUtils.getFileDomainApp() + map.get("avatar");
+               map.put("avatar",avatar);
+            }
+        }
+        return ResultData.success(mapSignList);
     }
     }
 }
 }

+ 21 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSubjectController.java

@@ -402,6 +402,11 @@ public class LabSubjectController extends BaseController {
         return ResultData.success(labSubjectService.multipleDetpBysubList(ids));
         return ResultData.success(labSubjectService.multipleDetpBysubList(ids));
     }
     }
 
 
+    @GetMapping("/cardInfo/subList")
+    public ResultData cardinfoSubList(LabSubject labSubject) {
+        return ResultData.success(labSubjectService.cardinfoSubList(labSubject));
+    }
+
     /**
     /**
      * 获取实验室气瓶数量详细信息
      * 获取实验室气瓶数量详细信息
      */
      */
@@ -448,4 +453,20 @@ public class LabSubjectController extends BaseController {
     public ResultData getSubjectDetails(@PathVariable("id") Long id) {
     public ResultData getSubjectDetails(@PathVariable("id") Long id) {
         return ResultData.success(labSubjectService.getSubjectDetailsById(id));
         return ResultData.success(labSubjectService.getSubjectDetailsById(id));
     }
     }
+
+    /**
+     * 获取信息牌首页实验室的信息
+     */
+    @RequestMapping(value = "/getSubjectName/{id}")
+    public ResultData getSubjectName(@PathVariable("id") Long id) {
+        return ResultData.success(labSubjectService.getSubjectNameById(id));
+    }
+
+    /**
+     * 获取信息牌首页实验室的信息
+     */
+    @RequestMapping(value = "/isAdminOrSafeUser/{labId}/{userId}")
+    public ResultData getSubjectName(@PathVariable("labId") Long labId,@PathVariable("userId") Long userId) {
+        return ResultData.success(labSubjectService.isAdminOrSafeUser(labId,userId));
+    }
 }
 }

+ 14 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabWhitelistController.java

@@ -99,6 +99,20 @@ public class LabWhitelistController extends BaseController
     }
     }
 
 
     /**
     /**
+     * 获取白名单信息-值班使用
+     * @param userId
+     * @return
+     */
+    @ApiOperation(value = "获取白名单详细信息-值班使用")
+    @GetMapping(value = "/subWhiteList")
+    public ResultData<List<LabWhitelistVO>> getWhiteSubList(Long userId)
+    {
+        LabWhitelistVO vo = new LabWhitelistVO();
+        vo.setUserId(userId);
+        return ResultData.success(labWhitelistService.selectWhiteSublist(vo));
+    }
+
+    /**
      * 新增白名单
      * 新增白名单
      */
      */
     @ApiOperation(value = "新增白名单")
     @ApiOperation(value = "新增白名单")

+ 183 - 19
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpCardInfoController.java

@@ -3,12 +3,18 @@ package com.zd.laboratory.controller;
 import com.zd.common.core.annotation.Log;
 import com.zd.common.core.annotation.Log;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.log.BusinessType;
+import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.ExcelUtil;
 import com.zd.common.core.utils.ExcelUtil;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.common.core.web.controller.BaseController;
-import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.XxpCardInfo;
 import com.zd.laboratory.domain.XxpCardInfo;
+import com.zd.laboratory.service.ILabSecurityApplyService;
+import com.zd.laboratory.service.ILabSubjectService;
 import com.zd.laboratory.service.IXxpCardInfoService;
 import com.zd.laboratory.service.IXxpCardInfoService;
+import com.zd.laboratory.service.IXxpDutyService;
+import com.zd.model.constant.CacheConstants;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.domain.per.PerPrefix;
@@ -21,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * 电子信息牌Controller
  * 电子信息牌Controller
@@ -31,13 +38,20 @@ import java.util.List;
 @RestController
 @RestController
 @Api(tags = "【电子信息牌】")
 @Api(tags = "【电子信息牌】")
 @RequestMapping("/XxpCardInfo")
 @RequestMapping("/XxpCardInfo")
-public class LabXxpCardInfoController extends BaseController
-{
+public class LabXxpCardInfoController extends BaseController {
     @Autowired
     @Autowired
     private IXxpCardInfoService xxpCardInfoService;
     private IXxpCardInfoService xxpCardInfoService;
+    @Autowired
+    private ILabSecurityApplyService iLabSecurityApplyService;
+    @Autowired
+    private ILabSubjectService iLabSubjectService;
+    @Autowired
+    private IXxpDutyService iXxpDutyService;
 
 
     @Autowired
     @Autowired
     private TokenService tokenService;
     private TokenService tokenService;
+    @Autowired
+    private RedisService redisService;
 
 
     /**
     /**
      * 查询电子信息牌列表
      * 查询电子信息牌列表
@@ -45,8 +59,24 @@ public class LabXxpCardInfoController extends BaseController
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.LIST)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.LIST)
     @GetMapping("/list")
     @GetMapping("/list")
     @ApiOperation(value = "查询电子信息牌列表")
     @ApiOperation(value = "查询电子信息牌列表")
-    public TableDataInfo<XxpCardInfo> list(XxpCardInfo xxpCardInfo)
-    {
+    public TableDataInfo<XxpCardInfo> list(XxpCardInfo xxpCardInfo) {
+        startPage("create_time", "descending");
+        List<XxpCardInfo> list = xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
+        for (XxpCardInfo cardInfo:list){
+            //设备是否在线
+            if(StringUtils.isNotNull(redisService.getCacheObject(CacheConstants.HEARTBEAT+cardInfo.getCardNum()))){
+                cardInfo.setOperate(2);
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询电子信息牌列表-无权限
+     */
+    @GetMapping("/getlist")
+    @ApiOperation(value = "查询电子信息牌列表-无权限")
+    public TableDataInfo<XxpCardInfo> getlist(XxpCardInfo xxpCardInfo) {
         startPage();
         startPage();
         List<XxpCardInfo> list = xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
         List<XxpCardInfo> list = xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
         return getDataTable(list);
         return getDataTable(list);
@@ -59,8 +89,7 @@ public class LabXxpCardInfoController extends BaseController
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.EXPORT)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.EXPORT)
     @Log(title = "电子信息牌", businessType = BusinessType.EXPORT)
     @Log(title = "电子信息牌", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, XxpCardInfo xxpCardInfo) throws IOException
-    {
+    public void export(HttpServletResponse response, XxpCardInfo xxpCardInfo) throws IOException {
         List<XxpCardInfo> list = xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
         List<XxpCardInfo> list = xxpCardInfoService.selectXxpCardInfoList(xxpCardInfo);
         ExcelUtil<XxpCardInfo> util = new ExcelUtil<XxpCardInfo>(XxpCardInfo.class);
         ExcelUtil<XxpCardInfo> util = new ExcelUtil<XxpCardInfo>(XxpCardInfo.class);
         util.exportExcel(response, list, "电子信息牌数据");
         util.exportExcel(response, list, "电子信息牌数据");
@@ -72,8 +101,7 @@ public class LabXxpCardInfoController extends BaseController
     @ApiOperation(value = "获取电子信息牌详细")
     @ApiOperation(value = "获取电子信息牌详细")
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.QUERY)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.QUERY)
     @GetMapping(value = "/{id}")
     @GetMapping(value = "/{id}")
-    public ResultData<XxpCardInfo> getInfo(@PathVariable("id") Long id)
-    {
+    public ResultData<XxpCardInfo> getInfo(@PathVariable("id") Long id) {
         return ResultData.success(xxpCardInfoService.selectXxpCardInfoById(id));
         return ResultData.success(xxpCardInfoService.selectXxpCardInfoById(id));
     }
     }
 
 
@@ -85,12 +113,19 @@ public class LabXxpCardInfoController extends BaseController
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.ADD)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.ADD)
     @Log(title = "电子信息牌", businessType = BusinessType.INSERT)
     @Log(title = "电子信息牌", businessType = BusinessType.INSERT)
     @PostMapping
     @PostMapping
-    public ResultData add(@RequestBody XxpCardInfo xxpCardInfo)
-    {
+    public ResultData add(@RequestBody XxpCardInfo xxpCardInfo) {
         return ResultData.result(xxpCardInfoService.insertXxpCardInfo(xxpCardInfo));
         return ResultData.result(xxpCardInfoService.insertXxpCardInfo(xxpCardInfo));
     }
     }
 
 
-
+    /**
+     * 新增电子信息牌-无权限
+     */
+    @ApiOperation(value = "新增电子信息牌-无权限")
+    @Log(title = "电子信息牌", businessType = BusinessType.INSERT)
+    @PostMapping("/addInfo")
+    public ResultData addInfo(@RequestBody XxpCardInfo xxpCardInfo) {
+        return ResultData.result(xxpCardInfoService.insertXxpCardInfo(xxpCardInfo));
+    }
 
 
     /**
     /**
      * 修改电子信息牌
      * 修改电子信息牌
@@ -99,9 +134,18 @@ public class LabXxpCardInfoController extends BaseController
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.EDIT)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.EDIT)
     @Log(title = "电子信息牌", businessType = BusinessType.UPDATE)
     @Log(title = "电子信息牌", businessType = BusinessType.UPDATE)
     @PutMapping
     @PutMapping
-    public ResultData edit(@RequestBody XxpCardInfo xxpCardInfo)
-    {
-        return  ResultData.result(xxpCardInfoService.updateXxpCardInfo(xxpCardInfo));
+    public ResultData edit(@RequestBody XxpCardInfo xxpCardInfo) {
+        return ResultData.result(xxpCardInfoService.updateXxpCardInfo(xxpCardInfo));
+    }
+
+    /**
+     * 修改电子信息牌-无权限
+     */
+    @ApiOperation(value = "修改电子信息牌-无权限")
+    @Log(title = "电子信息牌", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public ResultData editCard(@RequestBody XxpCardInfo xxpCardInfo) {
+        return ResultData.result(xxpCardInfoService.updateXxpCardInfo(xxpCardInfo));
     }
     }
 
 
     /**
     /**
@@ -111,13 +155,13 @@ public class LabXxpCardInfoController extends BaseController
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.REMOVE)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.REMOVE)
     @Log(title = "电子信息牌", businessType = BusinessType.DELETE)
     @Log(title = "电子信息牌", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @DeleteMapping("/{ids}")
-    public ResultData remove(@PathVariable Long[] ids)
-    {
+    public ResultData remove(@PathVariable Long[] ids) {
         return ResultData.result(xxpCardInfoService.deleteXxpCardInfoByIds(ids));
         return ResultData.result(xxpCardInfoService.deleteXxpCardInfoByIds(ids));
     }
     }
 
 
     /**
     /**
      * 根据id删除
      * 根据id删除
+     *
      * @param id
      * @param id
      * @return
      * @return
      */
      */
@@ -125,9 +169,129 @@ public class LabXxpCardInfoController extends BaseController
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.REMOVE)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CARDINFO + PerFun.REMOVE)
     @Log(title = "电子信息牌", businessType = BusinessType.DELETE)
     @Log(title = "电子信息牌", businessType = BusinessType.DELETE)
     @PostMapping("/{id}")
     @PostMapping("/{id}")
-    public ResultData remove(@PathVariable Long id)
-    {
+    public ResultData remove(@PathVariable Long id) {
+        return ResultData.result(xxpCardInfoService.deleteXxpCardInfoById(id));
+    }
+
+    /**
+     * 根据id删除-无权限
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id删除-无权限")
+    @Log(title = "电子信息牌", businessType = BusinessType.DELETE)
+    @PostMapping("/del/{id}")
+    public ResultData del(@PathVariable Long id) {
         return ResultData.result(xxpCardInfoService.deleteXxpCardInfoById(id));
         return ResultData.result(xxpCardInfoService.deleteXxpCardInfoById(id));
     }
     }
 
 
+
+    /**
+     * 根据卡号获取电子信息牌信息
+     *
+     * @param cardNum
+     * @return
+     */
+    @RequestMapping("/XxpCardInfoByCard/{num}")
+    public ResultData XxpCardInfoByCard(@PathVariable("num") String cardNum) {
+        List<Map<String, Object>> list = xxpCardInfoService.selectXxpCardInfoByCard(cardNum);
+        if (list.size() > 0) {
+            return ResultData.success(list.get(0));
+        }
+        return ResultData.success();
+    }
+
+
+    /**
+     * 验证密码是否正确
+     *
+     * @param num 电子班牌号码
+     * @param pwd 用户密码
+     * @param labId 实验室id
+     * @param userId 用户id
+     * @return
+     */
+    @RequestMapping("/pwdValidate")
+    public ResultData pwdValidate(String num, String pwd,Long labId, Long userId) {
+        Integer isDutyUser=0;
+        Map<String,Object> map=iLabSecurityApplyService.selectCountLabSecurityUserId(labId,userId);
+        if(null==map){
+            return ResultData.fail("未获得实验室准入资格;");
+        }
+        int count = xxpCardInfoService.selectPwdCountByPwd(num, pwd);
+        if (count == 0) {
+            return ResultData.fail("密码输入错误,请重新输入;");
+        }
+        String userType=String.valueOf(map.get("userType"));
+        String isWhite=String.valueOf(map.get("isWhite"));
+        //如果是学生 或者白名单的老师 进二类页面
+        if(userType.equals("22") || (userType.equals("11") && isWhite.equals("0"))){
+            map.put("pageType",2);
+        }
+        int number=iLabSubjectService.isAdminOrSafeUser(labId,userId);
+        //一类首页对应身份为白名单老师、实验室负责人、安全责任人
+        if(number>0 || (userType.equals("11") && isWhite.equals("1"))){
+            map.put("pageType",1);
+        }
+        map.remove("isWhite");
+        String dateTime = DateUtils.getDate();
+        List<Map<String,Object>> list = iXxpDutyService.selectDutyUser(labId,dateTime);
+        //判断是否当天值班
+        for(Map<String,Object> dutyMap:list){
+            String userObj=String.valueOf(dutyMap.get("userId"));
+            if(StringUtils.isNotEmpty(userObj) && StringUtils.isNotNull(userObj)){
+                if(Long.parseLong(userObj)==userId){
+                    isDutyUser=1;
+                    break;
+                }
+            }
+        }
+        map.put("isDutyUser",isDutyUser);
+        return ResultData.success(map);
+    }
+
+
+
+    /**
+     * 验证用户签退走巡查签退还是准入签退
+     * @param labId 实验室id
+     * @param userId 用户id
+     * @return
+     */
+    @RequestMapping("/validateUser")
+    public ResultData validateUser(Long labId, Long userId) {
+        Integer isDutyUser=0;
+        Map<String,Object> map=iLabSecurityApplyService.selectCountLabSecurityUserId(labId,userId);
+        if(null==map){
+            return ResultData.fail("未获得实验室准入资格;");
+        }
+        String userType=String.valueOf(map.get("userType"));
+        String isWhite=String.valueOf(map.get("isWhite"));
+        //如果是学生 或者白名单的老师 进二类页面
+        if(userType.equals("22") || (userType.equals("11") && isWhite.equals("0"))){
+            map.put("pageType",2);
+        }
+        int number=iLabSubjectService.isAdminOrSafeUser(labId,userId);
+        //一类首页对应身份为白名单老师、实验室负责人、安全责任人
+        if(number>0 || (userType.equals("11") && isWhite.equals("1"))){
+            map.put("pageType",1);
+        }
+        map.remove("isWhite");
+        String dateTime = DateUtils.getDate();
+        List<Map<String,Object>> list = iXxpDutyService.selectDutyUser(labId,dateTime);
+        //判断是否当天值班
+        for(Map<String,Object> dutyMap:list){
+            String userObj=String.valueOf(dutyMap.get("userId"));
+            if(StringUtils.isNotEmpty(userObj) && StringUtils.isNotNull(userObj)){
+                if(Long.parseLong(userObj)==userId){
+                    isDutyUser=1;
+                    break;
+                }
+            }
+        }
+        map.put("isDutyUser",isDutyUser);
+        return ResultData.success(map);
+    }
+
 }
 }

+ 117 - 7
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyController.java

@@ -6,16 +6,19 @@ import com.zd.common.core.exception.NoRollException;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.ExcelUtil;
 import com.zd.common.core.utils.ExcelUtil;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.common.core.web.controller.BaseController;
+import com.zd.laboratory.api.vo.ClassifyDetailVO;
+import com.zd.laboratory.api.vo.ClassifyVO;
 import com.zd.laboratory.domain.LabWhiteJoinSublist;
 import com.zd.laboratory.domain.LabWhiteJoinSublist;
 import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.XxpClassify;
 import com.zd.laboratory.domain.XxpClassify;
+import com.zd.laboratory.domain.XxpClassifyDetail;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
 import com.zd.laboratory.domain.vo.LabWhitelistVO;
 import com.zd.laboratory.domain.vo.LabWhitelistVO;
-import com.zd.laboratory.service.ILabWhiteJoinSublistService;
-import com.zd.laboratory.service.ILabWhitelistService;
+import com.zd.laboratory.domain.vo.XxpClassifyDetailVO;
+import com.zd.laboratory.service.IXxpClassifyDetailedService;
 import com.zd.laboratory.service.IXxpClassifyService;
 import com.zd.laboratory.service.IXxpClassifyService;
-import com.zd.laboratory.service.impl.HaiKangDoorService;
 import com.zd.model.constant.HttpStatus;
 import com.zd.model.constant.HttpStatus;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerFun;
@@ -27,9 +30,9 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
-
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
@@ -48,6 +51,9 @@ public class LabXxpClassifyController extends BaseController
     private IXxpClassifyService xxpClassifyService;
     private IXxpClassifyService xxpClassifyService;
 
 
     @Autowired
     @Autowired
+    private IXxpClassifyDetailedService xxpClassifyDetailedService;
+
+    @Autowired
     private TokenService tokenService;
     private TokenService tokenService;
 
 
     /**
     /**
@@ -58,14 +64,47 @@ public class LabXxpClassifyController extends BaseController
     @ApiOperation(value = "查询信息牌类目列表")
     @ApiOperation(value = "查询信息牌类目列表")
     public TableDataInfo<XxpClassify> list(XxpClassify xxpClassify)
     public TableDataInfo<XxpClassify> list(XxpClassify xxpClassify)
     {
     {
-        // 排序规则获取
-        String sort=  "s".equals(xxpClassify.getRemark())?"sort":"create_time";
-        startPage(sort,"descending");
+        startPage();
         List<XxpClassify> list = xxpClassifyService.selectXxpClassifyList(xxpClassify);
         List<XxpClassify> list = xxpClassifyService.selectXxpClassifyList(xxpClassify);
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
     /**
     /**
+     * 查询信息牌类目列表-无权限-实验室编辑使用
+     */
+    @GetMapping("/listSub")
+    public TableDataInfo<XxpClassify> listSub(XxpClassifyDetailVO detailVO)
+    {
+        // 显示的
+        XxpClassify cfy = new XxpClassify();
+        //展示的数据
+        cfy.setIsShow(1);
+        List<XxpClassify> list = xxpClassifyService.selectXxpClassifyList(cfy);
+        XxpClassifyDetailVO  publicCd= new XxpClassifyDetailVO();
+        XxpClassifyDetailVO  privateCd = new XxpClassifyDetailVO();
+        XxpClassifyDetailVO  normalCd = new XxpClassifyDetailVO();
+        for (XxpClassify classify:list) {
+
+            //查询非公共所有配置
+            normalCd.setIsCollective(1);
+            normalCd.setInfoClassifyId(classify.getId());
+            List<XxpClassifyDetailVO> normalList = xxpClassifyDetailedService.selectXxpClassifyDetailedList(normalCd);
+            classify.setNormalDetailList(normalList);
+
+            if(StringUtils.isNotNull(detailVO.getSubjectId())){
+                //查询私有配置
+                privateCd.setInfoClassifyId(classify.getId());
+                privateCd.setIsCollective(1);
+                privateCd.setSubjectId(detailVO.getSubjectId());
+                List<XxpClassifyDetailVO> privateList = xxpClassifyDetailedService.selectXxpClassifyDetailedByPara(privateCd);
+                classify.setPrivateDetailList(privateList);
+            }
+
+        }
+        return getDataTable(list);
+    }
+
+    /**
      * 导出信息牌类目列表
      * 导出信息牌类目列表
      */
      */
     @ApiOperation(value = "导出信息牌类目列表")
     @ApiOperation(value = "导出信息牌类目列表")
@@ -143,4 +182,75 @@ public class LabXxpClassifyController extends BaseController
         return ResultData.result(xxpClassifyService.deleteXxpClassifyById(id));
         return ResultData.result(xxpClassifyService.deleteXxpClassifyById(id));
     }
     }
 
 
+    @ApiOperation(value = "是否有子类")
+    @GetMapping(value = "/delCheck")
+    public TableDataInfo<XxpClassifyDetailVO> delCheck(Long id)
+    {
+        return getDataTable(xxpClassifyService.delCheck(id));
+    }
+
+    /***
+     * 根据实验室id查询实验室安全类目
+     * @param subJectId
+     * @return
+     */
+    @ApiOperation(value = "根据实验室id查询实验室安全类目")
+    @GetMapping(value = "/getClassifyBySubId")
+    public List<ClassifyVO> getSubClassify(Long subJectId){
+        List<ClassifyVO> classifyVOList = new ArrayList<>();
+        try {
+            //查询所有有效类目配置
+            XxpClassify classify = new XxpClassify();
+            classify.setIsShow(1);
+            //classify.setIsSpecial(1);
+            classify.setRemark("sort");
+            List<XxpClassify> classifyList = xxpClassifyService.selectXxpClassifyList(classify);
+            for (XxpClassify xcf:classifyList) {
+                ClassifyVO classifyVO = new ClassifyVO();
+                classifyVO.setId(xcf.getId());
+                classifyVO.setClassifyName(xcf.getClassifyName());
+                classifyVO.setClassifyType(xcf.getClassifyType());
+                classifyVOList.add(classifyVO);
+
+                //查询公共配置
+                XxpClassifyDetailVO detailVO = new XxpClassifyDetailVO();
+                detailVO.setInfoClassifyId(xcf.getId());
+                detailVO.setIsCollective(1);
+                //类目下公共所有子项类目
+                List<XxpClassifyDetailVO> allDetailList= xxpClassifyDetailedService.selectXxpClassifyDetailedList(detailVO);
+                List<ClassifyDetailVO> showPublickList= new ArrayList<>();
+                for (XxpClassifyDetailVO vo:allDetailList ) {
+                    ClassifyDetailVO detailVO1 = new ClassifyDetailVO();
+                    detailVO1.setId(vo.getId());
+                    detailVO1.setInfoClassifyId(vo.getInfoClassifyId());
+                    detailVO1.setInfoName(vo.getInfoName());
+                    detailVO1.setInfoType(vo.getInfoType());
+                    detailVO1.setInfoContent(vo.getInfoContent());
+                    showPublickList.add(detailVO1);
+                }
+
+                if(StringUtils.isNotNull(subJectId)){
+                    detailVO.setSubjectId(subJectId);
+                    //实验室私有配置类目
+                    List<XxpClassifyDetailVO> detailVOList= xxpClassifyDetailedService.selectXxpClassifyDetailedByPara(detailVO);
+                    List<ClassifyDetailVO> showprivateList = new ArrayList<>();
+                    for (XxpClassifyDetailVO vo:detailVOList) {
+                        ClassifyDetailVO classifyDetailVO = new ClassifyDetailVO();
+                        classifyDetailVO.setId(vo.getId());
+                        classifyDetailVO.setInfoClassifyId(vo.getInfoClassifyId());
+                        classifyDetailVO.setInfoName(vo.getInfoName());
+                        classifyDetailVO.setInfoType(vo.getInfoType());
+                        classifyDetailVO.setInfoContent(vo.getInfoContent());
+                        showprivateList.add(classifyDetailVO);
+                    }
+                    classifyVO.setPrivateList(showprivateList);
+                }
+                classifyVO.setPublicList(showPublickList);
+            }
+        }catch (Exception e){
+            logger.info("查询实验室下的安全类目信息异常:"+e);
+        }
+        return classifyVOList;
+    }
+
 }
 }

+ 25 - 5
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyDetailedController.java

@@ -10,7 +10,10 @@ import com.zd.laboratory.api.vo.LabXxpClassifyVo;
 import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.XxpClassify;
 import com.zd.laboratory.domain.XxpClassify;
 import com.zd.laboratory.domain.XxpClassifyDetail;
 import com.zd.laboratory.domain.XxpClassifyDetail;
+import com.zd.laboratory.domain.XxpClassifySubject;
+import com.zd.laboratory.domain.vo.XxpClassifyDetailVO;
 import com.zd.laboratory.service.IXxpClassifyDetailedService;
 import com.zd.laboratory.service.IXxpClassifyDetailedService;
+import com.zd.laboratory.service.IXxpClassifySubjectService;
 import com.zd.laboratory.service.IXxpClassifyService;
 import com.zd.laboratory.service.IXxpClassifyService;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerFun;
@@ -45,16 +48,20 @@ public class LabXxpClassifyDetailedController extends BaseController
     @Autowired
     @Autowired
     private TokenService tokenService;
     private TokenService tokenService;
 
 
+    @Autowired
+    private IXxpClassifySubjectService classifySubjectService;
+
     /**
     /**
      * 查询安全信息类目详情列表
      * 查询安全信息类目详情列表
      */
      */
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CLASSIFY_DET + PerFun.LIST)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CLASSIFY_DET + PerFun.LIST)
     @GetMapping("/list")
     @GetMapping("/list")
     @ApiOperation(value = "查询安全信息类目详情列表")
     @ApiOperation(value = "查询安全信息类目详情列表")
-    public TableDataInfo<XxpClassifyDetail> list(XxpClassifyDetail classifyDetailed)
+    public TableDataInfo<XxpClassifyDetailVO> list(XxpClassifyDetailVO classifyDetailed)
     {
     {
         startPage();
         startPage();
-        List<XxpClassifyDetail> list = classifyDetailedService.selectXxpClassifyDetailedList(classifyDetailed);
+        classifyDetailed.setRemark("list");
+        List<XxpClassifyDetailVO> list = classifyDetailedService.selectXxpClassifyDetailedList(classifyDetailed);
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
@@ -65,10 +72,10 @@ public class LabXxpClassifyDetailedController extends BaseController
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CLASSIFY_DET + PerFun.EXPORT)
     @PreAuthorize(hasPermi = PerPrefix.LABORATORY_CLASSIFY_DET + PerFun.EXPORT)
     @Log(title = "安全信息类目详情", businessType = BusinessType.EXPORT)
     @Log(title = "安全信息类目详情", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, XxpClassifyDetail classifyDetailed) throws IOException
+    public void export(HttpServletResponse response, XxpClassifyDetailVO classifyDetailed) throws IOException
     {
     {
-        List<XxpClassifyDetail> list = classifyDetailedService.selectXxpClassifyDetailedList(classifyDetailed);
-        ExcelUtil<XxpClassifyDetail> util = new ExcelUtil<XxpClassifyDetail>(XxpClassifyDetail.class);
+        List<XxpClassifyDetailVO> list = classifyDetailedService.selectXxpClassifyDetailedList(classifyDetailed);
+        ExcelUtil<XxpClassifyDetailVO> util = new ExcelUtil<XxpClassifyDetailVO>(XxpClassifyDetailVO.class);
         util.exportExcel(response, list, "安全信息类目详情数据");
         util.exportExcel(response, list, "安全信息类目详情数据");
     }
     }
 
 
@@ -149,4 +156,17 @@ public class LabXxpClassifyDetailedController extends BaseController
         List<LabXxpClassifyVo> xxpClassifyVoList=classifyDetailedService.selectXxpClassify(id);
         List<LabXxpClassifyVo> xxpClassifyVoList=classifyDetailedService.selectXxpClassify(id);
         return ResultData.success(xxpClassifyVoList);
         return ResultData.success(xxpClassifyVoList);
     }
     }
+
+    @PostMapping(value = "/addSub")
+    public ResultData addSub(@RequestBody XxpClassifySubject subject)
+    {
+        return ResultData.success(classifySubjectService.insertClassifySubject(subject));
+    }
+
+    @GetMapping(value = "/delSub")
+    public ResultData delSub(Long subjectId)
+    {
+        return ResultData.success(classifySubjectService.deleteBySubjectId(subjectId));
+    }
+
 }
 }

+ 57 - 4
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpDutyController.java

@@ -4,7 +4,10 @@ import com.zd.common.core.annotation.Log;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.ExcelUtil;
 import com.zd.common.core.utils.ExcelUtil;
+import com.zd.common.core.utils.FileConfigUtils;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpInspection;
 import com.zd.laboratory.domain.XxpInspection;
@@ -21,8 +24,7 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
 /**
  * 值班Controller
  * 值班Controller
@@ -41,6 +43,9 @@ public class LabXxpDutyController extends BaseController
     @Autowired
     @Autowired
     private TokenService tokenService;
     private TokenService tokenService;
 
 
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
+
     /**
     /**
      * 查询值班列表
      * 查询值班列表
      */
      */
@@ -64,10 +69,13 @@ public class LabXxpDutyController extends BaseController
     {
     {
         //startPage();
         //startPage();
         List<XxpDutyVO> list = xxpDutyService.selectDutyYmdById(xxpDuty);
         List<XxpDutyVO> list = xxpDutyService.selectDutyYmdById(xxpDuty);
+        XxpDuty du  = new XxpDuty();
         for (XxpDutyVO duty:list) {
         for (XxpDutyVO duty:list) {
-            XxpDutyVO vo= xxpDutyService.selectSubAndUserSum(duty.getDutyTime());
+            du.setDeptId(xxpDuty.getDeptId());
+            du.setDutyTime(duty.getDutyTime());
+            XxpDutyVO vo= xxpDutyService.selectSubAndUserSum(du);
             duty.setSubSum(vo.getSubSum());
             duty.setSubSum(vo.getSubSum());
-            duty.setUserSum(vo.getSubSum());
+            duty.setUserSum(vo.getUserSum());
         }
         }
         return getDataTable(list);
         return getDataTable(list);
     }
     }
@@ -99,6 +107,27 @@ public class LabXxpDutyController extends BaseController
 
 
 
 
     /**
     /**
+     * 根据时间获取值班详情
+     */
+    @ApiOperation(value = "根据时间获取值班详情")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_DUTY + PerFun.QUERY)
+    @GetMapping(value = "/getInfoByDate")
+    public TableDataInfo<XxpDutyVO> getInfoByDate(XxpDuty xxpDuty)
+    {
+        startPage();
+        List<XxpDutyVO> listVo = xxpDutyService.selectInfoByDate(xxpDuty);
+        XxpDuty newDuty = new XxpDuty();
+        for (XxpDutyVO duty:listVo) {
+            newDuty.setSubjectId(duty.getSubjectId());
+            newDuty.setDutyTime(xxpDuty.getDutyTime());
+            newDuty.setDeptId(xxpDuty.getDeptId());
+            List<XxpDuty> list =xxpDutyService.selectXxpDutyList(newDuty);
+            duty.setDutyList(list);
+        }
+        return getDataTable(listVo);
+    }
+
+    /**
      * 新增值班
      * 新增值班
      */
      */
     @ApiOperation(value = "新增值班")
     @ApiOperation(value = "新增值班")
@@ -157,6 +186,12 @@ public class LabXxpDutyController extends BaseController
     public ResultData<List<Map<String,Object>>> list(Long labId,String dateTime)
     public ResultData<List<Map<String,Object>>> list(Long labId,String dateTime)
     {
     {
         List<Map<String,Object>> list = xxpDutyService.selectDutyUser(labId,dateTime);
         List<Map<String,Object>> list = xxpDutyService.selectDutyUser(labId,dateTime);
+        for(Map<String,Object> map:list){
+            if(StringUtils.isNotNull(map.get("avatar"))){
+                String avatar=fileConfigUtils.getFileDomainApp() + map.get("avatar");
+                map.put("avatar",avatar);
+            }
+        }
         return ResultData.success(list);
         return ResultData.success(list);
     }
     }
 
 
@@ -166,6 +201,24 @@ public class LabXxpDutyController extends BaseController
     public ResultData<List<Map<String,Object>>> selectDutyUserList(Long labId,String startTime,String endTime)
     public ResultData<List<Map<String,Object>>> selectDutyUserList(Long labId,String startTime,String endTime)
     {
     {
         List<Map<String,Object>> list = xxpDutyService.selectDutyUserList(labId,startTime,endTime);
         List<Map<String,Object>> list = xxpDutyService.selectDutyUserList(labId,startTime,endTime);
+        Optional.ofNullable(list).orElseGet(Collections::emptyList)
+                .stream()
+                .forEach(a->{
+                    if(StringUtils.isNotNull(a.get("avatar"))){
+                        String url = fileConfigUtils.getFileDomainApp() + a.get("avatar");
+                        a.put("avatar",url);
+                    }
+                });
         return ResultData.success(list);
         return ResultData.success(list);
     }
     }
+
+    /***
+     *
+     * 获取当前时间
+     */
+    @GetMapping(value = "/getDate")
+    public ResultData getDate()
+    {
+        return ResultData.success(DateUtils.getDate());
+    }
 }
 }

+ 189 - 5
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpInspectionController.java

@@ -4,17 +4,25 @@ import com.zd.common.core.annotation.Log;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.log.BusinessType;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.ExcelUtil;
 import com.zd.common.core.utils.ExcelUtil;
+import com.zd.common.core.utils.FileConfigUtils;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.common.core.web.controller.BaseController;
-import com.zd.laboratory.domain.LabWhitelist;
-import com.zd.laboratory.domain.XxpClassify;
+import com.zd.laboratory.api.vo.XxpInspectionVo;
+import com.zd.laboratory.domain.XxpCardInfo;
+import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpInspection;
 import com.zd.laboratory.domain.XxpInspection;
-import com.zd.laboratory.service.IXxpClassifyService;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
+import com.zd.laboratory.service.ILabSubjectAccessRecordService;
+import com.zd.laboratory.service.IXxpCardInfoService;
 import com.zd.laboratory.service.IXxpInspectionService;
 import com.zd.laboratory.service.IXxpInspectionService;
+import com.zd.model.constant.HttpStatus;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.page.TableDataInfo;
 import com.zd.model.page.TableDataInfo;
+import com.zd.system.api.feign.RemoteUserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,7 +30,8 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  * 巡查Controller
  * 巡查Controller
@@ -39,8 +48,21 @@ public class LabXxpInspectionController extends BaseController
     private IXxpInspectionService xxpInspectionService;
     private IXxpInspectionService xxpInspectionService;
 
 
     @Autowired
     @Autowired
+    private IXxpCardInfoService iXxpCardInfoService;
+
+    @Autowired
     private TokenService tokenService;
     private TokenService tokenService;
 
 
+    @Autowired
+    private FileConfigUtils fileConfigUtils;
+
+    @Autowired
+    private RemoteUserService remoteUserService;
+
+    @Autowired
+    private ILabSubjectAccessRecordService iLabSubjectAccessRecordService;
+
+
     /**
     /**
      * 查询巡查列表
      * 查询巡查列表
      */
      */
@@ -55,6 +77,78 @@ public class LabXxpInspectionController extends BaseController
     }
     }
 
 
     /**
     /**
+     * 查询巡查列表(根据时间段)
+     */
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXP_INSPECTION + PerFun.LIST)
+    @GetMapping("/listYmd")
+    @ApiOperation(value = "查询巡查列表")
+    public List<XxpInspectionVO> listYmd(XxpInspectionVO inspectionVO)
+    {
+        Map<String,XxpInspectionVO> allMap = new LinkedHashMap<>();
+        inspectionVO.setEndTime(DateUtils.getDate());
+        //startPage();
+        //获取时间段内签到人员总数
+        List<XxpInspectionVO> signinList = xxpInspectionService.selectListSigninCount(inspectionVO);
+        Optional.ofNullable(signinList).orElseGet(Collections::emptyList)
+                .stream()
+                .forEach(a->{
+                    a.setNoSignedInCount(0);
+                    allMap.put(a.getDutyTime(),a);
+                });
+
+        //获取时间段内签到人员总数
+        List<XxpInspectionVO> notSigninLlist = xxpInspectionService.selectListNotSigninCount(inspectionVO);
+        Optional.ofNullable(notSigninLlist).orElseGet(Collections::emptyList)
+                .stream()
+                .forEach(a->{
+                    if(allMap.get(a.getDutyTime())!=null){
+                        XxpInspectionVO newInspectionVo = allMap.get(a.getDutyTime());
+                        newInspectionVo.setNoSignedInCount(a.getNoSignedInCount());
+                        allMap.put(a.getDutyTime(),newInspectionVo);
+                    }else{
+                        a.setSignInCount(0);
+                        allMap.put(a.getDutyTime(),a);
+                    }
+
+                });
+        return Optional.ofNullable(allMap.entrySet()).orElseGet(Collections::emptySet)
+                .stream()
+                .map(a->a.getValue())
+                .collect(Collectors.toList());
+    }
+
+    /***
+     * 签到列表-正常
+     * @param xxpInspection
+     * @return
+     */
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXP_INSPECTION + PerFun.QUERY)
+    @GetMapping("/listStandard")
+    @ApiOperation(value = "查询巡查列表-正常")
+    public TableDataInfo<XxpInspection> listStandard(XxpInspection xxpInspection)
+    {
+        startPage();
+        List<XxpInspection> list = xxpInspectionService.selectListSignin(xxpInspection);
+        return getDataTable(list);
+    }
+
+
+    /***
+     * 签到列表-异常
+     * @param xxpDuty
+     * @return
+     */
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXP_INSPECTION + PerFun.QUERY)
+    @GetMapping("/listAbnormal")
+    @ApiOperation(value = "查询巡查列表-异常")
+    public TableDataInfo<XxpDuty> listAbnormal(XxpDuty xxpDuty)
+    {
+        startPage();
+        List<XxpDuty> list = xxpInspectionService.selectListAbnormal(xxpDuty);
+        return getDataTable(list);
+    }
+
+    /**
      * 导出巡查列表
      * 导出巡查列表
      */
      */
     @ApiOperation(value = "导出巡查列表")
     @ApiOperation(value = "导出巡查列表")
@@ -144,6 +238,96 @@ public class LabXxpInspectionController extends BaseController
     @PostMapping("/app/selectUserXxpInspectionList")
     @PostMapping("/app/selectUserXxpInspectionList")
     public ResultData selectUserXxpInspectionList(Long labId,String startTime,String endTime )
     public ResultData selectUserXxpInspectionList(Long labId,String startTime,String endTime )
     {
     {
-        return ResultData.success(xxpInspectionService.selectUserXxpInspectionList(labId,startTime,endTime));
+        List<Map<String,Object>> list = xxpInspectionService.selectUserXxpInspectionList(labId,startTime,endTime);
+        Optional.ofNullable(list).orElseGet(Collections::emptyList)
+                .stream()
+                .forEach(a->{
+                    if(StringUtils.isNotNull(a.get("avatar"))){
+                        String url = fileConfigUtils.getFileDomainApp() + a.get("avatar");
+                        a.put("avatar",url);
+                    }
+                });
+        return ResultData.success(list);
     }
     }
+
+
+    /**
+     * 新增巡查
+     */
+    @ApiOperation(value = "巡查签到")
+    @PostMapping("/addInspection")
+    public ResultData addInspection(@RequestBody XxpInspectionVo xxpInspectionVo) {
+        XxpCardInfo xxpCardInfo=iXxpCardInfoService.selectXxpInfoByCard(xxpInspectionVo.getNum());
+        if(null==xxpCardInfo){
+            return ResultData.fail("电子信息牌查询错误");
+        }
+        int num=xxpInspectionService.selectNoSignOut(xxpCardInfo.getSubjectId(),xxpInspectionVo.getUserId());
+        if(num>0){
+            return ResultData.fail("当前用户已经签到成功,不能重复签到!");
+        }
+        int numAccess=iLabSubjectAccessRecordService.getSignOutRecordNoOut(xxpCardInfo.getSubjectId(),xxpInspectionVo.getUserId());
+        if(numAccess>0){
+            return ResultData.fail("当前用户已经签到成功,不能重复签到!");
+        }
+        ResultData resultData=remoteUserService.getUserMapInfoByUserId(xxpInspectionVo.getUserId());
+        if(null==resultData ||resultData.getCode()!= HttpStatus.SUCCESS){
+            return ResultData.fail("获取用户信息失败");
+        }
+        Object userObj=resultData.getData();
+        if(null==userObj){
+            return ResultData.fail("获取用户信息失败");
+        }
+        Map<String,Object> map= (Map<String, Object>) userObj;
+        XxpInspection xxpInspection=new XxpInspection();
+        xxpInspection.setSubjectId(xxpCardInfo.getSubjectId());
+        xxpInspection.setSubjectName(xxpCardInfo.getSubjectName());
+        xxpInspection.setUserImg(String.valueOf(map.get("avatar")));
+        xxpInspection.setUserName(String.valueOf(map.get("userName")));
+        xxpInspection.setCreateBy(String.valueOf(map.get("userName")));
+        xxpInspection.setUserId(Long.parseLong(String.valueOf(map.get("userId"))));
+        xxpInspection.setDeptId(Long.parseLong(String.valueOf(map.get("deptId"))));
+        xxpInspection.setDeptName(String.valueOf(map.get("deptName")));
+        Date date=new Date();
+        xxpInspection.setCreateTime(date);
+        xxpInspection.setSignIn(date);
+        return ResultData.result(xxpInspectionService.insertXxpInspection(xxpInspection));
+    }
+
+
+    /**
+     * 修改巡查
+     */
+    @ApiOperation(value = "巡查签出")
+    @PostMapping("/updateInspection")
+    public ResultData updateInspection(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId) {
+        logger.info("labId:"+labId+"userId:"+userId);
+        Integer num=xxpInspectionService.updateXxpInspectionSignOut(labId,userId);
+        if(num>0){
+            return ResultData.success();
+        }
+        return ResultData.fail("未查到签到记录!");
+    }
+
+
+    /**
+     * 判断是巡查签到还是准入签到
+     */
+    @ApiOperation(value = "判断是巡查签到还是准入签到 1巡查 2准入")
+    @PostMapping("/isSignInType")
+    public ResultData isSignInType(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId) {
+        int type=0;
+        int num=xxpInspectionService.selectNoSignOut(labId,userId);
+        if(num>0){
+            type=1;
+        }
+        int numAccess=iLabSubjectAccessRecordService.getSignOutRecordNoOut(labId,userId);
+        if(numAccess>0){
+            type=2;
+        }
+        if(type==0){
+            return ResultData.fail("未查到签到记录!");
+        }
+        return ResultData.success(type);
+    }
+
 }
 }

+ 256 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpUserAuthController.java

@@ -0,0 +1,256 @@
+package com.zd.laboratory.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.zd.common.core.annotation.Log;
+import com.zd.common.core.annotation.PreAuthorize;
+import com.zd.common.core.log.BusinessType;
+import com.zd.common.core.redis.RedisService;
+import com.zd.common.core.security.TokenService;
+import com.zd.common.core.utils.DateUtils;
+import com.zd.common.core.utils.DictUtils;
+import com.zd.common.core.utils.ExcelUtil;
+import com.zd.common.core.utils.StringUtils;
+import com.zd.common.core.web.controller.BaseController;
+import com.zd.laboratory.api.vo.XxpUserAuthVo;
+import com.zd.laboratory.domain.LabSubject;
+import com.zd.laboratory.domain.XxpCardInfo;
+import com.zd.laboratory.domain.XxpUserAuth;
+import com.zd.laboratory.service.ILabSubjectService;
+import com.zd.laboratory.service.IXxpCardInfoService;
+import com.zd.laboratory.service.IXxpDutyService;
+import com.zd.laboratory.service.IXxpUserAuthService;
+import com.zd.model.domain.ResultData;
+import com.zd.model.domain.per.PerFun;
+import com.zd.model.domain.per.PerPrefix;
+import com.zd.model.page.TableDataInfo;
+import com.zd.system.api.entity.SysDictData;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * 信息牌人员权限 Controller
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+@RestController
+@Api(tags = "【信息牌人员权限】")
+@RequestMapping("/XxpUserAuth")
+public class LabXxpUserAuthController extends BaseController
+{
+    @Autowired
+    private IXxpUserAuthService xxpUserAuthService;
+
+    @Autowired
+    private IXxpCardInfoService iXxpCardInfoService;
+
+    @Autowired
+    private ILabSubjectService iLabSubjectService;
+
+    @Autowired
+    private IXxpDutyService iXxpDutyService;
+
+    /**
+     * 查询列表
+     */
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.LIST)
+    @GetMapping("/list")
+    @ApiOperation(value = "查询列表")
+    public TableDataInfo<XxpUserAuth> list(XxpUserAuth xxpUserAuth)
+    {
+        startPage();
+        List<XxpUserAuth> list = xxpUserAuthService.selectXxpUserAuthList(xxpUserAuth);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询授权类型列表
+     */
+    @GetMapping("/authTypelist")
+    @ApiOperation(value = "查询授权类型列表")
+    public TableDataInfo<SysDictData> authTypelist()
+    {
+        List<SysDictData> dictDataList = DictUtils.getDictCache("xxp_auth_type");
+        return getDataTable(dictDataList);
+    }
+
+    /**
+     * 导出列表
+     */
+    @ApiOperation(value = "导出列表")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.EXPORT)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, XxpUserAuth xxpUserAuth) throws IOException
+    {
+        List<XxpUserAuth> list = xxpUserAuthService.selectXxpUserAuthList(xxpUserAuth);
+        ExcelUtil<XxpUserAuth> util = new ExcelUtil<XxpUserAuth>(XxpUserAuth.class);
+        util.exportExcel(response, list, "巡查数据");
+    }
+
+    /**
+     * 获取详细
+     */
+    @ApiOperation(value = "获取详细")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.QUERY)
+    @GetMapping(value = "/{id}")
+    public ResultData<XxpUserAuth> getInfo(@PathVariable("id") Long id)
+    {
+        return ResultData.success(xxpUserAuthService.selectXxpUserAuthById(id));
+    }
+
+
+    /**
+     * 新增
+     */
+    @ApiOperation(value = "新增")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.ADD)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.INSERT)
+    @PostMapping
+    public ResultData add(@RequestBody XxpUserAuth xxpUserAuth)
+    {
+        return ResultData.result(xxpUserAuthService.insertXxpUserAuth(xxpUserAuth));
+    }
+
+    /****
+     * 批量新增
+     * @param xxpUserAuth
+     * @return
+     */
+    @ApiOperation(value = "新增")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.ADD)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.INSERT)
+    @PostMapping("/addAuth")
+    public ResultData addAuth(@RequestBody XxpUserAuth xxpUserAuth)
+    {
+        return ResultData.result(xxpUserAuthService.insertXxpUserAuthBatch(xxpUserAuth));
+    }
+
+    /**
+     * 修改巡查
+     */
+    @ApiOperation(value = "修改巡查")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.EDIT)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public ResultData edit(@RequestBody XxpUserAuth xxpUserAuth)
+    {
+        return  ResultData.result(xxpUserAuthService.updateXxpUserAuth(xxpUserAuth));
+    }
+
+    /**
+     * 删除
+     */
+    @ApiOperation(value = "删除")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.REMOVE)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public ResultData remove(@PathVariable Long[] ids)
+    {
+        return ResultData.result(xxpUserAuthService.deleteXxpUserAuthByIds(ids));
+    }
+
+    /**
+     * 根据id删除
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id删除巡查")
+    @PreAuthorize(hasPermi = PerPrefix.LABORATORY_XXPUSERAUTH + PerFun.REMOVE)
+    @Log(title = "信息牌人员权限", businessType = BusinessType.DELETE)
+    @PostMapping("/{id}")
+    public ResultData remove(@PathVariable Long id)
+    {
+        return ResultData.result(xxpUserAuthService.deleteXxpUserAuthById(id));
+    }
+
+    /**
+     * 电子信息牌指纹录入
+     * @param xxpUserAuthVo
+     * @return
+     */
+    @ApiOperation(value = "电子信息牌指纹录入")
+    @PostMapping("/addUserAuth")
+    public ResultData addUserAuth(@RequestBody XxpUserAuthVo xxpUserAuthVo)
+    {
+        XxpCardInfo xxpCardInfo=iXxpCardInfoService.selectXxpInfoByCard(xxpUserAuthVo.getNum());
+        if(null==xxpCardInfo){
+            return ResultData.fail("电子班牌查询错误");
+        }
+        XxpUserAuth xxpUserAuth=new XxpUserAuth();
+        xxpUserAuth.setUserId(xxpUserAuthVo.getUserId());
+        xxpUserAuth.setUserName(xxpUserAuthVo.getUserName());
+        xxpUserAuth.setUserType(xxpUserAuthVo.getUserType());
+        xxpUserAuth.setSubjectId(xxpCardInfo.getSubjectId());
+        xxpUserAuth.setSubjectName(xxpCardInfo.getSubjectName());
+        xxpUserAuth.setDeptId(xxpCardInfo.getCollegeId());
+        xxpUserAuth.setDeptName(xxpCardInfo.getCollege());
+        xxpUserAuth.setCreateBy(xxpUserAuthVo.getUserName());
+        xxpUserAuth.setCreateTime(new Date());
+        xxpUserAuth.setHardwareId(xxpCardInfo.getId());
+        xxpUserAuth.setFinger(xxpUserAuthVo.getFinger());
+        xxpUserAuth.setFingerKey(xxpUserAuthVo.getFingerKey());
+        return ResultData.result(xxpUserAuthService.insertXxpUserAppAuth(xxpUserAuth));
+    }
+
+
+    /**
+     * 根据用户id查询指纹信息
+     * @param userId
+     * @return
+     */
+    @GetMapping("/getFingerByUserId")
+    public ResultData getFingerByUserId(@RequestParam Long labId,@RequestParam Long userId)
+    {
+        List<Map<String,Object>> mapList= xxpUserAuthService.getFingerByUserId(userId);
+        for(Map<String,Object> map:mapList){
+            Integer isDutyUser=0;
+            String userType=String.valueOf(map.get("userType"));
+            String isWhite=String.valueOf(map.get("isWhite"));
+            //如果是学生 或者白名单的老师 进二类页面
+            if(userType.equals("22") || (userType.equals("11") && isWhite.equals("0"))){
+                map.put("pageType",2);
+            }
+            int number=iLabSubjectService.isAdminOrSafeUser(labId,userId);
+            //一类首页对应身份为白名单老师、实验室负责人、安全责任人
+            if(number>0 || (userType.equals("11") && isWhite.equals("1"))){
+                map.put("pageType",1);
+            }
+            String dateTime = DateUtils.getDate();
+            List<Map<String,Object>> list = iXxpDutyService.selectDutyUser(labId,dateTime);
+            //判断是否当天值班
+            for(Map<String,Object> dutyMap:list){
+                String userObj=String.valueOf(dutyMap.get("userId"));
+                if(StringUtils.isNotEmpty(userObj) && StringUtils.isNotNull(userObj)){
+                    if(Long.parseLong(userObj)==userId){
+                        isDutyUser=1;
+                        break;
+                    }
+                }
+            }
+            map.put("isDutyUser",isDutyUser);
+            map.remove("isWhite");
+        }
+        return ResultData.success(mapList);
+    }
+
+
+    /**
+     * 根据用户id查询指纹信息
+     * @param id
+     * @return
+     */
+    @GetMapping("/deleteFingerById")
+    public ResultData deleteFingerById(@RequestParam Long id)
+    {
+        return ResultData.result(xxpUserAuthService.deleteXxpUserAuthById(id));
+    }
+
+}

+ 122 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabSubject.java

@@ -48,7 +48,7 @@ public class LabSubject extends BaseEntity implements QCInterface {
      */
      */
     @ApiModelProperty("实验室房间号")
     @ApiModelProperty("实验室房间号")
     @Excel(name = "实验室房间号")
     @Excel(name = "实验室房间号")
-    private String room = "";
+    private String room;
 
 
     private String roomName = "";
     private String roomName = "";
 
 
@@ -86,6 +86,13 @@ public class LabSubject extends BaseEntity implements QCInterface {
     @ApiModelProperty("创建人")
     @ApiModelProperty("创建人")
     @Excel(name = "创建人", readConverterExp = "用=于数据权限")
     @Excel(name = "创建人", readConverterExp = "用=于数据权限")
     private Long userId;
     private Long userId;
+
+
+    /**
+     * 创建人(用于数据权限)
+     */
+    @ApiModelProperty("创建人名称")
+    private Long userName;
     /**
     /**
      * 是否是实验室
      * 是否是实验室
      */
      */
@@ -141,6 +148,16 @@ public class LabSubject extends BaseEntity implements QCInterface {
     //安全分类id
     //安全分类id
     private Long typeId;
     private Long typeId;
 
 
+    /***
+     * 实验室安全类目关系集合
+     */
+    List<XxpClassifySubject> classifySubjectList;
+
+    /***
+     * 安全类目信息
+     */
+    List<XxpClassify> classifyList;
+
     /**
     /**
      * 是否查询安全用户
      * 是否查询安全用户
      */
      */
@@ -195,8 +212,46 @@ public class LabSubject extends BaseEntity implements QCInterface {
 
 
     private String safeUserNames;
     private String safeUserNames;
 
 
-    private Integer bottleTotal;//实验室气瓶总数
-    private Integer bottleUserTotal;//实验室单人气瓶总数
+    /**
+     * 实验室气瓶总数
+     */
+    private Integer bottleTotal;
+
+    /**
+     * 实验室单人气瓶总数
+     */
+    private Integer bottleUserTotal;
+
+    /***
+     *巡查人员,穿戴检查项
+     */
+    private String inspectCheckIn;
+
+    /***
+     *巡查人员,穿戴检查可跳过(0 否,1 是)
+     */
+    private Integer inspectSkipped;
+
+    /***
+     *巡查人员,穿戴检查识别上限
+     */
+    private Integer inspectCheckCount;
+
+    /***
+     *巡查人员,签到有效时间
+     */
+    private Integer inspectSignTime;
+
+    /***
+     *实验室详情
+     */
+    private String details;
+
+    /***
+     * 关联的硬件 1海康 2电子信息牌
+     */
+    private Integer hardwareType;
+
     private List<Long> deptIds;
     private List<Long> deptIds;
 
 
     /**
     /**
@@ -528,4 +583,68 @@ public class LabSubject extends BaseEntity implements QCInterface {
     public void setRoomName(String roomName) {
     public void setRoomName(String roomName) {
         this.roomName = roomName;
         this.roomName = roomName;
     }
     }
+
+    public String getInspectCheckIn() {
+        return inspectCheckIn;
+    }
+
+    public void setInspectCheckIn(String inspectCheckIn) {
+        this.inspectCheckIn = inspectCheckIn;
+    }
+
+    public Integer getInspectSkipped() {
+        return inspectSkipped;
+    }
+
+    public void setInspectSkipped(Integer inspectSkipped) {
+        this.inspectSkipped = inspectSkipped;
+    }
+
+    public Integer getInspectCheckCount() {
+        return inspectCheckCount;
+    }
+
+    public void setInspectCheckCount(Integer inspectCheckCount) {
+        this.inspectCheckCount = inspectCheckCount;
+    }
+
+    public Integer getInspectSignTime() {
+        return inspectSignTime;
+    }
+
+    public void setInspectSignTime(Integer inspectSignTime) {
+        this.inspectSignTime = inspectSignTime;
+    }
+
+    public String getDetails() {
+        return details;
+    }
+
+    public void setDetails(String details) {
+        this.details = details;
+    }
+
+    public List<XxpClassifySubject> getClassifySubjectList() {
+        return classifySubjectList;
+    }
+
+    public void setClassifySubjectList(List<XxpClassifySubject> classifySubjectList) {
+        this.classifySubjectList = classifySubjectList;
+    }
+
+    public List<XxpClassify> getClassifyList() {
+        return classifyList;
+    }
+
+    public void setClassifyList(List<XxpClassify> classifyList) {
+        this.classifyList = classifyList;
+    }
+
+    public Integer getHardwareType() {
+        return hardwareType;
+    }
+
+    public void setHardwareType(Integer hardwareType) {
+        this.hardwareType = hardwareType;
+    }
 }
 }

+ 53 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/SubDiyVO.java

@@ -3,9 +3,11 @@ package com.zd.laboratory.domain;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zd.laboratory.api.entity.SensorFunctionStatus;
 import com.zd.laboratory.api.entity.SensorFunctionStatus;
 import com.zd.laboratory.api.entity.SubAddrr;
 import com.zd.laboratory.api.entity.SubAddrr;
+import com.zd.laboratory.api.vo.ClassifyVO;
 import com.zd.laboratory.api.vo.HardwareCVO;
 import com.zd.laboratory.api.vo.HardwareCVO;
 import com.zd.laboratory.api.vo.LabSubClassVO;
 import com.zd.laboratory.api.vo.LabSubClassVO;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
+import com.zd.laboratory.interfaces.SysProperties;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
@@ -30,6 +32,12 @@ public class SubDiyVO {
     private String name;
     private String name;
 
 
     /**
     /**
+     * 房间号
+     */
+    private String room;
+
+
+    /**
      * 实验室所属院系
      * 实验室所属院系
      */
      */
     private Long deptId;
     private Long deptId;
@@ -109,6 +117,9 @@ public class SubDiyVO {
     @ApiModelProperty("安全分类名称")
     @ApiModelProperty("安全分类名称")
     private String typeName;
     private String typeName;
 
 
+    @ApiModelProperty("安全类目信息")
+    private List<ClassifyVO>  classifyList;
+
     public int getSourceRiskCount() {
     public int getSourceRiskCount() {
         return sourceRiskCount;
         return sourceRiskCount;
     }
     }
@@ -290,6 +301,14 @@ public class SubDiyVO {
         this.fiedColor = fiedColor;
         this.fiedColor = fiedColor;
     }
     }
 
 
+    public List<ClassifyVO> getClassifyList() {
+        return classifyList;
+    }
+
+    public void setClassifyList(List<ClassifyVO> classifyList) {
+        this.classifyList = classifyList;
+    }
+
     @ApiModel("安全信息")
     @ApiModel("安全信息")
     public static class SafeInfo{
     public static class SafeInfo{
         @ApiModelProperty("安全警示标示--字典")
         @ApiModelProperty("安全警示标示--字典")
@@ -307,6 +326,11 @@ public class SubDiyVO {
         @ApiModelProperty("二维码")
         @ApiModelProperty("二维码")
         private String qrCode;
         private String qrCode;
 
 
+        @ApiModelProperty("二维码地址")
+        private String qrCodeUrl;
+
+        @ApiModelProperty("房间号")
+        private String room;
 
 
         @ApiModelProperty("实验室负责人名称")
         @ApiModelProperty("实验室负责人名称")
         private String subAdminName;
         private String subAdminName;
@@ -428,5 +452,34 @@ public class SubDiyVO {
         public void setAdminNameAndPhone(String adminNameAndPhone) {
         public void setAdminNameAndPhone(String adminNameAndPhone) {
             this.adminNameAndPhone = adminNameAndPhone;
             this.adminNameAndPhone = adminNameAndPhone;
         }
         }
+
+        public String getRoom() {
+            return room;
+        }
+
+        public void setRoom(String room) {
+            this.room = room;
+        }
+
+        public String getQrCodeUrl() {
+            return qrCodeUrl;
+        }
+
+        /**
+         * type = 5 实验室信息和安全检查二维码
+         *
+         * @param code = 实验室id + - + 实验室房间号
+         */
+        public void setQrCodeUrl(String code) {
+            this.qrCodeUrl = StrUtil.format(SysProperties.getLabInfoQrcode(), code, 5);
+        }
+    }
+
+    public String getRoom() {
+        return room;
+    }
+
+    public void setRoom(String room) {
+        this.room = room;
     }
     }
 }
 }

+ 13 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpCardInfo.java

@@ -72,6 +72,14 @@ public class XxpCardInfo extends BaseEntity {
     @ApiModelProperty(value = "设备状态")
     @ApiModelProperty(value = "设备状态")
     private Integer operate;
     private Integer operate;
 
 
+    @Excel(name = "授权方式")
+    @ApiModelProperty(value = "授权方式")
+    private Integer authType;
+
+    @Excel(name = "授权密码")
+    @ApiModelProperty(value = "授权密码")
+    private String authPwd;
+
     /**
     /**
      * 实验室id
      * 实验室id
      */
      */
@@ -105,7 +113,7 @@ public class XxpCardInfo extends BaseEntity {
      */
      */
     @Excel(name = "是否启用门锁")
     @Excel(name = "是否启用门锁")
     @ApiModelProperty(value = "是否启用门锁")
     @ApiModelProperty(value = "是否启用门锁")
-    private String isStart;
+    private Integer isStart;
 
 
     /**
     /**
      * 创建人id
      * 创建人id
@@ -229,4 +237,8 @@ public class XxpCardInfo extends BaseEntity {
     public void setSubjectId(Long subjectId) {
     public void setSubjectId(Long subjectId) {
         this.subjectId = subjectId;
         this.subjectId = subjectId;
     }
     }
+
+    public Integer getAuthType() {        return authType;    }
+
+    public void setAuthType(Integer authType) {        this.authType = authType;    }
 }
 }

+ 13 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassify.java

@@ -1,6 +1,7 @@
 package com.zd.laboratory.domain;
 package com.zd.laboratory.domain;
 
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.laboratory.domain.vo.XxpClassifyDetailVO;
 import com.zd.model.annotation.Excel;
 import com.zd.model.annotation.Excel;
 import com.zd.model.entity.BaseEntity;
 import com.zd.model.entity.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
@@ -11,6 +12,7 @@ import lombok.experimental.Accessors;
 import org.hibernate.validator.constraints.Length;
 import org.hibernate.validator.constraints.Length;
 
 
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
 
 
 /**
 /**
  * 安全信息类目对象 xxp_classify
  * 安全信息类目对象 xxp_classify
@@ -103,6 +105,17 @@ public class XxpClassify extends  BaseEntity
      */
      */
     private String endTime;
     private String endTime;
 
 
+
+    /**
+     * 类目子项-实验室私有
+     */
+    List<XxpClassifyDetailVO> privateDetailList;
+
+    /**
+     * 非共有的所有子类
+     */
+    List<XxpClassifyDetailVO> normalDetailList;
+
     @Override
     @Override
     public Long getUserId() {
     public Long getUserId() {
         return userId;
         return userId;

+ 4 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifyDetail.java

@@ -57,6 +57,10 @@ public class XxpClassifyDetail extends  BaseEntity
     private Integer sort;
     private Integer sort;
 
 
 
 
+    /** 是否共有 1非公共 2公共   */
+    @Excel(name = "是否共有")
+    @ApiModelProperty(value = "是否共有")
+    private Integer isCollective;
 
 
     /** 用户id */
     /** 用户id */
     @Excel(name = "用户id")
     @Excel(name = "用户id")

+ 61 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpClassifySubject.java

@@ -0,0 +1,61 @@
+package com.zd.laboratory.domain;
+
+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;
+
+
+/**
+ * 实验室安全类目关系表 xxp_classify_subject
+ *
+ * @author xxf
+ * @date 2023-03-27
+ */
+@ApiModel("实验室安全类目关系表")
+@Data
+@Accessors(chain = true)
+@ToString(callSuper = true)
+public class XxpClassifySubject extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 实验室id
+     */
+    @Excel(name = "实验室id")
+    @ApiModelProperty(value = "实验室id")
+    private Long subjectId;
+
+    /**
+     * 类目id
+     */
+    @Excel(name = "类目id")
+    @ApiModelProperty(value = "类目id")
+    private Long classifyId;
+
+    /**
+     * 详情id
+     */
+    @Excel(name = "详情id")
+    @ApiModelProperty(value = "详情id")
+    private Long classifyDetailId;
+
+    /***
+     * 开始时间
+     */
+    private String beginTime;
+
+    /***
+     * 结束时间
+     */
+    private String endTime;
+
+}

+ 9 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpInspection.java

@@ -47,11 +47,19 @@ public class XxpInspection extends BaseEntity {
 
 
 
 
     /**
     /**
+     * 人员姓名
+     */
+    @Excel(name = "人员图像")
+    @ApiModelProperty(value = "人员图像")
+    private String userImg;
+
+
+    /**
      * 实验室id
      * 实验室id
      */
      */
     @Excel(name = "实验室id")
     @Excel(name = "实验室id")
     @ApiModelProperty(value = "实验室id")
     @ApiModelProperty(value = "实验室id")
-    private Integer subjectId;
+    private Long subjectId;
 
 
     /**
     /**
      * 实验室名称
      * 实验室名称

+ 181 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/XxpUserAuth.java

@@ -0,0 +1,181 @@
+package com.zd.laboratory.domain;
+
+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 org.hibernate.validator.constraints.Length;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 信息牌人员权限表 对象 xxp_user_auth
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+@ApiModel("信息牌人员权限")
+@Data
+@Accessors(chain = true)
+@ToString(callSuper = true)
+public class XxpUserAuth extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 人员id
+     */
+    @Excel(name = "人员id")
+    @Length(message = "人员id长度不能超过20")
+    @ApiModelProperty(value = "人员id")
+    private Long userId;
+
+    /**
+     * 人员姓名
+     */
+    @Excel(name = "人员姓名")
+    @ApiModelProperty(value = "人员姓名")
+    private String userName;
+
+
+    /**
+     * 实验室id
+     */
+    @Excel(name = "实验室id")
+    @ApiModelProperty(value = "实验室id")
+    private Long subjectId;
+
+    /**
+     * 实验室名称
+     */
+    @Excel(name = "实验室名称")
+    @ApiModelProperty(value = "实验室名称")
+    private String subjectName;
+
+    /**
+     * 授权方式
+     */
+    @Excel(name = "授权方式")
+    @ApiModelProperty(value = "授权方式")
+    private String  authType;
+
+    /**
+     * 人员类型
+     */
+    @Excel(name = "人员类型")
+    @ApiModelProperty(value = "人员类型")
+    private String userType;
+
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id ")
+    @ApiModelProperty(value = "部门id ")
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称 ")
+    @ApiModelProperty(value = "部门名称 ")
+    private String deptName;
+
+    /**
+     * 指纹
+     */
+    @Excel(name = "指纹 ")
+    @ApiModelProperty(value = "指纹 ")
+    private String finger;
+
+    /**
+     * 密码
+     */
+    @Excel(name = "密码")
+    @ApiModelProperty(value = "密码")
+    private String userPassword;
+
+    /**
+     * 硬件id
+     */
+    @Excel(name = "硬件id")
+    @ApiModelProperty(value = "硬件id")
+    private Long hardwareId;
+
+
+    /**
+     * 手指标识
+     */
+    @Excel(name = "手指标识")
+    @ApiModelProperty(value = "手指标识")
+    private String fingerKey;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /***
+     * 开始时间
+     */
+    private String beginTime;
+
+    /***
+     * 结束时间
+     */
+    private String endTime;
+
+    List<XxpUserAuth> userAuthList;
+
+    @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;
+    }
+
+
+}

+ 10 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSecurityApplyVO.java

@@ -48,6 +48,8 @@ public class LabSecurityApplyVO extends LabSecurityApply {
 
 
     private List<Long> subjectIds;//实验室id集合
     private List<Long> subjectIds;//实验室id集合
 
 
+    private Integer valid;//0有效
+
     public String getLaboratoryDeptName() {        return laboratoryDeptName;    }
     public String getLaboratoryDeptName() {        return laboratoryDeptName;    }
 
 
     public void setLaboratoryDeptName(String laboratoryDeptName) {        this.laboratoryDeptName = laboratoryDeptName;    }
     public void setLaboratoryDeptName(String laboratoryDeptName) {        this.laboratoryDeptName = laboratoryDeptName;    }
@@ -122,4 +124,12 @@ public class LabSecurityApplyVO extends LabSecurityApply {
     public List<Long> getSubjectIds() {        return subjectIds;    }
     public List<Long> getSubjectIds() {        return subjectIds;    }
 
 
     public void setSubjectIds(List<Long> subjectIds) {        this.subjectIds = subjectIds;    }
     public void setSubjectIds(List<Long> subjectIds) {        this.subjectIds = subjectIds;    }
+
+    public Integer getValid() {
+        return valid;
+    }
+
+    public void setValid(Integer valid) {
+        this.valid = valid;
+    }
 }
 }

+ 12 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSecurityMaterialDataVO.java

@@ -19,7 +19,11 @@ import java.util.Map;
  */
  */
 @ApiModel("安全检查模板表")
 @ApiModel("安全检查模板表")
 public class LabSecurityMaterialDataVO extends LabSecurityMaterialData {
 public class LabSecurityMaterialDataVO extends LabSecurityMaterialData {
-    //材料表集合
+
+    List<LabSecurityMaterialrelation>  listMr; //材料表集合
+
+    Long subjectId;//实验室id
+
     public List<LabSecurityMaterialrelation> getListMr() {
     public List<LabSecurityMaterialrelation> getListMr() {
         return listMr;
         return listMr;
     }
     }
@@ -28,5 +32,11 @@ public class LabSecurityMaterialDataVO extends LabSecurityMaterialData {
         this.listMr = listMr;
         this.listMr = listMr;
     }
     }
 
 
-    List<LabSecurityMaterialrelation>  listMr;
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
 }
 }

+ 12 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSecuritySubjectmaterialVO.java

@@ -24,6 +24,10 @@ public class LabSecuritySubjectmaterialVO extends LabSecuritySubjectmaterial {
 
 
     private List<LabSecuritySubjectmaterial> publicList;//通用模板
     private List<LabSecuritySubjectmaterial> publicList;//通用模板
 
 
+    private Integer authType;//授权方式
+
+    private String authPwd;//授权密码
+
     public Long getIscheck() {        return ischeck;    }
     public Long getIscheck() {        return ischeck;    }
 
 
     public void setIscheck(Long ischeck) {        this.ischeck = ischeck;    }
     public void setIscheck(Long ischeck) {        this.ischeck = ischeck;    }
@@ -69,4 +73,12 @@ public class LabSecuritySubjectmaterialVO extends LabSecuritySubjectmaterial {
     public void setPublicList(List<LabSecuritySubjectmaterial> publicList) {
     public void setPublicList(List<LabSecuritySubjectmaterial> publicList) {
         this.publicList = publicList;
         this.publicList = publicList;
     }
     }
+
+    public Integer getAuthType() {        return authType;    }
+
+    public void setAuthType(Integer authType) {        this.authType = authType;    }
+
+    public String getAuthPwd() {        return authPwd;    }
+
+    public void setAuthPwd(String authPwd) {        this.authPwd = authPwd;    }
 }
 }

+ 11 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/LabSubjectVO.java

@@ -118,6 +118,9 @@ public class LabSubjectVO extends LabSubject {
     @ApiModelProperty(name = "位置")
     @ApiModelProperty(name = "位置")
     private String posi;
     private String posi;
 
 
+    @ApiModelProperty(name = "电子信息牌Id")
+    private Integer xxpCardInfoId;
+
     public String getSenseState() {
     public String getSenseState() {
         return senseState;
         return senseState;
     }
     }
@@ -399,4 +402,12 @@ public class LabSubjectVO extends LabSubject {
     public void setPosi(String posi) {
     public void setPosi(String posi) {
         this.posi = posi;
         this.posi = posi;
     }
     }
+
+    public Integer getXxpCardInfoId() {
+        return xxpCardInfoId;
+    }
+
+    public void setXxpCardInfoId(Integer xxpCardInfoId) {
+        this.xxpCardInfoId = xxpCardInfoId;
+    }
 }
 }

+ 17 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/XxpClassifyDetailVO.java

@@ -0,0 +1,17 @@
+package com.zd.laboratory.domain.vo;
+
+import com.zd.laboratory.domain.XxpClassifyDetail;
+import lombok.Data;
+
+/**
+ * @Author: xxf
+ * @Date: 2023/03/28/17:38
+ * @Description:
+ */
+@Data
+public class XxpClassifyDetailVO extends XxpClassifyDetail {
+    /***
+     * 实验室id
+     */
+    private Long subjectId;
+}

+ 34 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/XxpInspectionVO.java

@@ -0,0 +1,34 @@
+package com.zd.laboratory.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zd.laboratory.domain.XxpInspection;
+import com.zd.model.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: xxf
+ * @Date: 2023/03/27/15:44
+ * @Description:
+ */
+@Data
+public class XxpInspectionVO extends XxpInspection {
+
+    /**
+     * 签到总数
+     */
+    private Integer signInCount;
+
+    /**
+     * 未签到总数
+     */
+    private Integer noSignedInCount;
+    /**
+     * 值班时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String dutyTime;
+
+}

+ 14 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabCheckOptionMapper.java

@@ -66,4 +66,18 @@ public interface LabCheckOptionMapper
     int queryCheckOptionStatistics(LabCheckOptionStatisticsVo labCheckOptionStatisticsVo);
     int queryCheckOptionStatistics(LabCheckOptionStatisticsVo labCheckOptionStatisticsVo);
 
 
     List<LabCheckOptionStatisticsVo> queryCheckOptionStatisticDtails(LabCheckOptionStatisticsVo labCheckOptionStatisticsVo);
     List<LabCheckOptionStatisticsVo> queryCheckOptionStatisticDtails(LabCheckOptionStatisticsVo labCheckOptionStatisticsVo);
+
+    /***
+     * 大屏-安全隐患-按实验室统计-柱形图
+     * @param statisticsVo
+     * @return
+     */
+    List<LabCheckOptionStatisticsVo> selectSubjectListColumn(LabCheckOptionStatisticsVo statisticsVo);
+
+    /***
+     * 大屏-安全隐患-按实验室统计-列表
+     * @param statisticsVo
+     * @return
+     */
+    List<LabCheckOptionStatisticsVo> selectSubjectListList(LabCheckOptionStatisticsVo statisticsVo);
 }
 }

+ 1 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabHardwareStateMapper.java

@@ -65,6 +65,7 @@ public interface LabHardwareStateMapper {
      */
      */
     List<LabOnlineSubVO> onlineByBigView(LabSubjectVO labSubjectVO);
     List<LabOnlineSubVO> onlineByBigView(LabSubjectVO labSubjectVO);
 
 
+
     List<SysUser> querySubOnlineUser(Map<String, Object> params);
     List<SysUser> querySubOnlineUser(Map<String, Object> params);
 
 
     List<LabSubjectByUserNumVo> querySubsOnlineUser(List<Long> ids);
     List<LabSubjectByUserNumVo> querySubsOnlineUser(List<Long> ids);

+ 23 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSecurityApplyMapper.java

@@ -148,4 +148,27 @@ public interface LabSecurityApplyMapper
      * @return
      * @return
      */
      */
     List<Map<String, Object>> selectLabSecurityApply(Long subjectId);
     List<Map<String, Object>> selectLabSecurityApply(Long subjectId);
+
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     * @param subjectId
+     * @return
+     */
+    List<Map<String,Object>> selectSecurityFingerList(Long subjectId);
+
+    /**
+     * 电子信息牌获取卡号列表
+     * @param subjectId
+     * @return
+     */
+    List<Map<String,Object>> selectSecurityCardList(Long subjectId);
+
+
+    /**
+     * 判断是否获得安全准入
+     *
+     * @param userId 用户的id
+     * @return 安全准入申请
+     */
+    Map<String, Object> selectCountLabSecurityUserId(@Param("subjectId") Long subjectId,@Param("userId") Long userId);
 }
 }

+ 8 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabStudentsInfoMapper.java

@@ -1,5 +1,6 @@
 package com.zd.laboratory.mapper;
 package com.zd.laboratory.mapper;
 
 
+import com.zd.laboratory.api.entity.LabSysUserInfo;
 import com.zd.laboratory.domain.vo.LabStudentsInfoVO;
 import com.zd.laboratory.domain.vo.LabStudentsInfoVO;
 import com.zd.system.api.entity.LabStudentsInfo;
 import com.zd.system.api.entity.LabStudentsInfo;
 
 
@@ -67,4 +68,11 @@ public interface LabStudentsInfoMapper {
      * @return 结果
      * @return 结果
      */
      */
     public int deleteLabStudentsInfoByJoinStudentsIds(Long[] joinStudentsIds);
     public int deleteLabStudentsInfoByJoinStudentsIds(Long[] joinStudentsIds);
+
+    /**
+     * 查询学生信息
+     * @param subjectId 实验室id
+     * @return 学生信息
+     */
+    List<LabSysUserInfo> selectLabStudentsInfoBySubjectId(Long subjectId);
 }
 }

+ 9 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSubjectAccessRecordMapper.java

@@ -163,6 +163,15 @@ public interface LabSubjectAccessRecordMapper {
      */
      */
     public int getRecordNoOut(@Param("userId") Long userId,@Param("dateTime") String dateTime);
     public int getRecordNoOut(@Param("userId") Long userId,@Param("dateTime") String dateTime);
 
 
+    /**
+     * 查询当前用户没有签退的记录
+     * @param labId
+     * @param userId
+     * @param dateTime
+     * @return
+     */
+    int getSignOutRecordNoOut(@Param("labId") Long labId,@Param("userId") Long userId,@Param("dateTime") String dateTime);
+
     List<Map<String, Long>> selectJoinUsers(@Param("subs") List<Long> subs, @Param("date") Date date);
     List<Map<String, Long>> selectJoinUsers(@Param("subs") List<Long> subs, @Param("date") Date date);
 
 
     List<LabSubjectAccessRecord> selectSubIdByUserId(Long userId);
     List<LabSubjectAccessRecord> selectSubIdByUserId(Long userId);

+ 31 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSubjectMapper.java

@@ -272,6 +272,13 @@ public interface LabSubjectMapper {
      */
      */
     public List<LabSubject> multipleDetpBysubList(Long[] ids);
     public List<LabSubject> multipleDetpBysubList(Long[] ids);
 
 
+    /***
+     * 实验室列表查询-信息牌使用
+     * @param labSubject
+     * @return
+     */
+    public List<LabSubject> cardinfoSubList(LabSubject labSubject);
+
     List<LabSubject> getByIds(List<Long> ids);
     List<LabSubject> getByIds(List<Long> ids);
 
 
 
 
@@ -306,4 +313,28 @@ public interface LabSubjectMapper {
      * @return
      * @return
      */
      */
     String getSubjectDetailsById(Long id);
     String getSubjectDetailsById(Long id);
+
+    /**
+     * 根据实验室id获取实验室名称
+     * @param id
+     * @return
+     */
+    String getSubjectNameById(Long id);
+
+    /**
+     * 根据实验室编号查询实验室信息
+     * @param number
+     * @return
+     */
+    LabSubject selectLabSubjectByNum(String number);
+
+
+    /**
+     * 根据实验室id用户id查询是否是实验室管理员和安全管理员
+     * @param subjectId
+     * @param userId
+     * @return
+     */
+    Integer isAdminOrSafeUser(@Param("subjectId") Long subjectId,@Param("userId") Long userId);
+
 }
 }

+ 3 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabWhiteJoinSublistMapper.java

@@ -3,6 +3,7 @@ package com.zd.laboratory.mapper;
 import java.util.List;
 import java.util.List;
 import com.zd.laboratory.domain.LabWhiteJoinSublist;
 import com.zd.laboratory.domain.LabWhiteJoinSublist;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
+import com.zd.laboratory.domain.vo.LabWhitelistVO;
 
 
 /**
 /**
  * 白名单关联的实验室Mapper接口
  * 白名单关联的实验室Mapper接口
@@ -75,4 +76,6 @@ public interface LabWhiteJoinSublistMapper
      * @return
      * @return
      */
      */
     public int deleteLabWhiteJoinSublistByParameter(LabWhiteJoinSublist labWhiteJoinSublist);
     public int deleteLabWhiteJoinSublistByParameter(LabWhiteJoinSublist labWhiteJoinSublist);
+
+    public List<LabWhitelistVO> selectWhiteSublist(LabWhitelistVO whitelistVO);
 }
 }

+ 2 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabWhitelistMapper.java

@@ -67,4 +67,6 @@ public interface LabWhitelistMapper
      * @return 结果
      * @return 结果
      */
      */
     public int deleteLabWhitelistByIds(Long[] ids);
     public int deleteLabWhitelistByIds(Long[] ids);
+
+    public List<LabWhitelistVO>  selectWhiteSublist(LabWhitelistVO whitelistVO);
 }
 }

+ 25 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpCardInfoMapper.java

@@ -1,8 +1,10 @@
 package com.zd.laboratory.mapper;
 package com.zd.laboratory.mapper;
 
 
 import com.zd.laboratory.domain.XxpCardInfo;
 import com.zd.laboratory.domain.XxpCardInfo;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * 巡查信息 Mapper接口
  * 巡查信息 Mapper接口
@@ -60,4 +62,27 @@ public interface XxpCardInfoMapper
      * @return 结果
      * @return 结果
      */
      */
     public int deleteXxpCardInfoByIds(Long[] ids);
     public int deleteXxpCardInfoByIds(Long[] ids);
+
+    /**
+     * 根据卡号查询是否有门禁
+     * @param cardNum
+     * @return
+     */
+    List<Map<String,Object>> selectXxpCardInfoByCard(String cardNum);
+
+
+    /**
+     * 根据电子信息牌查询
+     * @param cardNum
+     * @return
+     */
+    XxpCardInfo selectXxpInfoByCard(String cardNum);
+
+    /**
+     * 根据卡号和密码查询是否密码是否正确
+     * @param cardNum
+     * @param pwd
+     * @return
+     */
+    int selectPwdCountByPwd(@Param("cardNum") String cardNum, @Param("pwd") String pwd);
 }
 }

+ 9 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpClassifyDetailedMapper.java

@@ -1,6 +1,7 @@
 package com.zd.laboratory.mapper;
 package com.zd.laboratory.mapper;
 
 
 import com.zd.laboratory.domain.XxpClassifyDetail;
 import com.zd.laboratory.domain.XxpClassifyDetail;
+import com.zd.laboratory.domain.vo.XxpClassifyDetailVO;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -26,7 +27,7 @@ public interface XxpClassifyDetailedMapper
      * @param classifyDetailed 信息牌类目详情
      * @param classifyDetailed 信息牌类目详情
      * @return 集合
      * @return 集合
      */
      */
-    public List<XxpClassifyDetail> selectXxpClassifyDetailedList(XxpClassifyDetail classifyDetailed);
+    public List<XxpClassifyDetailVO> selectXxpClassifyDetailedList(XxpClassifyDetailVO classifyDetailed);
 
 
 
 
     /**
     /**
@@ -67,4 +68,11 @@ public interface XxpClassifyDetailedMapper
      * @return
      * @return
      */
      */
     public List<XxpClassifyDetail> selectXxpClassifyBySubjectId(Long subjectId);
     public List<XxpClassifyDetail> selectXxpClassifyBySubjectId(Long subjectId);
+
+    /**
+     * 查询实验室下的类目配置
+     * @param classifyDetailVO
+     * @return
+     */
+    public List<XxpClassifyDetailVO> selectXxpClassifyDetailedByPara(XxpClassifyDetailVO classifyDetailVO);
 }
 }

+ 72 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpClassifySubjectMapper.java

@@ -0,0 +1,72 @@
+package com.zd.laboratory.mapper;
+
+import com.zd.laboratory.domain.XxpClassifySubject;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 实验室安全类目关系表 Mapper接口
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+public interface XxpClassifySubjectMapper
+{
+    /**
+     * 查询
+     *
+     * @param id 主键
+     * @return 值班信息
+     */
+    public XxpClassifySubject selectClassifySubjectById(Long id);
+
+    /**
+     * 查询列表
+     *
+     * @param XxpClassifySubject 值班信息
+     * @return 白名单集合
+     */
+    public List<XxpClassifySubject> selectClassifySubjectList(XxpClassifySubject XxpClassifySubject);
+
+
+    /**
+     * 新增值班信息
+     *
+     * @param XxpClassifySubject 值班信息
+     * @return 结果
+     */
+    public int insertClassifySubject(XxpClassifySubject XxpClassifySubject);
+
+    /**
+     * 修改
+     *
+     * @param XxpClassifySubject 值班信息
+     * @return 结果
+     */
+    public int updateClassifySubject(XxpClassifySubject XxpClassifySubject);
+
+    /**
+     * 删除
+     *
+     * @param subjectId 主键
+     * @return 结果
+     */
+    public int deleteClassifySubjectById(Long subjectId);
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteClassifySubjectByIds(Long[] ids);
+
+    /***
+     * 根据实验室id删除
+     * @param subjectId
+     * @return
+     */
+    public int deleteBySubjectId(Long subjectId);
+}

+ 30 - 24
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpDutyMapper.java

@@ -1,9 +1,8 @@
 package com.zd.laboratory.mapper;
 package com.zd.laboratory.mapper;
 
 
 import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpDuty;
-import com.zd.laboratory.domain.vo.XxpDutyVO;
-import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
 
 
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
@@ -18,14 +17,6 @@ import java.util.Map;
 public interface XxpDutyMapper
 public interface XxpDutyMapper
 {
 {
     /**
     /**
-     * 查询
-     *
-     * @param id 主键
-     * @return 值班信息
-     */
-    public XxpDuty selectXxpDutyById(Long id);
-
-    /**
      * 查询列表
      * 查询列表
      *
      *
      * @param xxpDuty 值班信息
      * @param xxpDuty 值班信息
@@ -33,6 +24,14 @@ public interface XxpDutyMapper
      */
      */
     public List<XxpDuty> selectXxpDutyList(XxpDuty xxpDuty);
     public List<XxpDuty> selectXxpDutyList(XxpDuty xxpDuty);
 
 
+    /**
+     * 查询
+     *
+     * @param id 主键
+     * @return 值班信息
+     */
+    public XxpDuty selectXxpDutyById(Long id);
+
 
 
     /**
     /**
      * 新增值班信息
      * 新增值班信息
@@ -66,20 +65,6 @@ public interface XxpDutyMapper
      */
      */
     public int deleteXxpDutyByIds(Long[] ids);
     public int deleteXxpDutyByIds(Long[] ids);
 
 
-    /***
-     * 根据时间段查询有数据的时间列表
-     * @param xxpDuty
-     * @return
-     */
-    public List<XxpDutyVO> selectDutyYmdById(XxpDuty xxpDuty);
-
-    /***
-     * 查询某个具体时间下的实验室和人员总数
-     * @param dutyTime
-     * @return
-     */
-    public XxpDutyVO selectSubAndUserSum(Date dutyTime);
-
     /**
     /**
      * 根据当前时间和实验室ID查询值班人员信息
      * 根据当前时间和实验室ID查询值班人员信息
      * @param labId
      * @param labId
@@ -96,4 +81,25 @@ public interface XxpDutyMapper
      * @return
      * @return
      */
      */
     List<Map<String, Object>> selectDutyUserList(@Param("labId") Long labId, @Param("startTime") String startTime,@Param("endTime") String endTime);
     List<Map<String, Object>> selectDutyUserList(@Param("labId") Long labId, @Param("startTime") String startTime,@Param("endTime") String endTime);
+
+    /***
+     * 根据时间段查询有数据的时间列表
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDutyVO> selectDutyYmdById(XxpDuty xxpDuty);
+
+    /***
+     * 查询某个具体时间下的实验室和人员总数
+     * @param xxpDuty
+     * @return
+     */
+    public XxpDutyVO selectSubAndUserSum(XxpDuty xxpDuty);
+
+    /***
+     * 根据时间查询实验室
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDutyVO> selectInfoByDate(XxpDuty xxpDuty);
 }
 }

+ 48 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpInspectionMapper.java

@@ -1,8 +1,10 @@
 package com.zd.laboratory.mapper;
 package com.zd.laboratory.mapper;
 
 
 import com.zd.laboratory.domain.XxpClassify;
 import com.zd.laboratory.domain.XxpClassify;
+import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpInspection;
 import com.zd.laboratory.domain.XxpInspection;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -82,4 +84,50 @@ public interface XxpInspectionMapper
      */
      */
     List<Map<String, Object>> selectUserXxpInspectionList(@Param("labId") Long labId, @Param("startTime") String startTime,@Param("endTime") String endTime);
     List<Map<String, Object>> selectUserXxpInspectionList(@Param("labId") Long labId, @Param("startTime") String startTime,@Param("endTime") String endTime);
 
 
+    /***
+     * 查询某时间段内签到人数集合
+     * @param inspectionVO
+     * @return
+     */
+    public List<XxpInspectionVO> selectListSigninCount(XxpInspectionVO inspectionVO);
+
+    /***
+     * 查询某时间段内未签到人数集合
+     * @param inspectionVO
+     * @return
+     */
+    public List<XxpInspectionVO> selectListNotSigninCount(XxpInspectionVO inspectionVO);
+
+    /***
+     * 正常签到列表
+     * @param inspection
+     * @return
+     */
+    public List<XxpInspection> selectListSignin(XxpInspection inspection);
+
+    /***
+     * 异常签到列表
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDuty> selectListAbnormal(XxpDuty xxpDuty);
+
+    /**
+     * 查询当天是否有签到为签出的记录
+     * @param labId
+     * @param userId
+     * @param date
+     * @return
+     */
+    Integer selectNoSignOut(@Param("labId") Long labId,@Param("userId") Long userId,@Param("date") String date);
+
+    /**
+     * 更新未签退的未签到
+     * @param labId
+     * @param userId
+     * @param date
+     * @return
+     */
+    Integer updateXxpInspectionSignOut(@Param("labId") Long labId,@Param("userId") Long userId,@Param("date") String date);
+
 }
 }

+ 84 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/XxpUserAuthMapper.java

@@ -0,0 +1,84 @@
+package com.zd.laboratory.mapper;
+
+import com.zd.laboratory.domain.XxpUserAuth;
+import com.zd.laboratory.domain.vo.XxpDutyVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 信息牌人员权限 Mapper接口
+ *
+ * @author xxf
+ * @date 2023-03-22
+ */
+public interface XxpUserAuthMapper
+{
+    /**
+     * 查询
+     *
+     * @param id 主键
+     * @return 信息牌人员权限
+     */
+    public XxpUserAuth selectXxpUserAuthById(Long id);
+
+    /**
+     * 查询列表
+     *
+     * @param XxpUserAuth 信息牌人员权限
+     * @return 白名单集合
+     */
+    public List<XxpUserAuth> selectXxpUserAuthList(XxpUserAuth XxpUserAuth);
+
+
+    /**
+     * 新增
+     *
+     * @param XxpUserAuth 信息牌人员权限
+     * @return 结果
+     */
+    public int insertXxpUserAuth(XxpUserAuth XxpUserAuth);
+
+    /**
+     * 修改
+     *
+     * @param XxpUserAuth 信息牌人员权限
+     * @return 结果
+     */
+    public int updateXxpUserAuth(XxpUserAuth XxpUserAuth);
+
+    /**
+     * 删除
+     *
+     * @param id 主键
+     * @return 结果
+     */
+    public int deleteXxpUserAuthById(Long id);
+
+
+
+    /**
+     * 删除
+     *
+     * @param userId 用户ID
+     * @return 结果
+     */
+    public int deleteXxpByUserId(Long userId);
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteXxpUserAuthByIds(Long[] ids);
+
+    /**
+     * 根据用户id查询指纹信息
+     * @param userId
+     * @return
+     */
+    List<Map<String, Object>> getFingerByUserId(Long userId);
+}

+ 60 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/controller/OneMachineController.java

@@ -159,6 +159,11 @@ public class OneMachineController extends BaseController {
     @GetMapping("/{subId}/function/list")
     @GetMapping("/{subId}/function/list")
     public ResultData<List<SensorFunctionStatus>> querySubFunctionList(@PathVariable("subId") Long subId) {
     public ResultData<List<SensorFunctionStatus>> querySubFunctionList(@PathVariable("subId") Long subId) {
         List<SensorFunctionStatus> list = subjectManagerService.querySenseFunctionBySubId(subId);
         List<SensorFunctionStatus> list = subjectManagerService.querySenseFunctionBySubId(subId);
+        for(SensorFunctionStatus sensorFunctionStatus:list){
+            if(null==sensorFunctionStatus.getDescribe()){
+                sensorFunctionStatus.setDescribe(sensorFunctionStatus.getFuncName());
+            }
+        }
         //todo 设备来了完善
         //todo 设备来了完善
         return ResultData.success(list);
         return ResultData.success(list);
     }
     }
@@ -249,6 +254,44 @@ public class OneMachineController extends BaseController {
         return ResultData.success(oneMachineService.createSignInPerInfoVO(subId, userResult.getData(), SignEnum.SIGN_IN));
         return ResultData.success(oneMachineService.createSignInPerInfoVO(subId, userResult.getData(), SignEnum.SIGN_IN));
     }
     }
 
 
+
+
+    @GetMapping("/{subId}/SignInXxpCheck/{userId}")
+    public ResultData<SignInPerInfoVO> checkXxpUser(@PathVariable("userId") Long userId, @PathVariable("subId") Long subId, HttpServletRequest request) {
+        //获取指定用户信息
+        // 查询用户信息
+        R<SysUser> userResult = userService.getUserInfoByUserId(userId,SecurityConstants.INNER);
+
+        //验证用户账户状态
+        SysUser sysUser = userResult.getData();
+        if(sysUser.getStatus()==null || !sysUser.getStatus().equals("0")){
+            throw new ServiceException("用户:" + sysUser.getNickName() + " 账户停用,请联系管理员");
+        }
+
+        /*String url="";
+        String baseUrl=request.getServerName() ;
+        if(baseUrl.contains("192.168")){
+            url=fileConfigUtils.getLocalUrl()+sysUser.getAvatar();
+        }else {
+            url=fileConfigUtils.getRemoteUrl()+sysUser.getAvatar();
+        }*/
+//        //通过配置动态加载域名
+//        String url = fileConfigUtils.getFileDomainApp() + sysUser.getAvatar();
+//        String imgUrl = UrlFormatUtils.getHttpsORHttpUrl(url);
+//        sysUser.setAvatar(imgUrl);
+
+        //判断当天是否已签到,没有签出
+//        int num=labSubjectAccessRecordService.getRecordNoOut(userResult.getData().getUserId());
+//        if(num==0){
+//            return ResultData.fail(600,"你已经签到了,无法进行重复签到!");
+//        }
+        //签证前置信息
+        return ResultData.success(oneMachineService.createSignInPerInfoVO(subId, userResult.getData(), SignEnum.SIGN_IN));
+    }
+
+
+
+
     @ApiOperation("签出验证")
     @ApiOperation("签出验证")
     @GetMapping("/{subId}/SignOutCheck/{username}")
     @GetMapping("/{subId}/SignOutCheck/{username}")
     public ResultData<SignInPerInfoVO> checkOutUser(@PathVariable("username") String username, @PathVariable("subId") Long subId) {
     public ResultData<SignInPerInfoVO> checkOutUser(@PathVariable("username") String username, @PathVariable("subId") Long subId) {
@@ -258,6 +301,15 @@ public class OneMachineController extends BaseController {
         return ResultData.success(oneMachineService.createSignInPerInfoVO(subId, userResult.getData(), SignEnum.SIGN_OUT));
         return ResultData.success(oneMachineService.createSignInPerInfoVO(subId, userResult.getData(), SignEnum.SIGN_OUT));
     }
     }
 
 
+    @ApiOperation("签出验证根据用户ID")
+    @GetMapping("/{subId}/SignOutXXpCheck/{userId}")
+    public ResultData<SignInPerInfoVO> checkOutUser(@PathVariable("userId") Long userId, @PathVariable("subId") Long subId) {
+        //获取指定用户信息
+        R<SysUser> userResult = userService.getUserInfoByUserId(userId,SecurityConstants.INNER);
+        //签证前置信息
+        return ResultData.success(oneMachineService.createSignInPerInfoVO(subId, userResult.getData(), SignEnum.SIGN_OUT));
+    }
+
     @ApiOperation("签到提交")
     @ApiOperation("签到提交")
     @PostMapping("/{code}/SignIn")
     @PostMapping("/{code}/SignIn")
     public ResultData postSignIn(@PathVariable @ApiParam("验证码") String code, @RequestBody @ApiParam("特征数据") byte[] data) {
     public ResultData postSignIn(@PathVariable @ApiParam("验证码") String code, @RequestBody @ApiParam("特征数据") byte[] data) {
@@ -509,4 +561,12 @@ public class OneMachineController extends BaseController {
                 .collect(Collectors.toList()));
                 .collect(Collectors.toList()));
     }
     }
 
 
+
+    @RequestMapping("/getSubjectIdByNum/{num}")
+    public ResultData querySubInfoByNumber(@PathVariable("num") String num) {
+        //转换实验室ID
+        Long aLong = labHardwareService.querySubIdByNum(num);
+        return ResultData.success(aLong);
+    }
+
 }
 }

+ 24 - 14
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/service/OneMachineService.java

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zd.algorithm.api.face.feign.FaceCompare;
 import com.zd.algorithm.api.face.feign.FaceCompare;
 import com.zd.algorithm.api.face.feign.RemoteFaceService;
 import com.zd.algorithm.api.face.feign.RemoteFaceService;
+import com.zd.common.core.exception.NoRollException;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
@@ -112,6 +113,9 @@ public class OneMachineService implements ValidationSignInPerInfo {
     @Autowired
     @Autowired
     private LabSubjectMapper labSubjectMapper;
     private LabSubjectMapper labSubjectMapper;
 
 
+    @Autowired
+    private IXxpInspectionService xxpInspectionService;
+
         private Map<SignEnum, Function<SignInfoVO, SignInPerInfoVO>> validMap;
         private Map<SignEnum, Function<SignInfoVO, SignInPerInfoVO>> validMap;
 
 
     @PostConstruct
     @PostConstruct
@@ -135,6 +139,10 @@ public class OneMachineService implements ValidationSignInPerInfo {
             if (subject.getIsDel()) {
             if (subject.getIsDel()) {
                 messages.add("实验室当前已禁用,请联系负责人开启!");
                 messages.add("实验室当前已禁用,请联系负责人开启!");
             }
             }
+            int num=xxpInspectionService.selectNoSignOut(signInfoVO.getSubId(),signInfoVO.getSingInUser().getUserId());
+            if(num>0){
+                throw new NoRollException(500,"当前用户已经签到成功,不能重复签到!");
+            }
             //1、判断是否有安全准入资格,如没有准入资格进行提示(语音+浮层):验证失败,您需要通过小程序申请实验室准入资格后才能签到。
             //1、判断是否有安全准入资格,如没有准入资格进行提示(语音+浮层):验证失败,您需要通过小程序申请实验室准入资格后才能签到。
             if(UserConstants.USER_TYPE_STUDENT.equals(signInPerInfoVO.getSingInUser().getType())){
             if(UserConstants.USER_TYPE_STUDENT.equals(signInPerInfoVO.getSingInUser().getType())){
                 if (signInPerInfoVO.getSingInUser().getExpirationDate() != null) {
                 if (signInPerInfoVO.getSingInUser().getExpirationDate() != null) {
@@ -159,6 +167,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
                     labSecurityApply.setSubjectId(signInfoVO.getSubId());
                     labSecurityApply.setSubjectId(signInfoVO.getSubId());
                     labSecurityApply.setUserId(signInfoVO.getSingInUser().getUserId());
                     labSecurityApply.setUserId(signInfoVO.getSingInUser().getUserId());
                     labSecurityApply.setAuditStatus(2);
                     labSecurityApply.setAuditStatus(2);
+                    labSecurityApply.setValid(0);
                     List<LabSecurityApplyVO> listapply= iLabSecurityApplyService.selectLabSecurityApplyList(labSecurityApply);
                     List<LabSecurityApplyVO> listapply= iLabSecurityApplyService.selectLabSecurityApplyList(labSecurityApply);
                     if (listapply.size()==0) {
                     if (listapply.size()==0) {
                         messages.add("您未获取准入凭证!您需要通过小程序申请实验室准入资格后才能签到。");
                         messages.add("您未获取准入凭证!您需要通过小程序申请实验室准入资格后才能签到。");
@@ -337,29 +346,30 @@ public class OneMachineService implements ValidationSignInPerInfo {
             logger.info("&&&&&&&&&&&&&&&&&&&&&&" + code + "," + signEnum);
             logger.info("&&&&&&&&&&&&&&&&&&&&&&" + code + "," + signEnum);
             if (StringUtils.isEmpty(code)) {
             if (StringUtils.isEmpty(code)) {
                 //            throw new CaptchaException("签到验证码错误,请重新刷卡重试!");
                 //            throw new CaptchaException("签到验证码错误,请重新刷卡重试!");
-                ResultData.fail(600, "签到验证码错误,请重新刷卡重试!");
+                return ResultData.fail(600, "签到验证码错误,请重新刷卡重试!");
             }
             }
             String verifyKey = BaseConstants.SINGIN_CAPTCHA_CODE_KEY + code;
             String verifyKey = BaseConstants.SINGIN_CAPTCHA_CODE_KEY + code;
             SingInUser user = redisService.getCacheObject(verifyKey);
             SingInUser user = redisService.getCacheObject(verifyKey);
             if (user == null || user.getUserId() == null) {
             if (user == null || user.getUserId() == null) {
-                ResultData.fail(600, "签到&签出人脸已超时,请重新刷卡重试!");
+                return ResultData.fail(600, "签到&签出人脸已超时,请重新刷卡重试!");
             }
             }
 //            boolean expire = redisService.expire(verifyKey, 120);
 //            boolean expire = redisService.expire(verifyKey, 120);
 //            if (!expire) return ResultData.fail(600, "签到&签出验证码已超时,请重新刷卡重试!");
 //            if (!expire) return ResultData.fail(600, "签到&签出验证码已超时,请重新刷卡重试!");
             if (user != null) {
             if (user != null) {
                 String s = StrUtil.subAfter(code, "_", true);
                 String s = StrUtil.subAfter(code, "_", true);
                 if (signEnum.equals(SignEnum.SIGN_IN)) {
                 if (signEnum.equals(SignEnum.SIGN_IN)) {
-
                     logger.info("1111111签到调用人脸服务");
                     logger.info("1111111签到调用人脸服务");
                     //调用人脸验证
                     //调用人脸验证
-                    R r = faceCompare(user.getUserId(), face);
-                    //验证失败刷新验证码时间
-                    logger.info("r.getCode():"+r.getCode());
-                    if (r.getCode() != 200) {
-                        return ResultData.fail(r.getMsg());
+                    R r;
+                    if(null!=face){
+                        r = faceCompare(user.getUserId(), face);
+                        //验证失败刷新验证码时间
+                        logger.info("r.getCode():"+r.getCode());
+                        if (r.getCode() != 200) {
+                            return ResultData.fail(r.getMsg());
+                        }
+                        logger.info("2222222人脸服务调用完成!");
                     }
                     }
-                    logger.info("2222222人脸服务调用完成!");
-
                     //插入进入实验室记录
                     //插入进入实验室记录
                     LabSubjectAccessRecordVo subjectAccessRecord = new LabSubjectAccessRecordVo();
                     LabSubjectAccessRecordVo subjectAccessRecord = new LabSubjectAccessRecordVo();
                     subjectAccessRecord.setDeptId(user.getDeptId());
                     subjectAccessRecord.setDeptId(user.getDeptId());
@@ -384,7 +394,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
                             messageSendService.builUserByChange(floorVo.getBuildId());
                             messageSendService.builUserByChange(floorVo.getBuildId());
                         }
                         }
                     }else{
                     }else{
-                        return ResultData.fail("当前用户已经签到成功,不能重复签到");
+                        return ResultData.fail("当前用户已经签到成功,不能重复签到");
                     }
                     }
 
 
                     //学生登陆时 给奖励分
                     //学生登陆时 给奖励分
@@ -392,7 +402,7 @@ public class OneMachineService implements ValidationSignInPerInfo {
                         Map map = new HashMap();
                         Map map = new HashMap();
                         map.put("userId", user.getUserId());
                         map.put("userId", user.getUserId());
                         map.put("status", "0");
                         map.put("status", "0");
-                       r = remoteExamService.addLoginfo(map);
+                        r = remoteExamService.addLoginfo(map);
                         if (r.getCode() != 200) {
                         if (r.getCode() != 200) {
                             logger.info("打卡签到奖励分记录保存失败!");
                             logger.info("打卡签到奖励分记录保存失败!");
                             // throw new ServiceException("打卡签出奖励分记录保存失败!");
                             // throw new ServiceException("打卡签出奖励分记录保存失败!");
@@ -503,12 +513,12 @@ public class OneMachineService implements ValidationSignInPerInfo {
     }
     }
 
 
     public R faceCompare(Long userId, byte[] face) {
     public R faceCompare(Long userId, byte[] face) {
-
+        logger.info("*********"+userId+"*********");
         FaceCompare faceCompare = new FaceCompare();
         FaceCompare faceCompare = new FaceCompare();
         faceCompare.setUserId(userId);
         faceCompare.setUserId(userId);
         faceCompare.setData(face);
         faceCompare.setData(face);
         R compare = remoteFaceService.compare(faceCompare);
         R compare = remoteFaceService.compare(faceCompare);
-
+        logger.info("***********compare.getCode()"+compare.getCode());
         return compare;
         return compare;
     }
     }
 
 

+ 23 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabSecurityApplyService.java

@@ -177,4 +177,27 @@ public interface ILabSecurityApplyService
      * @return
      * @return
      */
      */
     List<LabSecurityApply>  selectValidApply(LabSecurityApply labSecurityApply);
     List<LabSecurityApply>  selectValidApply(LabSecurityApply labSecurityApply);
+
+
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     * @param subjectId
+     * @return
+     */
+    List<Map<String,Object>> selectSecurityFingerList(Long subjectId);
+
+    /**
+     *获取安全准入人员的卡号信息
+     * @param subjectId
+     * @return
+     */
+    List<Map<String,Object>> selectSecurityCardList(Long subjectId);
+
+    /**
+     * 判断是否获得安全准入
+     *
+     * @param userId 用户的id
+     * @return 安全准入申请
+     */
+    Map<String,Object> selectCountLabSecurityUserId(Long subjectId, Long userId);
 }
 }

+ 9 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabStudentsInfoService.java

@@ -1,5 +1,6 @@
 package com.zd.laboratory.service;
 package com.zd.laboratory.service;
 
 
+import com.zd.laboratory.api.entity.LabSysUserInfo;
 import com.zd.laboratory.domain.dto.LabStudentsInfoAuditDTO;
 import com.zd.laboratory.domain.dto.LabStudentsInfoAuditDTO;
 import com.zd.laboratory.domain.vo.LabStudentsInfoVO;
 import com.zd.laboratory.domain.vo.LabStudentsInfoVO;
 import com.zd.system.api.entity.LabStudentsInfo;
 import com.zd.system.api.entity.LabStudentsInfo;
@@ -102,4 +103,12 @@ public interface ILabStudentsInfoService {
      * @return 结果
      * @return 结果
      */
      */
     public int deleteLabStudentsInfoByJoinStudentsId(Long joinStudentsId);
     public int deleteLabStudentsInfoByJoinStudentsId(Long joinStudentsId);
+
+
+    /**
+     * 查询学生信息
+     * @param subjectId 实验室id
+     * @return 学生信息
+     */
+    public List<LabSysUserInfo> selectLabStudentsInfoBySubjectId(Long subjectId);
 }
 }

+ 8 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabSubjectAccessRecordService.java

@@ -165,6 +165,14 @@ public interface ILabSubjectAccessRecordService {
     public int getRecordNoOut(Long userId);
     public int getRecordNoOut(Long userId);
 
 
     /**
     /**
+     * 获取没有签退的人
+     * @param labId
+     * @param userId
+     * @return
+     */
+    int getSignOutRecordNoOut(Long labId,Long userId);
+
+    /**
      * 更新签到记录
      * 更新签到记录
      * @param accessRecord
      * @param accessRecord
      * @return
      * @return

+ 35 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabSubjectService.java

@@ -6,6 +6,7 @@ import com.zd.laboratory.domain.vo.LabClassifiedVo;
 import com.zd.laboratory.domain.vo.LabClasstypeVo;
 import com.zd.laboratory.domain.vo.LabClasstypeVo;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
 import com.zd.laboratory.domain.vo.LabSubjectVO;
 import com.zd.model.entity.TotalByID;
 import com.zd.model.entity.TotalByID;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -282,4 +283,38 @@ public interface ILabSubjectService {
      * @return
      * @return
      */
      */
     String getSubjectDetailsById(Long id);
     String getSubjectDetailsById(Long id);
+
+
+    /**
+     * 根据实验室id获取实验室名称
+     * @param id
+     * @return
+     */
+    String getSubjectNameById(Long id);
+
+    /***
+     * 实验室列表查询-信息牌使用
+     * @param labSubject
+     * @return
+     */
+    public List<LabSubject> cardinfoSubList(LabSubject labSubject);
+
+
+    /**
+     * 查询实验室根据编号
+     *
+     * @param number 实验室编号
+     * @return 实验室
+     */
+    public LabSubject selectLabSubjectByNum(String number);
+
+
+    /**
+     * 根据实验室id用户id查询是否是实验室管理员和安全管理员
+     * @param subjectId
+     * @param userId
+     * @return
+     */
+    Integer isAdminOrSafeUser(Long subjectId,Long userId);
+
 }
 }

+ 2 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabWhitelistService.java

@@ -78,4 +78,6 @@ public interface ILabWhitelistService
      * @return 结果
      * @return 结果
      */
      */
     public int deleteLabWhitelistById(Long id);
     public int deleteLabWhitelistById(Long id);
+
+    public List<LabWhitelistVO> selectWhiteSublist(LabWhitelistVO whitelistVO);
 }
 }

+ 23 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpCardInfoService.java

@@ -3,6 +3,7 @@ package com.zd.laboratory.service;
 import com.zd.laboratory.domain.XxpCardInfo;
 import com.zd.laboratory.domain.XxpCardInfo;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * 电子信息牌 Service接口
  * 电子信息牌 Service接口
@@ -63,4 +64,26 @@ public interface IXxpCardInfoService
      * @return 结果
      * @return 结果
      */
      */
     public int deleteXxpCardInfoById(Long id);
     public int deleteXxpCardInfoById(Long id);
+
+    /**
+     * 根据卡号查询是否有门禁
+     * @param card
+     * @return
+     */
+    public List<Map<String,Object>> selectXxpCardInfoByCard(String card);
+
+    /**
+     * 根据电子信息牌查询
+     * @param cardNum
+     * @return
+     */
+    XxpCardInfo selectXxpInfoByCard(String cardNum);
+
+    /**
+     * 根据卡号和密码查询是否密码是否正确
+     * @param cardNum
+     * @param pwd
+     * @return
+     */
+    int selectPwdCountByPwd(String cardNum, String pwd);
 }
 }

+ 9 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifyDetailedService.java

@@ -2,7 +2,7 @@ package com.zd.laboratory.service;
 
 
 import com.zd.laboratory.api.vo.LabXxpClassifyVo;
 import com.zd.laboratory.api.vo.LabXxpClassifyVo;
 import com.zd.laboratory.domain.XxpClassifyDetail;
 import com.zd.laboratory.domain.XxpClassifyDetail;
-
+import com.zd.laboratory.domain.vo.XxpClassifyDetailVO;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -27,7 +27,7 @@ public interface IXxpClassifyDetailedService
      * @param classifyDetail 安全信息类目详情
      * @param classifyDetail 安全信息类目详情
      * @return 安全信息类目详情集合
      * @return 安全信息类目详情集合
      */
      */
-    public List<XxpClassifyDetail> selectXxpClassifyDetailedList(XxpClassifyDetail classifyDetail);
+    public List<XxpClassifyDetailVO> selectXxpClassifyDetailedList(XxpClassifyDetailVO classifyDetail);
 
 
 
 
 
 
@@ -65,6 +65,13 @@ public interface IXxpClassifyDetailedService
      */
      */
     public int deleteXxpClassifyDetailedById(Long id);
     public int deleteXxpClassifyDetailedById(Long id);
 
 
+    /**
+     * 查询实验室下的类目配置
+     * @param classifyDetailVO
+     * @return
+     */
+    public List<XxpClassifyDetailVO> selectXxpClassifyDetailedByPara(XxpClassifyDetailVO classifyDetailVO);
+
 
 
     /**
     /**
      * 根据实验室id查询主要类别
      * 根据实验室id查询主要类别

+ 7 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifyService.java

@@ -4,6 +4,7 @@ import com.zd.laboratory.domain.LabWhitelist;
 import com.zd.laboratory.domain.XxpClassify;
 import com.zd.laboratory.domain.XxpClassify;
 import com.zd.laboratory.domain.XxpClassifyDetail;
 import com.zd.laboratory.domain.XxpClassifyDetail;
 import com.zd.laboratory.domain.vo.LabWhitelistVO;
 import com.zd.laboratory.domain.vo.LabWhitelistVO;
+import com.zd.laboratory.domain.vo.XxpClassifyDetailVO;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -73,4 +74,10 @@ public interface IXxpClassifyService
      * @return
      * @return
      */
      */
     List<XxpClassify> selectXxpClassifySubjectById(Long id);
     List<XxpClassify> selectXxpClassifySubjectById(Long id);
+    /***
+     * 查看该类目下是否有子类
+     * @param classifyId
+     * @return
+     */
+    public List<XxpClassifyDetailVO> delCheck(Long classifyId);
 }
 }

+ 73 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpClassifySubjectService.java

@@ -0,0 +1,73 @@
+package com.zd.laboratory.service;
+
+import com.zd.laboratory.domain.XxpClassifySubject;
+import java.util.List;
+
+/**
+ * 值班 Service接口
+ *
+ * @author zd
+ * @date 2022-01-26
+ */
+public interface IXxpClassifySubjectService
+{
+    /**
+     * 查询值班
+     *
+     * @param id 值班主键
+     * @return 值班
+     */
+    public XxpClassifySubject  selectClassifySubjectById(Long id);
+
+    /**
+     * 查询值班列表
+     *
+     * @param classifySubject 值班
+     * @return 值班集合
+     */
+    public List<XxpClassifySubject> selectClassifySubjectList(XxpClassifySubject classifySubject);
+
+
+
+    /**
+     * 新增值班
+     *
+     * @param classifySubject 值班
+     * @return 结果
+     */
+    public int insertClassifySubject(XxpClassifySubject classifySubject);
+
+
+
+    /**
+     * 修改值班
+     *
+     * @param classifySubject 值班
+     * @return 结果
+     */
+    public int updateClassifySubject(XxpClassifySubject classifySubject);
+
+    /**
+     * 批量删除值班
+     *
+     * @param ids 需要删除的值班主键集合
+     * @return 结果
+     */
+    public int deleteClassifySubjectByIds(Long[] ids);
+
+    /**
+     * 删除值班信息
+     *
+     * @param id 值班主键
+     * @return 结果
+     */
+    public int deleteClassifySubjectById(Long id);
+
+    /***
+     * 根据实验室id删除
+     * @param subjectId
+     * @return
+     */
+    public int deleteBySubjectId(Long subjectId);
+
+}

+ 12 - 7
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpDutyService.java

@@ -2,8 +2,8 @@ package com.zd.laboratory.service;
 
 
 import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.vo.XxpDutyVO;
 import com.zd.laboratory.domain.vo.XxpDutyVO;
-import java.util.Date;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
@@ -45,10 +45,10 @@ public interface IXxpDutyService
     /**
     /**
      * 新增值班
      * 新增值班
      *
      *
-     * @param xxpDuty 值班
+     * @param xxpDutyVO 值班
      * @return 结果
      * @return 结果
      */
      */
-    public int insertXxpDuty(XxpDutyVO xxpDuty);
+    public int insertXxpDuty(XxpDutyVO xxpDutyVO);
 
 
 
 
 
 
@@ -85,10 +85,17 @@ public interface IXxpDutyService
 
 
     /***
     /***
      * 查询某个具体时间下的实验室和人员总数
      * 查询某个具体时间下的实验室和人员总数
-     * @param dutyTime
+     * @param xxpDuty
      * @return
      * @return
      */
      */
-    public XxpDutyVO selectSubAndUserSum(Date dutyTime);
+    public XxpDutyVO selectSubAndUserSum(XxpDuty xxpDuty);
+
+    /***
+     * 根据时间查询实验室
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDutyVO> selectInfoByDate(XxpDuty xxpDuty);
 
 
     /**
     /**
      * 查询实验室值班人员信息
      * 查询实验室值班人员信息
@@ -99,6 +106,4 @@ public interface IXxpDutyService
      */
      */
     public List<Map<String,Object>> selectDutyUserList(Long labId,String startTime,String endTime);
     public List<Map<String,Object>> selectDutyUserList(Long labId,String startTime,String endTime);
 
 
-
-
 }
 }

+ 50 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpInspectionService.java

@@ -1,6 +1,9 @@
 package com.zd.laboratory.service;
 package com.zd.laboratory.service;
 
 
+import com.zd.laboratory.domain.XxpDuty;
 import com.zd.laboratory.domain.XxpInspection;
 import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -81,4 +84,51 @@ public interface IXxpInspectionService
      */
      */
     public List<Map<String,Object>> selectUserXxpInspectionList(Long labId,String startTime,String endTime);
     public List<Map<String,Object>> selectUserXxpInspectionList(Long labId,String startTime,String endTime);
 
 
+
+    /***
+     * 查询某时间段内签到人数集合
+     * @param inspectionVO
+     * @return
+     */
+    public List<XxpInspectionVO> selectListSigninCount(XxpInspectionVO inspectionVO);
+
+    /***
+     * 查询某时间段内未签到人数集合
+     * @param inspectionVO
+     * @return
+     */
+    public List<XxpInspectionVO> selectListNotSigninCount(XxpInspectionVO inspectionVO);
+
+    /***
+     * 正常签到列表
+     * @param inspection
+     * @return
+     */
+    public List<XxpInspection> selectListSignin(XxpInspection inspection);
+
+    /***
+     * 异常签到列表
+     * @param xxpDuty
+     * @return
+     */
+    public List<XxpDuty> selectListAbnormal(XxpDuty xxpDuty);
+
+
+    /***
+     * 签到记录
+     * @param labId
+     * @param userId
+     * @return
+     */
+    public Integer selectNoSignOut(Long labId,Long userId);
+
+
+    /**
+     * 更新未签退的未签到
+     * @param labId
+     * @param userId
+     * @return
+     */
+    Integer updateXxpInspectionSignOut(Long labId,Long userId);
+
 }
 }

+ 106 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/IXxpUserAuthService.java

@@ -0,0 +1,106 @@
+package com.zd.laboratory.service;
+
+import com.zd.laboratory.api.vo.XxpUserAuthVo;
+import com.zd.laboratory.domain.XxpDuty;
+import com.zd.laboratory.domain.XxpInspection;
+import com.zd.laboratory.domain.XxpUserAuth;
+import com.zd.laboratory.domain.vo.XxpInspectionVO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 信息牌人员权限 Service接口
+ *
+ * @author zd
+ * @date 2023-03-26
+ */
+public interface IXxpUserAuthService
+{
+    /**
+     * 查询
+     *
+     * @param id 主键
+     * @return
+     */
+    public XxpUserAuth selectXxpUserAuthById(Long id);
+
+    /**
+     * 查询列表
+     *
+     * @param xxpUserAuth
+     * @return 集合
+     */
+    public List<XxpUserAuth> selectXxpUserAuthList(XxpUserAuth xxpUserAuth);
+
+
+
+    /**
+     * 新增
+     *
+     * @param xxpUserAuth
+     * @return 结果
+     */
+    public int insertXxpUserAuth(XxpUserAuth xxpUserAuth);
+
+
+    /**
+     * 新增
+     *
+     * @param xxpUserAuth
+     * @return 结果
+     */
+    public int insertXxpUserAuthBatch(XxpUserAuth xxpUserAuth);
+
+
+
+    /**
+     * 新增
+     *
+     * @param xxpUserAuth
+     * @return 结果
+     */
+    public int insertXxpUserAppAuth(XxpUserAuth xxpUserAuth);
+
+
+
+    /**
+     * 新增
+     *
+     * @param xxpUserAuth
+     * @return 结果
+     */
+    public int updateXxpUserAuth(XxpUserAuth xxpUserAuth);
+
+    /**
+     * 批量删除
+     *
+     * @param ids 需要删除的主键集合
+     * @return 结果
+     */
+    public int deleteXxpUserAuthByIds(Long[] ids);
+
+    /**
+     * 删除信息
+     *
+     * @param id 主键
+     * @return 结果
+     */
+    public int deleteXxpUserAuthById(Long id);
+
+    /**
+     * 根据用户id查询指纹信息
+     * @param userId
+     * @return
+     */
+    List<Map<String, Object>> getFingerByUserId(Long userId);
+
+
+    /**
+     * 批量删除
+     *
+     * @param userId 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteXxpByUserId(Long userId);
+}

+ 33 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecurityApplyServiceImpl.java

@@ -3,6 +3,7 @@ package com.zd.laboratory.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.annotation.DataScope;
+import com.zd.common.core.exception.NoRollException;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.DateUtils;
@@ -33,7 +34,6 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
-
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.BufferedInputStream;
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.BufferedOutputStream;
@@ -483,4 +483,36 @@ public class LabSecurityApplyServiceImpl implements ILabSecurityApplyService
     public List<LabSecurityApply> selectValidApply(LabSecurityApply labSecurityApply) {
     public List<LabSecurityApply> selectValidApply(LabSecurityApply labSecurityApply) {
         return labSecurityApplyMapper.selectValidApply(labSecurityApply);
         return labSecurityApplyMapper.selectValidApply(labSecurityApply);
     }
     }
+
+    /**
+     * 电子信息牌获取准入人员的指纹信息列表
+     * @param subjectId
+     * @return
+     */
+    @Override
+    public List<Map<String,Object>> selectSecurityFingerList(Long subjectId) {
+        return labSecurityApplyMapper.selectSecurityFingerList(subjectId);
+    }
+
+    /**
+     * 电子信息牌获取卡号列表
+     * @param subjectId
+     * @return
+     */
+    @Override
+    public List<Map<String,Object>> selectSecurityCardList(Long subjectId) {
+        return labSecurityApplyMapper.selectSecurityCardList(subjectId);
+    }
+
+    /**
+     * 判断是否获得安全准入
+     *
+     * @param userId 用户的id
+     * @return 安全准入申请
+     */
+    @Override
+    public Map<String, Object> selectCountLabSecurityUserId(Long subjectId, Long userId){
+        return labSecurityApplyMapper.selectCountLabSecurityUserId(subjectId,userId);
+    }
+
 }
 }

+ 29 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecuritySubjectmaterialServiceImpl.java

@@ -2,13 +2,19 @@ package com.zd.laboratory.service.impl;
 
 
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
-import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.SaveUtil;
 import com.zd.common.core.utils.SaveUtil;
 
 
 import com.zd.laboratory.domain.LabSubject;
 import com.zd.laboratory.domain.LabSubject;
+import com.zd.laboratory.domain.XxpCardInfo;
 import com.zd.laboratory.domain.vo.LabSecuritySubjectmaterialVO;
 import com.zd.laboratory.domain.vo.LabSecuritySubjectmaterialVO;
+import com.zd.laboratory.mqtt.entiy.MessageBody;
+import com.zd.laboratory.mqtt.service.impl.CommonSend;
+import com.zd.laboratory.service.IXxpCardInfoService;
+import com.zd.model.constant.MqttConstants;
 import com.zd.model.entity.SysUser;
 import com.zd.model.entity.SysUser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.zd.laboratory.mapper.LabSecuritySubjectmaterialMapper;
 import com.zd.laboratory.mapper.LabSecuritySubjectmaterialMapper;
@@ -25,12 +31,18 @@ import org.springframework.transaction.annotation.Transactional;
 @Service
 @Service
 public class LabSecuritySubjectmaterialServiceImpl implements ILabSecuritySubjectmaterialService
 public class LabSecuritySubjectmaterialServiceImpl implements ILabSecuritySubjectmaterialService
 {
 {
+    private static Logger logger = LoggerFactory.getLogger(LabSecuritySubjectmaterialServiceImpl.class);
     @Autowired
     @Autowired
     private LabSecuritySubjectmaterialMapper labSecuritySubjectmaterialMapper;
     private LabSecuritySubjectmaterialMapper labSecuritySubjectmaterialMapper;
 
 
     @Autowired
     @Autowired
     private TokenService tokenService;
     private TokenService tokenService;
 
 
+    @Autowired
+    private IXxpCardInfoService xxpCardInfoService;
+
+    @Autowired
+    private CommonSend commonSend;
     /**
     /**
      * 查询实验室和准入模板关系
      * 查询实验室和准入模板关系
      *
      *
@@ -146,6 +158,22 @@ public class LabSecuritySubjectmaterialServiceImpl implements ILabSecuritySubjec
     public int addList(LabSecuritySubjectmaterialVO labSecuritySubjectmaterialVO) {
     public int addList(LabSecuritySubjectmaterialVO labSecuritySubjectmaterialVO) {
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
         List<LabSubject> labSubjectList= labSecuritySubjectmaterialVO.getLabSubjectList();//实验室集合
         List<LabSubject> labSubjectList= labSecuritySubjectmaterialVO.getLabSubjectList();//实验室集合
+
+        //配置信息牌 考勤方式和考勤密码
+        XxpCardInfo cardInfo = new XxpCardInfo();
+        cardInfo.setSubjectId(labSubjectList.get(0).getId());
+        List<XxpCardInfo> xxpList =  xxpCardInfoService.selectXxpCardInfoList(cardInfo);
+        if(xxpList.size()>0){
+            cardInfo = xxpList.get(0);
+            if(!labSecuritySubjectmaterialVO.getAuthType().equals(cardInfo.getAuthType())){
+                commonSend.send(MqttConstants.TOPIC_LAB_SUB_INFO + labSubjectList.get(0).getId(), new MessageBody(labSecuritySubjectmaterialVO.getAuthType()+""));
+                logger.info("通知电子信息牌,实验室验证方式已经修改");
+            }
+            cardInfo.setAuthType(labSecuritySubjectmaterialVO.getAuthType());
+            cardInfo.setAuthPwd(labSecuritySubjectmaterialVO.getAuthPwd());
+            xxpCardInfoService.updateXxpCardInfo(cardInfo);
+        }
+
         //删除改实验室模板重新添加
         //删除改实验室模板重新添加
         labSecuritySubjectmaterialMapper.deleteLabSecurityMaterialDataBysubjectId(labSubjectList.get(0).getId());
         labSecuritySubjectmaterialMapper.deleteLabSecurityMaterialDataBysubjectId(labSubjectList.get(0).getId());
         int id=0;
         int id=0;

+ 0 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabStudentsInfoServiceImpl.java


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio