public List<WkTUser> findByTrueName(String trueName, List<WkTDept> dlist) { String query = "from WkTUser as u where u.kuName like '%" + trueName + "%' and u.kdId in ("; StringBuffer sb = new StringBuffer(""); for (int i = 0; i < dlist.size(); i++) { WkTDept d = (WkTDept) dlist.get(i); sb.append(d.getKdId() + ""); if (i < (dlist.size() - 1)) { sb.append(","); } } query = query + sb.toString() + ")"; return getHibernateTemplate().find(query); }
public void initWindow() { List deptlist = departmentService.findDeptByKdidAndType(0L, "1"); deptList.setModel(new ListModelList(deptlist)); deptList.setItemRenderer( new ListitemRenderer() { public void render(Listitem arg0, Object arg1) throws Exception { WkTDept dept = (WkTDept) arg1; arg0.setLabel(dept.getKdName()); arg0.setValue(dept.getKdId()); } }); deptList.getItemAtIndex(0).setSelected(true); WkTDept department = (WkTDept) deptlist.get(0); KdId = department.getKdId(); List rolelist = roleService.findByKdidAndKrname(KdId, "ѧÉú"); if (rolelist.size() != 0) { WkTRole role = (WkTRole) rolelist.get(0); Role = role.getKrId(); } search.setDisabled(true); loadTree(); initPanel(); WkTDept dept = (WkTDept) userService.get(WkTDept.class, KdId); yuan.setLabel(dept.getGradeName(WkTDept.GRADE_YUAN)); xi.setLabel(dept.getGradeName(WkTDept.GRADE_XI)); leaderlist.setItemRenderer( new ListitemRenderer() { public void render(Listitem item, Object data) throws Exception { final Student stu = (Student) data; Listcell c1 = new Listcell(item.getIndex() + 1 + ""); Listcell c2 = new Listcell(stu.getStId()); Listcell c3 = new Listcell(stu.getUser().getKuName()); Listcell c4 = new Listcell(stu.getStClass()); Listcell c5 = new Listcell(stu.getUser().getXiDept()); Listcell c6 = new Listcell(stu.getUser().getYuDept()); Listcell c7 = new Listcell(stu.getUser().getKuPasswd()); item.appendChild(c1); item.appendChild(c2); item.appendChild(c3); item.appendChild(c4); item.appendChild(c5); item.appendChild(c6); item.appendChild(c7); } }); }
public void onClick$view() { WkTDept dept = (WkTDept) deptlist.getSelectedItem().getValue(); /*如果JXKH_AppraisalMember中有再去WKTUser中查询**/ // 首先去JXKH_AppraisalMember中查询 List<JXKH_AppraisalMember> managerList = auditConfigService.findManagerPeo(perId.getValue(), perName.getValue(), dept.getKdId()); List<WkTUser> checkedmanagerList = new ArrayList<WkTUser>(); if (managerList.size() > 0) { for (int i = 0; i < managerList.size(); i++) { List<WkTUser> manage = auditConfigService.findUser(managerList.get(i).getKuId()); manage.get(0).getKuName(); checkedmanagerList.add(manage.get(0)); } } listbox1.setModel(new ListModelList(checkedmanagerList)); checkedmanagerList.clear(); }
public List<WkTUser> findByDlistAndTnameAndTno(List<WkTDept> deplist, String tname, String tno) { StringBuffer queryString = new StringBuffer( "from WkTUser as u where u.kuName like '%" + tname + "%' and u.kuLid like '%" + tno + "%' and u.kuId in(select tea.kuId from Teacher as tea )and u.kdId in("); for (int i = 0; i < deplist.size(); i++) { WkTDept dept = (WkTDept) deplist.get(i); queryString.append(dept.getKdId()); if (i < deplist.size() - 1) { queryString.append(","); } } queryString.append(" )order by u.kdId,u.kuLid"); return getHibernateTemplate().find(queryString.toString()); }
/** * * <li>功能描述:将树节点展开并默认打开某个部门用户。 * * @param chi * @param dept void * @author DaLei */ @SuppressWarnings("unchecked") private void openTree(Treechildren chi, WkTDept dept) { if (chi == null) return; List<Treeitem> tlist = chi.getChildren(); for (int i = 0; i < tlist.size(); i++) { Treeitem item = (Treeitem) tlist.get(i); WkTDept d = (WkTDept) item.getValue(); if (d.getKdId().intValue() == dept.getKdId().intValue()) { tree.setSelectedItem(item); if (uWindow == null) { openListWindow(d); } else { uWindow.initWindow(d); } } if (d.getKdLevel() == WkTDept.GRADE_SCH.intValue()) item.setOpen(true); else item.setOpen(false); openTree(item.getTreechildren(), dept); } }
/** * * <li>功能描述:初始化页面 * * @param dept void * @author DaLei */ public void initWindow(WkTDept dept) { this.dept = dept; this.setTitle("编辑部门用户:" + dept.getKdName()); reloadList(); }