feat:看板强制登出功能
This commit is contained in:
@@ -925,16 +925,22 @@ public class HandheldServiceImpl implements HandheldService {
|
||||
if (StrUtil.isNotEmpty(json.getString("device_code"))) {
|
||||
Object deviceLogin = redisUtils.get("mobile:" + json.getString("device_code"));
|
||||
if (deviceLogin != null) {
|
||||
throw new BadRequestException("当前设备工序已经登陆,无法继续选择");
|
||||
} else {
|
||||
SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);
|
||||
Param isInvokeConnector = sysParamService.findByCode(GeneralDefinition.HANDHELD_LOGIN_TIME);
|
||||
int loginTime = 3;
|
||||
if (ObjectUtil.isNotEmpty(isInvokeConnector)) {
|
||||
loginTime = Integer.parseInt(isInvokeConnector.getValue());
|
||||
// 检查是否需要强制登出
|
||||
Boolean forceLogout = json.getBoolean("force_logout");
|
||||
if (Boolean.TRUE.equals(forceLogout)) {
|
||||
// 强制登出,清除redis中的key
|
||||
redisUtils.del("mobile:" + json.getString("device_code"));
|
||||
} else {
|
||||
throw new BadRequestException("当前设备工序已经登陆,无法继续选择");
|
||||
}
|
||||
redisUtils.set("mobile:" + json.getString("device_code"), json.getString("device_code"), loginTime, TimeUnit.HOURS);
|
||||
}
|
||||
SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);
|
||||
Param isInvokeConnector = sysParamService.findByCode(GeneralDefinition.HANDHELD_LOGIN_TIME);
|
||||
int loginTime = 3;
|
||||
if (ObjectUtil.isNotEmpty(isInvokeConnector)) {
|
||||
loginTime = Integer.parseInt(isInvokeConnector.getValue());
|
||||
}
|
||||
redisUtils.set("mobile:" + json.getString("device_code"), json.getString("device_code"), loginTime, TimeUnit.HOURS);
|
||||
}
|
||||
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(json.getString("device_code"));
|
||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||
|
||||
Reference in New Issue
Block a user