This commit is contained in:
aikai 2024-08-27 09:19:26 +08:00
commit 603c75f7ee
2 changed files with 17 additions and 5 deletions

View File

@ -49,7 +49,9 @@ public class AttendanceMachineJob {
statusUpdateVOS.add(new DeviceStatusUpdateVO(reqDO.getId(),reqDO.getDeviceNo(), 0, null));
//同步 删除对应sessionId
webSocketSessionManager.removeSession(webSocketSessionManager.getSessionByDeviceNum(reqDO.getDeviceNo()));
if (webSocketSessionManager.getSessionByDeviceNum(reqDO.getDeviceNo()) != null) {
webSocketSessionManager.removeSession(webSocketSessionManager.getSessionByDeviceNum(reqDO.getDeviceNo()));
}
} else {
statusUpdateVOS.add(new DeviceStatusUpdateVO(reqDO.getId(),reqDO.getDeviceNo(),
1, LocalDateTime.parse(data, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))));

View File

@ -29,6 +29,7 @@ import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import cn.iocoder.yudao.module.system.service.websocket.WebsocketService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.github.yulichang.toolkit.SpringContentUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.StringRedisTemplate;
@ -118,15 +119,24 @@ public class UsersExtServiceImpl implements UsersExtService {
}else {
//有人脸图片的情况
if (usersExtDO.getFaceImg() != null) {
if (StringUtils.isNotEmpty(usersExtDO.getFaceImg())) {
// 变更business_file的content字段内容
url = fileApi.updateBusinessFileContent(usersExtDO.getFaceImg(), 6L, name, content);
// //更新人脸图片
// updateDO.setId(usersExtDO.getId());
// updateDO.setFaceImg(url);
// usersExtMapper.updateById(usersExtDO);
}else {
// 同步 把人脸图片插入 BusinessFile中 存储文件
url = fileApi.createBusinessFile(6L, name, content) ;
//更新人脸图片
updateDO.setId(usersExtDO.getId());
updateDO.setFaceImg(url);
usersExtMapper.updateById(usersExtDO);
usersExtMapper.updateById(new UsersExtDO()
.setId(usersExtDO.getId())
.setFaceImg(url));
}
// 判断用户是否已下发至考勤设备