opt:增加返回点功能。

This commit is contained in:
2024-05-11 22:33:01 +08:00
parent 345e2c5fd2
commit 4ea1b25e03
6 changed files with 16 additions and 16 deletions

View File

@@ -174,16 +174,13 @@
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
<!-- https://www.jianshu.com/p/e40d111c7bfc?utm_source=oschina-app 热部署 https://zhuanlan.zhihu.com/p/63381268-->
<!-- Spring boot websocket -->
<!--https://blog.csdn.net/m0_55371060/article/details/135994809-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- https://www.jianshu.com/p/e40d111c7bfc?utm_source=oschina-app 热部署 https://zhuanlan.zhihu.com/p/63381268-->
<!-- jwt -->
<dependency>
<groupId>io.jsonwebtoken</groupId>

View File

@@ -590,7 +590,9 @@ public class HomeServiceImpl implements HomeService {
String resultflag = resjo.getString("result");
if (StrUtil.equals("0", resultflag)) {
//返程指令已下发
taskjo.put("step", "1");
if (TaskTypeEnum.TAKE.getCode().equals(taskjo.getString("task_type")) || TaskTypeEnum.PUT.getCode().equals(taskjo.getString("task_type"))) {
taskjo.put("step", "1");
}
taskjo.put("is_manualfinished", "1");
updateTaskStatus(taskjo, TaskStatusEnum.END);
} else {
@@ -689,10 +691,13 @@ public class HomeServiceImpl implements HomeService {
//stopWatch.start();
JSONObject taskjo = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete='0'and task_status='01'").uniqueResult(0);
//小车停止,且已到达目标点位
if (ObjectUtil.isNotEmpty(taskjo) && StrUtil.equals("0", debugInfoJson.getString("PathFollow_Enable")) && debugInfoJson.getString("CurNodeID").equals(taskjo.getString("next_point_code"))) {
if (ObjectUtil.isNotEmpty(taskjo)) {
//普通任务
if (TaskTypeEnum.COMMON.getCode().equals(taskjo.getString("task_type"))) {
updateTaskStatus(taskjo, TaskStatusEnum.END);
if (StringUtils.isNotBlank(taskjo.getString("next_point_code2"))) {
createReturnTask(taskjo);
}
} else if (TaskTypeEnum.TAKE.getCode().equals(taskjo.getString("task_type")) || TaskTypeEnum.PUT.getCode().equals(taskjo.getString("task_type"))) {
//取货
if (TaskTypeEnum.TAKE.getCode().equals(taskjo.getString("task_type"))) {
@@ -745,7 +750,7 @@ public class HomeServiceImpl implements HomeService {
}
/**
* 定时清空过期任务
* 定时清空超过三个月过期任务
*/
@Async("taskExecutor")
public void autoDeleteTask() {

View File

@@ -176,6 +176,9 @@ public class TaskServiceServiceImpl implements TaskService {
if (ObjectUtil.isNotEmpty(taskrow)) {
seq_num = taskrow.getInteger("seq_num") + 1;
}
if(StringUtils.isNotBlank(jsonObject.get("next_point_code"))) {
taskjo.put("next_point_code2", jsonObject.get("next_point_code"));
}
taskjo.put("task_type", type);
taskjo.put("seq_num", type.equals(TaskTypeEnum.RETURN.getCode()) ? getSeqNum() : seq_num);
taskjo.put("task_uuid", IdUtil.simpleUUID());

View File

@@ -82,7 +82,7 @@ public class SendHomeWebSocketServer {
*/
@OnMessage
public void onMessage(String message, Session session) {
System.out.println(webSocketSet.size() + "_接收到消息_" + session.getId());
//System.out.println(webSocketSet.size() + "_接收到消息_" + session.getId());
}
@OnError

View File

@@ -1,15 +1,10 @@
package org.nl.utils;
import cn.hutool.core.date.StopWatch;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import cn.hutool.core.date.StopWatch;;
import lombok.extern.slf4j.Slf4j;
import org.nl.agv.service.HomeService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**

View File

@@ -31,7 +31,7 @@ https://juejin.cn/post/6844903775631572999
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<maxHistory>30</maxHistory>
<maxHistory>15</maxHistory>
<!--单个日志最大容量 至少10MB才能看得出来-->
<maxFileSize>120MB</maxFileSize>
<!--所有日志最多占多大容量-->