YrdzModel
package cn.hnisi.gdrk.models.hjdj.yrdz; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.faces.context.FacesContext; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallbackWithoutResult; import cn.hnisi.architecture.AbstractModel; import cn.hnisi.gdrk.data.dzgl.xxdz.Xxdz; import cn.hnisi.gdrk.data.hjdj.rkjbxx.Rkjbxx; import cn.hnisi.gdrk.data.hjdj.rkjbxx.RkjbxxDAO; import cn.hnisi.gdrk.data.hjdj.rkjbxx.RkjbxxDAOEx; import cn.hnisi.gdrk.data.hjdj.yrdzdj.Yrdzdj; import cn.hnisi.gdrk.data.hjdj.yrdzdj.YrdzdjDAOEx; import cn.hnisi.gdrk.models.hjsp.common.XxdzModel; import cn.hnisi.gdrk.utils.BizGlobalConstants; import cn.hnisi.gdrk.utils.CommonFunction; import cn.hnisi.gdrk.utils.GenarateConnection; import cn.hnisi.gdrk.utils.GlobalConstants; import cn.hnisi.gdrk.workflow.jbpmengine.util.QueryConVo; /** * * @author yanghanming * @function 户籍登记一户多址登记 */ public class YrdzModel extends AbstractModel { private static final Log log = LogFactory.getLog(YrdzModel.class); private RkjbxxDAOEx rkjbxxDAOEx; private YrdzdjDAOEx yrdzdjDAOEx; private Yrdzdj yrdzdj; private Xxdz xxdzmx; private Rkjbxx rkjbxx; // 进入修改页面时,临时存储yrdzdjList中的对象,并将对应修改对象付给tempYrdzdjForModify private Yrdzdj tempYrdzdj; // 用来保存删除的对象 private Yrdzdj tempYrdzdjForRemove; private XxdzModel xxdzModel; // 通过查询条件查询的结果放到此list中 private List<Rkjbxx> rkjbxxList; // 通过公民身份号码查询一人多址登记表放到此list中 private List<Yrdzdj> yrdzList; // 查询地址结果 private List<Xxdz> xxdzList; // 将选择的人员存到此list中 private List<Rkjbxx> selectedList; // 查询条件变量 private String gmsfhm4BriefQuery; private String xm4BriefQuery; private String hh4BriefQuery; private String yrdzdjJzzkmc; private String yrdzdjJzzk; private String[] dsxx;// 地市数组 private String ywlsh;// 业务流水号 // 控制新增按钮 private boolean bolCanAdd = true; // 控制增加居住地址页面的保存按钮 private boolean bolCanSave = true; private String selectedValue; // 页面配置 // 从立户地址页面跳转到本页面 private final static String FROMJZDZ_OUTCOME = "YRDZJZDZ_PARENT"; // 转到立户地址页面 private final static String JZDZ_OUTCOME = "JZDZ"; // 转到修改居住地址页面 private final static String MODIFY_OUTCOME = "MODIFY"; // 转到新增居住地址页面 private final static String ADDQTJZDZ_OUTCOME = "AddQtjzdzPane"; // 转到首页面 private final static String YRDZPANE_OUTCOME = "YrdzPane"; private final static String SELF_OUTCOME = "SELF"; /* 分页变量 */ // 记录数 protected int rowCount2 = 0; // 总页数 protected int pageCount2 = 0; // 每页显示的条数 protected int pageSize2 = GlobalConstants.DEFAULT_PAGE_SIZE; // 当前页码 protected int currentPageNumber2 = GlobalConstants.DEFAULT_PAGE_NUMBER; protected int gotoPageNumber2 = GlobalConstants.DEFAULT_PAGE_NUMBER; @SuppressWarnings("unchecked") public YrdzModel() { selectedList = new ArrayList(); } /** * * @author yanghanming * @createTime Sep 4, 2009 * @function 查询 */ protected String doBriefQuery() { // 清空一人多址列表 yrdzList = null; this.setRowCount2(0); String errMsg = findByQueryCondition(); fromOutcome = SELF_OUTCOME; return errMsg; } @SuppressWarnings("unchecked") public String findByQueryCondition() { String errMessage = null; List list = new ArrayList<QueryConVo>(); // 构造查询条件 if (StringUtils.isNotBlank(this.getGmsfhm4BriefQuery())) { QueryConVo conVo = new QueryConVo(RkjbxxDAO.GMSFHM, this .getGmsfhm4BriefQuery()); list.add(conVo); } if (StringUtils.isNotBlank(this.getXm4BriefQuery())) { QueryConVo conVo = new QueryConVo(RkjbxxDAO.XM, this .getXm4BriefQuery()); list.add(conVo); } if (StringUtils.isNotBlank(this.getHh4BriefQuery())) { QueryConVo conVo = new QueryConVo(RkjbxxDAO.HH, this .getHh4BriefQuery()); list.add(conVo); } GenarateConnection gc = (GenarateConnection) getCtx().getBean( BizGlobalConstants.X_GCONNECTION); // 根据条件从人口基本信息表里面查找数据 String hql = "from Rkjbxx as ti where 1=1 and ti.zt='1'"; try { rkjbxxList = gc.findListForPage(hql, list, this .getCurrentPageNumber(), this.getPageSize(), null); rowCount = gc.findCountForPage(hql, list, this .getCurrentPageNumber(), this.getPageSize()); setRowCount4Tmp(rowCount); } catch (Exception e) { e.printStackTrace(); log.equals(e); errMessage = e.toString(); } bolCanAdd = false; return errMessage; } /** * * @author yanghanming * @createTime Sep 4, 2009 * @function 点击查询出来的某个人,通过参数来查询yrdzdj表 */ @SuppressWarnings("unchecked") public String doSelectBriefQueryResult() { List list = new ArrayList<QueryConVo>(); String hql = null; GenarateConnection gc = (GenarateConnection) getCtx().getBean( BizGlobalConstants.X_GCONNECTION); Map requestParams = FacesContext.getCurrentInstance() .getExternalContext().getRequestParameterMap(); String id = (String) requestParams.get("taskid"); for (int i = 0; rkjbxxList != null && i < rkjbxxList.size(); i++) { if (id.equals(rkjbxxList.get(i).getId())) { rkjbxx=(Rkjbxx)rkjbxxList.get(i); break; } } hql = "from Yrdzdj as ti where ti.gmsfhm='" + rkjbxx.getGmsfhm() + "'"; try { this.yrdzList = gc.findListForPage(hql, list, this .getCurrentPageNumber2(), this.getPageSize2(), null); this.rowCount2 = gc.findCountForPage(hql, list, this .getCurrentPageNumber2(), this.getPageSize2()); this.setRowCount4Tmp(rowCount2); } catch (Exception e) { e.printStackTrace(); } bolCanAdd = false; return null; } /** * * @author yanghanming * @createTime Sep 4, 2009 * @function 进入修改页面 */ @SuppressWarnings("unchecked") public String toModify() { Map requestParams = FacesContext.getCurrentInstance() .getExternalContext().getRequestParameterMap(); String id = (String) requestParams.get("id"); for (int i = 0; yrdzList != null && i < yrdzList.size(); i++) { if (StringUtils.equals(yrdzList.get(i).getId(), id)) { tempYrdzdj = (Yrdzdj) yrdzList.get(i); break; } } return MODIFY_OUTCOME; } /** * * @author yanghanming * @createTime Sep 4, 2009 * @function 修改后进行保存 */ public String update() { transactionTemplate.execute(new TransactionCallbackWithoutResult() { public void doInTransactionWithoutResult( TransactionStatus transactionStatus) { yrdzdjDAOEx.attachDirty(tempYrdzdj); } }); return null; } /** * * @author yanghanming * @createTime Sep 4, 2009 * @function 删除居住地址 */ @SuppressWarnings("unchecked") public String remove() { transactionTemplate.execute(new TransactionCallbackWithoutResult() { public void doInTransactionWithoutResult( TransactionStatus transactionStatus) { Map requestParams = FacesContext.getCurrentInstance() .getExternalContext().getRequestParameterMap(); String id = (String) requestParams.get("id"); for (int i = 0; yrdzList != null && i < yrdzList.size(); i++) { tempYrdzdjForRemove = (Yrdzdj) yrdzList.get(i); if (tempYrdzdjForRemove.getId().equals(id)) { yrdzList.remove(i); break; } } yrdzdjDAOEx.delete(tempYrdzdjForRemove); } }); this.setRowCount2(yrdzList.size()); this.setRowCount(rkjbxxList.size()); return null; } /** * * @author yanghanming * @createTime Sep 4, 2009 * @function 点击新增时,进行跳转,跳转到增加居住地址页面 */ @SuppressWarnings("unchecked") public String addButton() { // 返回点第二次新增,不会出现空指针 selectedList = new ArrayList(); Map requestParams = FacesContext.getCurrentInstance() .getExternalContext().getRequestParameterMap(); String id = (String) requestParams.get("rkjbxxList_selected"); String[] gmsfhms = id.split(","); // 身份证号s // 选取的需要迁出的人员 int j = 0; for (int i = 0; rkjbxxList != null && i < rkjbxxList.size(); i++) { for (j = 0; j < gmsfhms.length; j++) { if (rkjbxxList.get(i).getGmsfhm().equals(gmsfhms[j])) { selectedList.add(rkjbxxList.get(i)); } } } if (selectedList.size() != 0) { bolCanSave = true; ywlsh = null; // 点增加按钮,将详细地址清空 xxdzmx = null; this.setYrdzdjJzzkmc(""); return ADDQTJZDZ_OUTCOME; } return SELF_OUTCOME; } /** * * @author yanghanming * @createTime Sep 2, 2009 * @function 跳转到选择居住地址界面 */ public String goToJzdzPage() { return JZDZ_OUTCOME; } /** * * @author yanghanming * @createTime Sep 3, 2009 * @function 由选择居住地址界面跳回到新增界面 */ @SuppressWarnings("unchecked") public String goToParentPageFromLihuPage() { Map requestParams = FacesContext.getCurrentInstance() .getExternalContext().getRequestParameterMap(); String xxdzid = (String) requestParams.get("id"); xxdzList = xxdzModel.getBriefQueryResult(); for (int i = 0; xxdzList != null && i < xxdzList.size(); i++) { xxdzmx = (Xxdz) xxdzList.get(i); if (xxdzmx.getId().equals(xxdzid)) { xxdzModel.setXxdz(xxdzmx); break; } } bolCanSave = false; return FROMJZDZ_OUTCOME; } /** * * @author yanghanming * @createTime Sep 3, 2009 * @function 新增居住地址进行保存 */ @SuppressWarnings("unchecked") public String doSaveToDB() { // 通过判断业务流水号 if (StringUtils.isBlank(ywlsh)) { ywlsh = CommonFunction.getSlh(); for (int i = 0; selectedList != null && i < selectedList.size(); i++) { dsxx = CommonFunction.getDsxx(); yrdzdj = new Yrdzdj(); yrdzdj.setYwlsh(ywlsh); yrdzdj.setJzzk(this.getYrdzdjJzzk()); yrdzdj.setJzzkmc(this.getYrdzdjJzzkmc()); yrdzdj.setXm(selectedList.get(i).getXm()); yrdzdj.setGmsfhm(selectedList.get(i).getGmsfhm()); yrdzdj.setHh(selectedList.get(i).getHh()); yrdzdj.setHlx(selectedList.get(i).getHlx()); yrdzdj.setHlxmc(selectedList.get(i).getHlxmc()); yrdzdj.setHxz(selectedList.get(i).getHxz()); yrdzdj.setHxzmc(selectedList.get(i).getHxzmc()); yrdzdj.setPcs(selectedList.get(i).getPcs()); yrdzdj.setPcsmc(selectedList.get(i).getPcsmc()); yrdzdj.setDs(dsxx[0]); yrdzdj.setDsmc(dsxx[1]); yrdzdj.setSsxq(xxdzmx.getSsxq()); yrdzdj.setSsxqmc(xxdzmx.getSsxqmc()); yrdzdj.setJlx(xxdzmx.getJlx()); yrdzdj.setJlxmc(xxdzmx.getJlxmc()); yrdzdj.setXzdj(xxdzmx.getXzjd()); yrdzdj.setXzjdmc(xxdzmx.getXzjdmc()); yrdzdj.setJwh(xxdzmx.getJcw()); yrdzdj.setJwhmc(xxdzmx.getJcwmc()); yrdzdj.setMlp(xxdzmx.getMlp()); yrdzdj.setDz(xxdzmx.getDz()); yrdzdj.setDzbm(xxdzmx.getDzbm()); yrdzdjDAOEx.save(yrdzdj); } } else { List<Yrdzdj> list = yrdzdjDAOEx.findByYwlsh(ywlsh); for (int i = 0; list != null && i < list.size(); i++) { yrdzdjDAOEx.delete(list.get(i)); } for (int i = 0; selectedList != null && i < selectedList.size(); i++) { dsxx = CommonFunction.getDsxx(); yrdzdj = new Yrdzdj(); yrdzdj.setYwlsh(ywlsh); yrdzdj.setJzzk(this.getYrdzdjJzzk()); yrdzdj.setJzzkmc(this.getYrdzdjJzzkmc()); yrdzdj.setXm(selectedList.get(i).getXm()); yrdzdj.setGmsfhm(selectedList.get(i).getGmsfhm()); yrdzdj.setHh(selectedList.get(i).getHh()); yrdzdj.setHlx(selectedList.get(i).getHlx()); yrdzdj.setHlxmc(selectedList.get(i).getHlxmc()); yrdzdj.setHxz(selectedList.get(i).getHxz()); yrdzdj.setHxzmc(selectedList.get(i).getHxzmc()); yrdzdj.setPcs(selectedList.get(i).getPcs()); yrdzdj.setPcsmc(selectedList.get(i).getPcsmc()); yrdzdj.setDs(dsxx[0]); yrdzdj.setDsmc(dsxx[1]); yrdzdj.setSsxq(xxdzmx.getSsxq()); yrdzdj.setSsxqmc(xxdzmx.getSsxqmc()); yrdzdj.setJlx(xxdzmx.getJlx()); yrdzdj.setJlxmc(xxdzmx.getJlxmc()); yrdzdj.setXzdj(xxdzmx.getXzjd()); yrdzdj.setXzjdmc(xxdzmx.getXzjdmc()); yrdzdj.setJwh(xxdzmx.getJcw()); yrdzdj.setJwhmc(xxdzmx.getJcwmc()); yrdzdj.setMlp(xxdzmx.getMlp()); yrdzdj.setDz(xxdzmx.getDz()); yrdzdj.setDzbm(xxdzmx.getDzbm()); yrdzdjDAOEx.save(yrdzdj); } } return null; } /** * * @author yanghanming * @createTime Sep 4, 2009 * @function 当前页面是增加居住地址页面时,点击返回,返回首页 */ public String backFromAdd() { yrdzList = null; this.setRowCount2(0); selectedList = null; return YRDZPANE_OUTCOME; } public static String getFROMJZDZ_OUTCOME() { return FROMJZDZ_OUTCOME; } public static String getJZDZ_OUTCOME() { return JZDZ_OUTCOME; } public static String getSELF_OUTCOME() { return SELF_OUTCOME; } public static Log getLog() { return log; } public XxdzModel getXxdzModel() { return xxdzModel; } public void setXxdzModel(XxdzModel xxdzModel) { this.xxdzModel = xxdzModel; } public RkjbxxDAOEx getRkjbxxDAOEx() { return rkjbxxDAOEx; } public void setRkjbxxDAOEx(RkjbxxDAOEx rkjbxxDAOEx) { this.rkjbxxDAOEx = rkjbxxDAOEx; } public YrdzdjDAOEx getYrdzdjDAOEx() { return yrdzdjDAOEx; } public void setYrdzdjDAOEx(YrdzdjDAOEx yrdzdjDAOEx) { this.yrdzdjDAOEx = yrdzdjDAOEx; } public String getGmsfhm4BriefQuery() { return gmsfhm4BriefQuery; } public void setGmsfhm4BriefQuery(String gmsfhm4BriefQuery) { this.gmsfhm4BriefQuery = gmsfhm4BriefQuery; } public String getXm4BriefQuery() { return xm4BriefQuery; } public void setXm4BriefQuery(String xm4BriefQuery) { this.xm4BriefQuery = xm4BriefQuery; } public String getHh4BriefQuery() { return hh4BriefQuery; } public void setHh4BriefQuery(String hh4BriefQuery) { this.hh4BriefQuery = hh4BriefQuery; } public Yrdzdj getYrdzdj() { return yrdzdj; } public void setYrdzdj(Yrdzdj yrdzdj) { this.yrdzdj = yrdzdj; } public List<Yrdzdj> getYrdzList() { return yrdzList; } public void setYrdzList(List<Yrdzdj> yrdzList) { this.yrdzList = yrdzList; } public List<Rkjbxx> getRkjbxxList() { return rkjbxxList; } public void setRkjbxxList(List<Rkjbxx> rkjbxxList) { this.rkjbxxList = rkjbxxList; } public List<Xxdz> getXxdzList() { return xxdzList; } public void setXxdzList(List<Xxdz> xxdzList) { this.xxdzList = xxdzList; } public String[] getDsxx() { return dsxx; } public void setDsxx(String[] dsxx) { this.dsxx = dsxx; } public boolean isBolCanAdd() { return bolCanAdd; } public void setBolCanAdd(boolean bolCanAdd) { this.bolCanAdd = bolCanAdd; } public static String getMODIFY_OUTCOME() { return MODIFY_OUTCOME; } public Yrdzdj getTempYrdzdj() { return tempYrdzdj; } public void setTempYrdzdj(Yrdzdj tempYrdzdj) { this.tempYrdzdj = tempYrdzdj; } public Yrdzdj getTempYrdzdjForRemove() { return tempYrdzdjForRemove; } public void setTempYrdzdjForRemove(Yrdzdj tempYrdzdjForRemove) { this.tempYrdzdjForRemove = tempYrdzdjForRemove; } public static String getYRDZPANE_OUTCOME() { return YRDZPANE_OUTCOME; } public static String getADDQTJZDZ_OUTCOME() { return ADDQTJZDZ_OUTCOME; } public boolean isBolCanSave() { return bolCanSave; } public void setBolCanSave(boolean bolCanSave) { this.bolCanSave = bolCanSave; } public String getSelectedValue() { return selectedValue; } public void setSelectedValue(String selectedValue) { this.selectedValue = selectedValue; } public int getRowCount2() { return rowCount2; } public void setRowCount2(int rowCount2) { this.rowCount2 = rowCount2; } public int getPageCount2() { if ((rowCount2 % pageSize2) == 0) { pageCount2 = this.rowCount2 / this.pageSize2; } else { pageCount2 = this.rowCount2 / this.pageSize2 + 1; } return pageCount2; } public void setPageCount2(int pageCount2) { this.pageCount2 = pageCount2; } public int getPageSize2() { return pageSize2; } public void setPageSize2(int pageSize2) { if (pageSize2 < 1) { this.pageSize2 = GlobalConstants.DEFAULT_PAGE_SIZE; } else { this.pageSize2 = pageSize2; } } public int getCurrentPageNumber2() { return currentPageNumber2; } public void setCurrentPageNumber2(int currentPageNumber2) { if (currentPageNumber2 < 1) { this.currentPageNumber2 = GlobalConstants.DEFAULT_PAGE_NUMBER; } else { this.currentPageNumber2 = currentPageNumber2; } } public int getGotoPageNumber2() { return gotoPageNumber2; } public void setGotoPageNumber2(int gotoPageNumber2) { this.gotoPageNumber2 = gotoPageNumber2; } public List<Rkjbxx> getSelectedList() { return selectedList; } public void setSelectedList(List<Rkjbxx> selectedList) { this.selectedList = selectedList; } public Xxdz getXxdzmx() { return xxdzmx; } public void setXxdzmx(Xxdz xxdzmx) { this.xxdzmx = xxdzmx; } public String getYwlsh() { return ywlsh; } public void setYwlsh(String ywlsh) { this.ywlsh = ywlsh; } public String getYrdzdjJzzkmc() { return yrdzdjJzzkmc; } public void setYrdzdjJzzkmc(String yrdzdjJzzkmc) { this.yrdzdjJzzkmc = yrdzdjJzzkmc; } public String getYrdzdjJzzk() { return yrdzdjJzzk; } public void setYrdzdjJzzk(String yrdzdjJzzk) { this.yrdzdjJzzk = yrdzdjJzzk; } public Rkjbxx getRkjbxx() { return rkjbxx; } public void setRkjbxx(Rkjbxx rkjbxx) { this.rkjbxx = rkjbxx; } }
YrdzPane.xhtml
<?xml version="1.0" encoding="GBK"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:f="http://java.sun.com/jsf/core" xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:jsfext="http://www.hnisi.cn/jsfext" xmlns:a4j="http://richfaces.org/a4j" xmlns:c="http://java.sun.com/jstl/core"> <ui:composition template="/cn/hnisi/gdrk/GDRKWorkspace.xhtml"> <ui:define name="BizTitleAndToolBar"> <h:form class="nomargin"> <jsfext:pageTitle title="一人多址"> <jsfext:instantHelp helpId="hjgl_yrdz" styleClass="toolbarButton" onmouseout="toolbarButtonMouseOut(this)" onmouseover="toolbarButtonMouseOver(this)" /> </jsfext:pageTitle> </h:form> </ui:define> <ui:define name="OperationPanel"> <t:saveState value="#{YrdzModel}" /> <h:panelGrid columns="1" id="EditPanel"> <jsfext:panelTabbedPane> <t:panelTab id="tab1" label="一人多址" style="width: 900px; height: 477px; border: 0px " tabindex="1"> <ui:include src="/cn/hnisi/gdrk/hjdj/others/yrdz/panel/YrdzListPanel.xhtml"></ui:include> </t:panelTab> </jsfext:panelTabbedPane> </h:panelGrid> </ui:define> </ui:composition> </html>
YrdzListPanel.xhtml
<?xml version="1.0" encoding="GBK"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:f="http://java.sun.com/jsf/core" xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:jsfext="http://www.hnisi.cn/jsfext" xmlns:a4j="http://richfaces.org/a4j" xmlns:c="http://java.sun.com/jstl/core"> <ui:component> <ui:define name="PrivateScript-2"> <jsfext:javascript path="/cn/hnisi/gdrk/hjdj/js/Yrdz.js" /> </ui:define> <ui:define name="QueryConditionPanel"> <jsfext:defaultFocusedElement value="hh4BriefQuery" /> <h:form class="nomargin" id="theBriefQueryForm"> <table width="100%" align="center"> <tr> <td align="left"> 户号: <jsfext:inputText tabindex="3" size="25" id="hh4BriefQuery" value="#{YrdzModel.hh4BriefQuery}"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:inputText> </td> <td align="left"> 公民身份号码: <jsfext:inputText tabindex="1" size="25" id="gmsfhm4BriefQuery" value="#{YrdzModel.gmsfhm4BriefQuery}"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:inputText> </td> <td align="left"> 姓名: <jsfext:inputText tabindex="2" size="25" id="xm4BriefQuery" value="#{YrdzModel.xm4BriefQuery}"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:inputText> </td> <td align="left"> <t:commandButton id="briefQueryButton" value="查询(F)" onclick="return checkConditions()" accesskey="f" action="#{YrdzModel.onBriefQueryFormSubmit}" tabindex="4" forceId="true" /> </td> </tr> </table> </h:form> </ui:define> <ui:define name="QueryConditionPanel"> <h:form style="margin:0px;" mce_style="margin:0px;" id="theBriefQueryResult"> <table width="100%" cellspacing="0" order="0"> <tr> <td align="center"> <jsfext:dataTableEx id="rkjbxxList" model="#{YrdzModel}" columns="3" checkbox="true" width="100%" value="#{YrdzModel.rkjbxxList}" jsonValue="{rkjbxxgmsfhm:'#{temp.gmsfhm}',rkjbxxid:'#{temp.id}'}" selectedValue="#{YrdzModel.selectedValue}" checkboxValue="#{temp.gmsfhm}" isJbpmList="false" height="250" fsWidth="900" fsHeight="235"> <jsfext:columnEx title="公民身份号码" value="#{temp.gmsfhm}" model="#{YrdzModel}" haveAction="true" isJbpmList="false"> <f:param value="#{temp.id}" name="taskid" /> </jsfext:columnEx> <jsfext:columnEx title="姓名" value="#{temp.xm}" isJbpmList="false" model="#{YrdzModel}" haveAction="true"> </jsfext:columnEx> <jsfext:columnEx title="性别" value="#{temp.xbmc}" isJbpmList="false" model="#{YrdzModel}" haveAction="true"> </jsfext:columnEx> <jsfext:columnEx title="出生日期" value="#{temp.csrq}" isJbpmList="false" model="#{YrdzModel}" haveAction="true"> </jsfext:columnEx> <jsfext:columnEx title="民族" value="#{temp.mzmc}" isJbpmList="false" model="#{YrdzModel}" haveAction="true"> </jsfext:columnEx> <jsfext:columnEx title="地址" value="#{temp.dz}" isJbpmList="false" model="#{YrdzModel}" haveAction="true"> </jsfext:columnEx> <jsfext:columnEx title="与户主关系" value="#{temp.yhzgxmc}" isJbpmList="false" model="#{YrdzModel}" haveAction="true"> </jsfext:columnEx> </jsfext:dataTableEx> </td> </tr> </table> <table width="100%" cellspacing="0" order="0"> <tr> <td align="center"> <jsfext:dataTableEx2 needRowClickAction="false" id="yrdzList" model="#{YrdzModel}" columns="3" checkbox="false" width="100%" value="#{YrdzModel.yrdzList}" isJbpmList="false" height="250" fsWidth="900" fsHeight="235"> <jsfext:columnEx title="姓名" value="#{temp.xm}" isJbpmList="false" model="#{YrdzModel}" haveAction="false"> </jsfext:columnEx> <jsfext:columnEx title="公民身份号码" value="#{temp.gmsfhm}" isJbpmList="false" model="#{YrdzModel}" haveAction="false"> </jsfext:columnEx> <jsfext:columnEx title="其他居住地址" value="#{temp.dz}" isJbpmList="false" model="#{YrdzModel}" haveAction="false"> </jsfext:columnEx> <jsfext:columnEx title="居住状况" value="#{temp.jzzkmc}" isJbpmList="false" model="#{YrdzModel}" haveAction="false"> </jsfext:columnEx> <rich:column colspan="1"> <f:facet name="header"> <h:outputLabel value="修改" /> </f:facet> <div align="center"> <t:commandLink value="修改" styleClass="cbLink_table" action="#{YrdzModel.toModify}"> <f:param name="id" value="#{temp.id}"></f:param> </t:commandLink> </div> </rich:column> <rich:column colspan="1"> <f:facet name="header"> <h:outputLabel value="删除" /> </f:facet> <div align="center"> <t:commandLink styleClass="cbLink_table" value="删除" action="#{YrdzModel.remove}" onclick="if(!confirm('确定要删除吗?')) return false;"> <f:param name="id" value="#{temp.id}"></f:param> </t:commandLink> </div> </rich:column> </jsfext:dataTableEx2> </td> </tr> </table> <div align="right"> <h:commandButton tabindex="11" value=" 新 增(Z)" accesskey="z" id="add" action="#{YrdzModel.addButton}" disabled="#{YrdzModel.bolCanAdd}" onclick="return checkIsSelect()"> </h:commandButton> </div> </h:form> </ui:define> </ui:component> </html>
AddQtjzdzPane.xhtml
<?xml version="1.0" encoding="GBK"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:f="http://java.sun.com/jsf/core" xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:jsfext="http://www.hnisi.cn/jsfext" xmlns:a4j="http://richfaces.org/a4j" xmlns:c="http://java.sun.com/jstl/core"> <ui:composition template="/cn/hnisi/gdrk/GDRKWorkspace.xhtml"> <ui:define name="PrivateScript-1"> <jsfext:javascript path="/cn/hnisi/gdrk/hjdj/js/Yrdz.js" /> </ui:define> <ui:define name="BizTitleAndToolBar"> <h:form style="margin:0px;" mce_style="margin:0px;"> <jsfext:pageTitle title="增加居住地址"> <h:commandLink value=" 返回(B) " action="#{YrdzModel.backFromAdd}" styleClass="toolbarButton" accesskey="b" onmouseout="toolbarButtonMouseOut(this)" onmouseover="toolbarButtonMouseOver(this)"></h:commandLink> <rich:spacer width="10" /> <h:outputLabel value=" "></h:outputLabel> <jsfext:instantHelp helpId="dzgl_bgmlp" /> </jsfext:pageTitle> </h:form> </ui:define> <ui:define name="OperationPanel"> <jsfext:defaultFocusedElement value="yrdzXzqh" /> <h:form> <t:saveState value="#{YrdzModel}" /> <fieldset align="center" style="width: 800; height: 200; border: 1px solid blue; margin: 0px; padding: 0px;"> <legend> <span style="font-size: 10pt; font-weight: bold; color: black" mce_style="font-size: 10pt; font-weight: bold; color: black">新增居住地址信息</span> </legend> <table width="90%" align="center" border="0"> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 行政区划: </td> <td> <jsfext:outputText value="#{YrdzModel.xxdzmx.ssxqmc}" id="xzqh" style="width:200px" maxlength="50" /> </td> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 街路巷: </td> <td> <jsfext:outputText value="#{YrdzModel.xxdzmx.jlxmc}" id="jlx" style="width:200px" maxlength="50" /> </td> </tr> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 乡镇街道: </td> <td> <jsfext:outputText value="#{YrdzModel.xxdzmx.xzjdmc}" id="xzjd" style="width:200px" maxlength="50" /> </td> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 居委会: </td> <td> <jsfext:outputText value="#{YrdzModel.xxdzmx.jcwmc}" id="jwh" style="width:200px" maxlength="50" /> </td> </tr> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 门(楼)牌: </td> <td> <jsfext:outputText value="#{YrdzModel.xxdzmx.mlp}" id="mlp" style="width:200px" maxlength="50" /> </td> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 地址: </td> <td> <jsfext:outputText value="#{YrdzModel.xxdzmx.dz}" id="dz" style="width:200px" maxlength="50" /> </td> </tr> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 居住状况: </td> <td> <jsfext:selectOneMenuEx2 id="jzzk" kind="BDFX" widthOfDropDown="100" tabindex="10" style="width:182px" detail="#{YrdzModel.yrdzdjJzzkmc}" value="#{YrdzModel.yrdzdjJzzk}"> </jsfext:selectOneMenuEx2> </td> </tr> </table> <div align="center"> <jsfext:commandButtonProxy value="查询(F)" target="openLhdzPage" id="openLhdzPageProxy" accesskey="f" /> <jsfext:commandButtonProxy value="保存(S)" target="save" accesskey="s" disabled="#{YrdzModel.bolCanSave}" onsubmit="checkAddJzdz()" /> <label style="display: none;" mce_style="display: none;"> <jsfext:cb4Biz value="保存" accesskey="s" id="save" tabindex="100" model="#{YrdzModel}" /> </label> </div> </fieldset> </h:form> <jsfext:showModalDialog title="选择居住地址" width="980" height="450"> <t:commandLink value="选择居住地址" tabindex="-1" id="openLhdzPage" styleClass="cbLink_title_menu_hidden" target="dialogIframe" action="#{YrdzModel.goToJzdzPage}" forceId="true"> <f:param value="YrdzModel" name="parentModel4Lihu" /> </t:commandLink> </jsfext:showModalDialog> </ui:define> </ui:composition> </html>
ModifyQtjzdzPane.xhtml
<?xml version="1.0" encoding="GBK"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:f="http://java.sun.com/jsf/core" xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:jsfext="http://www.hnisi.cn/jsfext" xmlns:a4j="http://richfaces.org/a4j" xmlns:c="http://java.sun.com/jstl/core"> <ui:composition template="/cn/hnisi/gdrk/GDRKWorkspace.xhtml"> <ui:define name="BizTitleAndToolBar"> <h:form style="margin:0px;" mce_style="margin:0px;"> <jsfext:pageTitle title="修改居住地址信息"> <h:commandLink value=" 返回(B) " action="YrdzPane" styleClass="toolbarButton" accesskey="b" onmouseout="toolbarButtonMouseOut(this)" onmouseover="toolbarButtonMouseOver(this)"></h:commandLink> <rich:spacer width="10" /> <h:outputLabel value=" "></h:outputLabel> <jsfext:instantHelp helpId="dzgl_bgmlp" /> </jsfext:pageTitle> </h:form> </ui:define> <ui:define name="OperationPanel"> <jsfext:defaultFocusedElement value="yrdzXzqh" /> <h:form> <t:saveState value="#{YrdzModel}" /> <fieldset align="center" style="width: 800; height: 200; border: 1px solid blue; margin: 0px; padding: 0px;"> <legend> <span style="font-size: 10pt; font-weight: bold; color: black" mce_style="font-size: 10pt; font-weight: bold; color: black">居住地址信息</span> </legend> <table width="90%" align="center" border="0"> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 行政区划: </td> <td> <jsfext:outputText value="#{YrdzModel.tempYrdzdj.ssxqmc}" id="xzqh" style="width:200px" maxlength="50" /> </td> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 街路巷: </td> <td> <jsfext:outputText value="#{YrdzModel.tempYrdzdj.jlxmc}" id="jlx" style="width:200px" maxlength="50" /> </td> </tr> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 乡镇街道: </td> <td> <jsfext:outputText value="#{YrdzModel.tempYrdzdj.xzjdmc}" id="xzjd" style="width:200px" maxlength="50" /> </td> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 居委会: </td> <td> <jsfext:outputText value="#{YrdzModel.tempYrdzdj.jwhmc}" id="jwh" style="width:200px" maxlength="50" /> </td> </tr> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 门(楼)牌: </td> <td> <jsfext:outputText value="#{YrdzModel.tempYrdzdj.mlp}" id="mlp" style="width:200px" maxlength="50" /> </td> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 地址: </td> <td> <jsfext:outputText value="#{YrdzModel.tempYrdzdj.dz}" id="dz" style="width:200px" maxlength="50" /> </td> </tr> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 居住状况: </td> <td> <jsfext:selectOneMenuEx2 id="jzzk" kind="BDFX" widthOfDropDown="100" tabindex="10" style="width:182px" detail="#{YrdzModel.tempYrdzdj.jzzkmc}" value="#{YrdzModel.tempYrdzdj.jzzk}"> </jsfext:selectOneMenuEx2> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </td> </tr> </table> <div align="center"> <h:commandButton tabindex="4" value=" 保 存(S)" id="save" accesskey="s" action="#{YrdzModel.update}" /> </div> </fieldset> </h:form> </ui:define> </ui:composition> </html>
Yrdz.js
function checkConditions() { var gmsfhmInput = document.getElementById("gmsfhm4BriefQuery"); var xmInput = document.getElementById("xm4BriefQuery"); var hhInput = document.getElementById("hh4BriefQuery"); if ((gmsfhmInput.value == null || gmsfhmInput.value == "") && (xmInput.value == null || xmInput.value == "") && (hhInput.value == null || hhInput.value == "")) { alert("查询条件不能为空"); return false; } return true; } function checkAddJzdz(){ var jzzkInput=document.getElementById("jzzk"); if(jzzkInput.value==null||jzzkInput.value==""){ alert("居住状况不能为空!"); return false; } return true; } function checkIsSelect(){ var id = getDataTableExSelectedValue("rkjbxxList", "rkjbxxid"); if(id == null || id == ""){ alert("请选择需要增加居住地址的人!"); return false; } return true; }