⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 engageinterviewaction.java

📁 人力资源管理系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.accphr.web.action;

import java.io.PrintWriter;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.accphr.biz.IEngageInterviewBiz;
import com.accphr.biz.IEngageResumeBiz;
import com.accphr.entity.EngageInterview;
import com.accphr.entity.EngageResume;
import com.accphr.page.PageResult;
import com.accphr.web.form.EngageInterviewForm;

/** 
 * 面试管理
 * XDoclet definition:
 * @struts.action path="/engageInterview" name="engageInterviewForm" parameter="opei" scope="request"
 */
public class EngageInterviewAction extends DispatchAction {
	
	private IEngageInterviewBiz engageInterviewBiz;
	private IEngageResumeBiz engageResumeBiz;
	
	
	public void setEngageResumeBiz(IEngageResumeBiz engageResumeBiz) {
		this.engageResumeBiz = engageResumeBiz;
	}



	public void setEngageInterviewBiz(IEngageInterviewBiz engageInterviewBiz) {
		this.engageInterviewBiz = engageInterviewBiz;
	}


	//显示
	public ActionForward toList(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		EngageInterviewForm engageInterviewForm = (EngageInterviewForm) form;
		
		if(request.getParameter("eresult")!=null){
			PageResult pageResult=engageInterviewForm.getPageResult();
			this.engageInterviewBiz.setPageResult(null, pageResult);
			request.setAttribute("jieguo", "jieguo");
		}
		else{
			EngageInterview engageInterview=engageInterviewForm.getEngageInterview();
			
			EngageResume engageResume=new EngageResume();
			engageResume.setHumanMajorKindId(engageInterview.getHumanMajorKindId());
			engageResume.setHumanMajorId(engageInterview.getHumanMajorId());
			engageResume.setHumanName(engageInterview.getHumanName());
			engageResume.setHumanHistoryRecords(engageResume.getHumanName());
			engageResume.setRemark(engageInterview.getChecker());
			engageResume.setAttachmentName(engageInterview.getRegister());
			
			PageResult pageResult=engageInterviewForm.getPageResult();
			this.engageResumeBiz.setPageResult(engageResume, pageResult);
		}
		return mapping.findForward("tolist");
	}
	
	
	//到添加页面
	public ActionForward toAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		EngageInterviewForm engageInterviewForm = (EngageInterviewForm) form;
		Short eid=Short.parseShort(request.getParameter("eid"));
		//获取简历信息
		EngageResume engageResume=this.engageResumeBiz.findById(eid);
		request.setAttribute("ermes", engageResume);
		//获取面试次数
		EngageInterview engageInterview=new EngageInterview();
		engageInterview.setHumanName(engageResume.getHumanName());
		List list=this.engageInterviewBiz.find(engageInterview);
		if(list!=null)
		request.setAttribute("amount", list.size());
		return mapping.findForward("toadd");
	}
	
	//添加
	public ActionForward doAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		EngageInterviewForm engageInterviewForm = (EngageInterviewForm) form;
		
		EngageInterview engageInterview =engageInterviewForm.getEngageInterview();
		//取面试时间
		String times=request.getParameter("times");
		try {
			SimpleDateFormat format =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			Date date=format.parse(times);
			//设置面试时间
			engageInterview.setRegisteTime(new Timestamp(date.getTime()));
		} catch (ParseException e) {
			e.printStackTrace();
		}
		//更改用户的面试状态
		EngageResume engageResume=this.engageResumeBiz.findById(engageInterview.getResumeId());
		engageResume.setInterviewStatus(Short.parseShort("1"));
		this.engageResumeBiz.update(engageResume);
		//添加面试结果
		this.engageInterviewBiz.add(engageInterview);
		
		PrintWriter out=response.getWriter();
		out.print("<script>alert('添加成功');location.href='engageInterview.do?opei=toList'</script>");
		
		return null;
	}
	
	//到筛选页面
	public ActionForward toCheck(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		EngageInterviewForm engageInterviewForm = (EngageInterviewForm) form;
		Short eid=Short.parseShort(request.getParameter("eid"));
		EngageInterview engageInterview=engageInterviewForm.getEngageInterview();
		engageInterview=this.engageInterviewBiz.findById(eid);
		engageInterviewForm.setEngageInterview(engageInterview);
		//获取简历信息
		EngageResume engageResume=this.engageResumeBiz.findById(engageInterview.getResumeId());
		request.setAttribute("ermes", engageResume);
		
		return mapping.findForward("tocheck");
	}
	//到筛选查询页面
	public ActionForward toCheckFind(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		EngageInterviewForm engageInterviewForm = (EngageInterviewForm) form;
		PageResult pageResult=engageInterviewForm.getPageResult();
		this.engageInterviewBiz.setPageResult(null, pageResult);
		return mapping.findForward("tocheckfind");
	}
	
	//筛选
	public ActionForward doCheck(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		EngageInterviewForm engageInterviewForm = (EngageInterviewForm) form;
		EngageInterview engageInterview =engageInterviewForm.getEngageInterview();
		if(engageInterview.getResult().equals("删除简历")){
			
			this.engageInterviewBiz.del(engageInterview.getEinId());
			this.engageResumeBiz.del(engageInterview.getResumeId());
			//取该简历所有面试结果
			EngageInterview engageInterview2=new EngageInterview();
			engageInterview2.setResumeId(engageInterview.getResumeId());
			List list=this.engageInterviewBiz.find(engageInterview2);
			//删除该简历的所有面试结果
			for (int i = 0; i < list.size(); i++) {
				EngageInterview engageInterview3=(EngageInterview)list.get(i);
				this.engageInterviewBiz.del(engageInterview3.getEinId());
			}
			
			
			PrintWriter out=response.getWriter();
			out.print("<script>alert('删除成功');location.href='engageInterview.do?opei=toCheckFind'</script>");
			
			return null;
		}else{
			if(engageInterview.getResult().equals("建议面试")){
				engageInterview.setRegister(null);
				EngageResume engageResume=this.engageResumeBiz.findById(engageInterview.getResumeId());
				engageResume.setCheckStatus(Short.parseShort("0"));
				this.engageResumeBiz.update(engageResume);
			
			}
			//取时间
			String times=request.getParameter("times");
			try {
				SimpleDateFormat format =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
				Date date=format.parse(times);
				//设置时间
				engageInterview.setCheckTime(new Timestamp(date.getTime()));
			} catch (ParseException e) {
				e.printStackTrace();
			}
			//如果筛选结果为'建议录用'则其状态为1,如果筛选结果为"建议笔试",则其状态为2(是否能进行笔试的条件).
			if(engageInterview.getResult().equals("建议录用")){
				EngageResume engageResume=this.engageResumeBiz.findById(engageInterview.getResumeId());
				engageResume.setCheckStatus(Short.parseShort("1"));
				this.engageResumeBiz.update(engageResume);
			}
			if(engageInterview.getResult().equals("建议笔试")){
				EngageResume engageResume=this.engageResumeBiz.findById(engageInterview.getResumeId());
				engageResume.setCheckStatus(Short.parseShort("2"));
				this.engageResumeBiz.update(engageResume);
			}
			//取该简历所有面试结果
			EngageInterview engageInterview2=new EngageInterview();
			engageInterview2.setResumeId(engageInterview.getResumeId());
			List list=this.engageInterviewBiz.find(engageInterview2);
			//删除该简历的所有面试结果
			for (int i = 0; i < list.size(); i++) {
				EngageInterview engageInterview3=(EngageInterview)list.get(i);
				this.engageInterviewBiz.del(engageInterview3.getEinId());
			}
			
			this.engageInterviewBiz.add(engageInterview);
	
			PrintWriter out=response.getWriter();
			out.print("<script>alert('筛选成功');location.href='engageInterview.do?opei=toCheckFind'</script>");
			
			return null;
		}
	}
	
	//删除
	public ActionForward doDel(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		EngageInterviewForm engageInterviewForm = (EngageInterviewForm) form;
		return null;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -