代码更新

This commit is contained in:
lyd
2022-11-04 17:51:51 +08:00
parent 19db98e95b
commit 2c8eb7dea9
11 changed files with 31 additions and 62 deletions

View File

@@ -118,9 +118,6 @@ public class AuthorizationController {
put("user", jsonObject);
}};
// 使redis获取过期的token
redisUtils.set("my-satoken", StpUtil.getTokenValue(), StpUtil.getTokenTimeout());
// 保存在线信息
onlineUserService.save(userDto, StpUtil.getTokenValue(), request);
return ResponseEntity.ok(authInfo);

View File

@@ -50,7 +50,6 @@ public class MobileAuthorizationController {
@SaIgnore
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
// 密码解密 - 前端的加密规则: encrypt根据实际更改
// String password = authUser.getPassword();
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
// 校验数据库
// 根据用户名查询,在比对密码
@@ -83,8 +82,6 @@ public class MobileAuthorizationController {
put("user", jsonObject);
}};
redisUtils.set("pe-satoken", StpUtil.getTokenValue(), StpUtil.getTokenTimeout());
return ResponseEntity.ok(authInfo);
}
}

View File

@@ -1,45 +0,0 @@
package org.nl.modules.security.satoken;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.mnt.websocket.MsgType;
import org.nl.modules.mnt.websocket.SocketMsg;
import org.nl.modules.mnt.websocket.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* @author: lyd
* @description: redis过期key监听器
* @Date: 2022/10/8
*/
@Slf4j
@Component
public class TokenKeyExpirationListener extends KeyExpirationEventMessageListener {
@Autowired
private StringRedisTemplate redisTemplate;
public TokenKeyExpirationListener(RedisMessageListenerContainer listenerContainer) {
super(listenerContainer);
}
@Override
public void onMessage(Message message, byte[] pattern) {
String expireKeyValue = redisTemplate.opsForValue().get("my-satoken");
try {
if (ObjectUtil.isEmpty(expireKeyValue))
WebSocketServer.sendInfo(new SocketMsg("token会话过期", MsgType.INFO), "exp-token");
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}

View File

@@ -199,6 +199,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject param = new JSONObject();
param.put("point_code2", point_code);
param.put("vehicle_type", vehicle_type);
param.put("vehicle_code", vehicle_code);
param.put("qty", material_num);
// 创建任务
GjxCallEmpVehicleTask taskBean = SpringContextHolder.getBean(GjxCallEmpVehicleTask.class);
@@ -223,6 +224,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject param = new JSONObject();
param.put("point_code2", point_code);
param.put("vehicle_code", vehicle_code);
param.put("qty", vehicle_num);
// 创建任务
YqxCallEmpVehicleTask taskBean = SpringContextHolder.getBean(YqxCallEmpVehicleTask.class);
@@ -249,6 +251,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
param.put("point_code1", point_code);
param.put("qty", vehicle_num);
param.put("vehicle_type", vehicle_type);
param.put("vehicle_code", vehicle_code);
// 创建任务
YqxSendEmpVehicleTask taskBean = SpringContextHolder.getBean(YqxSendEmpVehicleTask.class);
taskBean.createTask(param);
@@ -278,6 +281,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} else if (StrUtil.equals(type, "7")) {
JSONObject param = new JSONObject();
param.put("point_code1", point_code);
param.put("vehicle_code", vehicle_code);
param.put("vehicle_type", vehicle_type);
param.put("qty", material_num);
// 1.生成起点确定的任务
SpringContextHolder.getBean(YqxSendMaterialTask.class).createTask(param);

View File

@@ -192,6 +192,10 @@ public class GjxCallEmpVehicleTask extends AbstractAcsTask {
jsonTask.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
taskTab.update(jsonTask);
// 起点上锁
jsonDpjStart.put("lock_type", 2);
pointTab.update(jsonDpjStart);
} else {
// 判断叠盘架载具数量是否是0
JSONObject jsonDpjStart2 = pointTab.query("region_id = '" + RegionTypeEnum.DPJQB.getId() + "' and can_vehicle_type = '" + vehicle_type + "' and lock_type = '1' and is_used = '1' and is_delete = '0' and vehicle_qty = '0'").uniqueResult(0);
@@ -365,7 +369,8 @@ public class GjxCallEmpVehicleTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
}
@Override

View File

@@ -195,11 +195,16 @@ public class YqxCallEmpVehicleTask extends AbstractAcsTask {
jsonTask.put("vehicle_qty", jsonDpjStart.getIntValue("vehicle_qty"));
}
// 起点上锁
jsonDpjStart.put("lock_type", "2");
pointTab.update(jsonDpjStart);
// 更新任务起点
jsonTask.put("point_code1", jsonDpjStart.getString("point_code"));
jsonTask.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
taskTab.update(jsonTask);
} else {
// 判断叠盘架载具数量是否是0
JSONObject jsonDpjStart2 = pointTab.query("region_id = '" + RegionTypeEnum.DPJQA.getId() + "' and can_vehicle_type = '" + vehicle_type + "' and lock_type = '1' and is_used = '1' and is_delete = '0' and vehicle_qty = '0'").uniqueResult(0);
@@ -373,7 +378,8 @@ public class YqxCallEmpVehicleTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
}
@Override

View File

@@ -99,7 +99,7 @@ public class HtSendEmpVehicleTask extends AbstractAcsTask {
vehicle_qty += jsonTask.getInteger("vehicle_qty");
endPoint.put("lock_type", "1");
endPoint.put("vehicle_qty", vehicle_qty);
endPoint.put("point_status", "1");
endPoint.put("point_status", "2");
endPoint.put("vehicle_type", jsonTask.getString("vehicle_type"));
pointTab.update(endPoint);
} else {//非叠盘架
@@ -244,7 +244,8 @@ public class HtSendEmpVehicleTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
}
@Transactional(rollbackFor = Exception.class)

View File

@@ -97,7 +97,7 @@ public class YqxSendEmpVehicleTask extends AbstractAcsTask {
vehicle_qty += jsonTask.getInteger("vehicle_qty");
endPoint.put("lock_type", "1");
endPoint.put("vehicle_qty", vehicle_qty);
endPoint.put("point_status", "1");
endPoint.put("point_status", "2");
endPoint.put("vehicle_type", jsonTask.getString("vehicle_type"));
pointTab.update(endPoint);
} else {//非叠盘架
@@ -126,6 +126,7 @@ public class YqxSendEmpVehicleTask extends AbstractAcsTask {
SchTaskDto dto = SchTaskDto.builder().task_id(org.nl.wms.util.IdUtil.getLongId())
.task_code(CodeUtil.getNewCode("TASK_CODE"))
.task_type("")
.task_name("油漆线空盘入库")
.task_status(TaskStatusEnum.SURE_START.getCode())
.point_code1(point_code1)
.vehicle_code(form.getString("vehicle_code"))

View File

@@ -54,7 +54,7 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
if (StrUtil.equals(status, "0")) {
//取消任务,释放相关点位的锁
String point_code1 = jsonTask.getString("point_code1");
String point_code2 = jsonTask.getString("point_code1");
String point_code2 = jsonTask.getString("point_code2");
JSONObject param = new JSONObject();
param.put("lock_type", "1");
param.put("task_id", "");
@@ -85,7 +85,7 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
//取消任务,释放相关点位的锁
String point_code1 = jsonTask.getString("point_code1");
String point_code2 = jsonTask.getString("point_code1");
String point_code2 = jsonTask.getString("point_code2");
JSONObject param = new JSONObject();
param.put("lock_type", "1");
param.put("task_id", "");
@@ -124,6 +124,7 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
//修改任务状态
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
taskObj.put("point_code2", endPoint.getString("point_code"));
taskObj.put("update_optid", SecurityUtils.getCurrentUserId());
taskObj.put("update_optname", SecurityUtils.getCurrentNickName());
taskObj.put("update_time", DateUtil.now());
@@ -191,7 +192,8 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
}
@Transactional(rollbackFor = Exception.class)