From b256cdb895234a3e68da88310325b5eb38600777 Mon Sep 17 00:00:00 2001
From: Administrator <1051256694@qq.com>
Date: 星期一, 16 三月 2026 10:27:56 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java | 39 ++++-----------------------------------
1 files changed, 4 insertions(+), 35 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java b/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
index f3bbd8a..01993be 100644
--- a/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
@@ -30,9 +30,6 @@
import java.text.MessageFormat;
import java.util.Date;
-import java.util.List;
-import java.util.ArrayList;
-import com.zy.core.utils.WmsOperateUtils;
import com.zy.asrs.entity.BasCrnpErrLog;
import com.zy.asrs.service.BasCrnpErrLogService;
@@ -48,7 +45,6 @@
private ZyCrnConnectDriver zyCrnConnectDriver;
private CrnProtocol crnProtocol;
private int deviceLogCollectTime = 200;
- private List<Integer> lastReportedIndices = new ArrayList<>();
public ZySiemensCrnThread(DeviceConfig deviceConfig, RedisUtil redisUtil) {
this.deviceConfig = deviceConfig;
@@ -82,16 +78,14 @@
if (task != null) {
step = task.getStep();
}
+
if (step == 2) {
sendCommand((CrnCommand) task.getData());
- }
- if (step == 3) {
+ }else if (step == 3) {
sendCommand1((CrnCommand) task.getData());
- }
- if (step == 4) {
+ }else if (step == 4) {
sendCommand2((CrnCommand) task.getData());
- }
- if (step == 5) {
+ }else if (step == 5) {
sendCommand3((CrnCommand) task.getData());
}
@@ -194,31 +188,6 @@
crnProtocol.setYDuration(crnStatus.getYDuration());
crnProtocol.setWeight(crnStatus.getWeight());
crnProtocol.setDb110Data(crnStatus.getDb110Data());
-
- // 涓婃姤鍫嗗灈鏈篋B110鐘舵�佹暟鎹�
- short[] db110Data = crnProtocol.getDb110Data();
- List<Integer> currentIndices = new ArrayList<>();
- if (db110Data != null) {
- for (int i = 0; i < db110Data.length; i++) {
- if (db110Data[i] == 1) {
- currentIndices.add(i);
- }
- }
- }
- //!currentIndices.equals(lastReportedIndices)
- boolean changed = true;
-
- if (changed) {
- try {
- WmsOperateUtils wmsOperateUtils = SpringUtils.getBean(WmsOperateUtils.class);
- if (wmsOperateUtils != null) {
- wmsOperateUtils.reportCrnDb110Status(crnProtocol.getCrnNo(), currentIndices);
- lastReportedIndices = new ArrayList<>(currentIndices);
- }
- } catch (Exception e) {
- log.error("Report Crn Db110 Status Fail", e);
- }
- }
OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), deviceConfig.getDeviceNo()));
--
Gitblit v1.9.1