/** @param 关注对象(t_gzdx) 修改 */ public boolean updateGzdx(Gzdx gzdx) { // TODO:将姓名的拼音加入 String xm = gzdx.getXm(); String xmpy = ""; if (xm != null && !"".equals(xm)) { xmpy = com.aisino2.core.util.PinYinUtil.getHanyuPingYin(xm); } gzdx.setXmpy(xmpy); return gzdxDao.updateGzdx(gzdx) > 0; }
/** @param 关注对象(t_gzdx) 增加 */ public Gzdx insertGzdx(Gzdx gzdx) { // TODO:将姓名的拼音加入 String xm = gzdx.getXm(); String xmpy = ""; if (xm != null && !"".equals(xm)) { xmpy = com.aisino2.core.util.PinYinUtil.getHanyuPingYin(xm); } gzdx.setXmpy(xmpy); return (Gzdx) gzdxDao.insertGzdx(gzdx); }
/** 验证 */ public String validateZjhm(Gzdx gzdx) { // TODO Auto-generated method stub List list = gzdxDao.validateZjhm(gzdx); for (java.util.Iterator iter = list.iterator(); iter.hasNext(); ) { Gzdx oneGzdx = (Gzdx) iter.next(); if (oneGzdx.getNum() > 0) { return oneGzdx.getFlag(); } } return "OK"; }
public void setTabledata(List lData) throws Exception { List lPro = new ArrayList(); lPro.add("gzdxid"); lPro.add("xm"); lPro.add("zjhm"); lPro.add("xb"); lPro.add("csrq"); lPro.add("minzu"); lPro.add("whcd"); lPro.add("hjdxzqh"); lPro.add("hjdxz"); // 这里需要根据flag参数来决定操作那要些什么项目 Gzdx setGzdx = new Gzdx(); gzdx = (Gzdx) this.setClass(setGzdx, null); String flag = gzdx.getFlag(); List lModify = new ArrayList(); List lDel = new ArrayList(); List lCol = new ArrayList(); // 如果是管理菜单,则加入操作项 if ("manage".equals(flag)) { lPro.add("num"); lPro.add("zxbz"); lModify.add("setModifyQuery"); lModify.add("修改"); lDel.add("setDelete"); lDel.add("删除"); lCol.add(lModify); lCol.add(lDel); // 如果是注销页面,则只要加入注销标识,查询菜单没有操作项 } else if ("cancel".equals(flag)) { lPro.add("num"); lDel.add("setModifyQuery"); lDel.add("注销"); lCol.add(lDel); } Gzdx getGzdx = new Gzdx(); this.setData(getGzdx, lData, lPro, lCol); this.tabledata = this.getData(); totalrows = this.getTotalrows(); }
public String queryForExport() { ActionContext ctx = ActionContext.getContext(); HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST); HttpSession session = request.getSession(); session.removeAttribute("gzdxExportResult"); // User user= (User)session.getAttribute(Constants.userKey); Globalpar glo = this.getCacheGlobalpar("exportmaxrows"); String maxRows = glo.getGlobalparvalue(); try { Gzdx setGzdx = new Gzdx(); gzdx = (Gzdx) this.setClass(setGzdx, null); Map map = new HashMap(); // map.put("xm", gzdx.getXm()); // map.put("xb", gzdx.getXb()); // map.put("zjhm", gzdx.getZjhm()); // map.put("csrq", gzdx.getCsrq()); // map.put("csrq2", gzdx.getCsrq2()); // map.put("mzdm", gzdx.getMzdm()); // map.put("hjdxzqhdm", gzdx.getHjdxzqhdm()); // //如果选择了姓名拼音的同音查询,则需要得到姓名的拼音 // if("1".equals(gzdx.getTyCheck())){ // map.put("xmpy", PinYinUtil.getHanyuPingYin(gzdx.getXm())); // map.put("xm", ""); // } map.put("xm", gzdx.getXm()); map.put("xb", gzdx.getXb()); map.put("zjhm", gzdx.getZjhm()); map.put("csrq", gzdx.getCsrq()); map.put("csrq2", gzdx.getCsrq2()); map.put("mzdm", gzdx.getMzdm()); map.put("hjdxzqhdm", gzdx.getHjdxzqhdm()); map.put("hylbdm", gzdx.getHylbdm()); User user = (User) this.getRequest().getSession().getAttribute(Constants.userKey); if (user != null) { String dqdwbm = user.getDepartment().getDepartcode(); int level = user.getDepartment().getDepartlevel().intValue(); if (level >= 3) map.put("tbdabm", StringUtil.trimEven0(dqdwbm) + "%"); map.put("dqdwbm", dqdwbm); } // 如果查询菜单是注销管理,则应该要加一个默认条件为未注销 if ("cancel".equals(gzdx.getFlag())) { map.put("zxbz", "0"); } // 如果选择了姓名拼音的同音查询,则需要得到姓名的拼音 if ("1".equals(gzdx.getTyCheck())) { map.put("xmpy", PinYinUtil.getHanyuPingYin(gzdx.getXm())); map.put("xm", ""); } map.put("endRow", maxRows); // Excel输出 lGzdx = gzdxService.getListExportGzdx(map, sort, dir); // ///cache 替换 List lPro = new ArrayList(); lPro.add("xm"); lPro.add("zjhm"); lPro.add("xb"); lPro.add("csrq"); lPro.add("minzu"); lPro.add("whcd"); lPro.add("hjdxzqh"); lPro.add("hjdxz"); List lcache = new ArrayList(); /*List lcache_mz = this.getDictItemCacheList("minzu", "dm_mz", "0"); //民族替换 "0"为不加列 "1"替换列 lcache.add(lcache_mz); List lcache_xb = this.getDictItemCacheList("xingbie", "dm_xb", "0"); // 性别 "0"为不加列 "1"替换列 lcache.add(lcache_xb);*/ Gzdx getGzdx = new Gzdx(); lGzdx = this.getResultCache(getGzdx.getClass().getName(), lPro, lGzdx, lcache); session.setAttribute("gzdxExportResult", lGzdx); this.result = "success"; } catch (IOException e) { e.printStackTrace(); this.result = e.getMessage(); } catch (Exception e) { e.printStackTrace(); this.result = e.getMessage(); } return "success"; }
public String querylist() throws Exception { Gzdx setGzdx = new Gzdx(); gzdx = (Gzdx) this.setClass(setGzdx, null); Map map = new HashMap(); map.put("xm", gzdx.getXm()); map.put("xb", gzdx.getXb()); map.put("zjhm", gzdx.getZjhm()); map.put("csrq", gzdx.getCsrq()); map.put("csrq2", gzdx.getCsrq2()); map.put("mzdm", gzdx.getMzdm()); map.put("hjdxzqhdm", gzdx.getHjdxzqhdm()); map.put("hylbdm", gzdx.getHylbdm()); User user = (User) this.getRequest().getSession().getAttribute(Constants.userKey); if (user != null) { String dqdwbm = user.getDepartment().getDepartcode(); int level = user.getDepartment().getDepartlevel().intValue(); if (level >= 3) map.put("tbdabm", StringUtil.trimEven0(dqdwbm) + "%"); map.put("dqdwbm", dqdwbm); } // 如果查询菜单是注销管理,则应该要加一个默认条件为未注销 if ("cancel".equals(gzdx.getFlag())) { map.put("zxbz", "0"); } // 如果选择了姓名拼音的同音查询,则需要得到姓名的拼音 if ("1".equals(gzdx.getTyCheck())) { map.put("xmpy", PinYinUtil.getHanyuPingYin(gzdx.getXm())); map.put("xm", ""); } Page page = gzdxService.getListForPage(map, pagesize, pagerow, sort, dir); totalpage = page.getTotalPages(); totalrows = page.getTotalRows(); lGzdx = page.getData(); setTabledata(lGzdx); this.result = "success"; return "success"; }