From 12e9ce64c364deb7ea08ba82f8d72abf6e561fc2 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期一, 27 五月 2024 16:53:50 +0800
Subject: [PATCH] 田间灌溉项目管理 灌溉制度模块 修改查询流浪灌溉单元和已绑定灌溉单元接口返回id类型 作物分页查询增加返回备注字段
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java | 105 +++++++++++++++++++++++++++-------------------------
1 files changed, 55 insertions(+), 50 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java
index 2b3aa3a..3eea8c9 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java
@@ -75,14 +75,16 @@
if(clazz.isAnnotationPresent(AnnotationDriver.class)){
AnnotationDriver ann = clazz.getAnnotation(AnnotationDriver.class) ;
if(ann != null){
- protocolName = ann.name() ;
- if(!(protocolName.trim().equals(""))){
- if(driverMap.containsKey(protocolName)){
- throw new Exception("涓ラ噸閿欒锛屽崗璁┍鍔ㄥ悕绉�" + protocolName + "鍑虹幇浜嗛噸澶嶆敞瑙o紒") ;
+ if(ann.enable()){
+ protocolName = ann.name() ;
+ if(!(protocolName.trim().equals(""))){
+ if(driverMap.containsKey(protocolName)){
+ throw new Exception("涓ラ噸閿欒锛屽崗璁┍鍔ㄥ悕绉�" + protocolName + "鍑虹幇浜嗛噸澶嶆敞瑙o紒") ;
+ }
+ driverMap.put(protocolName, new AnnotationDriverVo(clazz)) ;
+ }else{
+ throw new Exception("涓ラ噸閿欒锛屽崗璁┍鍔ㄥ悕绉版敞瑙e�间负绌哄瓧绗︿覆") ;
}
- driverMap.put(protocolName, new AnnotationDriverVo(clazz)) ;
- }else{
- throw new Exception("涓ラ噸閿欒锛屽崗璁┍鍔ㄥ悕绉版敞瑙e�间负绌哄瓧绗︿覆") ;
}
}
}
@@ -91,61 +93,64 @@
if(clazz.isAnnotationPresent(AnnotationPrefixedDataAvailable.class)){
AnnotationPrefixedDataAvailable ann = clazz.getAnnotation(AnnotationPrefixedDataAvailable.class) ;
if(ann != null){
- protocolName = ann.protocolName() ;
- if(!(protocolName.trim().equals(""))){
- if(prefixedDataAvailableMap.containsKey(protocolName)){
- throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶅崗璁┍鍔�" + protocolName + "鍑虹幇浜嗛噸澶嶆敞瑙o紒") ;
+ if(ann.enable()){
+ protocolName = ann.protocolName() ;
+ if(!(protocolName.trim().equals(""))){
+ if(prefixedDataAvailableMap.containsKey(protocolName)){
+ throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶅崗璁┍鍔�" + protocolName + "鍑虹幇浜嗛噸澶嶆敞瑙o紒") ;
+ }
+ }else{
+ throw new Exception("涓ラ噸閿欒锛屼笂琛屾暟鎹畬鏁存�ф鏌ユ墍閰嶅崗璁┍鍔ㄦ敞瑙e�间负绌哄瓧绗︿覆") ;
}
- }else{
- throw new Exception("涓ラ噸閿欒锛屼笂琛屾暟鎹畬鏁存�ф鏌ユ墍閰嶅崗璁┍鍔ㄦ敞瑙e�间负绌哄瓧绗︿覆") ;
- }
- priority = ann.priority() ;
- if(priority == 0){
- throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶄紭鍏堢骇娉ㄨВ涓嶈兘涓�0") ;
- }
- if(isRepeatPrefixedDataAvailablePriority(priority, prefixedDataAvailableMap)){
- throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶄紭鍏堢骇娉ㄨВ(priority)鏁板��" + priority + "閲嶅") ;
- }
+ priority = ann.priority() ;
+ if(priority == 0){
+ throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶄紭鍏堢骇娉ㄨВ涓嶈兘涓�0") ;
+ }
+ if(isRepeatPrefixedDataAvailablePriority(priority, prefixedDataAvailableMap)){
+ throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶄紭鍏堢骇娉ㄨВ(priority)鏁板��" + priority + "閲嶅") ;
+ }
- onLineDataMinLength = ann.onLineDataMinLength() ;
- /*姘旇薄鍗忚涓�0
- if(onLineDataMinLength == 0){
- throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶄笂绾挎暟鎹渶灏忛暱搴︽敞瑙d笉鑳戒负0") ;
- }
- */
- headMinLength = ann.headMinLength() ;
- /*姘旇薄鍗忚涓�0
- if(headMinLength == 0){
- throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶄笂鎶ユ暟鎹殑澶撮儴鏈�灏忛暱搴︽敞瑙d笉鑳戒负0") ;
- }
- */
-
- prefixedDataAvailableMap.put(protocolName, new AnnotationPrefixedDataAvailableVo(clazz, protocolName, priority, onLineDataMinLength, headMinLength, ProtocolConstant.errorMaxLength)) ;
+ onLineDataMinLength = ann.onLineDataMinLength() ;
+ /*姘旇薄鍗忚涓�0
+ if(onLineDataMinLength == 0){
+ throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶄笂绾挎暟鎹渶灏忛暱搴︽敞瑙d笉鑳戒负0") ;
+ }
+ */
+ headMinLength = ann.headMinLength() ;
+ /*姘旇薄鍗忚涓�0
+ if(headMinLength == 0){
+ throw new Exception("涓ラ噸閿欒锛� 涓婅鏁版嵁瀹屾暣鎬ф鏌ユ墍閰嶄笂鎶ユ暟鎹殑澶撮儴鏈�灏忛暱搴︽敞瑙d笉鑳戒负0") ;
+ }
+ */
+ prefixedDataAvailableMap.put(protocolName, new AnnotationPrefixedDataAvailableVo(clazz, protocolName, priority, onLineDataMinLength, headMinLength, ProtocolConstant.errorMaxLength)) ;
+ }
}
}
if(clazz.isAnnotationPresent(AnnotationOnLine.class)){
AnnotationOnLine ann = clazz.getAnnotation(AnnotationOnLine.class) ;
if(ann != null){
- protocolName = ann.protocolName() ;
- if(!(protocolName.trim().equals(""))){
- if(onLineMap.containsKey(protocolName)){
- throw new Exception("涓ラ噸閿欒锛� 涓婄嚎鏁版嵁鍒嗘瀽鎵�閰嶅崗璁┍鍔�" + protocolName + "鍑虹幇浜嗛噸澶嶆敞瑙o紒") ;
+ if(ann.enable()){
+ protocolName = ann.protocolName() ;
+ if(!(protocolName.trim().equals(""))){
+ if(onLineMap.containsKey(protocolName)){
+ throw new Exception("涓ラ噸閿欒锛� 涓婄嚎鏁版嵁鍒嗘瀽鎵�閰嶅崗璁┍鍔�" + protocolName + "鍑虹幇浜嗛噸澶嶆敞瑙o紒") ;
+ }
+ }else{
+ throw new Exception("涓ラ噸閿欒锛屼笂绾挎暟鎹垎鏋愭墍閰嶅崗璁┍鍔ㄦ敞瑙e�间负绌哄瓧绗︿覆") ;
}
- }else{
- throw new Exception("涓ラ噸閿欒锛屼笂绾挎暟鎹垎鏋愭墍閰嶅崗璁┍鍔ㄦ敞瑙e�间负绌哄瓧绗︿覆") ;
- }
- priority = ann.priority() ;
- if(priority == 0){
- throw new Exception("涓ラ噸閿欒锛� 涓婄嚎鏁版嵁鍒嗘瀽鎵�閰嶄紭鍏堢骇娉ㄨВ涓嶈兘涓�0") ;
- }
- if(isRepeatOnLinePriority(priority, onLineMap)){
- throw new Exception("涓ラ噸閿欒锛� 涓婄嚎鏁版嵁鍒嗘瀽鎵�閰嶄紭鍏堢骇娉ㄨВ(priority)鏁板��" + priority + "閲嶅") ;
- }
+ priority = ann.priority() ;
+ if(priority == 0){
+ throw new Exception("涓ラ噸閿欒锛� 涓婄嚎鏁版嵁鍒嗘瀽鎵�閰嶄紭鍏堢骇娉ㄨВ涓嶈兘涓�0") ;
+ }
+ if(isRepeatOnLinePriority(priority, onLineMap)){
+ throw new Exception("涓ラ噸閿欒锛� 涓婄嚎鏁版嵁鍒嗘瀽鎵�閰嶄紭鍏堢骇娉ㄨВ(priority)鏁板��" + priority + "閲嶅") ;
+ }
- onLineMap.put(protocolName, new AnnotationOnLineVo(clazz, protocolName, priority)) ;
+ onLineMap.put(protocolName, new AnnotationOnLineVo(clazz, protocolName, priority)) ;
+ }
}
}
}
--
Gitblit v1.8.0