欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

數據字典統一管理,動態下拉框

系統 2010 0

前端xhr ?js

?

    var buildTag = {



	/*

	 *構建數據字典某一項的下拉框

	 */

	getInfoTypeDatas:function(selectId,infoCode,defaultValue){

		$.get(basePath+"/tag/build!getInfoTypeDatas.action?infoCode="+infoCode,function(arg){

			for(var i=0; i<arg.length; i++){

				var selected = "";

				if(defaultValue){

					if(arg[i].id == defaultValue){

						selected = "selected";

					}

				}

				$("<option "+selected+">",{

					value:arg[i].id,

					text:arg[i].name

				}).appendTo($("#"+selectId));

			}

		},"json");

	},

	

	/*

	 *選擇城市

	 */

	selectCity:function(selectId,defaultValue){

		this.getInfoTypeDatas(selectId,"city",defaultValue);

	},



	selectCompanyType:function(selectId,defaultValue){

		this.getInfoTypeDatas(selectId,"companyType",defaultValue);

	},

	selectApplicationType:function(selectId,defaultValue){

		this.getInfoTypeDatas(selectId,"applicationType",defaultValue);

	},

	/**

	 * feedback type

	 * @param selectId

	 * @param defaultValue

	 */

	selectFeedbackType:function(selectId,defaultValue){

		this.getInfoTypeDatas(selectId,"feedbacktype",defaultValue);

	}

	

	

};
  


后端java代碼

?

action

?

    import java.util.List;



import javax.annotation.Resource;



import com.google.gson.Gson;



import cn.com.qytx.cbb.domain.InfoType;

import cn.com.qytx.cbb.service.IInfoType;





public class BuildTagAction extends BaseAction {



	private String infoCode;

	

	@Resource(name="infoTypeImpl")

	private IInfoType<InfoType> infoTypeService;

	

	

	public String getInfoCode() {

		return infoCode;

	}





	public void setInfoCode(String infoCode) {

		this.infoCode = infoCode;

	}





	public String getInfoTypeDatas() throws Exception{

		List<InfoType> list = infoTypeService.findByCode(infoCode);

		if(list!=null){

			Gson gson = new Gson();

			ajax(gson.toJson(list));

		}else{

			ajax("");

		}

		return null;

	}

}


  


service

?

?

    public List<InfoType> findByCode(String code){

		InfoType it = infoTypeDao.findByCode(code);

		Integer parentId = it.getId();

		return infoTypeDao.findSysList(parentId);

	}
  

?


java bean

?

    public class InfoType extends BaseEntity

{

	public enum InfoCode{

		feedbacktype("feedbacktype");

		private InfoCode(String infocode){

			this.infocode = infocode;

		}

		String infocode;

		public String getInfoCode(){

			return infocode;

		}

	}



	

    /**

     * 序列號

     */

    private static final long serialVersionUID = 2669727616436832468L;

    @Expose

    private String name; // key

    private String infoCode; // 值

    private Integer recordUserId; // 記錄人或最后修改人

    private Integer parentId;

    private Timestamp createDate;

    private Timestamp modifyDate;



    public Integer getParentId() {

		return parentId;

	}



	public void setParentId(Integer parentId) {

		this.parentId = parentId;

	}



	public Timestamp getCreateDate() {

		return createDate;

	}



	public void setCreateDate(Timestamp createDate) {

		this.createDate = createDate;

	}



	public Timestamp getModifyDate() {

		return modifyDate;

	}



	public void setModifyDate(Timestamp modifyDate) {

		this.modifyDate = modifyDate;

	}



	public String getName()

    {

        return this.name;

    }



    public void setName(String name)

    {

        this.name = name;

    }





    public Integer getRecordUserId()

    {

        return recordUserId;

    }



    public void setRecordUserId(Integer recordUserId)

    {

        this.recordUserId = recordUserId;

    }



	public String getInfoCode() {

		return infoCode;

	}



	public void setInfoCode(String infoCode) {

		this.infoCode = infoCode;

	}



	

}


  

?


util

?

    package cn.com.qytx.ayzw.util;



import java.util.HashMap;

import java.util.Map;



import cn.com.qytx.cbb.domain.InfoType;



/**

 * 功能:字典表工具類,單例模式

 * 版本: 1.0

 * 開發人員:賈永強

 * 創建日期: 下午4:40:07 

 * 修改日期:下午4:40:07 

 * 修改列表:

 */

public class InfoTypeUtil {

	

	/*******單例模式開始********/

	private static InfoTypeUtil instance = null;

	private InfoTypeUtil(){

		

	}

	public static synchronized InfoTypeUtil getInstance(){

		if(instance == null){

			instance = new InfoTypeUtil();

		}

		return instance;

	}

	

	/*******單例模式結束********/

	

	private static Map<Integer,InfoType> container = new HashMap<Integer,InfoType>();

	

	/**

	 * 功能:

	 * @param

	 * @return

	 * @throws   

	 */

	public void putToContainer(Integer id,InfoType infoType){

		this.container.put(id, infoType);

	}

	

	public static InfoType getInfoTypeById(int infoTypeId){

		return container.get(infoTypeId);

	}

	

	

}


  

?

    package cn.com.qytx.ayzw.servlet;



import java.util.List;



import javax.servlet.ServletException;

import javax.servlet.http.HttpServlet;



import cn.com.qytx.ayzw.util.InfoTypeUtil;

import cn.com.qytx.cbb.domain.InfoType;

import cn.com.qytx.cbb.service.IInfoType;

import cn.com.qytx.cbb.util.spring.SpringUtil;



public class InitInfoTypeServlet extends HttpServlet {



	@Override

	public void init() throws ServletException {

		// TODO Auto-generated method stub

		super.init();

		IInfoType<InfoType> infoTypeService = (IInfoType<InfoType>) SpringUtil.getBean("infoTypeImpl");

		List<InfoType> list = infoTypeService.findAll();

		if(list!=null){

			for(int i=0; i<list.size(); i++){

				InfoTypeUtil.getInstance().putToContainer(list.get(i).getId(), list.get(i));

			}

		}

	}



}


  


?



數據字典統一管理,動態下拉框


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日韩欧美一区二区三区 | 国产精品午夜电影 | 91精品国产欧美一区二区 | 精品一区二区三区中文字幕 | 北京一级毛片 | 亚洲综合精品 | 国产综合成色在线视频 | 日本伦理网站 | 日韩在线精品视频 | 欧美高清不卡午夜精品免费视频 | 免费观看成人毛片A片2008 | 欧美日韩欧美日韩 | 成人免费视频网站在线观看 | 国产精品一区二区三区四区 | 午夜电影网 | 成人爱爱电影 | 成人亚洲 | 在线播放一区二区三区 | 欧美精品国产综合久久 | 日本喷潮| 久久精品国产久精国产 | 一本色道久久88综合亚洲精品高清 | 狠狠色噜噜狠狠狠97影音先锋 | 欧美日韩亚洲一区 | 欧美黄色一级片视频 | 欧美激情欧美激情在线五月 | 韩国男女无遮挡高清性视频 | 国产永久在线视频 | 午夜激情视频 | 亚洲精品免费观看 | 国产乱码精品一区二区三区五月婷 | 97在线观看视频 | 色客成人网 | www.奇米影视.com| 黄色片特级 | 国产亚洲一区在线 | 午夜久久视频 | 亚洲国产aⅴ成人精品无吗 国内成人自拍视频 | 天天久| 猫咪人成免费网站在线观看 | 国产成人一区二区三区久久久 |