From 107ef10e9309dd299e8983232dbec5beacecb06d Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期四, 28 十一月 2024 15:14:19 +0800
Subject: [PATCH] 获取任务类型列表接口,获取工单列表接口返回值增加处理结果ID字段
---
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java | 44 ++++++++++++++++++++++++++++++--------------
1 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java
index 68d6305..b19ea75 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java
@@ -13,6 +13,7 @@
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
/**
* @Author: liurunyu
@@ -136,8 +137,7 @@
//rtu涓嶅湪鍗囩骇涔嬪垪
return ;
}
- }
- if(ugRtu != null){
+ }else{
if(ugRtu.isOver){
//褰撳墠RTU宸茬粡鍗囩骇瀹屾垚锛屾棤闇�鍐嶅崌绾�
return;
@@ -173,9 +173,6 @@
ugRtu.trigger(code, protocolName, protocolVersion, this.softFileDataGrp, callbackCom) ;
}
}
- }else{
- //rtu涓嶅湪鍗囩骇涔嬪垪
- return ;
}
}
}
@@ -202,10 +199,10 @@
if(this.taskVo.rtuAddrList != null && this.taskVo.rtuAddrList.size() > 0){
state.rtuTotal = this.taskVo.rtuAddrList.size() ;
if(this.upgradeRtus != null && this.upgradeRtus.size() > 0){
- Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
- for(UpgradeRtu info : col){
+ AtomicBoolean hasRunning = new AtomicBoolean(false);
+ 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){
@@ -216,11 +213,22 @@
state.failOneTotal++;
state.failTotal++;
}else if(info.state == UpgradeRtu.STATE_FAIL) {
+ state.failMultiTotal++;
state.failTotal++;
+ }else if(info.state == UpgradeRtu.STATE_FAILOFFLINE) {
+ state.failTotal++;
+ state.failOffTotal++;
}
if(info.isOver){
state.overTotal++;
+ }else{
+ hasRunning.set(true);
}
+ });
+ if(!hasRunning.get()){
+ state.allOver = true ;
+ }else{
+ state.allOver = false ;
}
}
}
@@ -264,14 +272,16 @@
}
///////////////////////////////////////////////////////////
- //浠ヤ笅鏂规硶涓哄唴閮ㄦ湇鍔★紝涓嶅澶栨彁渚涙湇鍔�
+ //
+ // 浠ヤ笅鏂规硶涓哄唴閮ㄦ湇鍔★紝涓嶅澶栨彁渚涙湇鍔�
+ //
///////////////////////////////////////////////////////////
/**
* 鍒ゆ柇鏄惁娌$敤浠讳綍涓�涓猂TU杩涜杩囧崌绾э紝鑰屼笖瓒呰繃浜嗘椂闄�
* @return -1:鏃犱竴RTU鍗囩骇涓旇秴鏃讹紝0锛氭棤RTU鍗囩骇浣嗘湭瓒呮椂绛夊緟锛�1鏈塕TU鍗囩骇姝e父鎵ц
*/
- protected int countNoOneRtuUpgrade(){
+ protected int countNoOneRtuUpgradeInDuration(){
if(this.upgradeRtus == null || upgradeRtus.size() == 0){
//褰撳墠娌℃湁浠讳綍涓�涓澶囪繘琛岃繃鍗囩骇
Long now = System.currentTimeMillis() ;
@@ -297,7 +307,7 @@
/**
* 缁熻褰撳墠姝e湪鍗囩骇鐨凴TU鏁伴噺锛屼负鍚屾椂鍗囩骇鏁伴噺闄愬埗鍋氬噯澶�
*/
- protected void statisticsRunningRtuCount(){
+ protected void countRunningRtuCount(){
int runningTotal = 0 ;
Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
for(UpgradeRtu info : col){
@@ -309,28 +319,34 @@
}
/**
- * 缁熻闇�瑕佸崌绾т絾褰撳墠绂荤嚎RTU鐨勬儏鍐�
+ * 缁熻闇�瑕佸崌绾т絾褰撳墠绂荤嚎RTU鐨勬儏鍐碉紝瓒呰繃鏃堕檺鐨勮澶囦负鍗囩骇瀹屾垚
+ * @return -1:娌℃湁瓒呮椂锛�0瓒呮椂浜嗕笖鏃犲洜绂荤嚎琚己鍒惰缃崌绾у畬鎴愮殑RTU锛�>0绂荤嚎琚己鍒惰缃崌绾у畬鎴愮殑RTU鏁伴噺
*/
- protected void statisticsOffRtuCountAndSet() {
+ 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 ;
}
}
/**
* 缁熻鏄惁鍗囩骇鍏ㄩ儴缁撴潫
*/
- protected boolean statisticsIsAllOver() {
+ protected boolean countIsAllOver() {
if (this.taskVo.rtuAddrList != null && this.taskVo.rtuAddrList.size() > 0) {
Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
for(UpgradeRtu info : col){
--
Gitblit v1.8.0