public String listAjax() { CmsRequestlogQuery query = newQuery(CmsRequestlogQuery.class, DEFAULT_SORT_COLUMNS); String sort = this.getRequest().getParameter("sort"); if (StringUtils.isNotEmpty(sort)) query.setSortColumns(sort); Page page = cmsRequestlogManager.findPage(query); Map map = new HashMap(); map.put("total", page.getTotalCount()); map.put("rows", page.getResult()); return writeAjaxResponse(Json.toJson(map)); }
/** * 发起测评 -- 跨单位 * * @return */ public String outUserList() { Page page = this.userManager.findOutPage(query, this.getCurrUser().getDeptIDs()); String userId = query.getId(); List<User> userList = page.getResult(); for (User user : userList) { String uId = user.getId(); if (!isNullOrEmptyString(userId)) { if (userId.indexOf(uId) != -1) { user.setChecked("1"); } } } super.saveCurrentPage(page, query); return "outUserList"; }
public String sponsorList() { Page page = this.userManager.findHead(query); String userId = query.getId(); List<User> usersList = page.getResult(); for (User user : usersList) { String uId = user.getId(); if (!isNullOrEmptyString(userId)) { if (userId.indexOf(uId) != -1) { user.setChecked("1"); } } } this.saveCurrentPage(page, query); return "sponsorList"; }
/** * 去分配组织机构页面 * * @return */ public String toGrantOrganizPage() { OrganizationQuery orgQuery = new OrganizationQuery(); BeanUtils.copyProperties(orgQuery, query); orgQuery.setDf("0"); orgQuery.setPageSize(Integer.MAX_VALUE); Page page = organizationManager.findPage(orgQuery); List<Organization> l = page.getResult(); String selectIds = this.partition.getOrgIds(); for (Organization org : l) { if (StrUtil.isNotNullOrBlank(selectIds)) { if (selectIds.indexOf(org.getId()) != -1) { org.setChecked("checked"); } } } this.saveCurrentPage(page, query); return GRANT_ORGANIZ_JSP; }
/** * 加载用户列表,用于选择用户组件 * * @return */ @SuppressWarnings("unchecked") public String loadUserList() { query.setDf("0"); // 如果是取某分区下的用户,根据分区下的组织机构取得所有用户 if (partitionId != null && !"".equals(partitionId)) { Partition partition = partitionManager.getById(partitionId); if (partition != null) { query.setOrganizIds(organizationManager.findAllChildByPartition(partition)); } } Page page = this.organizationUserRelationManager.findByUserPage(query); page = userManager.findPage(query); List<User> users = page.getResult(); // 处理部门列表 for (User user : users) { user.setDeptsString(""); if (user.getOuRelations() != null) { StringBuffer sb = new StringBuffer(); for (OrganizationUserRelation our : user.getOuRelations()) { if (our.getOrganization() != null) { sb.append(our.getOrganization().getName() + ","); } } user.setDeptsString(sb.toString()); } } // 性别 for (User user : users) { /*if (user.getSex() != null && !user.getSex().equals("")) { this.sexMap = this.dicUtil.getDicList("DICT_SEX"); user.setSexString(this.sexMap.get(user.getSex())); }*/ } this.saveCurrentPage(page, query); return "loadUserList"; }
/** * 执行搜索 * * @return */ @SuppressWarnings("unchecked") public String list() { // Flash.current().clear(); /*// 删除标记的不显示 query.setDf("0"); // 启用状态 query.setAbledFlag(this.abledFlag); // 如果是取某分区下的用户,根据分区下的组织机构取得所有用户 if (partitionId != null && !"".equals(partitionId)) { Partition partition = partitionManager.getById(partitionId); if (partition != null) { query.setOrganizIds(organizationManager.findAllChildByPartition(partition)); } }*/ Page page = this.organizationUserRelationManager.findByUserPage(query); List<User> users = page.getResult(); // 处理部门列表 for (User user : users) { user.setDeptsString(""); if (user.getOuRelations() != null) { StringBuffer sb = new StringBuffer(); for (OrganizationUserRelation our : user.getOuRelations()) { if (our.getOrganization() != null) { sb.append(our.getOrganization().getName() + ","); } } user.setDeptsString(sb.toString()); } } this.saveCurrentPage(page, query); return LIST_JSP; }
@SuppressWarnings("unchecked") public String loadExtSubsTree(final HttpServletRequest pRequest, LeafInfo leafInfo) throws Exception { final Long parentID = leafInfo.getLeafParentId(); final String parentTYPE = leafInfo.getLeafParentType(); PageRequest pageRequest = bindPageRequest(pRequest, leafInfo, DEFAULT_SORT_COLUMNS); pageRequest.setPageSize(1000); Page nodesPages = leafInfoManager.findByPageRequest(pageRequest); AbstractWebTreeModelCreator treeModelCreator = new AbstractWebTreeModelCreator() { @Override protected Node createNode(Object pUserData, UserDataUncoder pUncoder) { LeafInfo leaf = (LeafInfo) pUserData; WebTreeDynamicNode result = new WebTreeDynamicNode( leaf.getLeafName(), leaf.getLeafType() + "_" + leaf.getLeafId()); result.setSubTreeURL( getUrl( "/tree/" + leaf.getLeafId() + "?" + PARENT_ID + "=" + leaf.getLeafId() + "&" + PARENT_TYPE + "=" + leaf.getLeafType() + "&random=" + Math.random())); result.setValue(String.valueOf(leaf.getLeafId())); result.setTip(leaf.getLeafName()); // 台区 if (SystemConst.TREE_TG.equals(leaf.getLeafType())) { result.setIcon(getUrl(TG_IMG)); result.setAction("javascript:showTg(" + leaf.getLeafId() + ")"); } else if (SystemConst.TREE_ORG.equals(leaf.getLeafType())) { result.setIcon(getUrl(ORG_IMG)); result.setAction("javascript:showOrg(" + leaf.getLeafId() + ")"); } return result; } }; treeModelCreator.init(pRequest); TreeModel treeModel = treeModelCreator.create( nodesPages.getResult(), new UserDataUncoder() { public Object getParentID(Object arg) throws UncodeException { return parentID; } public Object getID(Object arg) throws UncodeException { return ((LeafInfo) arg).getLeafId(); } }); TreeDirector director = new DefaultTreeDirector(); director.setComparator(new DefaultNodeComparator()); WebTreeBuilder treeBuilder = new ExtSubTreeBuilder(); treeBuilder.init(pRequest); director.build(treeModel, treeBuilder); String treeScript = treeBuilder.getTreeScript(); return treeScript; }