Пример #1
0
 @Override
 public void closeRecruitment(String id) throws ServiceException {
   // TODO Auto-generated method stub
   RecruitmentModel model = recruitmentDAO.get(id);
   model.setState(RecruitmentModel.EState.OverTime.getValue());
   recruitmentDAO.saveOrUpdate(model);
 }
Пример #2
0
 @Override
 public PaginationSupport<RecruitmentModel> getRecruitmentsByCondition(
     String schoolId,
     String departmentId,
     String postName,
     String scopes,
     String states,
     String beginDate,
     String endDate,
     int index,
     int pageSize)
     throws ServiceException {
   //		String now=(new Date()).pattern("yyyy-MM-dd") ;
   //		DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
   //		String now=format1.format(new Date());
   //
   //		PaginationSupport<RecruitmentModel> ps= recruitmentDAO.getRecruitmentsByCondition(schoolId,
   // departmentId, postName, scopes, states, beginDate, endDate, index, pageSize);
   //		if(ps!=null&&ps.getItemCount()>0){
   //			for(RecruitmentModel model:ps.getItems()){
   //
   //				if(model.getEndTime()!=null)
   //				{
   //
   //					int   res   =   format1.format(model.getEndTime()).compareTo(now);
   //
   //					if(res<0)
   //					{
   //						model.setState(RecruitmentModel.EState.OverTime.getValue());
   ////
   ////						newModel=recruitmentDAO.get(model.getId());
   ////						newModel.setState(RecruitmentModel.EState.OverTime.getValue());
   ////						recruitmentDAO.merge(newModel);
   //					}
   //				}
   //				else
   //				{
   //					model.setState(RecruitmentModel.EState.OverTime.getValue());
   ////					newModel.setState(RecruitmentModel.EState.OverTime.getValue());
   ////					recruitmentDAO.merge(newModel);
   //				}
   //
   //			}
   //		}
   PaginationSupport<RecruitmentModel> resultList =
       recruitmentDAO.getRecruitmentsByCondition(
           schoolId, departmentId, postName, scopes, states, beginDate, endDate, index, pageSize);
   if (resultList != null && resultList.getItemCount() > 0)
     for (int i = 0; i < resultList.getItemCount(); i++) {
       RecruitmentModel model = resultList.getItems().get(i);
       int inside =
           recruitmentInsideApplyDAO.getRecruitmentInsideAppliesByRecruitmentId(model.getId());
       int outside =
           recruitmentOutsideApplyDAO.getRecruitmentOutsideApplysByRecruitmentId(model.getId());
       int total = inside + outside;
       resultList.getItems().get(i).setApplicantNum(total);
     }
   return resultList; // recruitmentDAO.getRecruitmentsByCondition(schoolId, departmentId,
                      // postName, scopes, states, beginDate, endDate, index, pageSize);
 }
Пример #3
0
  @Override
  public void saveRecruitment(RecruitmentModel model, String attachmentIds)
      throws ServiceException {
    if (StringUtils.isEmpty(model.getId())) model.setPostTime(new Date());
    model.setAttachments(null);
    recruitmentDAO.saveOrUpdate(model);

    if (StringUtils.isNotEmpty(attachmentIds)) {
      String[] ids = attachmentIds.split(";");
      for (int i = 0; i < ids.length; i++) {
        AttachmentModel attachment = attachmentDAO.get(ids[i]);
        attachment.setBelongObject(RecruitmentModel.class.getSimpleName());
        attachment.setBelongObjectId(model.getId());
        attachmentDAO.saveOrUpdate(attachment);
      }
    }
    RecruitmentModel newModel = recruitmentDAO.get(model.getId());
    recruitmentDAO.merge(newModel);
  }
Пример #4
0
 @Override
 public List<RecruitmentModel> getRecruitmentsByCondition(
     String schoolId,
     String departmentId,
     String postName,
     String scopes,
     String states,
     String beginDate,
     String endDate)
     throws ServiceException {
   // TODO Auto-generated method stub
   return recruitmentDAO.getRecruitmentsByCondition(
       schoolId, departmentId, postName, scopes, states, beginDate, endDate);
 }
Пример #5
0
 @Override
 public void remove(String id) throws ServiceException {
   // TODO Auto-generated method stub
   recruitmentDAO.remove(recruitmentDAO.get(id));
 }
Пример #6
0
 @Override
 public RecruitmentModel getRecruitment(String id) throws ServiceException {
   return recruitmentDAO.get(id);
 }