From 41e68f8b4deaabb52d5fe5f8181e9a8cffeb2456 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 16 三月 2026 16:39:34 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/impl/ZySiemensCrnV2Thread.java | 51 ++++++++++++++++++++++++++++++---------------------
1 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/ZySiemensCrnV2Thread.java b/src/main/java/com/zy/core/thread/impl/ZySiemensCrnV2Thread.java
index 2541dd5..1801e71 100644
--- a/src/main/java/com/zy/core/thread/impl/ZySiemensCrnV2Thread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZySiemensCrnV2Thread.java
@@ -22,6 +22,7 @@
import com.zy.core.network.DeviceConnectPool;
import com.zy.core.network.ZyCrnV2ConnectDriver;
import com.zy.core.network.entity.ZyCrnStatusEntity;
+import com.zy.core.service.WrkCommandRollbackService;
import com.zy.core.thread.CrnThread;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -58,7 +59,7 @@
try {
deviceLogCollectTime = Utils.getDeviceLogCollectTime();
readStatus();
- Thread.sleep(50);
+ Thread.sleep(100);
} catch (Exception e) {
log.error("CrnThread Fail", e);
}
@@ -307,27 +308,35 @@
response = zyCrnConnectDriver.sendCommand(command);
return response;
} finally {
- String sourceLocNo = Utils.getLocNo(command.getSourcePosX(), command.getSourcePosY(), command.getSourcePosZ());
- String targetLocNo = Utils.getLocNo(command.getDestinationPosX(), command.getDestinationPosY(), command.getDestinationPosZ());
- BasCrnpOptService bean = SpringUtils.getBean(BasCrnpOptService.class);
- ZyCrnStatusEntity statusEntity = zyCrnConnectDriver.getStatus();
- BasCrnpOpt basCrnpOpt = new BasCrnpOpt(
- command.getTaskNo().intValue(),
- command.getCrnNo(),
- new Date(),
- String.valueOf(command.getTaskMode()),
- sourceLocNo,
- targetLocNo,
- null,
- null,
- null,
- JSON.toJSONString(command),
- JSON.toJSONString(statusEntity),
- 1,
- JSON.toJSONString(response)
- );
- if (bean != null) {
+ if (command != null) {
+ String sourceLocNo = Utils.getLocNo(command.getSourcePosX(), command.getSourcePosY(), command.getSourcePosZ());
+ String targetLocNo = Utils.getLocNo(command.getDestinationPosX(), command.getDestinationPosY(), command.getDestinationPosZ());
+ BasCrnpOptService bean = SpringUtils.getBean(BasCrnpOptService.class);
+ ZyCrnStatusEntity statusEntity = zyCrnConnectDriver.getStatus();
+ BasCrnpOpt basCrnpOpt = new BasCrnpOpt(
+ command.getTaskNo(),
+ command.getCrnNo(),
+ new Date(),
+ String.valueOf(command.getTaskMode()),
+ sourceLocNo,
+ targetLocNo,
+ null,
+ null,
+ null,
+ JSON.toJSONString(command),
+ JSON.toJSONString(statusEntity),
+ 1,
+ JSON.toJSONString(response)
+ );
bean.save(basCrnpOpt);
+ try {
+ WrkCommandRollbackService rollbackService = SpringUtils.getBean(WrkCommandRollbackService.class);
+ if (rollbackService != null) {
+ rollbackService.handleSingleCrnSendResult(command, response, "鍗曞伐浣嶅爢鍨涙満V2");
+ }
+ } catch (Exception e) {
+ log.error("澶勭悊鍗曞伐浣峍2鍛戒护涓嬪彂缁撴灉澶辫触, wrkNo={}", command.getTaskNo(), e);
+ }
}
}
}
--
Gitblit v1.9.1