From aec4636e4fb430055feb66751da0e6c05bb864df Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期三, 30 四月 2025 16:25:30 +0800
Subject: [PATCH] fix(irrigatePlan): 修复终止灌溉计划时长设置错误- 将终止计划的默认时长从 9999 修改为 0 - 此修改确保在终止灌溉计划时,不会出现时长设置过长的问题
---
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalDecoder.java | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalDecoder.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalDecoder.java
new file mode 100644
index 0000000..976f340
--- /dev/null
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/LocalDecoder.java
@@ -0,0 +1,37 @@
+package com.dy.testClient.tcpClient;
+
+import com.dy.common.util.ByteUtil;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
+import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
+
+import java.io.IOException;
+
+public class LocalDecoder extends CumulativeProtocolDecoder {
+
+ private static final Logger log = LogManager.getLogger(LocalDecoder.class) ;
+
+ private static final String DECODER_STATE_KEY = LocalDecoder.class.getName() + ".STATE";
+
+ public static final int MAX_SIZE = 2147483647 ;
+
+
+ /**
+ * 瀵圭綉缁滀紶杈撴潵鐨勬暟鎹繘琛岃В鐮�
+ */
+ protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws IOException, Exception{
+ int remain = in.remaining() ;
+ if(remain > 0){
+ byte[] preByte = new byte[remain];
+ in.get(preByte) ;
+ in.position(0) ;
+ log.info("鏀跺埌涓績涓嬭鏁版嵁锛�" + ByteUtil.bytes2Hex(preByte, true));
+ }
+ return true;
+ }
+
+
+}
--
Gitblit v1.8.0