@Override
 public void passDocument(String id) throws ServiceException {
   // TODO Auto-generated method stub
   StudentDocumentModel model = studentDocumentDAO.get(id);
   model.setStatus("2");
   model.setReason(null);
   studentDocumentDAO.merge(model);
 }
 @Override
 public StudentDocumentModel saveDocument(StudentDocumentModel model) throws ServiceException {
   // TODO Auto-generated method stub
   if (model.getId() == null) {
     model.setPostTime(new Date());
     studentDocumentDAO.saveOrUpdate(model);
   } else {
     model.setPostTime(new Date());
     studentDocumentDAO.merge(model);
   }
   return model;
 }
 @Override
 public PaginationSupport<StudentDocumentModel> getEducateDocumentsByCondition(
     String enrollId, String documentType, int index, int pageSize) throws ServiceException {
   // TODO Auto-generated method stub
   return studentDocumentDAO.getEducateDocumentsByCondition(
       enrollId, documentType, index, pageSize);
 }
  @Override
  public List<StudentDocumentVO> getStudentDocumentVOList(
      String schoolIds,
      String studentId,
      String teacherName,
      String academicStaffId,
      String checkStatus)
      throws ServiceException {
    // TODO Auto-generated method stub
    List<StudentDocumentVO> result = new ArrayList<StudentDocumentVO>();
    List<StudentDocumentModel> documentList = studentDocumentDAO.getDocumentsByStatus(checkStatus);
    if (documentList != null && documentList.size() > 0)
      for (StudentDocumentModel document : documentList) {
        EnrollModel enroll = enrollDAO.get(document.getEnrollId());
        if (!containID(schoolIds, enroll.getEnrollProductSchool().getId())) continue;

        boolean studentFlag = true;
        boolean teacherFlag = true;
        boolean academicFlag = true;
        StudentDocumentVO vo = new StudentDocumentVO();
        vo.setDocId(document.getId());
        vo.setDocName(document.getName());
        if (document.getDocumentType() == 2) // 获取教学计划
        {
          vo.setDocType("学生教学计划");
          vo.setPostId(document.getPostId());
          vo.setPostTime(document.getPostTime());
          vo.setStatus(document.getStatus());
          vo.setUrl(document.getUrl());
          if (enroll != null) {
            if (studentId != null && studentId != "") {
              if (!enroll.getStudent().getId().equals(studentId)) studentFlag = false;
            }
            if (teacherName != null && teacherName != "") {
              if (!enroll.getTechStaff().equals(teacherName)) teacherFlag = false;
            }
            if (academicStaffId != null && academicStaffId != "") {
              if (!enroll.getAcademicStaff().equals(academicStaffId)) academicFlag = false;
            }
            if (studentFlag && teacherFlag && academicFlag) {
              vo.setAcademicStaff(enroll.getAcademicStaff().getId());
              vo.setStudentName(enroll.getStudent().getId());
              vo.setTeachStaff(enroll.getTechStaff().getId());
              result.add(vo);
            }
          }
        }
      }

    return result;
  }
 @Override
 public void removeDocument(String id) throws ServiceException {
   // TODO Auto-generated method stub
   studentDocumentDAO.remove(studentDocumentDAO.get(id));
 }
 @Override
 public StudentDocumentModel getDocument(String id) throws ServiceException {
   // TODO Auto-generated method stub
   return studentDocumentDAO.get(id);
 }