From f375859f0f6207b54b4dafa9a46079a6864e9a3c Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 11 六月 2024 11:06:42 +0800
Subject: [PATCH] 1、启动开关阀上行数据的数据库存储; 2、增加系统部署记录“文档/各系统部署/嘉峪关.txt”。

---
 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/MyThreadJob.java |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/MyThreadJob.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/MyThreadJob.java
index 7575093..0f58f3e 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/MyThreadJob.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/MyThreadJob.java
@@ -39,18 +39,24 @@
 
     @Override
     public void execute() throws Exception {
-        if(session != null){
-            if(sendTimes <= ServerProperties.sendTimes){
-                log.info("RTU" + rtuAddr + "寮�濮嬩换鍔�");
-                log.info("RTU" + rtuAddr + "灏嗚鎵ц" + ServerProperties.sendTimes + "杞浠诲姟锛屽綋鍓嶈疆娆℃槸" + sendTimes);
-                sendDataOfP206V1_0_0() ;
-            }else{
-                log.info("RTU" + rtuAddr + "绛夊緟涓�浼氾紝浠ユ帴鏀堕�氫俊涓棿浠朵笅琛屾暟鎹�");
-                if(overStart == 0){
-                    overStart = System.currentTimeMillis() ;
+        if(!this.isOver){
+            if(session != null){
+                if(sendTimes <= ServerProperties.sendTimes){
+                    log.info("RTU" + rtuAddr + "寮�濮嬩换鍔�");
+                    log.info("RTU" + rtuAddr + "灏嗚鎵ц" + ServerProperties.sendTimes + "杞浠诲姟锛屽綋鍓嶈疆娆℃槸" + sendTimes);
+                    sendDataOfP206V1_0_0() ;
                 }else{
-                    long now = System.currentTimeMillis() ;
-                    if(now - overStart >= 30 * 1000){
+                    if(ServerProperties.sendOverThenCloseConnect == 1){
+                        log.info("RTU" + rtuAddr + "绛夊緟涓�浼氾紝浠ユ帴鏀堕�氫俊涓棿浠朵笅琛屾暟鎹�");
+                        if(overStart == 0){
+                            overStart = System.currentTimeMillis() ;
+                        }else{
+                            long now = System.currentTimeMillis() ;
+                            if(now - overStart >= 30 * 1000){
+                                this.jobOver() ;
+                            }
+                        }
+                    }else{
                         this.jobOver() ;
                     }
                 }
@@ -95,7 +101,9 @@
     }
 
     private void jobOver(){
-        session.closeOnFlush() ;
+        if(ServerProperties.sendOverThenCloseConnect == 1){
+            session.closeOnFlush() ;
+        }
         this.isOver = true ;
         TcpClUnit.clientOver() ;
     }

--
Gitblit v1.8.0