/** * 显示选择单位列表 * * @return */ public String selectUnitList() { String selectUnit = this.partition.getOrgIds(); StringBuffer sbOrgId = new StringBuffer(); StringBuffer sbOrgName = new StringBuffer(); StringBuffer html = new StringBuffer(); if (!StringUtils.isEmpty(selectUnit)) { String[] strs = selectUnit.split(","); for (String str : strs) { Organization org = organizationManager.getById(str); String orgName = org.getName(); if (orgName.length() > 16) { orgName = orgName.substring(0, 15) + "..."; } if (org != null) { sbOrgId.append(org.getId() + ","); sbOrgName.append(org.getName() + ","); html.append("<div class='iframe_name_box' id='" + org.getId() + "'>"); html.append("<p class='iframe_name_text'>" + orgName + "</p>"); html.append("<p class='iframe_name_close'>"); html.append("<a onclick=\"delItem('" + org.getId() + "', '" + org.getName() + "')\">"); html.append( "<img src='" + getRequest().getContextPath() + "/images/component/open_textboxclose.gif' width='11' height='11' />"); html.append("</a>"); html.append("</p>"); html.append("</div>"); } } } String str = ServletActionContext.getRequest().getContextPath() + "/images/component/open_textboxclose.gif"; System.out.println(str); getRequest().setAttribute("selectedOrgHTML", html.toString()); if (!StringUtils.isEmpty(sbOrgId.toString())) { String _sbOrgId = sbOrgId.toString().substring(0, sbOrgId.toString().length() - 1); getRequest().setAttribute("selectedIds", _sbOrgId); } if (!StringUtils.isEmpty(sbOrgName.toString())) { String _sbOrgName = sbOrgName.toString().substring(0, sbOrgName.toString().length() - 1); getRequest().setAttribute("selectedNames", _sbOrgName); } return "chonse_jsp"; }
/** * 去分配组织机构页面 * * @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 */ public String grantOrgnizPage() { try { // 取得所有的组织机构 List<Organization> resultTopList = organizationManager.findTopByDf(); String selectedIds = ""; if (partition.getOrganizations() != null && partition.getOrganizations().size() > 0) { for (Organization orgByPar : partition.getOrganizations()) { selectedIds += orgByPar.getId() + "|"; } } // 查找有checked属性的框 String menuXmlString = Common.getOrganizationForFq(resultTopList, selectedIds, null); HttpServletResponse response = getResponse(); response.setContentType("text/xml; charset=UTF-8"); response.setHeader("Cache-control", "no-cache"); response.getWriter().print(menuXmlString); } catch (IOException e) { e.printStackTrace(); } return null; }