コード例 #1
0
ファイル: InfomationController.java プロジェクト: avords/w-hr
 /**
  * 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
ファイル: InfomationController.java プロジェクト: avords/w-hr
  @RequestMapping("detail/{noticeId}")
  public String detail(
      HttpServletRequest request, HttpServletResponse response, @PathVariable Long noticeId) {
    Infomation infomation = infomationManager.getByObjectId(noticeId);
    User user = userManager.getUserByUserId(infomation.getCreatedBy());
    infomation.setCreateUserName(user.getUserName());
    request.setAttribute("infomation", infomation);

    InfomationNotice sample = new InfomationNotice();
    sample.setInfomationId(noticeId);
    List<InfomationNotice> notices = infomationNoticeManager.getBySample(sample);
    request.setAttribute("notices", notices);
    return getFileBasePath() + "detail";
  }
コード例 #3
0
ファイル: InfomationController.java プロジェクト: avords/w-hr
 @RequestMapping("edit/{objectId}/{type}")
 public String saveActivity(
     HttpServletRequest request,
     HttpServletResponse response,
     @PathVariable Long objectId,
     @PathVariable Integer type) {
   Infomation infomation = infomationManager.getByObjectId(objectId);
   infomation.setTitle(infomation.getTitle().trim());
   request.setAttribute("infomation", infomation);
   InfomationNotice sample = new InfomationNotice();
   sample.setInfomationId(objectId);
   List<InfomationNotice> notices = infomationNoticeManager.getBySample(sample);
   request.setAttribute("notices", notices);
   if (IBSConstants.HR_ACTIVITY == type) {
     return getFileBasePath() + "addActivity";
   } else if (IBSConstants.HR_NOTICE == type) {
     return getFileBasePath() + "addNotice";
   } else {
     return "redirect:detail/" + objectId;
   }
 }
コード例 #4
0
ファイル: InfomationController.java プロジェクト: avords/w-hr
 @RequestMapping("delBatch")
 @ResponseBody
 public String delete(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() != 1) {
         continue;
       }
       infomationManager.delete(objectid);
       count = count + 1;
     } else {
       continue;
     }
   }
   return String.valueOf(count);
 }