From a1e94379b115721b2e604070dc48063b8016f72f Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期二, 21 十月 2025 19:32:59 +0800
Subject: [PATCH] 侧面输送线出库码盘信息对接
---
src/main/java/com/zy/core/netty/handle/PackageServerHandler.java | 31 +++++++++++++------------------
1 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/src/main/java/com/zy/core/netty/handle/PackageServerHandler.java b/src/main/java/com/zy/core/netty/handle/PackageServerHandler.java
index fc7f7a5..a134908 100644
--- a/src/main/java/com/zy/core/netty/handle/PackageServerHandler.java
+++ b/src/main/java/com/zy/core/netty/handle/PackageServerHandler.java
@@ -1,15 +1,10 @@
package com.zy.core.netty.handle;
-import com.core.common.Cools;
-import com.zy.core.Slave;
-import com.zy.core.cache.SlaveConnection;
-import com.zy.core.enums.SlaveType;
import com.zy.core.netty.AbstractInboundHandler;
import com.zy.core.netty.cache.ChannelCache;
import com.zy.core.netty.domain.ChPackage;
import com.zy.core.netty.properties.TcpProperties;
import com.zy.core.properties.SlaveProperties;
-import com.zy.core.thread.BarcodeThread;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
@@ -31,6 +26,19 @@
@Autowired
private TcpProperties tcpProperties;
+ /**
+ * 鏁版嵁涓嬭
+ */
+ public static void write(ChPackage chPackage) {
+ String uuid = chPackage.getUuid();
+ Channel channel = ChannelCache.getChannel(uuid);
+ if (null == channel) {
+ log.warn("閫氶亾uuid={} 涓嶅湪绾�", uuid);
+ return;
+ }
+ channel.writeAndFlush(chPackage);
+ }
+
@Override
protected boolean channelRead0(ChannelHandlerContext ctx, ChPackage pac) {
// log.info("璇荤爜鍣ㄣ�怚P:{}銆� 涓婅鏁版嵁 ===>> {}", pac.getIp(), pac.getAscii());
@@ -50,18 +58,5 @@
// }
return true;
- }
-
- /**
- * 鏁版嵁涓嬭
- */
- public static void write(ChPackage chPackage){
- String uuid = chPackage.getUuid();
- Channel channel = ChannelCache.getChannel(uuid);
- if (null == channel){
- log.warn("閫氶亾uuid={} 涓嶅湪绾�", uuid);
- return;
- }
- channel.writeAndFlush(chPackage);
}
}
--
Gitblit v1.9.1