|
|
@@ -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);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+*/
|