@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); }
@Override public List<NoticeModel> getTop10Notices() throws ServiceException { // TODO Auto-generated method stub PaginationSupport<NoticeModel> ps = getNoticesByConditions(null, null, null, null, null, null, null, null, null, 0, 10); if (ps != null) return ps.getItems(); else return null; }