Procházet zdrojové kódy

海康门禁 和 人脸识别 屏蔽

linft před 2 roky
rodič
revize
d4de91803a
18 změnil soubory, kde provedl 139 přidání a 199 odebrání
  1. 2 2
      zd-modules/zd-algorithm/pom.xml
  2. 23 22
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/FaceApi.java
  3. 7 73
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/FaceManagerApi.java
  4. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/component/AppStartedListener.java
  5. 2 2
      zd-modules/zd-modules-laboratory/pom.xml
  6. 0 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/ZdLaboratoryApplication.java
  7. 2 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/config/DisposableConfig.java
  8. 6 9
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabHaikangUserController.java
  9. 4 5
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabWhitelistController.java
  10. 0 4
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyController.java
  11. 2 3
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabHaikangUser.java
  12. 1 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/HaikangUserVo.java
  13. 59 38
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/HaiKangDoorService.java
  14. 7 7
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHaikangUserFingerServiceImpl.java
  15. 7 8
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHaikangUserServiceImpl.java
  16. 7 7
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHardwareServiceImpl.java
  17. 3 5
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecurityApplyServiceImpl.java
  18. 6 6
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabWhitelistServiceImpl.java

+ 2 - 2
zd-modules/zd-algorithm/pom.xml

@@ -94,11 +94,11 @@
         </dependency>
 
         <!-- 人脸识别 -->
-        <dependency>
+        <!--<dependency>
             <groupId>com.zd.common</groupId>
             <artifactId>face-component</artifactId>
             <version>${project.version}</version>
-        </dependency>
+        </dependency>-->
 
         <!-- https://mvnrepository.com/artifact/org.bytedeco/ffmpeg-platform -->
         <dependency>

+ 23 - 22
zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/FaceApi.java

@@ -1,13 +1,9 @@
 package com.zd.alg.face;
 
-import com.arcsoft.face.FaceFeature;
-import com.arcsoft.face.FaceInfo;
-import com.arcsoft.face.toolkit.ImageInfo;
 import com.zd.model.entity.FaceCompare;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.StringUtils;
 import com.zd.common.core.utils.file.FileUtils;
-import com.zd.common.face.FaceRecognitionService;
 import com.zd.laboratory.api.entity.LabStudentsInfo;
 import com.zd.laboratory.api.entity.LabSysUserInfo;
 import com.zd.laboratory.api.feign.RemoteDutyService;
@@ -44,19 +40,19 @@ public class FaceApi {
     
     private Logger logger = LoggerFactory.getLogger(FaceApi.class);
 
-    @Autowired
-    private FaceRecognitionService faceService;
+    //@Autowired
+    //private FaceRecognitionService faceService;
 
-    @Autowired
-    private RemoteStudentsService remoteStudentsService;
+    //@Autowired
+    //private RemoteStudentsService remoteStudentsService;
 
-    @Autowired
-    private RemoteDutyService remoteDutyService;
+    //@Autowired
+    //private RemoteDutyService remoteDutyService;
 
     @ApiOperation("根据照片文件获取特征码")
     @PostMapping("/faceFeature")
     public ResultData faceFeature(@RequestParam("file") MultipartFile file) throws IOException {
-        ImageInfo imageInfo;
+        /*ImageInfo imageInfo;
         File file1 = null;
         try {
             file1 = FileUtils.multipartFileToFile(file);
@@ -71,14 +67,15 @@ public class FaceApi {
             return ResultData.fail("识别中");
         }
         FaceFeature faceFeature = faceService.faceFeature(imageInfo, faceInfos);
-        return ResultData.success(faceFeature.getFeatureData());
+        return ResultData.success(faceFeature.getFeatureData());*/
+        return ResultData.fail("此功能未开放");
     }
 
 
     @ApiOperation("检测是否是人脸")
     @PostMapping("/detectFaces")
     public ResultData detectFaces(@RequestParam("file") MultipartFile file) throws IOException {
-        File fileToFile = null;
+        /*File fileToFile = null;
         try {
             fileToFile = FileUtils.multipartFileToFile(file);
             ImageInfo  imageInfo = faceService.getImageInfo(fileToFile);
@@ -91,7 +88,8 @@ public class FaceApi {
             if (fileToFile != null) {
                 fileToFile.delete();
             }
-        }
+        }*/
+        return ResultData.fail("此功能未开放");
     }
 
 
@@ -103,7 +101,7 @@ public class FaceApi {
     @ApiOperation("人脸比较")
     @PostMapping("/compare")
     public ResultData faceDetection(@RequestBody FaceCompare faceCompare) {
-        R<LabStudentsInfo> info = remoteStudentsService.getInfo(faceCompare.getUserId());
+        /*R<LabStudentsInfo> info = remoteStudentsService.getInfo(faceCompare.getUserId());
         if (info.getCode() == 200 && info.getData() != null) {
             FaceFeature target = new FaceFeature(info.getData().getFaceFeature());
             FaceFeature source = new FaceFeature(faceCompare.getData());
@@ -112,7 +110,8 @@ public class FaceApi {
             return ResultData.result(bool, () -> "人脸对比不符!");
         } else {
             return ResultData.fail("未获取到对比数据!:" + info.getMsg());
-        }
+        }*/
+        return ResultData.fail("此功能未开放");
     }
 
     /**
@@ -123,7 +122,7 @@ public class FaceApi {
     @ApiOperation("人脸比较")
     @PostMapping("/newCompare")
     public ResultData newCompare(@RequestParam("file") MultipartFile file,FaceCompare faceCompare) throws IOException{
-        ImageInfo imageInfo;
+        /*ImageInfo imageInfo;
         File file1 = null;
         try {
             file1 = FileUtils.multipartFileToFile(file);
@@ -151,7 +150,8 @@ public class FaceApi {
             }
         }else{
             return ResultData.fail("未获取到特征码!");
-        }
+        }*/
+        return ResultData.fail("此功能未开放");
     }
 
     /**
@@ -162,7 +162,7 @@ public class FaceApi {
     @ApiOperation("人脸比较")
     @PostMapping("/multiCompare")
     public ResultData multiFaceDetection(@RequestBody FaceCompare faceCompare) throws ExecutionException, InterruptedException {
-        long time=System.currentTimeMillis();
+        /*long time=System.currentTimeMillis();
         ResultData<List<LabSysUserInfo>> infoList = remoteStudentsService.getFaceBySecuritySubjectId(faceCompare.getLabId());
         if(infoList.getCode() == 200 && infoList.getData() != null){
             List<Future> list = Optional.ofNullable(infoList.getData()).orElseGet(Collections::emptyList)
@@ -187,10 +187,11 @@ public class FaceApi {
             }
             //pool.shutdown();
         }
-        return ResultData.fail("未获取实验室安全准入人脸数据!");
+        return ResultData.fail("未获取实验室安全准入人脸数据!");*/
+        return ResultData.fail("此功能未开放");
     }
 
-    private ResultData getMultiFaceDetection(LabSysUserInfo info,FaceCompare faceCompare){
+    /*private ResultData getMultiFaceDetection(LabSysUserInfo info,FaceCompare faceCompare){
         Integer isDutyUser=0;
         FaceFeature target = new FaceFeature(info.getFaceFeature());
         FaceFeature source = new FaceFeature(faceCompare.getData());
@@ -232,7 +233,7 @@ public class FaceApi {
             return ResultData.success(info);
         }
         return ResultData.fail("未获取实验室安全准入人脸数据!");
-    }
+    }*/
 
 
     //获取流文件

+ 7 - 73
zd-modules/zd-algorithm/src/main/java/com/zd/alg/face/FaceManagerApi.java

@@ -4,12 +4,10 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.io.FileUtil;
 import com.zd.common.core.exception.ServiceException;
 import com.zd.common.core.utils.IdUtils;
-import com.zd.common.face.config.FaceEngineFactory;
-import com.zd.common.face.config.FaceProperties;
 import com.zd.model.domain.R;
+import com.zd.model.domain.ResultData;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -32,11 +30,11 @@ import java.util.Set;
 @RequestMapping("/faceManagerApi")
 public class FaceManagerApi {
 
-    @Autowired
-    FaceEngineFactory faceEngineFactory;
+    //@Autowired
+    //FaceEngineFactory faceEngineFactory;
 
-    @Autowired
-    FaceProperties faceProperties;
+   // @Autowired
+    //FaceProperties faceProperties;
 
 
     final static Set<String> libSet = new HashSet<>();
@@ -53,77 +51,13 @@ public class FaceManagerApi {
     @PostMapping()
     @ApiOperation("上传sdk-lib")
     public R uploadLib(@RequestParam("files") MultipartFile [] multipartFiles) {
-
-        String path =FaceEngineFactory.CACHE_LIB_FOLDER;
-
-        //先删除原来的文件。。如果直接删除,但又没有保存成功还会导致之前的功能异常,所以这里要先保存再删除
-        //生成操作ID
-        String id= IdUtils.simpleUUID();
-
-        Map<String,MultipartFile> temp = new HashMap<>(multipartFiles.length);
-
-        for (MultipartFile multipartFile : multipartFiles) {
-
-            String originalFilename = multipartFile.getOriginalFilename();
-            if (!libSet.contains(originalFilename)) {
-                return R.fail("上传文件名错误,请确认为:" + String.join(",", libSet));
-            }
-            temp.put(originalFilename, multipartFile);
-        }
-
-        if(CollUtil.isNotEmpty(temp))
-        {
-            try {
-                Map<String,File> tempFile = new HashMap<>(temp.size());
-                temp.forEach((k,v)->{
-                    //创建文件
-                    File touch = FileUtil.touch(path + File.separator + k+id);
-                    try {
-                        v.transferTo(touch);
-                        tempFile.put(k,touch);
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                        throw new ServiceException("创建lib文件出错:"+e.getMessage());
-                    }
-                });
-                //todo 这里应该先备份一次
-                temp.forEach((a,b)->{
-                    FileUtil.copy(path + File.separator +a,path + File.separator +a+"_copy",true);
-                });
-                try {
-                    tempFile.forEach((a,b)->{
-                        FileUtil.rename(b,path+ File.separator,true);
-                    });
-                } catch (Exception e) {
-                    //出现异常后还原文件
-                    tempFile.forEach((a,b)->{
-                        FileUtil.copy(path + File.separator +a+"_copy",path + File.separator +a,true);
-                    });
-                    throw new ServiceException("替换lib文件出错:"+e.getMessage());
-                }
-                //如果是三个lib文件都上传了,则调用激活
-                faceEngineFactory.activeOnline();
-            } finally {
-                //是否成功都要删除
-                temp.forEach((k,v)->{
-                    FileUtil.del(path + File.separator + k + id);
-                    FileUtil.del(path + File.separator + k + "_copy");
-                });
-
-            }
-        }
-        else
-        {
-            R.fail("没有找到符合的lib文件!");
-        }
-        return R.ok();
+        return R.fail("此功能未开放");
     }
 
     @PostMapping("/activation")
     @ApiOperation("激活")
     public R activation() {
-        faceEngineFactory.activeOnline();
-        return R.ok("激活成功!");
+        return R.fail("此功能未开放");
     }
 
 }

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/forward/component/AppStartedListener.java

@@ -17,7 +17,7 @@ import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 
-@Component
+//@Component
 public class AppStartedListener implements ApplicationListener<ApplicationStartedEvent> {
     Logger logger = LoggerFactory.getLogger(AppStartedListener.class);
     @Autowired

+ 2 - 2
zd-modules/zd-modules-laboratory/pom.xml

@@ -133,13 +133,13 @@
             </exclusions>
         </dependency>
 
-        <dependency>
+        <!--<dependency>
             <groupId>Acs</groupId>
             <artifactId>com.zd.Acs</artifactId>
             <version>1.0</version>
             <scope>system</scope>
             <systemPath>${pom.basedir}/src/main/resources/libs/zd-haikang.jar</systemPath>
-        </dependency>
+        </dependency>-->
         <dependency>
             <groupId>net.coobird</groupId>
             <artifactId>thumbnailator</artifactId>

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

@@ -1,10 +1,8 @@
 package com.zd.laboratory;
 
-import Acs.AcsBase;
 import com.zd.common.core.annotation.EnableCustomConfig;
 import com.zd.common.core.annotation.EnableZdFeignClients;
 import com.zd.common.core.launch.ZdStartApplication;
-import com.zd.laboratory.service.impl.HaiKangDoorService;
 import com.zd.model.constant.ApplicationConstants;
 import com.zd.model.constant.BaseConstants;
 import org.mybatis.spring.annotation.MapperScan;
@@ -27,7 +25,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @EnableAsync
 public class ZdLaboratoryApplication {
     public static void main(String[] args) {
-        HaiKangDoorService.skdInit = AcsBase.sdk_init();
         ZdStartApplication.run(ApplicationConstants.LABORATORY_SERVICE, ZdLaboratoryApplication.class, args);
     }
 }

+ 2 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/config/DisposableConfig.java

@@ -1,6 +1,6 @@
 package com.zd.laboratory.config;
 
-import Acs.AcsBase;
+/*import Acs.AcsBase;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.stereotype.Component;
 
@@ -10,4 +10,4 @@ public class DisposableConfig implements DisposableBean {
     public void destroy() throws Exception {
         AcsBase.sdk_cleanup();
     }
-}
+}*/

+ 6 - 9
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabHaikangUserController.java

@@ -1,6 +1,5 @@
 package com.zd.laboratory.controller;
 
-import Commom.enums.UserVerifyMode;
 import com.zd.common.core.annotation.PreAuthorize;
 import com.zd.common.core.web.controller.BaseController;
 import com.zd.laboratory.domain.LabHaikangUser;
@@ -8,7 +7,6 @@ import com.zd.laboratory.domain.vo.HaikangAddUserVo;
 import com.zd.laboratory.domain.vo.HaikangSubVo;
 import com.zd.laboratory.domain.vo.HaikangUserVo;
 import com.zd.laboratory.service.LabHaikangUserService;
-import com.zd.laboratory.service.impl.HaiKangDoorService;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
 import com.zd.model.domain.per.PerPrefix;
@@ -18,7 +16,6 @@ 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.validation.Valid;
 import java.util.ArrayList;
@@ -41,8 +38,8 @@ public class LabHaikangUserController extends BaseController {
      */
     @Resource
     private LabHaikangUserService labHaikangUserService;
-    @Autowired
-    private HaiKangDoorService haiKangDoorService;
+    //@Autowired
+    //private HaiKangDoorService haiKangDoorService;
 
     /**
      * 查询门禁授权列表
@@ -124,19 +121,19 @@ public class LabHaikangUserController extends BaseController {
     public ResultData< List<Map<String, String>>> queryTypes() {
 
         List<Map<String, String>> list = new ArrayList<>();
-        UserVerifyMode[] modes = UserVerifyMode.values();
+        /*UserVerifyMode[] modes = UserVerifyMode.values();
         Map<String, String> map;
         for (UserVerifyMode mode : modes) {
             map = new HashMap<>();
             map.put("key", mode.getKey());
             map.put("value", mode.getValue());
             list.add(map);
-        }
+        }*/
 
         return ResultData.success(list);
     }
 
-    @ApiOperation("海康更新用户卡号")
+    /*@ApiOperation("海康更新用户卡号")
     @PostMapping("/updateUserCard")
     public void updateUserCard(@RequestBody SysUser user) {
         haiKangDoorService.updateUserCard(user);
@@ -146,7 +143,7 @@ public class LabHaikangUserController extends BaseController {
     @PostMapping("/updateUserFace")
     public void updateUserFace(@RequestBody SysUser user) {
         haiKangDoorService.updateUserFace(user);
-    }
+    }*/
 
 }
 

+ 4 - 5
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabWhitelistController.java

@@ -13,7 +13,6 @@ import com.zd.laboratory.domain.vo.LabSubjectVO;
 import com.zd.laboratory.domain.vo.LabWhitelistVO;
 import com.zd.laboratory.service.ILabWhiteJoinSublistService;
 import com.zd.laboratory.service.ILabWhitelistService;
-import com.zd.laboratory.service.impl.HaiKangDoorService;
 import com.zd.model.constant.HttpStatus;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
@@ -53,8 +52,8 @@ public class LabWhitelistController extends BaseController
     @Autowired
     private ILabWhiteJoinSublistService labWhiteJoinSublistService;
 
-    @Autowired
-    private HaiKangDoorService haiKangDoorService;
+    //@Autowired
+    //private HaiKangDoorService haiKangDoorService;
 
     /**
      * 查询白名单列表
@@ -158,8 +157,8 @@ public class LabWhitelistController extends BaseController
                labWhiteJoinSublistService.insertLabWhiteJoinSublist(labWhiteJoinSublist);
            }
 
-            count += haiKangDoorService.addUserDoorByWhiteList(labWhitelistVo.getLabWhiteJoinSubList(), labWhitelistVo.getLabWhitelist(),
-                    tokenService.getLoginUser());
+            //count += haiKangDoorService.addUserDoorByWhiteList(labWhitelistVo.getLabWhiteJoinSubList(), labWhitelistVo.getLabWhitelist(),
+            //        tokenService.getLoginUser());
 
         }
 

+ 0 - 4
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabXxpClassifyController.java

@@ -21,7 +21,6 @@ import com.zd.laboratory.service.ILabWhiteJoinSublistService;
 import com.zd.laboratory.service.ILabWhitelistService;
 import com.zd.laboratory.service.IXxpClassifyDetailedService;
 import com.zd.laboratory.service.IXxpClassifyService;
-import com.zd.laboratory.service.impl.HaiKangDoorService;
 import com.zd.model.constant.HttpStatus;
 import com.zd.model.domain.ResultData;
 import com.zd.model.domain.per.PerFun;
@@ -57,9 +56,6 @@ public class LabXxpClassifyController extends BaseController
     @Autowired
     private IXxpClassifyDetailedService xxpClassifyDetailedService;
 
-    @Autowired
-    private TokenService tokenService;
-
     /**
      * 查询信息牌类目列表
      */

+ 2 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabHaikangUser.java

@@ -1,8 +1,7 @@
 package com.zd.laboratory.domain;
 
-import Commom.enums.UserVerifyMode;
-import com.zd.model.entity.BaseEntity;
 
+import com.zd.model.entity.BaseEntity;
 import java.util.Date;
 
 /**
@@ -60,7 +59,7 @@ public class LabHaikangUser extends BaseEntity {
     /**
      * 验证方式(1 人脸,2 指纹,3 密码,4 刷卡,5 工号)
      */
-    private String verifyMode = UserVerifyMode.faceOrFpOrCardOrPw.getKey();
+    private String verifyMode;// = UserVerifyMode.faceOrFpOrCardOrPw.getKey();
     /**
      * 失效时间(无代表无限)
      */

+ 1 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/vo/HaikangUserVo.java

@@ -1,6 +1,5 @@
 package com.zd.laboratory.domain.vo;
 
-import Commom.enums.UserVerifyMode;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.zd.model.entity.BaseEntity;
 import io.swagger.annotations.ApiModel;
@@ -81,7 +80,7 @@ public class HaikangUserVo extends BaseEntity {
 
     public String getVerifyMode() {
         if(StringUtils.isNotBlank(verifyMode)){
-            return UserVerifyMode.valueOf(verifyMode).getValue();
+            //return UserVerifyMode.valueOf(verifyMode).getValue();
         }
         return null;
     }

+ 59 - 38
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/HaiKangDoorService.java

@@ -1,3 +1,4 @@
+/*
 package com.zd.laboratory.service.impl;
 
 import Acs.*;
@@ -105,9 +106,10 @@ public class HaiKangDoorService {
         return false;
     }
 
-    /**
+*
      * 删除过期数据
-     */
+
+
     @Scheduled(cron = "0 0 2 * * ? ")
     public void checkHaiKangStatus() {
         List<LabHaikangUser> list = labHaikangUserMapper.queryByOverdue();
@@ -155,10 +157,11 @@ public class HaiKangDoorService {
 
     }
 
-    /**
+*
      * @param type 1 新增, 2 修改, 3 删除
      * @param verifyType
-     */
+
+
     private String getRemark(int type, Integer verifyType) {
         String remark = "";
         if(type == 1){
@@ -181,10 +184,11 @@ public class HaiKangDoorService {
         return remark;
     }
 
-    /**
+*
      * 实验室添加设备授权
      * @return
-     */
+
+
     public void addUserAuthorizeDoor(boolean isAdmin, LabHardware labHardware, LoginUser loginUser) {
 //        int code = AcsBase.sdk_login("192.168.1.35", "admin", "sxdlc1818", (short) 8000);
         List<LabHaikangUser> haikangUsers = new ArrayList<>();
@@ -314,14 +318,15 @@ public class HaiKangDoorService {
         }
     }
 
-    /**
+*
      * 实验室修改设备授权
-     */
+
+
     public void updateUserAuthorizeDoor(LabHardware old, LabHardware labHardware) {
 
         addUserAuthorizeDoor(true, labHardware, tokenService.getLoginUser());
 
-        /*if(old.getControlScope() == null){
+if(old.getControlScope() == null){
             old.setControlScope("");
         }
         if(labHardware.getControlScope() == null){
@@ -337,9 +342,10 @@ public class HaiKangDoorService {
             }catch (NoRollException e){
                 count = e.getCount();
             }
-        }*/
+        }
+
 
-        /*String oldScope = old.getControlScope().replaceAll(labHardware.getControlScope(), "");
+String oldScope = old.getControlScope().replaceAll(labHardware.getControlScope(), "");
         if (StringUtils.isBlank(oldScope)) {
             // 删除该门禁之前的用户
             for (String scope : oldScope.split(",")) {
@@ -347,12 +353,14 @@ public class HaiKangDoorService {
                     labHaikangUserMapper.deleteByHardId(old.getId(), Integer.parseInt(scope));
                 }
             }
-        }*/
+        }
+
     }
 
-    /**
+*
      * 实验室删除设备授权
-     */
+
+
     public void deleteUserAuthorizeDoor(LabHardwareVO labHardware) {
 
         labHaikangUserMapper.deleteByHardId(labHardware.getId(), null);
@@ -373,9 +381,10 @@ public class HaiKangDoorService {
         }
     }
 
-    /**
+*
      * 批量添加用户授权
-     */
+
+
     public void addUserDoorByHardId(Long hardId, List<LabHaikangUser> entities, LoginUser loginUser) {
         LabHardwareVO labHardware = labHardwareMapper.selectLabHardwareById(hardId);
 
@@ -428,9 +437,10 @@ public class HaiKangDoorService {
         }
     }
 
-    /**
+*
      * 删除用户授权
-     */
+
+
     public void deleteUserDoorByHardId(Long hardId, LabHaikangUser haikangUser, LoginUser loginUser) {
         Set<Long> ids = new HashSet<>();
         ids.add(haikangUser.getJoinUserId());
@@ -461,9 +471,10 @@ public class HaiKangDoorService {
         AcsBase.sdk_logout();
     }
 
-    /**
+*
      * 安全准入审核用户授权
-     */
+
+
     public void addUserDoorByApplay(LabSecurityApply labSecurityApply, LoginUser loginUser) {
         Set<Long> ids = new HashSet<>();
         ids.add(labSecurityApply.getUserId());
@@ -524,9 +535,10 @@ public class HaiKangDoorService {
 
     }
 
-    /**
+*
      * 用户修改卡号
-     */
+
+
     public void updateUserCard(SysUser user) {
 
         LabHaikangUser labHaikangUser = new LabHaikangUser();
@@ -587,9 +599,10 @@ public class HaiKangDoorService {
         }
     }
 
-    /**
+*
      * 用户修改人脸
-     */
+
+
     public void updateUserFace(SysUser user) {
 
         LabHaikangUser labHaikangUser = new LabHaikangUser();
@@ -626,9 +639,10 @@ public class HaiKangDoorService {
 
     }
 
-    /**
+*
      * 白名单修改人员授权
-     */
+
+
     public void updateUserDoorByWhiteList(List<LabWhiteJoinSublist> labWhiteJoinSubList, @NotNull Long userId,
                                        LoginUser loginUser) {
 
@@ -672,9 +686,10 @@ public class HaiKangDoorService {
 
     }
 
-    /**
+*
      * 白名单人员批量进行实验室授权
-     */
+
+
     public int addUserDoorByWhiteList(List<LabWhiteJoinSublist> labWhiteJoinSubList, List<LabWhitelist> labWhitelist,
                                        LoginUser loginUser) {
         Set<Long> ids = labWhitelist.stream().map(LabWhitelist::getUserId).collect(Collectors.toSet());
@@ -686,10 +701,11 @@ public class HaiKangDoorService {
 
     }
 
-    /**
+*
      * 删除用户所有门禁授权
      * @param userId
-     */
+
+
     public void deleteUserByAllDoor(Long userId) {
 
         LabHardware labHardware = new LabHardware();
@@ -705,10 +721,11 @@ public class HaiKangDoorService {
 
     }
 
-    /**
+*
      * 修改用户失效日期
      * @param entities
-     */
+
+
     public void updateUserInfo(List<LabHaikangUser> entities) {
         Map<Long, List<LabHaikangUser>> map = entities.stream().collect(Collectors.groupingBy(a -> a.getHardId()));
 
@@ -1014,11 +1031,12 @@ public class HaiKangDoorService {
         return null;
     }
 
-    /**
+*
      * 远程采集指纹
      * @param hardId 设备ID
      * @return
-     */
+
+
     public HaikangResult fingerCapture(Long hardId) {
 
         LabHardwareVO labHardware = labHardwareMapper.selectLabHardwareById(hardId);
@@ -1034,9 +1052,10 @@ public class HaiKangDoorService {
         }
     }
 
-    /**
+*
      * 指纹下发设备
-     */
+
+
     public void fingerprint(List<LabHaikangUser> userList, List<LabHaikangUserFinger> list) {
 
 
@@ -1061,7 +1080,7 @@ public class HaiKangDoorService {
             }
         }
 
-        /*LabMessageContent labMessageContent = new LabMessageContent();
+LabMessageContent labMessageContent = new LabMessageContent();
         labMessageContent.setSendRange(3);
         labMessageContent.setMessClass(1);
         labMessageContent.setContent("实验室:" + subName + ",管理员已将您授权该实验室门禁权限。密码:" + haikangUser.getCipher() +
@@ -1071,9 +1090,11 @@ public class HaiKangDoorService {
         labMessageContent.setUserId(-2L);
         labMessageContent.setCreateTime(new Date());
         labMessageContent.setCreateBy("系统");
-        labMessageContentMapper.insertLabMessageContent(labMessageContent);*/
+        labMessageContentMapper.insertLabMessageContent(labMessageContent);
+
 
         labHaikangUserMapper.insertOrUpdateBatch(userList);
     }
 
 }
+*/

+ 7 - 7
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHaikangUserFingerServiceImpl.java

@@ -10,7 +10,6 @@ import com.zd.laboratory.mapper.LabHaikangUserFingerMapper;
 import com.zd.laboratory.mapper.LabHaikangUserMapper;
 import com.zd.laboratory.service.LabHaikangUserFingerService;
 import com.zd.model.domain.ResultData;
-import entity.HaikangResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -29,8 +28,8 @@ public class LabHaikangUserFingerServiceImpl implements LabHaikangUserFingerServ
     private LabHaikangUserFingerMapper labHaikangUserFingerMapper;
     @Resource
     private LabHaikangUserMapper labHaikangUserMapper;
-    @Autowired
-    private HaiKangDoorService haiKangDoorService;
+    //@Autowired
+    //private HaiKangDoorService haiKangDoorService;
 
     /**
      * 通过ID查询单条数据
@@ -110,7 +109,7 @@ public class LabHaikangUserFingerServiceImpl implements LabHaikangUserFingerServ
 
     @Override
     public ResultData<String> fingerCapture(Long hardId, int num) {
-        HaikangResult result = haiKangDoorService.fingerCapture(hardId);
+        /*HaikangResult result = haiKangDoorService.fingerCapture(hardId);
         if(result.getStatusCode() == 1){
 
             LabHaikangUserFinger labHaikangUserFinger = new LabHaikangUserFinger();
@@ -133,7 +132,8 @@ public class LabHaikangUserFingerServiceImpl implements LabHaikangUserFingerServ
 
             return ResultData.success();
         }
-        return ResultData.fail(result.getStatusString());
+        return ResultData.fail(result.getStatusString());*/
+        return ResultData.fail();
     }
 
     @Override
@@ -150,9 +150,9 @@ public class LabHaikangUserFingerServiceImpl implements LabHaikangUserFingerServ
             List<LabHaikangUser> userList = labHaikangUserMapper.queryAll(labHaikangUser);
 
 //            List<Long> hardIds = userList.stream().filter(a -> a.isState()).map(b -> b.getHardId()).collect(Collectors.toList());
-            if(userList.size() > 0){
+            /*if(userList.size() > 0){
                 haiKangDoorService.fingerprint(userList, list);
-            }
+            }*/
         }
 
         return ResultData.success();

+ 7 - 8
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHaikangUserServiceImpl.java

@@ -36,8 +36,8 @@ import java.util.stream.Collectors;
 public class LabHaikangUserServiceImpl implements LabHaikangUserService {
     @Resource
     private LabHaikangUserMapper labHaikangUserMapper;
-    @Autowired
-    private HaiKangDoorService haiKangDoorService;
+    //@Autowired
+    //private HaiKangDoorService haiKangDoorService;
     @Autowired
     private TokenService tokenService;
 
@@ -76,9 +76,9 @@ public class LabHaikangUserServiceImpl implements LabHaikangUserService {
             LabHaikangUser haikangUser = labHaikangUserMapper.queryById(i);
             this.labHaikangUserMapper.deleteById(i);
 
-            if(haikangUser.isState()){
+           /* if(haikangUser.isState()){
                 haiKangDoorService.deleteUserDoorByHardId(haikangUser.getHardId(), haikangUser, tokenService.getLoginUser());
-            }
+            }*/
         }
         return true;
     }
@@ -123,7 +123,7 @@ public class LabHaikangUserServiceImpl implements LabHaikangUserService {
             }
 //            int count = labHaikangUserMapper.insertBatch(entities);
 //            if(count > 0){
-                haiKangDoorService.addUserDoorByHardId(haikangAddUserVo.getHardId(), entities, tokenService.getLoginUser());
+//                haiKangDoorService.addUserDoorByHardId(haikangAddUserVo.getHardId(), entities, tokenService.getLoginUser());
 //            }
             return 1;
         }
@@ -157,7 +157,7 @@ public class LabHaikangUserServiceImpl implements LabHaikangUserService {
             haikangUser.setIds(entities.stream().map(LabHaikangUser::getId).collect(Collectors.toList()));
 
             List<LabHaikangUser> list = labHaikangUserMapper.queryAll(haikangUser);
-            haiKangDoorService.updateUserInfo(list);
+            //haiKangDoorService.updateUserInfo(list);
             return 1;
         }
 
@@ -181,8 +181,7 @@ public class LabHaikangUserServiceImpl implements LabHaikangUserService {
             if(list.size() != ids.size()){
                 throw new ServiceException("参数异常!请重试!");
             }
-            haiKangDoorService.addUserDoorByHardId(haikangAddUserVo.getHardId(), list, tokenService.getLoginUser());
-
+            //haiKangDoorService.addUserDoorByHardId(haikangAddUserVo.getHardId(), list, tokenService.getLoginUser());
             return list.size();
         }
         return 0;

+ 7 - 7
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHardwareServiceImpl.java

@@ -78,8 +78,8 @@ public class LabHardwareServiceImpl implements ILabHardwareService {
     @Autowired
     private RemoteCabinetService remoteCabinetService;
 
-    @Autowired
-    private HaiKangDoorService haiKangDoorService;
+    //@Autowired
+    //private HaiKangDoorService haiKangDoorService;
     @Autowired
     private TokenService tokenService;
 
@@ -256,7 +256,7 @@ public class LabHardwareServiceImpl implements ILabHardwareService {
                     if(labHardwareMapper.selectCountByType(labHardware) > 3){
                         throw new ServiceException("添加失败:同一实验室最多添加3台门禁设备");
                     }
-                    haiKangDoorService.addUserAuthorizeDoor(true, labHardware, tokenService.getLoginUser());
+                    //haiKangDoorService.addUserAuthorizeDoor(true, labHardware, tokenService.getLoginUser());
                 }
 
             }catch (DuplicateKeyException e){
@@ -350,9 +350,9 @@ public class LabHardwareServiceImpl implements ILabHardwareService {
             try{
                 id=labHardwareMapper.updateLabHardware(labHardware);
 
-                if(HardwareTypeEnum.HK_DOOR.equals(old.getType()) && !old.getControlScope().equals(labHardware.getControlScope())){
+                /*if(HardwareTypeEnum.HK_DOOR.equals(old.getType()) && !old.getControlScope().equals(labHardware.getControlScope())){
                     haiKangDoorService.updateUserAuthorizeDoor(old, labHardware);
-                }
+                }*/
 
             }catch (DuplicateKeyException e){
                 throw new ServiceException("继电器编号位置重复,请重新输入。");
@@ -486,9 +486,9 @@ public class LabHardwareServiceImpl implements ILabHardwareService {
         labSubjectHardwarePostionMapper.deleteLabSubjectHardwarePositionByHardId(ids[0]);
         int flag = labHardwareMapper.deleteLabHardwareByIds(ids);
 
-        if(HardwareTypeEnum.HK_DOOR.equals(labHardware.getType())){
+        /*if(HardwareTypeEnum.HK_DOOR.equals(labHardware.getType())){
             haiKangDoorService.deleteUserAuthorizeDoor(labHardware);
-        }
+        }*/
         return flag;
     }
 

+ 3 - 5
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecurityApplyServiceImpl.java

@@ -28,8 +28,6 @@ import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.entity.LoginUser;
 import com.zd.model.entity.SysUser;
 import com.zd.system.api.feign.RemoteUserService;
-import org.apache.ibatis.annotations.Param;
-import org.json.JSONString;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -79,8 +77,8 @@ public class LabSecurityApplyServiceImpl implements ILabSecurityApplyService
     @Autowired
     private ILabMessageUserService labMessageUserService;
 
-    @Autowired
-    private HaiKangDoorService haiKangDoorService;
+   // @Autowired
+    //private HaiKangDoorService haiKangDoorService;
 
     private static final Logger log = LoggerFactory.getLogger(LabSecurityApplyServiceImpl.class);
 
@@ -192,7 +190,7 @@ public class LabSecurityApplyServiceImpl implements ILabSecurityApplyService
                 initMap.put("reason","获取实验室安全准入资格");
                 remoteExamService.initCreditPoints(initMap);
             }
-            haiKangDoorService.addUserDoorByApplay(applyVO, tokenService.getLoginUser());
+            //haiKangDoorService.addUserDoorByApplay(applyVO, tokenService.getLoginUser());
         }
         labSecurityApply.setUpdateTime(DateUtils.getNowDate());
         labSecurityApply.setUpdateBy(SecurityUtils.getUsername());

+ 6 - 6
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabWhitelistServiceImpl.java

@@ -38,8 +38,8 @@ public class LabWhitelistServiceImpl implements ILabWhitelistService
 
     @Autowired
     private TokenService tokenService;
-    @Autowired
-    private HaiKangDoorService haiKangDoorService;
+    //@Autowired
+    //private HaiKangDoorService haiKangDoorService;
 
     /**
      * 查询白名单
@@ -119,8 +119,8 @@ public class LabWhitelistServiceImpl implements ILabWhitelistService
             labWhiteJoinSublistMapper.insertLabWhiteJoinSublist(a);
         });
 
-        haiKangDoorService.updateUserDoorByWhiteList(labWhitelistVo.getLabWhiteJoinSubList(),
-                labWhitelistVo.getUserId(), tokenService.getLoginUser());
+        //haiKangDoorService.updateUserDoorByWhiteList(labWhitelistVo.getLabWhiteJoinSubList(),
+        //        labWhitelistVo.getUserId(), tokenService.getLoginUser());
 
         return 1;
     }
@@ -169,9 +169,9 @@ public class LabWhitelistServiceImpl implements ILabWhitelistService
 
             //删除白名单表数据
             count = labWhitelistMapper.deleteLabWhitelistById(id);
-            if(count > 0){
+            /*if(count > 0){
                 haiKangDoorService.deleteUserByAllDoor(labWhitelist.getUserId());
-            }
+            }*/
         }