@RequestMapping("saveActivity") public String saveActivity( HttpServletRequest request, HttpServletResponse response, Infomation t) { User user = (User) request.getSession().getAttribute(SecurityConstants.SESSION_USER); t.setType(IBSConstants.HR_NOTICE); t.setCreatedOn(new Date()); t.setCreatedBy(user.getObjectId()); t.setCompanyId(user.getCompanyId()); if (IBSConstants.USER_TYPE_COMPANY_ADMIN != user.getType()) { t.setOrganizationId(user.getOrganizationId()); } t.setTitle(t.getTitle().trim()); t.setContent(UeditorUtils.convertSpace(t.getContent())); if (IBSConstants.PLATFORM_NOTICE_ALL_USER.equals(t.getFaceMember())) { t.setFacePeople(IBSConstants.STATUS_YES); } else { t.setFacePeople(IBSConstants.STATUS_NO); } t = infomationManager.save(t); InfomationNotice delInfomationNotice = new InfomationNotice(); delInfomationNotice.setInfomationId(t.getObjectId()); infomationNoticeManager.deleteBySample(delInfomationNotice); if (IBSConstants.PLATFORM_NOTICE_ALL_USER.equals(t.getFaceMember())) { InfomationNotice infomationNotice = new InfomationNotice(); infomationNotice.setInfomationId(t.getObjectId()); infomationNotice.setAllUser(IBSConstants.PLATFORM_NOTICE_ALL_USER); infomationNotice.setCompanyId(user.getCompanyId()); infomationNoticeManager.save(infomationNotice); } else { String[] members = request.getParameterValues("userId"); for (String memberId : members) { InfomationNotice infomationNotice = new InfomationNotice(); infomationNotice.setUserId(Long.parseLong(memberId)); infomationNotice.setInfomationId(t.getObjectId()); infomationNotice.setCompanyId(user.getCompanyId()); infomationNoticeManager.save(infomationNotice); } } return "redirect:listNotice"; }