From f033da325dd16825bbca0d1ac71cc76420dfc8a2 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期五, 09 一月 2026 11:14:36 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java | 36 ++++++++++++++++++++++++++----------
1 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java b/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
index 235b579..99d4dd9 100644
--- a/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
@@ -11,6 +11,7 @@
import com.zy.common.utils.RedisUtil;
import com.zy.core.News;
import com.zy.core.enums.RedisKeyType;
+import com.zy.core.enums.StationCommandType;
import com.zy.core.model.CommandResponse;
import com.zy.core.model.command.StationCommand;
import com.zy.core.network.api.ZyStationConnectApi;
@@ -101,29 +102,44 @@
return new CommandResponse(true, "鍛戒护宸插彈鐞嗭紙寮傛鎵ц锛�");
}
+ @Override
+ public CommandResponse sendOriginCommand(String address, short[] data) {
+ return new CommandResponse(true, "鍘熷鍛戒护宸插彈鐞嗭紙寮傛鎵ц锛�");
+ }
+
+ @Override
+ public byte[] readOriginCommand(String address, int length) {
+ return new byte[0];
+ }
+
private void handleCommand(Integer deviceNo, StationCommand command) {
News.info("[WCS Debug] 绔欑偣浠跨湡妯℃嫙宸插惎鍔紝鍛戒护鏁版嵁={}", JSON.toJSONString(command));
Integer taskNo = command.getTaskNo();
Integer stationId = command.getStationId();
Integer targetStationId = command.getTargetStaNo();
+ StationCommandType commandType = command.getCommandType();
boolean generateBarcode = false;
- if(taskNo == 0 && targetStationId == 0){
- //娓呯┖绔欑偣
- resetStation(deviceNo, stationId);
- return;
+ if(commandType == StationCommandType.RESET){
+ if(taskNo == 0 && targetStationId == 0){
+ //娓呯┖绔欑偣
+ resetStation(deviceNo, stationId);
+ return;
+ }
+ }
+
+ if(commandType == StationCommandType.WRITE_INFO){
+ if (taskNo == 9998 && targetStationId == 0) {
+ //鐢熸垚鍑哄簱绔欑偣浠跨湡鏁版嵁
+ generateFakeOutStationData(deviceNo, stationId);
+ return;
+ }
}
//浠诲姟鍙峰睘浜庝豢鐪熷叆搴撲换鍔″彿
if (checkTaskNoInArea(taskNo)) {
//鐢熸垚浠跨湡鏁版嵁
generateBarcode = true;
- }
-
- if (taskNo == 9998 && targetStationId == 0) {
- //鐢熸垚鍑哄簱绔欑偣浠跨湡鏁版嵁
- generateFakeOutStationData(deviceNo, stationId);
- return;
}
if (taskNo > 0 && taskNo != 9999 && taskNo != 9998 && stationId == targetStationId) {
--
Gitblit v1.9.1