/**
   * 删除通知,这里接收者只删除中间表信息
   *
   * @return 删除信息成功
   */
  public String deleteNotice() { // 删除通知信息
    FUserNumber = (String) session.get("FUserNumber"); // 从session中取到数据
    for (int i = 0; i < noticeId.size(); i++) { // 先找到所有该信息都给谁发了
      List<TabNoticetosb> nlist = systomNoticeService.findNoticeToByNoticeId(noticeId.get(i));
      for (int j = 0; j < nlist.size(); j++) { // 删除本公司信息的中间表项
        if (nlist.get(j).getMhqxTabUser().getFUserNumber().equals(FUserNumber)) {
          systomNoticeService.deleteNoticeTo(nlist.get(j));
        }
      }
    }

    return "deleteNotice";
  }
  /**
   * 查找到所有的通知
   *
   * @return 返回给研究生发送的所有同志
   */
  public String findAllNotice() {
    FUserNumber = (String) session.get("FUserNumber"); // 从session中取到数据
    List<TabNoticetosb> nlist = systomNoticeService.findNoticeToByUserNum(FUserNumber);
    System.out.println(nlist.size());
    noticeList = new ArrayList<TabNotice>();
    for (int i = 0; i < nlist.size(); i++) {
      if (nlist
          .get(i)
          .getTabNotice()
          .getFInfoType()
          .equals(CommonConstVariable.NOTICE_TYPE_ADMINTOCOMPANY)) {
        noticeList.add(nlist.get(i).getTabNotice());
      }
    }
    if (noticeList.size() > 10) {
      int pages = 10;
      int listlength = this.noticeList.size();
      if (listlength % pages == 0) {
        this.lastPage = listlength / pages;
      } else {
        this.lastPage = listlength / pages + 1;
      }
      if (this.p < 1) this.p = 1;
      if (this.p > this.lastPage) this.p = this.lastPage;
      int startIndex = (this.p - 1) * pages;
      int endIndex = startIndex + pages;
      if (endIndex >= listlength) endIndex = listlength;
      this.noticeList = this.noticeList.subList(startIndex, endIndex);
    }

    return "findAllNotice";
  }
  public String getUserNewNotice() {
    // Notice
    FUserNumber = (String) session.get("FUserNumber");
    // 从session中取到数据
    System.out.println("Notice:" + FUserNumber);
    List<TabNoticetosb> list = systomNoticeService.findNoticeToByUserNum(FUserNumber);
    noticeList = new ArrayList<TabNotice>();
    for (int i = 0; i < list.size(); i++) {
      noticeList.add(list.get(i).getTabNotice());
    }
    //	HttpSession session = ServletActionContext.getRequest().getSession();

    //		if(session.getAttribute("roletype").toString().equals("1"))
    //		{
    //		//homework
    //		isTeacher=1;
    //	homeworkcount =teacherHomeworkManageDAO.findNewHomeworkCount(FUserNumber);
    return "getUserNewNotice";
    //		}
    //		else
    //		{
    //			return "getUserNewNotice";
    //		}
  }
 /**
  * 显示通知的详情
  *
  * @return 返回通知详情信息
  */
 public String showNoticeDetail() { // 显示详情
   detailInfo = systomNoticeService.findNoticeById(detailId);
   return "showNoticeDetail";
 }