/** * 进入更新页面 * * @return */ public String edit() { getRequest().setAttribute(DEPTS, organizationManager.findAllByDf()); // 性别 this.sexMap = dicUtil.getDicList("DICT_SEX"); // 组织机构IDS StringBuffer sbId = new StringBuffer(); StringBuffer sbText = new StringBuffer(); for (OrganizationUserRelation our : user.getOuRelations()) { if (our.getOrganization() != null) { sbId.append(our.getOrganization().getId() + ","); sbText.append(our.getOrganization().getName() + ","); } } try { // 创建一个webservice /* * WebApplicationContext wac = * WebApplicationContextUtils.getRequiredWebApplicationContext * (getRequest().getSession().getServletContext()); PictureService * pictureService = (PictureService)wac.getBean("pictureService"); * AttachmentImpl [] attachments = * pictureService.findAttachment(user.getId(), * FILE_NAME,FILE_MODEL); */ ClientAttachmentService clientAttach = new ClientAttachmentService(); List<Attachment> attachments = clientAttach.findAttachmentByXml(user.getId(), FILE_NAME, FILE_MODEL); if (attachments != null && attachments.size() > 0) { getRequest().setAttribute("attachment", attachments.get(0)); } } catch (Exception e) { getRequest().setAttribute("attachment", null); } String ids = sbId.toString(); String texts = sbText.toString(); if (ids != null && !ids.equals("")) { user.setDeptIDs(ids.substring(0, ids.length() - 1)); user.setDeptsString(texts.substring(0, texts.length() - 1)); } return EDIT_JSP; }
/** * 修改个人设置页面 * * @return */ public String editPersonPage() { user = userManager.getById(getCurrUser().getUserID()); // getRequest().setAttribute("depts", deptManager.findAll()); // getRequest().setAttribute(DEPTS, organizationManager.findAllByDf()); // 性别 this.sexMap = dicUtil.getDicList("DICT_SEX"); // 组织机构IDS StringBuffer sbId = new StringBuffer(); StringBuffer sbText = new StringBuffer(); for (OrganizationUserRelation our : user.getOuRelations()) { sbId.append(our.getOrganization().getId() + ","); sbText.append(our.getOrganization().getName() + ","); } String ids = sbId.toString(); String texts = sbText.toString(); if (ids != null && !ids.equals("")) { user.setDeptIDs(ids.substring(0, ids.length() - 1)); user.setDeptsString(texts.substring(0, texts.length() - 1)); } return EDIT_PERSON_INFO; }