From e542047aab71e433928cc0a51758d4847632c6c5 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 05 十二月 2024 15:24:27 +0800
Subject: [PATCH] 调整RTU状态查询中显示的内容(去掉一些内容不序列化成json)
---
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java | 53 ++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java
index 42d96ad..bd52b71 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java
@@ -27,6 +27,8 @@
private Integer failTryTimes ;//鍗囩骇澶辫触鍚庯紝閲嶆柊鍋胯瘯鍗囩骇娆℃暟锛�0琛ㄧず涓嶉噸鏂板伩璇曞崌绾�
private Integer ugMaxRtuSameTime ;//鍚屾椂鍗囩骇RTU鏈�澶т釜鏁�
+ private Integer notifyTimesAfterOver; //鍗囩骇缁撴潫鍚庯紝鍐嶅悜web鏈嶅姟绯荤粺閫氱煡鐘舵�佺殑娆℃暟
+ private int nowNotifyTimesAfterOver; //鍗囩骇缁撴潫鍚庯紝鍐嶅悜web鏈嶅姟绯荤粺閫氱煡鐘舵�佺殑娆℃暟
private UpgradeTask task ;//鍗囩骇浠诲姟
private boolean monitorFirst = true ;//鏄惁鏄涓�娆$洃瑙�
@@ -45,6 +47,7 @@
public void initOption(UpgradeUnitConfigVo configVo) {
this.failTryTimes = configVo.failTryTimes;
this.ugMaxRtuSameTime = configVo.ugMaxRtuAtOnce;
+ this.notifyTimesAfterOver = configVo.notifyTimesAfterOver;
}
/**
@@ -64,6 +67,7 @@
this.task = new UpgradeTask();
this.task.initOption(this.failTryTimes, this.ugMaxRtuSameTime);
this.task.setTask(vo);
+ this.nowNotifyTimesAfterOver = 0 ;
log.info("======================================================") ;
log.info("= =") ;
log.info("=璁剧疆浜嗗崌绾т换鍔★紝娑夊強RTU" + vo.rtuAddrList.size() + "鍙� =") ;
@@ -92,11 +96,10 @@
if(this.task != null){
this.task.countRunningRtuCount();
if(this.task.curUgRunningRtuTotal > 0){
- return "褰撳墠瀛樺湪鍗囩骇涓殑璁惧锛屼笉鑳藉仠姝㈠崌绾т换鍔�" ;
+ return "褰撳墠瀛樺湪鍗囩骇涓殑璁惧锛屼笉鑳界粨鏉熷崌绾т换鍔�" ;
}else{
this.stop();
this.task.forceOver();
- this.task = null ;
return null ;
}
}else{
@@ -192,6 +195,7 @@
this.stop() ;
}else{
if(!this.task.taskIsOver){
+ this.nowNotifyTimesAfterOver = 0 ;
//鍗囩骇浠诲姟鏈畬鎴�
//宸ヤ綔1锛氬垽鏂槸鍚︽棤浠讳綍涓�涓猂TU杩涜杩囧崌绾э紝骞朵笖杈惧埌鏃堕檺锛屽垯璁や负褰撳墠鍗囩骇浠诲姟瀹屾垚
//-1:鏃犱竴RTU鍗囩骇涓旇秴鏃讹紝0锛氭棤RTU鍗囩骇浣嗘湭瓒呮椂绛夊緟锛�1鏈塕TU鍗囩骇姝e父鎵ц
@@ -209,27 +213,44 @@
}else if(temp == 1){
//褰撳墠鏈塕TU杩涜杩囧崌绾�
//宸ヤ綔2锛氱粺璁″綋鍓嶆鍦ㄥ崌绾х殑RTU鏁伴噺锛屼负鍚屾椂鍗囩骇鏁伴噺闄愬埗鍋氬噯澶�
- this.task.countRunningRtuCount() ;
+ temp = this.task.countRunningRtuCount() ;
+ if(temp > 0){
+ //璇村墠褰撳墠杩樻湁鍗囩骇涓殑RTU
+ }
//宸ヤ綔3锛氱粺璁¢渶瑕佸崌绾т絾褰撳墠绂荤嚎RTU鐨勬儏鍐碉紝瓒呰繃鏃堕檺鐨勮缃负鍗囩骇瀹屾垚
int tmp = this.task.countOffRtuAndSetIfOver() ;
if(tmp >= 1){
- //瓒呮椂锛屽己鍒惰缃竴浜汻TU鍗囩骇澶辫触骞朵笖鍗囩骇瀹屾垚锛�
+ //瓒呮椂锛屽己鍒惰缃竴浜汻TU鍗囩骇澶辫触骞朵笖鍗囩骇瀹屾垚
log.info("======================================================") ;
log.info("= =") ;
log.info("=鍥犵绾胯秴鏃讹紝寮哄埗璁剧疆" + tmp + "鍙癛TU鍗囩骇澶辫触骞朵笖鍗囩骇瀹屾垚 =") ;
log.info("= =") ;
log.info("======================================================") ;
}else if(tmp == 0){
+ /*
log.info("======================================================") ;
log.info("= =") ;
log.info("=绂荤嚎瓒呮椂锛屼絾鏃犱竴鍙癛TU鍥犵绾胯�岃璁剧疆鎴愬崌绾уけ璐ュ苟涓斿崌绾у畬鎴� =") ;
log.info("= =") ;
log.info("======================================================") ;
+ */
}else{//tmp = -1
//鏃犱换鍔¢�昏緫
}
- //宸ヤ綔4锛氱粺璁℃槸鍚﹀叏閮ㄥ崌绾у畬鎴�
+
+ //宸ヤ綔4锛氱粺璁¤繘琛屽崌绾ц繃绋嬭�屽悗鍙堝仠姝㈠崌绾э紝鍙戝憜涓�瀹氭椂闀跨殑璁惧
+ tmp = this.task.countRunningIdleRtuAndSetIfOver() ;
+ if(tmp >= 1){
+ //鍗囩骇鍙戝憜瓒呮椂锛屽己鍒惰缃竴浜汻TU鍗囩骇澶辫触骞朵笖鍗囩骇瀹屾垚
+ log.info("======================================================") ;
+ log.info("= =") ;
+ log.info("=鍥犲崌绾у彂鍛嗚秴鏃讹紝寮哄埗璁剧疆" + tmp + "鍙癛TU鍗囩骇澶辫触骞朵笖鍗囩骇瀹屾垚 =") ;
+ log.info("= =") ;
+ log.info("======================================================") ;
+ }
+
+ //宸ヤ綔5锛氱粺璁℃槸鍚﹀叏閮ㄥ崌绾у畬鎴�
this.task.taskIsOver = this.task.countIsAllOver() ;
if(this.task.taskIsOver){
log.info("==================================================") ;
@@ -248,24 +269,38 @@
this.task.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//浠诲姟瀹屾垚鏃堕棿(yyyy-mm-dd HH:MM:SS)
}
//浠诲姟瀹屾垚锛屾墽琛屾渶鍚庝竴娆″崌绾х姸鎬侀�氱煡
- //宸ヤ綔5锛氬崌绾х姸鎬侀�氱煡
+ //宸ヤ綔6锛氬崌绾х姸鎬侀�氱煡
//if(!first){
// this.notifyUpgradeStatus() ;
//}
}else{
//浠诲姟鏈畬鎴愶紝缁х画鎵ц鍗囩骇鐘舵�侀�氱煡
- //宸ヤ綔5锛� 鍗囩骇鐘舵�侀�氱煡
+ //宸ヤ綔6锛� 鍗囩骇鐘舵�侀�氱煡
//if(!first){
// this.notifyUpgradeStatus() ;
//}
}
- //宸ヤ綔5锛氬崌绾х姸鎬侀�氱煡
+ //宸ヤ綔6锛氬崌绾х姸鎬侀�氱煡
if(!this.monitorFirst){
this.notifyUpgradeStatus() ;
}
}else{
//浠诲姟宸茬粡瀹屾垚
- this.stop();
+ //宸ヤ綔6锛氫换鍔$粨鏉熷悗锛屾渶鍚庡彂鍗囩骇鐘舵�侀�氱煡
+ if(this.nowNotifyTimesAfterOver == 0){
+ this.nowNotifyTimesAfterOver++ ;
+ this.notifyUpgradeStatus() ;//蹇呴』閫氱煡涓�娆�
+ }else{
+ //鐒跺悗閲嶅閫氱煡
+ if(this.nowNotifyTimesAfterOver <= this.notifyTimesAfterOver){
+ //淇濊瘉涓婇潰蹇呴』閫氱煡涓�娆★紝閭f澶勪笂闈f涓氨寰楃敤<=
+ this.nowNotifyTimesAfterOver++ ;
+ this.notifyUpgradeStatus() ;
+ }else{
+ this.stop();
+ }
+ }
+
}
}
if(this.monitorFirst){
--
Gitblit v1.8.0