| | |
| | | import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper; |
| | | import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; |
| | | import com.dy.pipIrrGlobal.daoBa.BaUserMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmIrrigateProfileMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SePaymentMethodMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeWaterTypeMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaDistrict; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaSettings; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaUser; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrWaterPrice; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmIrrigateProfile; |
| | | import com.dy.pipIrrGlobal.pojoSe.SePaymentMethod; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeWaterType; |
| | |
| | | private BaSettingsMapper settingsDao ; |
| | | private SeWaterTypeMapper waterTypeDao ; |
| | | private RmIrrigateProfileMapper rmIrrigateProfileDao; |
| | | private PrWaterPriceMapper prWaterPriceDao; |
| | | |
| | | @Autowired |
| | | public void setResourceLoader(ResourceLoader resourceLoader){ |
| | |
| | | @Autowired |
| | | public void setRmIrrigateProfileDao(RmIrrigateProfileMapper rmIrrigateProfileDao) { |
| | | this.rmIrrigateProfileDao = rmIrrigateProfileDao; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setWaterPriceDao(PrWaterPriceMapper prWaterPriceDao) { |
| | | this.prWaterPriceDao = prWaterPriceDao; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } |
| | | if(!this.existWaterTypes()){ |
| | | if(configXml.existElement(doc, "config.orgs.org" + num + ".waterPrice")){ |
| | | String price = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".waterPrice","price", null, false, null) ; |
| | | this.saveWaterPrice(orgTag, price); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | break ; |
| | |
| | | * @return 存在否 |
| | | */ |
| | | private boolean existWaterTypes(){ |
| | | Long total = this.waterTypeDao.selectCount(null) ; |
| | | Long total = this.prWaterPriceDao.selectCount(null) ; |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | |
| | | */ |
| | | private boolean existIrrigateProfile(){ |
| | | Long total = this.rmIrrigateProfileDao.selectCount(null) ; |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | | /** |
| | | * 数据库中是否存在水价 |
| | | * @return |
| | | */ |
| | | private boolean existWaterPrice() { |
| | | Long total = this.prWaterPriceDao.selectCount(null); |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存水价 |
| | | * @param price |
| | | */ |
| | | private void saveWaterPrice(String orgTag, String price) { |
| | | if(price != null && !price.trim().equals("")) { |
| | | PrWaterPrice po = new PrWaterPrice(); |
| | | po.setPrice(Double.parseDouble(price)); |
| | | po.setDeleted((byte)0); |
| | | this.prWaterPriceDao.insert(po); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |