zhubaomin
2025-04-07 9fb370afff71f4d5659d8904e8751479280d5b48
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/TcpDownCommandObj.java
@@ -72,20 +72,25 @@
         return false ;
      }
      Long lastDownComTime = tcpSe.lastDownComTime ;
      boolean nowSend = false ;
      if(this.result.isQuickSend){
         //未收到命令结果,未达到最大发送次数,RTU在线,离上行数据时刻不近,当前是速发命令,满足发送命令条件,执行发送命令
         nowSend = true ;
      }else if(lastDownComTime == null){
         //未收到命令结果,未达到最大发送次数,RTU在线,离上行数据时刻不近,当前RTU上线以来未曾下发过命令,满足发送命令条件,执行发送命令
         nowSend = true ;
      }else if(this.result.isFastCom && now - lastDownComTime >= ServerProperties.fastCommandSendInterval){
         //未收到命令结果,未达到最大发送次数,RTU在线,离上行数据时刻不近,RTU上线以来曾下发过命令,当前命令是快速命令且超过命令下发间隔,满足发送命令条件,执行发送命令
         nowSend = true ;
      }else if(!this.result.isFastCom && now - lastDownComTime >= ServerProperties.commandSendInterval){
         //未收到命令结果,未达到最大发送次数,RTU在线,离上行数据时刻不近,RTU上线以来曾下发过命令,当前命令非快速命令,RTU下发命令间隔超过命令下发间隔,满足发送命令条件,执行发送命令
         nowSend = true ;
      if(this.result.countdown4Send > 0){
         this.result.countdown4Send -= 1 ;
      }else{
         Long lastDownComTime = tcpSe.lastDownComTime ;
         if(this.result.isQuickSend){
            //在命令构建时,只有在低功耗情况下,才会把isQuickSend付值为true
            //未收到命令结果,未达到最大发送次数,RTU在线,离上行数据时刻不近,当前是速发命令,满足发送命令条件,执行发送命令
            nowSend = true ;
         }else if(lastDownComTime == null){
            //未收到命令结果,未达到最大发送次数,RTU在线,离上行数据时刻不近,当前RTU上线以来未曾下发过命令,满足发送命令条件,执行发送命令
            nowSend = true ;
         }else if(this.result.isFastCom && (now - lastDownComTime) >= ServerProperties.fastCommandSendInterval){
            //未收到命令结果,未达到最大发送次数,RTU在线,离上行数据时刻不近,RTU上线以来曾下发过命令,当前命令是快速命令且超过命令下发间隔,满足发送命令条件,执行发送命令
            nowSend = true ;
         }else if(!this.result.isFastCom && (now - lastDownComTime) >= ServerProperties.commandSendInterval){
            //未收到命令结果,未达到最大发送次数,RTU在线,离上行数据时刻不近,RTU上线以来曾下发过命令,当前命令非快速命令,RTU下发命令间隔超过命令下发间隔,满足发送命令条件,执行发送命令
            nowSend = true ;
         }
      }
      if(nowSend){