代码更新
This commit is contained in:
@@ -118,9 +118,6 @@ public class AuthorizationController {
|
|||||||
put("user", jsonObject);
|
put("user", jsonObject);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
// 使redis获取过期的token
|
|
||||||
redisUtils.set("my-satoken", StpUtil.getTokenValue(), StpUtil.getTokenTimeout());
|
|
||||||
|
|
||||||
// 保存在线信息
|
// 保存在线信息
|
||||||
onlineUserService.save(userDto, StpUtil.getTokenValue(), request);
|
onlineUserService.save(userDto, StpUtil.getTokenValue(), request);
|
||||||
return ResponseEntity.ok(authInfo);
|
return ResponseEntity.ok(authInfo);
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ public class MobileAuthorizationController {
|
|||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
||||||
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
||||||
// String password = authUser.getPassword();
|
|
||||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
||||||
// 校验数据库
|
// 校验数据库
|
||||||
// 根据用户名查询,在比对密码
|
// 根据用户名查询,在比对密码
|
||||||
@@ -83,8 +82,6 @@ public class MobileAuthorizationController {
|
|||||||
put("user", jsonObject);
|
put("user", jsonObject);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
redisUtils.set("pe-satoken", StpUtil.getTokenValue(), StpUtil.getTokenTimeout());
|
|
||||||
|
|
||||||
return ResponseEntity.ok(authInfo);
|
return ResponseEntity.ok(authInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -199,6 +199,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("point_code2", point_code);
|
param.put("point_code2", point_code);
|
||||||
param.put("vehicle_type", vehicle_type);
|
param.put("vehicle_type", vehicle_type);
|
||||||
|
param.put("vehicle_code", vehicle_code);
|
||||||
param.put("qty", material_num);
|
param.put("qty", material_num);
|
||||||
// 创建任务
|
// 创建任务
|
||||||
GjxCallEmpVehicleTask taskBean = SpringContextHolder.getBean(GjxCallEmpVehicleTask.class);
|
GjxCallEmpVehicleTask taskBean = SpringContextHolder.getBean(GjxCallEmpVehicleTask.class);
|
||||||
@@ -223,6 +224,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("point_code2", point_code);
|
param.put("point_code2", point_code);
|
||||||
|
param.put("vehicle_code", vehicle_code);
|
||||||
param.put("qty", vehicle_num);
|
param.put("qty", vehicle_num);
|
||||||
// 创建任务
|
// 创建任务
|
||||||
YqxCallEmpVehicleTask taskBean = SpringContextHolder.getBean(YqxCallEmpVehicleTask.class);
|
YqxCallEmpVehicleTask taskBean = SpringContextHolder.getBean(YqxCallEmpVehicleTask.class);
|
||||||
@@ -249,6 +251,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
param.put("point_code1", point_code);
|
param.put("point_code1", point_code);
|
||||||
param.put("qty", vehicle_num);
|
param.put("qty", vehicle_num);
|
||||||
param.put("vehicle_type", vehicle_type);
|
param.put("vehicle_type", vehicle_type);
|
||||||
|
param.put("vehicle_code", vehicle_code);
|
||||||
// 创建任务
|
// 创建任务
|
||||||
YqxSendEmpVehicleTask taskBean = SpringContextHolder.getBean(YqxSendEmpVehicleTask.class);
|
YqxSendEmpVehicleTask taskBean = SpringContextHolder.getBean(YqxSendEmpVehicleTask.class);
|
||||||
taskBean.createTask(param);
|
taskBean.createTask(param);
|
||||||
@@ -278,6 +281,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
} else if (StrUtil.equals(type, "7")) {
|
} else if (StrUtil.equals(type, "7")) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("point_code1", point_code);
|
param.put("point_code1", point_code);
|
||||||
|
param.put("vehicle_code", vehicle_code);
|
||||||
|
param.put("vehicle_type", vehicle_type);
|
||||||
param.put("qty", material_num);
|
param.put("qty", material_num);
|
||||||
// 1.生成起点确定的任务
|
// 1.生成起点确定的任务
|
||||||
SpringContextHolder.getBean(YqxSendMaterialTask.class).createTask(param);
|
SpringContextHolder.getBean(YqxSendMaterialTask.class).createTask(param);
|
||||||
|
|||||||
@@ -192,6 +192,10 @@ public class GjxCallEmpVehicleTask extends AbstractAcsTask {
|
|||||||
jsonTask.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
jsonTask.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||||
taskTab.update(jsonTask);
|
taskTab.update(jsonTask);
|
||||||
|
|
||||||
|
// 起点上锁
|
||||||
|
jsonDpjStart.put("lock_type", 2);
|
||||||
|
pointTab.update(jsonDpjStart);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 判断叠盘架载具数量是否是0
|
// 判断叠盘架载具数量是否是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);
|
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
|
@Override
|
||||||
public void cancel(String task_id) {
|
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
|
@Override
|
||||||
|
|||||||
@@ -195,11 +195,16 @@ public class YqxCallEmpVehicleTask extends AbstractAcsTask {
|
|||||||
jsonTask.put("vehicle_qty", jsonDpjStart.getIntValue("vehicle_qty"));
|
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("point_code1", jsonDpjStart.getString("point_code"));
|
||||||
jsonTask.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
jsonTask.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||||
taskTab.update(jsonTask);
|
taskTab.update(jsonTask);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 判断叠盘架载具数量是否是0
|
// 判断叠盘架载具数量是否是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);
|
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
|
@Override
|
||||||
public void cancel(String task_id) {
|
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
|
@Override
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class HtSendEmpVehicleTask extends AbstractAcsTask {
|
|||||||
vehicle_qty += jsonTask.getInteger("vehicle_qty");
|
vehicle_qty += jsonTask.getInteger("vehicle_qty");
|
||||||
endPoint.put("lock_type", "1");
|
endPoint.put("lock_type", "1");
|
||||||
endPoint.put("vehicle_qty", vehicle_qty);
|
endPoint.put("vehicle_qty", vehicle_qty);
|
||||||
endPoint.put("point_status", "1");
|
endPoint.put("point_status", "2");
|
||||||
endPoint.put("vehicle_type", jsonTask.getString("vehicle_type"));
|
endPoint.put("vehicle_type", jsonTask.getString("vehicle_type"));
|
||||||
pointTab.update(endPoint);
|
pointTab.update(endPoint);
|
||||||
} else {//非叠盘架
|
} else {//非叠盘架
|
||||||
@@ -244,7 +244,8 @@ public class HtSendEmpVehicleTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel(String task_id) {
|
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)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class YqxSendEmpVehicleTask extends AbstractAcsTask {
|
|||||||
vehicle_qty += jsonTask.getInteger("vehicle_qty");
|
vehicle_qty += jsonTask.getInteger("vehicle_qty");
|
||||||
endPoint.put("lock_type", "1");
|
endPoint.put("lock_type", "1");
|
||||||
endPoint.put("vehicle_qty", vehicle_qty);
|
endPoint.put("vehicle_qty", vehicle_qty);
|
||||||
endPoint.put("point_status", "1");
|
endPoint.put("point_status", "2");
|
||||||
endPoint.put("vehicle_type", jsonTask.getString("vehicle_type"));
|
endPoint.put("vehicle_type", jsonTask.getString("vehicle_type"));
|
||||||
pointTab.update(endPoint);
|
pointTab.update(endPoint);
|
||||||
} else {//非叠盘架
|
} else {//非叠盘架
|
||||||
@@ -126,6 +126,7 @@ public class YqxSendEmpVehicleTask extends AbstractAcsTask {
|
|||||||
SchTaskDto dto = SchTaskDto.builder().task_id(org.nl.wms.util.IdUtil.getLongId())
|
SchTaskDto dto = SchTaskDto.builder().task_id(org.nl.wms.util.IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
.task_type("")
|
.task_type("")
|
||||||
|
.task_name("油漆线空盘入库")
|
||||||
.task_status(TaskStatusEnum.SURE_START.getCode())
|
.task_status(TaskStatusEnum.SURE_START.getCode())
|
||||||
.point_code1(point_code1)
|
.point_code1(point_code1)
|
||||||
.vehicle_code(form.getString("vehicle_code"))
|
.vehicle_code(form.getString("vehicle_code"))
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
|
|||||||
if (StrUtil.equals(status, "0")) {
|
if (StrUtil.equals(status, "0")) {
|
||||||
//取消任务,释放相关点位的锁
|
//取消任务,释放相关点位的锁
|
||||||
String point_code1 = jsonTask.getString("point_code1");
|
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();
|
JSONObject param = new JSONObject();
|
||||||
param.put("lock_type", "1");
|
param.put("lock_type", "1");
|
||||||
param.put("task_id", "");
|
param.put("task_id", "");
|
||||||
@@ -85,7 +85,7 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
//取消任务,释放相关点位的锁
|
//取消任务,释放相关点位的锁
|
||||||
String point_code1 = jsonTask.getString("point_code1");
|
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();
|
JSONObject param = new JSONObject();
|
||||||
param.put("lock_type", "1");
|
param.put("lock_type", "1");
|
||||||
param.put("task_id", "");
|
param.put("task_id", "");
|
||||||
@@ -124,6 +124,7 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
//修改任务状态
|
//修改任务状态
|
||||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
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_optid", SecurityUtils.getCurrentUserId());
|
||||||
taskObj.put("update_optname", SecurityUtils.getCurrentNickName());
|
taskObj.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
@@ -191,7 +192,8 @@ public class YqxSendMaterialTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel(String task_id) {
|
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)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|||||||
@@ -308,7 +308,7 @@
|
|||||||
@selection-change="crud.selectionChangeHandler"
|
@selection-change="crud.selectionChangeHandler"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="point_code" label="点位编码" sortable width="100">
|
<el-table-column prop="point_code" label="点位编码" sortable width="120" show-overflow-tooltip>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.point_code }}</el-link>
|
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.point_code }}</el-link>
|
||||||
</template>
|
</template>
|
||||||
@@ -323,7 +323,7 @@
|
|||||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="vehicle_code" label="载具编码" />
|
<el-table-column prop="vehicle_code" label="载具编码" min-width="120"/>
|
||||||
<el-table-column prop="vehicle_qty" label="载具数量" />
|
<el-table-column prop="vehicle_qty" label="载具数量" />
|
||||||
<el-table-column prop="remark" label="备注" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="remark" label="备注" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column prop="is_used" label="是否启用">
|
<el-table-column prop="is_used" label="是否启用">
|
||||||
|
|||||||
@@ -133,7 +133,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="vehicle_code" label="载具编码" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="vehicle_code" label="载具编码" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column prop="point_code1" label="点位1" width="100" />
|
<el-table-column prop="point_code1" label="点位1" width="100" />
|
||||||
<el-table-column prop="point1_region_name" label="区域1" width="100" />
|
<el-table-column prop="point1_region_name" label="区域1" width="120" />
|
||||||
<el-table-column prop="point_code2" label="点位2" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="point_code2" label="点位2" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column prop="point2_region_name" label="区域2" min-width="120" show-overflow-tooltip />
|
<el-table-column prop="point2_region_name" label="区域2" min-width="120" show-overflow-tooltip />
|
||||||
<!--<el-table-column prop="point_code3" label="点位3" min-width="100" show-overflow-tooltip />
|
<!--<el-table-column prop="point_code3" label="点位3" min-width="100" show-overflow-tooltip />
|
||||||
|
|||||||
Reference in New Issue
Block a user