|  |  |  | 
|---|
|  |  |  | //rtu不在升级之列 | 
|---|
|  |  |  | return ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(ugRtu != null){ | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | if(ugRtu.isOver){ | 
|---|
|  |  |  | //当前RTU已经升级完成,无需再升级 | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | 
|---|
|  |  |  | ugRtu.trigger(code, protocolName, protocolVersion, this.softFileDataGrp, callbackCom) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | //rtu不在升级之列 | 
|---|
|  |  |  | return ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | state.rtuTotal = this.taskVo.rtuAddrList.size() ; | 
|---|
|  |  |  | if(this.upgradeRtus != null && this.upgradeRtus.size() > 0){ | 
|---|
|  |  |  | AtomicBoolean hasRunning = new AtomicBoolean(false); | 
|---|
|  |  |  | this.upgradeRtus.values().stream().forEach(info ->{ | 
|---|
|  |  |  | this.upgradeRtus.values().forEach(info ->{ | 
|---|
|  |  |  | if(info.state == UpgradeRtu.STATE_OFFLINE){ | 
|---|
|  |  |  | state.offLineTotal ++ ; | 
|---|
|  |  |  | state.offLineTotal++ ; | 
|---|
|  |  |  | }else if(info.state == UpgradeRtu.STATE_UNSTART){ | 
|---|
|  |  |  | state.unStartTotal ++ ; | 
|---|
|  |  |  | }else if(info.state == UpgradeRtu.STATE_RUNNING){ | 
|---|
|  |  |  | state.runningTotal ++ ; | 
|---|
|  |  |  | }else if(info.state == UpgradeRtu.STATE_SUCCESS) { | 
|---|
|  |  |  | state.successTotal++; | 
|---|
|  |  |  | }else if(info.state == UpgradeRtu.STATE_FAIL) { | 
|---|
|  |  |  | state.failTotal++; | 
|---|
|  |  |  | }else if(info.state == UpgradeRtu.STATE_FAILONE) { | 
|---|
|  |  |  | state.failOneTotal++; | 
|---|
|  |  |  | state.failTotal++; | 
|---|
|  |  |  | }else if(info.state == UpgradeRtu.STATE_FAIL) { | 
|---|
|  |  |  | state.failMultiTotal++; | 
|---|
|  |  |  | state.failTotal++; | 
|---|
|  |  |  | }else if(info.state == UpgradeRtu.STATE_FAILOFFLINE) { | 
|---|
|  |  |  | state.failTotal++; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /////////////////////////////////////////////////////////// | 
|---|
|  |  |  | //以下方法为内部服务,不对外提供服务 | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //   以下方法为内部服务,不对外提供服务 | 
|---|
|  |  |  | // | 
|---|
|  |  |  | /////////////////////////////////////////////////////////// | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 统计需要升级但当前离线RTU的情况,超过时限的设备为升级完成 | 
|---|
|  |  |  | * @return -1:没有超时,0超时了且无因离线被强制设置升级完成的RTU,>0离线被强制设置升级完成的RTU数量 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | protected void countOffRtuAndSetIfOver() { | 
|---|
|  |  |  | protected int countOffRtuAndSetIfOver() { | 
|---|
|  |  |  | Long now = System.currentTimeMillis() ; | 
|---|
|  |  |  | if(now - this.setupDtLong > UpgradeUnit.confVo.rtuOffLineWaitDuration){ | 
|---|
|  |  |  | //rtu离线,等待其升级的时长(毫秒),超过配置的最大时长,设置其升级失败,且设置升级任务完成 | 
|---|
|  |  |  | int count = 0 ; | 
|---|
|  |  |  | if (this.taskVo.rtuAddrList != null && this.taskVo.rtuAddrList.size() > 0) { | 
|---|
|  |  |  | Collection<UpgradeRtu> col = this.upgradeRtus.values() ; | 
|---|
|  |  |  | for(UpgradeRtu info : col){ | 
|---|
|  |  |  | if(info.state == UpgradeRtu.STATE_OFFLINE){ | 
|---|
|  |  |  | info.isOver = true ; | 
|---|
|  |  |  | info.state = UpgradeRtu.STATE_FAILOFFLINE ; | 
|---|
|  |  |  | count ++ ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return count ; | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return -1 ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|