From f953070108efe8d06ccd0c04b92c51a78f03d349 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 07 七月 2025 16:41:42 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/properties/DeviceConfig.java | 2 ++
src/main/java/com/zy/core/thread/fake/FakeNyShuttleThread.java | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/core/properties/DeviceConfig.java b/src/main/java/com/zy/core/properties/DeviceConfig.java
index 4961c2f..ea64251 100644
--- a/src/main/java/com/zy/core/properties/DeviceConfig.java
+++ b/src/main/java/com/zy/core/properties/DeviceConfig.java
@@ -17,4 +17,6 @@
private Boolean fake = false;
+ private String fakeInitStatus;
+
}
diff --git a/src/main/java/com/zy/core/thread/fake/FakeNyShuttleThread.java b/src/main/java/com/zy/core/thread/fake/FakeNyShuttleThread.java
index 24732ea..5fd0464 100644
--- a/src/main/java/com/zy/core/thread/fake/FakeNyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/fake/FakeNyShuttleThread.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
+import com.zy.common.Cools;
import com.zy.common.SpringUtils;
import com.zy.common.utils.RedisUtil;
import com.zy.core.News;
@@ -76,8 +77,14 @@
try {
ServerSocket serverSocket = new ServerSocket(device.getPort());
Socket fakeSocket = serverSocket.accept();
+
+ String fakeStatus = JSON.toJSONString(fakeStatusDemo);
+ if (!Cools.isEmpty(device.getFakeInitStatus())) {
+ fakeStatus = device.getFakeInitStatus();
+ }
+
fakeServerMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), fakeSocket);
- fakeStatusMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), JSON.parseObject(JSON.toJSONString(fakeStatusDemo)));
+ fakeStatusMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), JSON.parseObject(fakeStatus));
while (true) {
if(fakeSocket == null) {
fakeServerMap.remove(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo());
--
Gitblit v1.9.1