From f16c96a3bbd126dca21b254ceb018a0558f5ea1d Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 25 十月 2024 13:57:24 +0800
Subject: [PATCH] “开关阀卡”修改成“巡检卡”

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java |   40 ++++++++++++++++++----------------------
 1 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java
index 4725c66..30864ee 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java
@@ -13,15 +13,14 @@
 
 public class PrefixedDataAvailableHandleImp implements PrefixedDataAvailableHandle {
 	
-	private static Logger log = LogManager.getLogger(PrefixedDataAvailableHandleImp.class) ;
+	private static final Logger log = LogManager.getLogger(PrefixedDataAvailableHandleImp.class) ;
 	
 
 	/**
 	 * 鍦ㄥ绾跨▼鐜涓繍琛�
 	 * 鍒嗘瀽涓婄嚎鏁版嵁(缃戠粶杩炴帴鍚庣涓�鍖呮暟鎹�)鏄惁鍙幏寰�
-	 * @param in
-	 * @return
-	 * @throws Exception
+	 * @param in IoBuffer
+	 * @return PrefixedDataAvailableStatus
 	 */
 	public PrefixedDataAvailableStatus forOnLine(IoBuffer in){
     	int remain = in.remaining() ;
@@ -31,18 +30,18 @@
     		try{
     			PrefixedDataAvailableStatus pds = null ;
     			
-    			HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCach.getPrefixedDataAvailableMap() ;
+    			HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCache.getPrefixedDataAvailableMap() ;
     			Collection<AnnotationPrefixedDataAvailableVo> set = prefixedDataAvailableMap.values() ;
-    			if(set == null || set.size() == 0){
+    			if(set.size() == 0){
     				throw new Exception("涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ユ椂锛屽緱鍒扮殑鍗忚瀹屾暣鎬ф鏌ョ被闆嗗悎涓虹┖銆�") ;
     			}
-    			int prority = ProtocolConstant.firstPriority ;
+    			int priority = ProtocolConstant.firstPriority ;
 
 	    		while(true){
-	    			Object[] objs = this.getClassObjAndAnnotationVo(prority, set) ;
+	    			Object[] objs = this.getClassObjAndAnnotationVo(priority, set) ;
 	    			PrefixedDataAvailable pda = (PrefixedDataAvailable)objs[0] ;
-	    			if(pda == null && prority == ProtocolConstant.firstPriority){
-	    				throw new Exception("涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ユ椂锛屾湭寰楀埌浼樺厛绾т负" + prority + "涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ョ被锛�") ;
+	    			if(pda == null && priority == ProtocolConstant.firstPriority){
+	    				throw new Exception("涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ユ椂锛屾湭寰楀埌浼樺厛绾т负" + priority + "涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ョ被锛�") ;
 	    			}else if(pda == null){
 	    				//璇存槑涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ョ被闆嗗悎宸茬粡閬嶅巻瀹屼簡銆�
 	    				break ;
@@ -54,7 +53,7 @@
 	    			if(pds == null){
 						//璇存槑涓嶆槸瀵瑰簲鐨勫崗璁暟鎹紝闇�瑕佸彟澶栫殑鍗忚鏉ュ鐞嗕笂绾�
 						//寰幆缁х画
-						prority++ ;
+						priority++ ;
 					}else{
 						//鍋滄寰幆锛岃繑鍥炵粨鏋�
 						break ;
@@ -80,11 +79,8 @@
 	/**
 	 * 鍦ㄥ绾跨▼鐜涓繍琛�
 	 * 鍒嗘瀽涓婅鏁版嵁(缃戠粶杩炴帴鍚庣浜�(鍖呭惈)鍖呬互鍚庢暟鎹�)鏄惁鍙幏寰�
-	 * @param in
-	 * @param clientProtocol
-	 * @param maxDataLength
-	 * @return
-	 * @throws Exception
+	 * @param in IoBuffer
+	 * @return PrefixedDataAvailableStatus
 	 */
 	public PrefixedDataAvailableStatus forUpData(IoBuffer in){
 		int remain = in.remaining() ;
@@ -94,9 +90,9 @@
     		try{
    			PrefixedDataAvailableStatus pds = null ;
     			
-    			HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCach.getPrefixedDataAvailableMap() ;
+    			HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCache.getPrefixedDataAvailableMap() ;
     			Collection<AnnotationPrefixedDataAvailableVo> set = prefixedDataAvailableMap.values() ;
-    			if(set == null || set.size() == 0){
+    			if(set.size() == 0){
     				throw new Exception("涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ユ椂锛屽緱鍒扮殑鍗忚闆嗗悎涓虹┖銆�") ;
     			}
     			int prority = ProtocolConstant.firstPriority ;
@@ -144,10 +140,10 @@
 
 	/**
 	 * 寰楀埌澶勭悊绫诲璞�
-	 * @param prority
-	 * @param set
-	 * @return
-	 * @throws Exception
+	 * @param prority 浼樺厛绾�
+	 * @param set 闆嗗悎
+	 * @return Object[]
+	 * @throws Exception 寮傚父
 	 */
 	private Object[] getClassObjAndAnnotationVo(int prority, Collection<AnnotationPrefixedDataAvailableVo> set) throws Exception{
 		PrefixedDataAvailable obj = null ;

--
Gitblit v1.8.0