@Override public void active(String type, String id) throws ServiceException { // TODO Auto-generated method stub if (type.equals("0")) { // 内部推荐 RecruitmentInsideApplyModel model = recruitmentInsideApplyDAO.get(id); model.setActiveFlag(1); recruitmentInsideApplyDAO.merge(model); } else { // 外部 RecruitmentOutsideApplyModel model = recruitmentOutsideApplyDAO.get(id); model.setActiveFlag(1); recruitmentOutsideApplyDAO.merge(model); } }
@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); }
private List<RecruitmentApplyVO> getRecruitmentApplyListByStage(String id, Integer stage) throws ServiceException { List<RecruitmentApplyVO> results = new ArrayList<RecruitmentApplyVO>(); List<RecruitmentInsideApplyModel> insides = recruitmentInsideApplyDAO.getRecruitmentInsideAppliesByStage(id, stage); List<RecruitmentOutsideApplyModel> outsides = recruitmentOutsideApplyDAO.getRecruitmentOutsideApplysByStage(id, stage); if (insides != null && insides.size() > 0) for (RecruitmentInsideApplyModel model : insides) { RecruitmentApplyVO vo = new RecruitmentApplyVO(); vo.setId(model.getId()); vo.setStage(model.getStage()); vo.setApplyTime(model.getApplyTime()); vo.setStageState(model.getStageState()); vo.setType(0); vo.setActiveFlag(model.getActiveFlag()); vo.setUserName(model.getName()); results.add(vo); } if (outsides != null && outsides.size() > 0) for (RecruitmentOutsideApplyModel model : outsides) { RecruitmentApplyVO vo = new RecruitmentApplyVO(); vo.setId(model.getId()); vo.setStage(model.getStage()); vo.setRecommandUserId(model.getRecommandUserId()); vo.setApplyTime(model.getRecommandTime()); vo.setStageState(model.getStageState()); vo.setType(1); vo.setActiveFlag(model.getActiveFlag()); vo.setUserName(model.getName()); results.add(vo); } return results; }