From 1139fca85eab3102e2aff0edbd5756e538e05577 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 17 五月 2023 14:42:31 +0800
Subject: [PATCH] 任务指令
---
src/main/java/com/zy/core/thread/SiemensCrnThread.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
index 3664661..32c6cbc 100644
--- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -9,8 +9,10 @@
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasCrnOpt;
import com.zy.asrs.entity.BasCrnp;
+import com.zy.asrs.entity.CommandInfo;
import com.zy.asrs.service.BasCrnOptService;
import com.zy.asrs.service.BasCrnpService;
+import com.zy.asrs.service.CommandInfoService;
import com.zy.core.CrnThread;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
@@ -49,7 +51,7 @@
this.connect();
while (true) {
try {
- int step = 1;
+ int step = 3;
Task task = MessageQueue.poll(SlaveType.Crn, slave.getId());
if (task != null) {
step = task.getStep();
@@ -353,6 +355,16 @@
if (command.getTaskNo() == 0 && command.getAckFinish() == 0) {
command.setTaskNo((short) 9999);
}
+
+ CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class);
+ CommandInfo commandInfo = new CommandInfo();
+ commandInfo.setWrkNo(command.getTaskNo().intValue());
+ commandInfo.setCommandStatus(1);
+ commandInfo.setStartTime(new Date());
+ commandInfo.setDevice("crn");
+ commandInfo.setCommand(JSON.toJSONString(command));
+ commandInfoService.insert(commandInfo);
+
command.setCrnNo(slave.getId());
short[] array = new short[9];
if (command.getAckFinish() == 0) {
--
Gitblit v1.9.1