From dd15f7f00e9eda3b15bd956ff830ccbe78752a4f Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期一, 20 五月 2024 17:11:07 +0800
Subject: [PATCH] 田间灌溉项目管理 项目模块 解决分页问题、增加创建时间字段、解决地址ID不一致问题 灌溉单元模块 创建Ctrl SV mapper 实体类
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ConfigXml.java | 48 ++++++++++++++++++++++++++++++++++--------------
1 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ConfigXml.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ConfigXml.java
index 329b6e3..1b7f619 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ConfigXml.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ConfigXml.java
@@ -104,7 +104,27 @@
}
}
}
-
+
+ /**
+ * 妫�鏌ュ厓绱犳槸鍚﹀瓨鍦�
+ * @param doc doc瀵硅薄
+ * @param elementName 鍏冪礌鍚嶇О
+ * @return 杩斿洖缁撴灉 杩斿洖缁撴灉
+ */
+ public Element getElement(Document doc, String elementName){
+ if(doc == null){
+ return null ;
+ }
+ if(elementName == null){
+ return null ;
+ }
+ elementName = elementName.trim() ;
+ if(elementName.equals("")){
+ return null ;
+ }
+ return this.get_element(doc, elementName) ;
+ }
+
/**
* 妫�鏌ュ厓绱犳槸鍚﹀瓨鍦�
* @param doc doc瀵硅薄
@@ -121,8 +141,8 @@
elementName = elementName.trim() ;
if(elementName.equals("")){
return false ;
- }
- Element e = this.getElement(doc, elementName) ;
+ }
+ Element e = this.get_element(doc, elementName) ;
return e != null;
}
@@ -168,7 +188,7 @@
* @throws Exception 鎶涘嚭寮傚父
*/
public String getSetAttrTxt(Document doc, String elementName, String attrName, String attPropertyNameFix, Boolean canBlank, String setValue) throws Exception{
- Element e = this.checkAndGetElement(doc, elementName);
+ Element e = this.check_and_get_element(doc, elementName);
return this.getSetAttrTxt(e, attrName, attPropertyNameFix, canBlank, setValue) ;
}
@@ -204,7 +224,7 @@
* @throws Exception 鎶涘嚭寮傚父
*/
public Integer getSetAttrPlusInt(Document doc, String elementName, String attrName, String attPropertyNameFix, Integer min, Integer max, String setValue) throws Exception{
- Element e = this.checkAndGetElement(doc, elementName);
+ Element e = this.check_and_get_element(doc, elementName);
return this.getSetAttrPlusInt(e, attrName, attPropertyNameFix, min, max, setValue) ;
}
@@ -248,7 +268,7 @@
* @throws Exception 鎶涘嚭寮傚父
*/
public Integer getSetAttrInt(Document doc, String elementName, String attrName, String attPropertyNameFix, Integer min, Integer max, String setValue) throws Exception{
- Element e = this.checkAndGetElement(doc, elementName);
+ Element e = this.check_and_get_element(doc, elementName);
return this.getSetAttrInt(e, attrName, attPropertyNameFix, min, max, setValue) ;
}
@@ -291,7 +311,7 @@
* @throws Exception 鎶涘嚭寮傚父
*/
public Double getSetAttrPlusDouble(Document doc, String elementName, String attrName, String attPropertyNameFix, Double min, Double max, String setValue) throws Exception{
- Element e = this.checkAndGetElement(doc, elementName);
+ Element e = this.check_and_get_element(doc, elementName);
return this.getSetAttrPlusDouble(e, attrName, attPropertyNameFix, min, max, setValue) ;
}
@@ -335,7 +355,7 @@
* @throws Exception 鎶涘嚭寮傚父
*/
public Double getSetAttrDouble(Document doc, String elementName, String attrName, String attPropertyNameFix, Double min, Double max, String setValue) throws Exception{
- Element e = this.checkAndGetElement(doc, elementName);
+ Element e = this.check_and_get_element(doc, elementName);
return this.getSetAttrDouble(e, attrName, attPropertyNameFix, min, max, setValue) ;
}
@@ -371,7 +391,7 @@
* @param elementName 鍏冪礌鍚嶇О 鍏冪礌鍚嶏紝褰㈠"config.base.test"
* @return 杩斿洖缁撴灉
*/
- private Element getElement(Document doc, String elementName){
+ private Element get_element(Document doc, String elementName){
Element e = null ;
Element root ;
String nm ;
@@ -383,7 +403,7 @@
if(eNames.length == 1){
e = root ;
}else{
- e = this.getNextElement(root, eNames, 1) ;
+ e = this.get_next_element(root, eNames, 1) ;
}
}
}
@@ -397,7 +417,7 @@
* @param index 鏁扮粍涓嬫爣
* @return 杩斿洖缁撴灉
*/
- private Element getNextElement(Element base, String[] eNames, int index){
+ private Element get_next_element(Element base, String[] eNames, int index){
Element e = null ;
String nm ;
List<Element> list = base.getChildren() ;
@@ -408,7 +428,7 @@
if(eNames.length == index + 1){
e = el ;
}else{
- e = this.getNextElement(el, eNames, index + 1) ;
+ e = this.get_next_element(el, eNames, index + 1) ;
}
break ;
}
@@ -423,7 +443,7 @@
* @return 杩斿洖缁撴灉
* @throws Exception 鎶涘嚭寮傚父
*/
- private Element checkAndGetElement(Document doc, String elementName)throws Exception{
+ private Element check_and_get_element(Document doc, String elementName)throws Exception{
if(doc == null){
throw new Exception("閰嶇疆鏂囦欢鐨凞OM瀵硅薄涓虹┖!");
}
@@ -434,7 +454,7 @@
if(elementName.equals("")){
throw new Exception("鍏冪礌鍚嶄负绌�!");
}
- Element e = this.getElement(doc, elementName) ;
+ Element e = this.get_element(doc, elementName) ;
if(e == null){
throw new Exception("鏈緱鍒板悕绉颁负" + elementName + "鐨勫厓绱�!");
}
--
Gitblit v1.8.0