📄 engageresumeaction.java
字号:
package org.better.hr.web.action;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.better.hr.comm.CopyBean;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
import org.better.hr.biz.ConfigMajorBiz;
import org.better.hr.biz.ConfigMajorKindBiz;
import org.better.hr.biz.ConfigPublicCharBiz;
import org.better.hr.biz.EngageInterviewBiz;
import org.better.hr.biz.EngageMajorReleaseBiz;
import org.better.hr.biz.EngageResumeBiz;
import org.better.hr.comm.Load;
import org.better.hr.comm.Util;
import org.better.hr.entity.EngageInterview;
import org.better.hr.entity.EngageResume;
import org.better.hr.exception.HrException;
import org.better.hr.web.form.EngageResumeForm;
public class EngageResumeAction extends BasicAction {
private ConfigMajorKindBiz configmajorkindBiz;
private ConfigMajorBiz configmajorBiz;
private ConfigPublicCharBiz configpubliccharBiz;
private EngageResumeBiz engageresumeBiz;
private EngageMajorReleaseBiz engagemajorreleaseBiz;
private EngageInterviewBiz engageinterviewBiz;
private final String _PICPATH = "Upload\\img\\";
private final String _ATTPATH = "Upload\\attach\\";
public EngageInterviewBiz getEngageinterviewBiz() {
return engageinterviewBiz;
}
public void setEngageinterviewBiz(EngageInterviewBiz engageinterviewBiz) {
this.engageinterviewBiz = engageinterviewBiz;
}
public EngageMajorReleaseBiz getEngagemajorreleaseBiz() {
return engagemajorreleaseBiz;
}
public void setEngagemajorreleaseBiz(EngageMajorReleaseBiz engagemajorreleaseBiz) {
this.engagemajorreleaseBiz = engagemajorreleaseBiz;
}
public EngageResumeBiz getEngageresumeBiz() {
return engageresumeBiz;
}
public void setEngageresumeBiz(EngageResumeBiz engageresumeBiz) {
this.engageresumeBiz = engageresumeBiz;
}
public ConfigPublicCharBiz getConfigpubliccharBiz() {
return configpubliccharBiz;
}
public void setConfigpubliccharBiz(ConfigPublicCharBiz configpubliccharBiz) {
this.configpubliccharBiz = configpubliccharBiz;
}
public ConfigMajorBiz getConfigmajorBiz() {
return configmajorBiz;
}
public void setConfigmajorBiz(ConfigMajorBiz configmajorBiz) {
this.configmajorBiz = configmajorBiz;
}
public ConfigMajorKindBiz getConfigmajorkindBiz() {
return configmajorkindBiz;
}
public void setConfigmajorkindBiz(ConfigMajorKindBiz configmajorkindBiz) {
this.configmajorkindBiz = configmajorkindBiz;
}
/**
* 点击"简历登记"时调用
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
public ActionForward toAdd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws HrException
{
List list_majorkind = this.getConfigmajorkindBiz().list(null);
List list_major = this.getConfigmajorBiz().list(null);
HashMap map = this.getConfigpubliccharBiz().listForHumanFile(null);
request.setAttribute("list_majorkind", list_majorkind);
request.setAttribute("list_major", list_major);
request.setAttribute("map", map);
return mapping.findForward("add");
}
/**
* 执行添加带有图片和附件的简历
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws HrException
*/
public ActionForward doAdd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws HrException
{
HttpSession session = request.getSession();
EngageResume condition = (EngageResume)session.getAttribute("item");//得到带有图片和附件的简历
this.getEngageresumeBiz().add(condition); //将该简历添加入数据库
session.removeAttribute("item");
return mapping.findForward("add_success");
}
/**
* 从注册页面跳转到添加图片页面
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
public ActionForward toUpLoadPhoto(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws HrException
{
EngageResumeForm myForm = (EngageResumeForm) form;
HttpSession session = request.getSession();
if(myForm.getItem().getHumanName() != null)
session.setAttribute("item", myForm.getItem());
return mapping.findForward("choose_picture");
}
/**
* 执行添加图片
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws HrException
*/
public ActionForward doUpLoadPhoto(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws HrException
{
EngageResumeForm myForm = (EngageResumeForm) form;
FormFile file = myForm.getThePhoto();//得到所上传的文件
String filepath = servlet.getServletContext().getRealPath("\\") + _PICPATH;
String myPic = Load.upload(file, filepath); //上传图片
HttpSession session = request.getSession();
EngageResume er = (EngageResume)session.getAttribute("item"); //得到注册时的EngageResume对象
er.setHumanPicture(_PICPATH + myPic);
session.setAttribute("item", er); //将对象存放到session中,以便其他页面调用
return mapping.findForward("addAttach");
}
/**
* 跳转到添加附件页面
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws HrException
*/
public ActionForward toUpLoadAttach(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws HrException
{
EngageResumeForm myForm = (EngageResumeForm) form;
HttpSession session = request.getSession();
if(myForm.getItem().getHumanName() != null)
session.setAttribute("item", myForm.getItem());
return mapping.findForward("addAttach");
}
/**
* 执行添加附件
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws HrException
*/
public ActionForward doUpLoadAttach(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws HrException
{
EngageResumeForm myForm = (EngageResumeForm) form;
FormFile file = myForm.getTheAttach();
String filepath = servlet.getServletContext().getRealPath("\\") + _ATTPATH;
String myAttach = Load.upload(file, filepath); //上传附件,并返回附件名称
HttpSession session = request.getSession();
EngageResume er = (EngageResume)session.getAttribute("item");
er.setAttachmentName(_ATTPATH + myAttach);
session.setAttribute("item", er); //将对象存放到session中,以便其他页面调用
return mapping.findForward("finish");
}
/**
* 由发布职位查询列表中的"申请该职位"按钮调用,并转到query页面
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
public ActionForward toApply(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws HrException
{
return mapping.findForward("apply");
}
/**
* 由超链"筛选"调用
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
public ActionForward toEdit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws HrException
{
EngageResumeForm myForm = (EngageResumeForm)form;
short id = Short.valueOf(request.getParameter("id"));
EngageResume er = this.getEngageresumeBiz().getERbyID(id);
String path[] = Util.splitPath(er.getAttachmentName());
if(path != null )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -