From 84182fbb85e7c11194014a8ca9d25a97f4f088e4 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期一, 29 七月 2024 13:49:54 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/文档/MybatisCodeHelper插件购买.docx                                                                           |    0 
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/RtuStatusDealer.java                   |   66 ++--
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataCodecFactory.java                          |   18 +
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpSessionCache.java                   |   15 +
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A2_Down.java                  |    2 
 pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/common/CodeLocal.java                 |    3 
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/BCDUtil.java                                             |  273 ++++++++++++++++++++++
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A1_Down.java                  |    2 
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoHandler.java                              |   27 ++
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java                                   |   26 ++
 pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/ComSupportP206V1_0_0.java  |   18 +
 pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java |   62 +++--
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpUnitStopCallback.java               |   13 +
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java                                            |  103 --------
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/localProtocol/CodeLocal.java            |    3 
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitAdapter.java                            |    5 
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/AdapterImp_TcpUnit.java                       |   12 
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitStopCallback.java                       |   10 
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java                 |   30 ++
 19 files changed, 513 insertions(+), 175 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataCodecFactory.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataCodecFactory.java
index 417bda2..284dcb6 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataCodecFactory.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataCodecFactory.java
@@ -8,16 +8,32 @@
 public class DataCodecFactory implements ProtocolCodecFactory {
 
 	private TcpUnitAdapter adapter ;
-	
+    private boolean stop = false ;//涓簍rue鏃讹紝鍋滄TCP鏈嶅姟锛屽苟鎶婂凡缁廡CP杩炴帴鏂繛鎺�
+
     public DataCodecFactory(TcpUnitAdapter adapter) {
     	this.adapter = adapter ;
     }
 
+    public void stop(){
+        stop = true ;
+    }
+
+    public void recover(){
+        this.stop = false ;
+    }
+
+
     public ProtocolEncoder getEncoder(IoSession ioSession) {
+        if(stop){
+            ioSession.closeNow() ;
+        }
         return new DataEncoder();
     }
 
     public ProtocolDecoder getDecoder(IoSession ioSession) {
+        if(stop){
+            ioSession.closeNow() ;
+        }
         return new DataDecoder(adapter.newPrefixedDataAvailableHandle());
     }
 }
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoHandler.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoHandler.java
index 695ec8d..fe53fdb 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoHandler.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoHandler.java
@@ -8,9 +8,18 @@
 
 	private TcpUnitAdapter adapter ;
 
+	private boolean stop = false ;//涓簍rue鏃讹紝鍋滄TCP鏈嶅姟锛屽苟鎶婂凡缁廡CP杩炴帴鏂繛鎺�
 
 	public TcpIoHandler(TcpUnitAdapter adapter){
 		this.adapter = adapter ;
+	}
+
+	public void stop(){
+		stop = true ;
+	}
+
+	public void recover(){
+		this.stop = false ;
 	}
 
 	/**
@@ -18,14 +27,22 @@
 	 */
 	@Override
 	public void sessionCreated(IoSession session) throws Exception {
-		super.sessionCreated(session);
+		if(stop){
+			session.closeNow() ;
+		}else{
+			super.sessionCreated(session);
+		}
 	}
    
 	/**
      * 浼氳瘽open鏃跺洖璋冪殑鏂规硶 
      */
     public void sessionOpened(IoSession session) throws Exception {
-    	this.adapter.newSessionEventCallback().sessionOpened(session);
+		if(stop){
+			session.closeNow() ;
+		}else{
+			this.adapter.newSessionEventCallback().sessionOpened(session);
+		}
     }
     
 	/**
@@ -76,7 +93,11 @@
      */
 	@Override
     public void messageReceived(IoSession session, Object message) throws Exception {
-    	this.adapter.newSessionEventCallback().messageReceived(session, message);
+		if(stop){
+			session.closeNow() ;
+		}else{
+			this.adapter.newSessionEventCallback().messageReceived(session, message);
+		}
     }
 
 }
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java
index e0d83d6..2b8d31a 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java
@@ -22,6 +22,8 @@
 	private static boolean started = false ;
 	
 	private TcpUnitAdapter adapter ;
+	private TcpIoHandler tcpIoHandler ;
+	private DataCodecFactory dataCodecFactory ;
 	
 	private TcpUnit(){} ;
 	
@@ -94,7 +96,8 @@
 			//寰楀埌缃戠粶 閫氫俊鏁版嵁杩囨护鍣ㄩ摼
 			DefaultIoFilterChainBuilder chain = acceptor.getFilterChain() ;
 			//缂栬В鐮佽繃婊ゅ櫒
-			chain.addLast("protocol", new ProtocolCodecFilter(new DataCodecFactory(this.adapter)));
+			dataCodecFactory = new DataCodecFactory(this.adapter) ;
+			chain.addLast("protocol", new ProtocolCodecFilter(dataCodecFactory));
 			
 			/*
 			 * 涓�鑸珽xecutorFilter 閮借鏀惧湪ProtocolCodecFilter 杩囨护鍣ㄧ殑鍚庨潰锛�
@@ -106,7 +109,8 @@
 			chain.addLast("exceutor", new ExecutorFilter());
 
 			//涓氬姟閫昏緫澶勭悊鍣紝璐熻矗澶勭悊缃戠粶浼氳瘽鍙婅緭鍏ヨ緭鍑烘暟鎹�
-			acceptor.setHandler(new TcpIoHandler(this.adapter));
+			tcpIoHandler = new TcpIoHandler(this.adapter) ;
+			acceptor.setHandler(tcpIoHandler) ;
 
 			boolean isException = false ;
 			try {
@@ -129,8 +133,26 @@
 		}
 	}
 
+	/**
+	 * 鍋滄妯″潡杩愯锛屽皢涓嶅啀鎺ュ叆TCP缃戠粶杩炴帴锛屽苟鎶婂凡缁弔cp杩炴帴鐨勫叏閮ㄦ柇杩炴帴
+	 * @param callback
+	 * @throws Exception
+	 */
 	@Override
 	public void stop(UnitStartedCallbackInterface callback) throws Exception {
+		this.tcpIoHandler.stop();
+		this.dataCodecFactory.stop();
+		this.adapter.newUnitStopCallback().callback();
+		callback.call(null);
+	}
+
+	/**
+	 * 瑙i櫎鍋滄锛屾仮澶峊CP鏈嶅姟杩愯
+	 * @throws Exception
+	 */
+	public void recover() throws Exception {
+		this.tcpIoHandler.recover();
+		this.dataCodecFactory.recover();
 	}
 	
 
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitAdapter.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitAdapter.java
index 50b4dac..bf194fa 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitAdapter.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitAdapter.java
@@ -22,5 +22,10 @@
 	 * @return
 	 */
 	TcpIoSessionEventCallback newSessionEventCallback() ;
+
+	/**
+	 * 妯″潡鍋滄鏃剁殑鍥炶皟
+	 */
+	TcpUnitStopCallback newUnitStopCallback() ;
 	
 }
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitStopCallback.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitStopCallback.java
new file mode 100644
index 0000000..71c80ff
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnitStopCallback.java
@@ -0,0 +1,10 @@
+package com.dy.common.mw.channel.tcp;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/7/29 9:25
+ * @Description
+ */
+public interface TcpUnitStopCallback {
+    void callback() ;
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A1_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A1_Down.java
index fb4fcc4..d6966ec 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A1_Down.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A1_Down.java
@@ -103,7 +103,7 @@
         if(cvo.year < 24 || cvo.year > 9999){
             throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉姝g‘") ;
         }
-        if(cvo.year > 24 && cvo.year < 2024){
+        if(cvo.year > 99 && cvo.year < 2024){
             throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉姝g‘") ;
         }
         if(cvo.month == null){
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A2_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A2_Down.java
index 9db5735..3a09630 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A2_Down.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_A2_Down.java
@@ -103,7 +103,7 @@
         if(cvo.year < 24 || cvo.year > 9999){
             throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉姝g‘") ;
         }
-        if(cvo.year > 24 && cvo.year < 2024){
+        if(cvo.year > 99 && cvo.year < 2024){
             throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉姝g‘") ;
         }
         if(cvo.month == null){
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/BCDUtil.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/BCDUtil.java
new file mode 100644
index 0000000..dfd7591
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/BCDUtil.java
@@ -0,0 +1,273 @@
+package com.dy.common.util;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/7/27 15:50
+ * @Description
+ */
+public class BCDUtil {
+
+    /**
+     *
+     * @param num
+     * @return
+     */
+    public static byte[] int2BCD_LE(int num){
+        int len =  (int) Math.log10(num) + 1 ;
+        byte[] bs = null ;
+        if(len % 2 == 0){
+            bs = new byte[len / 2] ;
+        }else{
+            bs = new byte[len / 2 + 1] ;
+        }
+        int index = 0 ;
+        while(num > 0){
+            int yu = num % 100 ;
+            bs[index++] = (byte)(((yu/10) << 4) + (yu%10)) ;
+            num = num / 100 ;
+        }
+        return bs ;
+    }
+
+    /**
+     *
+     * @param num
+     * @return
+     */
+    public static byte[] int2BCD_BE(int num){
+        int len =  (int) Math.log10(num) + 1 ;
+        byte[] bs = null ;
+        if(len % 2 == 0){
+            bs = new byte[len / 2] ;
+        }else{
+            bs = new byte[len / 2 + 1] ;
+        }
+        int index = bs.length - 1 ;
+        while(num > 0){
+            int yu = num % 100 ;
+            bs[index--] = (byte)(((yu/10) << 4) + (yu%10)) ;
+            num = num / 100 ;
+        }
+        return bs ;
+    }
+
+    /**
+     *
+     * @param num
+     * @return
+     */
+    public static byte[] long2BCD_LE(long num){
+        int len =  (int) Math.log10(num) + 1 ;
+        byte[] bs = null ;
+        if(len % 2 == 0){
+            bs = new byte[len / 2] ;
+        }else{
+            bs = new byte[len / 2 + 1] ;
+        }
+        int index = 0 ;
+        while(num > 0){
+            long yu = num % 100 ;
+            bs[index++] = (byte)(((yu/10) << 4) + (yu%10)) ;
+            num = num / 100 ;
+        }
+        return bs ;
+    }
+
+    /**
+     *
+     * @param num
+     * @return
+     */
+    public static byte[] long2BCD_BE(long num){
+        int len =  (int) Math.log10(num) + 1 ;
+        byte[] bs = null ;
+        if(len % 2 == 0){
+            bs = new byte[len / 2] ;
+        }else{
+            bs = new byte[len / 2 + 1] ;
+        }
+        int index = bs.length - 1 ;
+        while(num > 0){
+            long yu = num % 100 ;
+            bs[index--] = (byte)(((yu/10) << 4) + (yu%10)) ;
+            num = num / 100 ;
+        }
+        return bs ;
+    }
+
+    /**
+     *
+     * @param numStr
+     * @return
+     */
+    public static byte[] string2BCD_LE(String numStr) throws Exception{
+        if (numStr == null || !numStr.matches("\\d*")) {
+            throw new Exception("鏁板瓧杞垚BCD缂栫爜鏃跺嚭閿欙紝涓嶆槸鍚堟硶鏁板瓧:" + numStr, null);
+        }
+        int numLen = numStr.length() ;
+        int byteLen = 0 ;
+        if(numLen % 2 == 0){
+            byteLen = numLen / 2 ;
+        }else{
+            byteLen = numLen / 2 + 1 ;
+        }
+
+        int[] tmpInts = new int[byteLen * 2];
+        int index = numStr.length() - 1;
+        for (int i = 0; i <= tmpInts.length - 1 && index >= 0; i++, index--) {
+            tmpInts[i] = numStr.charAt(index) - '0';
+        }
+        byte[] bs = new byte[byteLen] ;
+        for (int i = 0, j = 0; i < byteLen; i++, j++) {
+            bs[i] = (byte) (tmpInts[2 * j + 1] * 16 + tmpInts[2 * j]);
+        }
+
+        return bs ;
+    }
+
+    /**
+     *
+     * @param numStr
+     * @return
+     */
+    public static byte[] string2BCD_BE(String numStr) throws Exception{
+        if (numStr == null || !numStr.matches("\\d*")) {
+            throw new Exception("鏁板瓧杞垚BCD缂栫爜鏃跺嚭閿欙紝涓嶆槸鍚堟硶鏁板瓧:" + numStr, null);
+        }
+        int numLen = numStr.length() ;
+        int byteLen = 0 ;
+        if(numLen % 2 == 0){
+            byteLen = numLen / 2 ;
+        }else{
+            byteLen = numLen / 2 + 1 ;
+        }
+
+        int[] tmpInts = new int[byteLen * 2];
+        int index = numStr.length() - 1;
+        for (int i = tmpInts.length - 1; i >= 0 && index >= 0; i--, index--) {
+            tmpInts[i] = numStr.charAt(index) - '0';
+        }
+        byte[] bs = new byte[byteLen] ;
+        for (int i = 0, j = 0; i < byteLen; i++, j++) {
+            bs[i] = (byte) (tmpInts[2 * j] * 16 + tmpInts[2 * j + 1]);
+        }
+
+        return bs ;
+    }
+
+    /**
+     *
+     * @param bs
+     * @return
+     */
+    public static int BCD2Int_LE(byte[] bs){
+        int num = 0 ;
+        int multiple = 1 ;
+        for(int i = 0; i < bs.length; i++){
+            num += (((bs[i] >> 4) * 10) + (bs[i] & 0xF)) * multiple ;
+            multiple = multiple * 100 ;
+        }
+        return num ;
+    }
+
+    /**
+     *
+     * @param bs
+     * @return
+     */
+    public static int BCD2Int_BE(byte[] bs){
+        int num = 0 ;
+        int multiple = 1 ;
+        for(int i = bs.length-1; i >= 0 ; i--){
+            num += (((bs[i] >> 4) * 10) + (bs[i] & 0xF)) * multiple ;
+            multiple = multiple * 100 ;
+        }
+        return num ;
+    }
+
+    /**
+     *
+     * @param bs
+     * @return
+     */
+    public static long BCD2Long_LE(byte[] bs){
+        long num = 0 ;
+        long multiple = 1 ;
+        for(int i = 0; i < bs.length; i++){
+            num += (((bs[i] >> 4) * 10) + (bs[i] & 0xF)) * multiple ;
+            multiple = multiple * 100 ;
+        }
+        return num ;
+    }
+
+    /**
+     *
+     * @param bs
+     * @return
+     */
+    public static long BCD2Long_BE(byte[] bs){
+        long num = 0 ;
+        long multiple = 1 ;
+        for(int i = bs.length-1; i >= 0 ; i--){
+            num += (((bs[i] >> 4) * 10) + (bs[i] & 0xF)) * multiple ;
+            multiple = multiple * 100 ;
+        }
+        return num ;
+    }
+
+    /**
+     *
+     * @param bs
+     * @return
+     */
+    public static String BCD2String_LE(byte[] bs) throws Exception{
+        StringBuilder sb = new StringBuilder();
+        for (int i = (bs.length - 1); i >= 0; i--) {
+            int value = (bs[i] + 256) % 256;
+            sb.append((char) (value / 16 + '0')).append((char) (value % 16 + '0'));
+        }
+
+        String result = sb.toString();
+        if (!result.matches("\\d*")) {
+            throw new Exception("瑙g爜BCD锛屼絾鏁版嵁闈濨CD鐮侊紒");
+        }
+        return result;
+    }
+
+    /**
+     *
+     * @param bs
+     * @return
+     */
+    public static String BCD2String_BE(byte[] bs) throws Exception{
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < bs.length ; i++) {
+            int value = (bs[i] + 256) % 256;
+            sb.append((char) (value / 16 + '0')).append((char) (value % 16 + '0'));
+            value++;
+        }
+        String result = sb.toString();
+        if (!result.matches("\\d*")) {
+            throw new Exception("瑙g爜BCD锛屼絾鏁版嵁锛�" + result + "闈濨CD鐮侊紒");
+        }
+        return result;
+    }
+
+    public static void main(String[] args) throws Exception {
+        int num = 1234567;
+        byte[] bs = int2BCD_LE(num) ;
+        int num_ =BCD2Int_LE(bs) ;
+        System.out.println(num_);
+        bs = int2BCD_BE(num) ;
+        num_ = BCD2Int_BE(bs);
+        System.out.println(num_);
+
+        String str = "12345678901234567890" ;
+        bs = string2BCD_LE(str) ;
+        String str_ = BCD2String_LE(bs) ;
+        System.out.println(str_);
+        bs = string2BCD_BE(str) ;
+        str_ = BCD2String_BE(bs) ;
+        System.out.println(str_);
+    }
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java
index 6819327..2f0c7d6 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java
@@ -1059,109 +1059,6 @@
 	}
 
 
-
-	private static final char[] HEX_CHAR = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
-//	/**
-//	 * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓�
-//	 *
-//	 * @param bytes 寰呰浆鎹yte[]
-//	 * @return 杩斿洖 杞崲鍚庣殑瀛楃涓�
-//	 */
-//	public static String bytesToHex(byte[] bytes) {
-//		//涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇�
-//		char[] buf = new char[bytes.length * 2];
-//		int a = 0;
-//		int index = 0;
-//		for (byte b : bytes) { // 浣跨敤闄や笌鍙栦綑杩涜杞崲
-//			if (b < 0) {
-//				a = 256 + b;
-//			} else {
-//				a = b;
-//			}
-//
-//			buf[index++] = HEX_CHAR[a / 16];
-//			buf[index++] = HEX_CHAR[a % 16];
-//		}
-//		return new String(buf);
-//	}
-//	/**
-//	 * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓�
-//	 *
-//	 * @param bytes 寰呰浆鎹yte[]
-//	 * @return 杩斿洖 杞崲鍚庣殑瀛楃涓�
-//	 */
-//	public static String bytesToHex_BE(byte[] bytes, int startIndex, int endIndex) {
-//		byte[] bs = new byte[endIndex - startIndex + 1] ;
-//		byte j = 0 ;
-//		for(int i = startIndex; i <= endIndex; i++){
-//			bs[j++] = bytes[i] ;
-//		}
-//		//涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇�
-//		char[] buf = new char[bs.length * 2];
-//		int a = 0;
-//		int index = 0;
-//		for (byte b : bs) { // 浣跨敤闄や笌鍙栦綑杩涜杞崲
-//			if (b < 0) {
-//				a = 256 + b;
-//			} else {
-//				a = b;
-//			}
-//
-//			buf[index++] = HEX_CHAR[a / 16];
-//			buf[index++] = HEX_CHAR[a % 16];
-//		}
-//		return new String(buf);
-//	}
-//
-//    /**
-//     * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓�
-//     *
-//     * @param bytes 寰呰浆鎹yte[]
-//     * @return 杩斿洖 杞崲鍚庣殑瀛楃涓�
-//     */
-//    public static String bytesToHex_LE(byte[] bytes, int startIndex, int endIndex) {
-//        byte[] bs = new byte[endIndex - startIndex + 1] ;
-//        byte j = 0 ;
-//        for(int i = endIndex; i >= startIndex; i--){
-//            bs[j++] = bytes[i] ;
-//        }
-//        //涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇�
-//        char[] buf = new char[bs.length * 2];
-//        int a = 0;
-//        int index = 0;
-//        for (byte b : bs) { // 浣跨敤闄や笌鍙栦綑杩涜杞崲
-//            if (b < 0) {
-//                a = 256 + b;
-//            } else {
-//                a = b;
-//            }
-//
-//            buf[index++] = HEX_CHAR[a / 16];
-//            buf[index++] = HEX_CHAR[a % 16];
-//        }
-//        return new String(buf);
-//    }
-//
-//	/**
-//	 * 灏�16杩涘埗瀛楃涓茶浆鎹负byte[]
-//	 *
-//	 * @param str 寰呰浆鎹㈠瓧绗︿覆
-//	 * @return 杩斿洖 杞崲鍚庣殑byte[]
-//	 */
-//	public static byte[] hexToBytes(String str) {
-//		if (str == null || "".equals(str.trim())) {
-//			return new byte[0];
-//		}
-//
-//		byte[] bytes = new byte[str.length() / 2];
-//		for (int i = 0; i < str.length() / 2; i++) {
-//			String subStr = str.substring(i * 2, i * 2 + 2);
-//			bytes[i] = (byte) Integer.parseInt(subStr, 16);
-//		}
-//
-//		return bytes;
-//	}
-
 	/**
 	 * Convert char to byte
 	 * @param c char
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/AdapterImp_TcpUnit.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/AdapterImp_TcpUnit.java
index 06a8ff4..5411286 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/AdapterImp_TcpUnit.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/AdapterImp_TcpUnit.java
@@ -1,9 +1,6 @@
 package com.dy.rtuMw.server;
 
-import com.dy.common.mw.channel.tcp.PrefixedDataAvailableHandle;
-import com.dy.common.mw.channel.tcp.TcpConfigVo;
-import com.dy.common.mw.channel.tcp.TcpIoSessionEventCallback;
-import com.dy.common.mw.channel.tcp.TcpUnitAdapter;
+import com.dy.common.mw.channel.tcp.*;
 import com.dy.common.mw.protocol.PrefixedDataAvailableHandleImp;
 import com.dy.rtuMw.server.forTcp.TcpIoSessionCallback;
 
@@ -30,4 +27,11 @@
 		return new TcpIoSessionCallback() ;
 	}
 
+	/**
+	 * 妯″潡鍋滄鏃剁殑鍥炶皟
+	 */
+	@Override
+	public TcpUnitStopCallback newUnitStopCallback() {
+		return new com.dy.rtuMw.server.forTcp.TcpUnitStopCallback() ;
+	}
 }
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/RtuStatusDealer.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/RtuStatusDealer.java
index 30d32b0..f60c73a 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/RtuStatusDealer.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/RtuStatusDealer.java
@@ -13,11 +13,11 @@
 	
 	
 	public static void onOffLine(RtuSessionStatus sta){
-		StOnOffLine st = new StOnOffLine() ;
-		st.rtuAddr = sta.rtuAddr ;
-		st.onOff_trueFalse = sta.onTrueOffLine ;
-		st.ip = sta.ip ;
-		st.port = sta.port ;
+//		StOnOffLine st = new StOnOffLine() ;
+//		st.rtuAddr = sta.rtuAddr ;
+//		st.onOff_trueFalse = sta.onTrueOffLine ;
+//		st.ip = sta.ip ;
+//		st.port = sta.port ;
 		
 //		if(member == null){
 //			log.error("鍑洪敊锛屾湭鑳藉緱鍒板鐞哛TU锛堝湴鍧�涓�" + sta.rtuAddr + "锛夌姸鎬佹暟鎹殑鏁版嵁涓棿浠讹紝鍙兘鏁版嵁涓棿浠舵湭鍚姩鎴栬劚绂荤殑闆嗙兢锛�");
@@ -28,11 +28,11 @@
 	}
 	
 	public static void onLine(String rtuAddr, String ip, Integer port){
-		StOnOffLine st = new StOnOffLine() ;
-		st.rtuAddr = rtuAddr ;
-		st.onOff_trueFalse = true ;
-		st.ip = ip ;
-		st.port = port ;
+//		StOnOffLine st = new StOnOffLine() ;
+//		st.rtuAddr = rtuAddr ;
+//		st.onOff_trueFalse = true ;
+//		st.ip = ip ;
+//		st.port = port ;
 		
 //		Address member = JgUnit.getInstance().getJgMembers().getDataMwMemberByRtuAddr(rtuAddr) ;
 //		if(member == null){
@@ -44,9 +44,9 @@
 	}
 	
 	public static void offLine(String rtuAddr){
-		StOnOffLine st = new StOnOffLine() ;
-		st.rtuAddr = rtuAddr ;
-		st.onOff_trueFalse = false ;
+//		StOnOffLine st = new StOnOffLine() ;
+//		st.rtuAddr = rtuAddr ;
+//		st.onOff_trueFalse = false ;
 		
 //		Address member = JgUnit.getInstance().getJgMembers().getDataMwMemberByRtuAddr(rtuAddr) ;
 //		if(member == null){
@@ -58,10 +58,10 @@
 	}
 	
 	public static void upData(String rtuAddr, Integer bufferLen){
-		StUpData st = new StUpData() ;
-		st.rtuAddr = rtuAddr ;
-		st.upBufferLen = bufferLen ;
-		st.isReport = false ;
+//		StUpData st = new StUpData() ;
+//		st.rtuAddr = rtuAddr ;
+//		st.upBufferLen = bufferLen ;
+//		st.isReport = false ;
 		
 //		Address member = JgUnit.getInstance().getJgMembers().getDataMwMemberByRtuAddr(rtuAddr) ;
 //		if(member == null){
@@ -73,10 +73,10 @@
 	}
 	
 	public static void upReport(String rtuAddr, Integer bufferLen){
-		StUpData st = new StUpData() ;
-		st.rtuAddr = rtuAddr ;
-		st.upBufferLen = bufferLen ;
-		st.isReport = true ;
+//		StUpData st = new StUpData() ;
+//		st.rtuAddr = rtuAddr ;
+//		st.upBufferLen = bufferLen ;
+//		st.isReport = true ;
 		
 //		Address member = JgUnit.getInstance().getJgMembers().getDataMwMemberByRtuAddr(rtuAddr) ;
 //		if(member == null){
@@ -88,9 +88,9 @@
 	}
 	
 	public static void downData(String rtuAddr, Integer bufferLen){
-		StDownData st = new StDownData() ;
-		st.rtuAddr = rtuAddr ;
-		st.downBufferLen = bufferLen ;
+//		StDownData st = new StDownData() ;
+//		st.rtuAddr = rtuAddr ;
+//		st.downBufferLen = bufferLen ;
 		
 //		Address member = JgUnit.getInstance().getJgMembers().getDataMwMemberByRtuAddr(rtuAddr) ;
 //		if(member == null){
@@ -102,9 +102,9 @@
 	}
 	
 	public static void commandSuccess(String rtuAddr){
-		StCommandResult st = new StCommandResult() ;
-		st.rtuAddr = rtuAddr ;
-		st.isSuccess = true ;
+//		StCommandResult st = new StCommandResult() ;
+//		st.rtuAddr = rtuAddr ;
+//		st.isSuccess = true ;
 		
 //		Address member = JgUnit.getInstance().getJgMembers().getDataMwMemberByRtuAddr(rtuAddr) ;
 //		if(member == null){
@@ -116,9 +116,9 @@
 	}
 	
 	public static void commandFailure(String rtuAddr){
-		StCommandResult st = new StCommandResult() ;
-		st.rtuAddr = rtuAddr ;
-		st.isSuccess = false ;
+//		StCommandResult st = new StCommandResult() ;
+//		st.rtuAddr = rtuAddr ;
+//		st.isSuccess = false ;
 		
 //		Address member = JgUnit.getInstance().getJgMembers().getDataMwMemberByRtuAddr(rtuAddr) ;
 //		if(member == null){
@@ -130,9 +130,9 @@
 	}
 	
 	public static void commandFail2Success(String rtuAddr){
-		StCommandResult st = new StCommandResult() ;
-		st.rtuAddr = rtuAddr ;
-		st.fail2Success = true ;
+//		StCommandResult st = new StCommandResult() ;
+//		st.rtuAddr = rtuAddr ;
+//		st.fail2Success = true ;
 		
 //		Address member = JgUnit.getInstance().getJgMembers().getDataMwMemberByRtuAddr(rtuAddr) ;
 //		if(member == null){
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpSessionCache.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpSessionCache.java
index e821b47..bf28087 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpSessionCache.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpSessionCache.java
@@ -23,7 +23,20 @@
 	 * 2023-12-19瀹炴祴锛屽彂鐜癏ashtable骞朵笉绾跨▼瀹夊叏锛屾墍浠ュ簲鐢ㄤ簡HashMap鍜宻ynchronized
 	 */
 	private static HashMap<String, TcpSession> sessionTable = new HashMap<String, TcpSession>() ;
-	
+
+	/**
+	 * 鍏抽棴鎵�鏈夌綉缁滆繛鎺�
+	 */
+	public static void closeAllSessions(){
+		synchronized (sessionTable){
+			Collection<TcpSession> col = sessionTable.values() ;
+			for(TcpSession se : col){
+				se.ioSession.closeNow() ;
+			}
+			sessionTable.clear();
+		}
+	}
+
 	/**
 	 * 鍔犲叆鏂扮殑IoSession
 	 * @param rtuAddr
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpUnitStopCallback.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpUnitStopCallback.java
new file mode 100644
index 0000000..fb39088
--- /dev/null
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpUnitStopCallback.java
@@ -0,0 +1,13 @@
+package com.dy.rtuMw.server.forTcp;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/7/29 9:26
+ * @Description
+ */
+public class TcpUnitStopCallback implements com.dy.common.mw.channel.tcp.TcpUnitStopCallback{
+    @Override
+    public void callback() {
+        TcpSessionCache.closeAllSessions();
+    }
+}
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java
index 0d783a9..9ae2f68 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java
@@ -1,5 +1,7 @@
 package com.dy.rtuMw.server.local;
 
+import com.dy.common.mw.UnitStartedCallbackInterface;
+import com.dy.common.mw.channel.tcp.TcpUnit;
 import com.dy.common.mw.protocol.Command;
 import com.dy.rtuMw.server.local.localProtocol.*;
 
@@ -23,6 +25,10 @@
             return this.onLine(com) ;
         }else if(code.equals(CodeLocal.allProtocols)){
             return this.allProtocols(com) ;
+        }else if(code.equals(CodeLocal.stopTcpSv)){
+            return this.stopTcpSv(com) ;
+        }else if(code.equals(CodeLocal.recoverTcpSv)){
+            return this.recoverTcpSv(com) ;
         }
         return ReturnCommand.errored("鍑洪敊锛屾敹鍒板唴閮ㄥ懡浠ょ殑鍔熻兘鐮佷笉鑳借瘑鍒紒", com.getId(), com.getCode()) ;
     }
@@ -54,4 +60,28 @@
         return ReturnCommand.successed("鏌ヨ鎵�鏈夐�氫俊鍗忚閰嶇疆", command.getId(), command.getCode(), mc) ;
     }
 
+    /**
+     * 鍋滄TCP鏈嶅姟锛屼笉鍐嶆帴鍏ユ柊鐨凾CP杩炴帴锛屽凡缁廡CP杩炴帴鐨勫叏閮ㄦ柇杩炴帴
+     * @throws Exception
+     */
+    private Command stopTcpSv(Command command) throws Exception{
+        TcpUnit.getInstance().stop(new UnitStartedCallbackInterface(){
+            public void call(Object obj) throws Exception {
+
+            }
+        });
+        return ReturnCommand.successed("宸茬粡鍚姩鍋滄TCP鏈嶅姟", command.getId(), command.getCode(), null) ;
+    }
+
+    /**
+     * 鎭㈠TCP鏈嶅姟锛屾帴鍏ユ柊鐨凾CP杩炴帴
+     * @throws Exception
+     */
+    private Command recoverTcpSv(Command command) throws Exception{
+        TcpUnit.getInstance().recover();
+        return ReturnCommand.successed("宸茬粡鍚姩鎭㈠TCP鏈嶅姟", command.getId(), command.getCode(), null) ;
+    }
+
+
+
 }
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/localProtocol/CodeLocal.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/localProtocol/CodeLocal.java
index d3322bc..49aa69d 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/localProtocol/CodeLocal.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/localProtocol/CodeLocal.java
@@ -8,4 +8,7 @@
 	
 	public static final String allProtocols = "LCD0100" ;//鏌ヨ鎵�鏈夊崗璁厤缃�
 
+	public static final String stopTcpSv = "LCD0110" ;//鍋滄TCP鏈嶅姟锛屼笉鍐嶆帴鍏ユ柊鐨凾CP杩炴帴锛屽凡缁廡CP杩炴帴鐨勫叏閮ㄦ柇杩炴帴
+	public static final String recoverTcpSv = "LCD0112" ;//閲嶅惎TCP鏈嶅姟锛屾帴鍏ユ柊鐨凾CP杩炴帴
+
 }
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/common/CodeLocal.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/common/CodeLocal.java
index b4135de..9b7edb2 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/common/CodeLocal.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/common/CodeLocal.java
@@ -8,4 +8,7 @@
 	
 	public static final String allProtocols = "LCD0100" ;//鏌ヨ鎵�鏈夊崗璁厤缃�
 
+	public static final String stopTcpSv = "LCD0110" ;//鍋滄TCP鏈嶅姟锛屼笉鍐嶆帴鍏ユ柊鐨凾CP杩炴帴锛屽凡缁廡CP杩炴帴鐨勫叏閮ㄦ柇杩炴帴
+	public static final String recoverTcpSv = "LCD0112" ;//鎭㈠TCP鏈嶅姟锛屾帴鍏ユ柊鐨凾CP杩炴帴
+
 }
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/ComSupportP206V1_0_0.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/ComSupportP206V1_0_0.java
index 6b98168..ae511a8 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/ComSupportP206V1_0_0.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/ComSupportP206V1_0_0.java
@@ -34,7 +34,22 @@
     private RestTemplate restTemplate;
 
 
-    protected Command command(String code, Object param, String comId){
+    protected Command commandLocal(String code, Object param, String comId){
+        Command com = new Command() ;
+        com.id = comId==null?Command.defaultId:(comId.trim().equals("")?Command.defaultId:comId) ;//瀹為檯搴旂敤涓紝鏇挎崲鎴愭暟鎹簱璁板綍id
+        com.protocol = ProtocolConstantV206V1_0_0.protocolName ;
+        com.code = code ;
+        com.rtuAddr = rtuAddr ;
+        com.type = CommandType.innerCommand ;
+        com.rtuResultSendWebUrl = rtuResultSendWebUrl ;
+
+        com.param = param ;
+
+        return com ;
+    }
+
+
+    protected Command commandOuter(String code, Object param, String comId){
         Command com = new Command() ;
         com.id = comId==null?Command.defaultId:(comId.trim().equals("")?Command.defaultId:comId) ;//瀹為檯搴旂敤涓紝鏇挎崲鎴愭暟鎹簱璁板綍id
         com.protocol = ProtocolConstantV206V1_0_0.protocolName ;
@@ -48,6 +63,7 @@
         return com ;
     }
 
+
     /**
      * 杩炴帴閫氫俊涓棿浠舵祴璇�
      * @return
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java
index d3ca03d..8a2bfa1 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java
@@ -31,7 +31,11 @@
             rt = this.connect() ;//杩炴帴閫氫俊涓棿浠舵祴璇�
         }else{
             try{
-                if(com.equals("10")){
+                if(com.equals(CodeLocal.stopTcpSv)){
+                    rt = this.stopTcpSv() ;
+                }else if(com.equals(CodeLocal.recoverTcpSv)){
+                    rt = this.recoverTcpSv() ;
+                }else if(com.equals("10")){
                     rt = this.cd10() ;
                 }else if(com.equals("21")){
                     rt = this.cd21() ;
@@ -96,89 +100,97 @@
         return this.sendTest() ;
     }
 
+    private BaseResponse stopTcpSv(){
+        return this.sendCom2Mw(this.commandLocal(CodeLocal.stopTcpSv, null, null)) ;
+    }
+
+    private BaseResponse recoverTcpSv(){
+        return this.sendCom2Mw(this.commandLocal(CodeLocal.recoverTcpSv, null, null)) ;
+    }
+
     private BaseResponse cd10(){
         Com10Vo comVo = new Com10Vo() ;
         comVo.rtuAddr = "532328059995" ;//鍓�6浣嶆槸琛屾斂鍖哄垝鐮侊紝鍚�6浣嶆槸搴忓垪鍙锋渶澶ф槸065535
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_10, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_10, comVo, null)) ;
     }
 
     private BaseResponse cd21(){
         Com21Vo comVo = new Com21Vo() ;
         comVo.ip = "8.140.180.59" ;//IP锛堜緥濡� 125.235.35.89锛�
         comVo.port = 6001 ;///绔彛鍙凤紙0~65536锛�
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_21, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_21, comVo, null)) ;
     }
 
     private BaseResponse cd37(){
         Com37Vo comVo = new Com37Vo() ;
         comVo.seconds = 20 ;//鍗曚綅绉�
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_37, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_37, comVo, null)) ;
     }
     private BaseResponse cd67(){
         Com37Vo comVo = new Com37Vo() ;
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_67, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_67, comVo, null)) ;
     }
 
     private BaseResponse cd38(){
         Com38Vo comVo = new Com38Vo() ;
         comVo.remainMoneyAlarm = 10.0 ;//鐢ㄦ埛浣欓鎶ヨ鍊�(澶т簬1.0)
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_38, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_38, comVo, null)) ;
     }
 
     private BaseResponse cd68(){
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_68, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_68, null, null)) ;
     }
 
     private BaseResponse cd39(){
         Com39Vo comVo = new Com39Vo() ;
         comVo.batteryVoltAlarm = 7.0 ;//鐢垫睜鐢靛帇鎶ヨ鍊�(澶т簬0.1)
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_39, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_39, comVo, null)) ;
     }
 
     private BaseResponse cd69(){
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_69, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_69, null, null)) ;
     }
 
     private BaseResponse cd3A(){
         Com3AVo comVo = new Com3AVo() ;
         comVo.current = 1.0 ;//闃�闂ㄥ牭杞數娴�(澶т簬0)
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3A, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_3A, comVo, null)) ;
     }
 
     private BaseResponse cd6A(){
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_6A, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_6A, null, null)) ;
     }
 
     private BaseResponse cd3B(){
         Com3BVo comVo = new Com3BVo() ;
         comVo.second = 120 ;//闃�闂ㄨ秴鏃舵椂闂�(绉�)(澶т簬1)
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3B, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_3B, comVo, null)) ;
     }
 
     private BaseResponse cd6B(){
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_6B, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_6B, null, null)) ;
     }
 
     private BaseResponse cd3C(){
         Com3CVo comVo = new Com3CVo() ;
         comVo.minute = 5 ;
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3C, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_3C, comVo, null)) ;
     }
 
     private BaseResponse cd65(){
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_65, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_65, null, null)) ;
     }
 
     private BaseResponse<String> cd91() {
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_91, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_91, null, null)) ;
     }
 
     private BaseResponse cd92(){
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_92, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_92, null, null)) ;
     }
 
     private BaseResponse cd93(){
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_93, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_93, null, null)) ;
     }
 
     //APP杩滅▼寮�闃�
@@ -187,13 +199,13 @@
         comVo.icCardNo = CommandP206V1_0_0Ctrl.vsIcCardNo;
         comVo.moneyRemain = 234.56 ;
         comVo.waterPrice = 1.2 ;
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_97, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_97, comVo, null)) ;
     }
     //APP杩滅▼鍏抽榾
     private BaseResponse cd98(){
         Com98Vo comVo = new Com98Vo() ;
         comVo.icCardNo = CommandP206V1_0_0Ctrl.vsIcCardNo;
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_98, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_98, comVo, null)) ;
     }
 
     //瀹氭椂鍏抽榾寮�闃�
@@ -203,7 +215,7 @@
         comVo.moneyRemain = 234.56 ;
         comVo.waterPrice = 1.2 ;
         comVo.minutes = 3 ;
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_99, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_99, comVo, null)) ;
     }
 
     //瀹氶噺鍏抽榾寮�闃�
@@ -213,7 +225,7 @@
         comVo.moneyRemain = 234.56 ;
         comVo.waterPrice = 1.2 ;
         comVo.waterAmount = 10 ;
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_A0, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_A0, comVo, null)) ;
     }
 
 
@@ -231,7 +243,7 @@
         comVo.day = nextDt[2] ;
         comVo.hour = nextDt[3] ;
         comVo.minute = nextDt[4] ;
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_A1, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_A1, comVo, null)) ;
     }
 
     //瀹氶噺鍏抽榾璁″垝寮�闃�
@@ -248,12 +260,12 @@
         comVo.day = nextDt[2] ;
         comVo.hour = nextDt[3] ;
         comVo.minute = nextDt[4] ;
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_A2, comVo, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_A2, comVo, null)) ;
     }
 
 
     private BaseResponse cdB0(){
-        return this.sendCom2Mw(this.command(CodeV1_0_1.cd_B0, null, null)) ;
+        return this.sendCom2Mw(this.commandOuter(CodeV1_0_1.cd_B0, null, null)) ;
     }
 
     //鍦ㄧ嚎鎯呭喌
diff --git "a/pipIrr-platform/\346\226\207\346\241\243/MybatisCodeHelper\346\217\222\344\273\266\350\264\255\344\271\260.docx" "b/pipIrr-platform/\346\226\207\346\241\243/MybatisCodeHelper\346\217\222\344\273\266\350\264\255\344\271\260.docx"
index ae83815..2ea5fe4 100644
--- "a/pipIrr-platform/\346\226\207\346\241\243/MybatisCodeHelper\346\217\222\344\273\266\350\264\255\344\271\260.docx"
+++ "b/pipIrr-platform/\346\226\207\346\241\243/MybatisCodeHelper\346\217\222\344\273\266\350\264\255\344\271\260.docx"
Binary files differ

--
Gitblit v1.8.0