From bfbb0cbe87bbacbaf3fdfb5fb3caa935ec91da1f Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期六, 10 一月 2026 16:23:36 +0800
Subject: [PATCH] #1
---
src/main/java/com/zy/core/network/real/ZyStationRealConnect.java | 21 +++++++--------------
1 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/zy/core/network/real/ZyStationRealConnect.java b/src/main/java/com/zy/core/network/real/ZyStationRealConnect.java
index 2083e72..3c87467 100644
--- a/src/main/java/com/zy/core/network/real/ZyStationRealConnect.java
+++ b/src/main/java/com/zy/core/network/real/ZyStationRealConnect.java
@@ -123,7 +123,7 @@
}
String barcode = siemensNet.getByteTransform().TransString(result2.Content, i * 16, 4, "UTF-8");
barcode = barcode.trim();
- barcodeEntity.setBarcode(barcode);
+ statusEntity.setBarcode(barcode);
}
}
@@ -144,16 +144,14 @@
return commandResponse;
}
- OperateResult write = null;
+ OperateResult writeTaskNo = null;
+ OperateResult writeTargetStaNo = null;
// 浠诲姟涓嬪彂娆℃暟
int writeCount = 0;
do {
- short[] data = new short[2];
- data[0] = command.getTaskNo().shortValue();
- data[1] = command.getTargetStaNo().shortValue();
-
- write = siemensNet.Write("DB100." + index * 4, data);
- if (write.IsSuccess) {
+ writeTaskNo = siemensNet.Write("DB100." + index * 4, command.getTaskNo());
+ writeTargetStaNo = siemensNet.Write("DB100." + index * 4 + 4, command.getTargetStaNo().shortValue());
+ if (writeTaskNo.IsSuccess && writeTargetStaNo.IsSuccess) {
log.error("鍐欏叆杈撻�佺嚎鍛戒护鎴愬姛銆傜珯鐐圭紪鍙�={}锛岀珯鐐规暟鎹�={},鍐欏叆娆℃暟={}", command.getStationId(), JSON.toJSON(command),
writeCount);
commandResponse.setResult(true);
@@ -166,12 +164,7 @@
}
} while (writeCount < 5);
- if (write == null) {
- commandResponse.setMessage("鍐欏叆鍛戒护澶辫触");
- return commandResponse;
- }
-
- if (!write.IsSuccess) {
+ if (!writeTaskNo.IsSuccess || !writeTargetStaNo.IsSuccess) {
ZyStationStatusEntity staProtocol = findStatusEntity(command.getStationId());
OutputQueue.DEVP.offer(MessageFormat.format("鍐欏叆杈撻�佺嚎绔欑偣鏁版嵁澶辫触銆傜珯鐐圭紪鍙�={1}锛岀珯鐐规暟鎹�={2}", command.getStationId(),
JSON.toJSON(staProtocol)));
--
Gitblit v1.9.1