예제 #1
0
 /**
  * repeal @Title: repeal @Description: TODO (发布)
  *
  * @param @param request
  * @param @param response
  * @param @param noticeId
  * @param @return 设定文件
  * @return String 返回类型
  * @throws
  */
 @RequestMapping("releaseInfo/{noticeId}")
 public String releaseInfo(
     HttpServletRequest request, HttpServletResponse response, @PathVariable Long noticeId) {
   Infomation infomation = infomationManager.getByObjectId(noticeId);
   infomation.setStatus(IBSConstants.INFOMATION_PUBLISH);
   infomationManager.save(infomation);
   return "redirect:/infomation/listNotice";
 }
예제 #2
0
 @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";
 }
예제 #3
0
 @RequestMapping("repealBatch")
 @ResponseBody
 public String repealBatch(HttpServletRequest request, HttpServletResponse response) {
   String noticeIds = request.getParameter("noticeIds");
   noticeIds = noticeIds.substring(0, noticeIds.length() - 1);
   String[] noticeid = noticeIds.split(",");
   int count = 0;
   for (int i = 0; i < noticeid.length; i++) {
     Long objectid = Long.parseLong(noticeid[i]);
     Infomation infomation = infomationManager.getByObjectId(objectid);
     if (infomation != null) {
       if (infomation.getStatus() != 2) {
         continue;
       }
       infomation.setStatus(IBSConstants.INFOMATION_DRAFT);
       infomationManager.save(infomation);
       count = count + 1;
     } else {
       continue;
     }
   }
   return String.valueOf(count);
 }