作者:阿凡达0205 | 来源:互联网 | 2024-11-21 16:25
publicclassBindActionextendsActionSupport{privateStringproString;privateStringcitString;
public class BindAction extends ActionSupport{ private String proString; private String citString; private String areString; private String bankString; private String proId; private String citId; private String areId; private LoanInfoService loanInfoService; public String bindPro(){ Listlist=this.loanInfoService.getProlist(); if(list.size()>0){ StringBuilder sb= new StringBuilder(); int size=list.size(); sb.append("["); for (TDictProvince pro : list) { size--; sb.append("{provinceid:/"");//此处小红叉 sb.append(pro.getProvinceid()); sb.append("/",provincename:/""); sb.append(pro.getProvincename()); sb.append("/"}"); if(size>0){ sb.append(","); } } sb.append("]"); proString=sb.toString(); return SUCCESS; } public String bindCit() { Listlist=this.loanInfoService.getCitylistByProId(proId); if(list.size()>0){ StringBuilder sb= new StringBuilder(); int size=list.size(); sb.append("["); for (TDictCity pro : list) { size--; sb.append("{cityid:/"");//此处小红叉 sb.append(pro.getCityid()); sb.append("/",cityname:/""); sb.append(pro.getCityname()); sb.append("/"}"); if(size>0){ sb.append(","); } } sb.append("]"); citString=sb.toString(); System.out.println(); return SUCCESS; } public String bindAre() { Listlist=this.loanInfoService.getArealistByCitId(citId); if(list.size()>0){ StringBuilder sb= new StringBuilder(); int size=list.size(); sb.append("["); for (TDictregion pro : list) { size--; sb.append("{regionid:/"");//此处小红叉 sb.append(pro.getRegionid()); sb.append("/",regionname:/""); sb.append(pro.getRegionname()); sb.append("/"}"); if(size>0){ sb.append(","); } } sb.append("]"); areString=sb.toString(); return SUCCESS; } public String bindBank() { Listlist=this.loanInfoService.getBanklistByareId(areId); if(list.size()>0){ StringBuilder sb= new StringBuilder(); int size=list.size(); sb.append("["); for (TDictBankOutlets bank : list) { size--; sb.append("{bankid:/"");//此处小红叉 sb.append(bank.getBankid()); sb.append("/",bankname:/""); sb.append(bank.getBankname()); sb.append("/"}"); if(size>0){ sb.append(","); } } sb.append("]"); bankString=sb.toString(); return SUCCESS; } @JSON(name="Pros")//此处小红叉 public String getProString() { return proString; } public void setProString(String proString) { this.proString = proString; } public String getCitString() { return citString; } public void setCitString(String citString) { this.citString = citString; } public String getAreString() { return areString; } public void setAreString(String areString) { this.areString = areString; } public String getBankString() { return bankString; } public void setBankString(String bankString) { this.bankString = bankString; } public String getProId() { return proId; } public void setProId(String proId) { this.proId = proId; } public String getCitId() { return citId; } public void setCitId(String citId) { this.citId = citId; } public String getAreId() { return areId; } public void setAreId(String areId) { this.areId = areId; } public LoanInfoService getLoanInfoService() { return loanInfoService; } public void setLoanInfoService(LoanInfoService loanInfoService) { this.loanInfoService = loanInfoService; } } <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> "> 请选择省 请选择城市 请选择地区
3 个解决方案