From e6f64dc1c6a24c3f6f38fcb312ed45aa9d57b68f Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期五, 01 十一月 2024 11:34:01 +0800
Subject: [PATCH] 2024-11-01 虚拟卡常用充值金额实现自动初始化
---
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java | 48 ++++++++++++++++++++++++
pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml | 24 ++++++++++++
2 files changed, 72 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml b/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml
index ad90287..4d44115 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml
@@ -49,6 +49,14 @@
<item7 defaultValue = "50" unit = "3" sort = "3" type = "2"/>
<item8 defaultValue = "80" unit = "3" sort = "4" type = "2"/>
</irrigateProfile>
+ <rechargeProfile>
+ <item1 rechargeAmount = "5000" sort = "1"/>
+ <item2 rechargeAmount = "10000" sort = "2" />
+ <item3 rechargeAmount = "20000" sort = "3"/>
+ <item4 rechargeAmount = "30000" sort = "4"/>
+ <item5 rechargeAmount = "50000" sort = "5"/>
+ <item6 rechargeAmount = "100000" sort = "6"/>
+ </rechargeProfile>
</org1>
<org2 tag="sp" name="娌欑洏" enable="true">
<districts>
@@ -97,6 +105,14 @@
<item7 defaultValue = "50" unit = "3" sort = "3" type = "2"/>
<item8 defaultValue = "80" unit = "3" sort = "4" type = "2"/>
</irrigateProfile>
+ <rechargeProfile>
+ <item1 rechargeAmount = "5000" sort = "1"/>
+ <item2 rechargeAmount = "10000" sort = "2" />
+ <item3 rechargeAmount = "20000" sort = "3"/>
+ <item4 rechargeAmount = "30000" sort = "4"/>
+ <item5 rechargeAmount = "50000" sort = "5"/>
+ <item6 rechargeAmount = "100000" sort = "6"/>
+ </rechargeProfile>
</org2>
<org3 tag="test" name="娴嬭瘯" enable="true">
<districts>
@@ -145,6 +161,14 @@
<item7 defaultValue = "50" unit = "3" sort = "3" type = "2"/>
<item8 defaultValue = "80" unit = "3" sort = "4" type = "2"/>
</irrigateProfile>
+ <rechargeProfile>
+ <item1 rechargeAmount = "5000" sort = "1"/>
+ <item2 rechargeAmount = "10000" sort = "2" />
+ <item3 rechargeAmount = "20000" sort = "3"/>
+ <item4 rechargeAmount = "30000" sort = "4"/>
+ <item5 rechargeAmount = "50000" sort = "5"/>
+ <item6 rechargeAmount = "100000" sort = "6"/>
+ </rechargeProfile>
</org3>
</orgs>
</config>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java
index eaf3213..095b9fa 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java
@@ -9,11 +9,13 @@
import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
import com.dy.pipIrrGlobal.daoRm.RmIrrigateProfileMapper;
import com.dy.pipIrrGlobal.daoSe.SePaymentMethodMapper;
+import com.dy.pipIrrGlobal.daoSe.SeRechargeProfileMapper;
import com.dy.pipIrrGlobal.daoSe.SeWaterTypeMapper;
import com.dy.pipIrrGlobal.pojoBa.*;
import com.dy.pipIrrGlobal.pojoPr.PrWaterPrice;
import com.dy.pipIrrGlobal.pojoRm.RmIrrigateProfile;
import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod;
+import com.dy.pipIrrGlobal.pojoSe.SeRechargeProfile;
import com.dy.pipIrrGlobal.pojoSe.SeWaterType;
import com.dy.pipIrrGlobal.util.DistrictLevel;
import org.jdom2.Document;
@@ -44,6 +46,7 @@
private PrWaterPriceMapper prWaterPriceDao;
private BaDictMapper baDictDao;
private BaDictItemMapper baDictItemDao;
+ private SeRechargeProfileMapper seRechargeProfileDao;
@Autowired
public void setResourceLoader(ResourceLoader resourceLoader){
@@ -93,6 +96,11 @@
@Autowired
public void setBaDictItemDao(BaDictItemMapper baDictItemDao) {
this.baDictItemDao = baDictItemDao;
+ }
+
+ @Autowired
+ public void setSeRechargeProfileDao(SeRechargeProfileMapper seRechargeProfileDao) {
+ this.seRechargeProfileDao = seRechargeProfileDao;
}
/**
@@ -205,6 +213,21 @@
}
}
}
+
+ if(!this.existRechargeProfile()){
+ if(configXml.existElement(doc, "config.orgs.org" + num + ".rechargeProfile")){
+ for(int i = 1 ; i < 10000; i++){
+ if(configXml.existElement(doc, "config.orgs.org" + num + ".rechargeProfile.item" + i)){
+ String rechargeAmount = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".rechargeProfile.item" + i,"rechargeAmount", null, false, null) ;
+ String sort = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".rechargeProfile.item" + i,"sort", null, false, null) ;
+ this.saveRechargeProfile(orgTag, rechargeAmount, sort);
+ }else{
+ break ;
+ }
+ }
+ }
+ }
+
if(!this.existWaterTypes()){
if(configXml.existElement(doc, "config.orgs.org" + num + ".waterTypes")){
for(int i = 1 ; i < 10000; i++){
@@ -305,6 +328,15 @@
private boolean existIrrigateProfile(){
Long total = this.rmIrrigateProfileDao.selectCount(null) ;
return (total != null && total > 0) ;
+ }
+
+ /**
+ * 鏁版嵁搴撲腑鏄惁瀛樺湪铏氭嫙甯哥敤鍏呭�奸噾棰濋厤缃�
+ * @return
+ */
+ private boolean existRechargeProfile() {
+ Long total = this.seRechargeProfileDao.selectCount(null);
+ return (total != null && total > 0);
}
/**
@@ -446,6 +478,22 @@
}
/**
+ * 淇濆瓨铏氭嫙鍗″父鐢ㄥ厖鍊奸噾棰濋厤缃�
+ * @param orgTag
+ * @param recharge_amount
+ * @param sort
+ */
+ private void saveRechargeProfile(String orgTag, String recharge_amount, String sort) {
+ if((recharge_amount != null && !recharge_amount.trim().equals("")) && (sort != null && !sort.trim().equals(""))) {
+ SeRechargeProfile po = new SeRechargeProfile();
+ po.setRechargeAmount(Integer.parseInt(recharge_amount));
+ po.setSort(Integer.parseInt(sort));
+ this.seRechargeProfileDao.insert(po);
+
+ }
+ }
+
+ /**
* 淇濆瓨姘翠环
* @param price
*/
--
Gitblit v1.8.0