📄 registermajoraction.java
字号:
package com.y2.hr.change.majorchange.web.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
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.y2.hr.base.commom.Common;
import com.y2.hr.base.commom.Page;
import com.y2.hr.change.majorchange.bean.MajorChange;
import com.y2.hr.change.majorchange.biz.MarCheBiz;
import com.y2.hr.change.majorchange.web.form.MarCheForm;
import com.y2.hr.human.file.bean.HumanFile;
import com.y2.hr.salary.standard.biz.StandardBiz;
public class RegisterMajorAction extends DispatchAction {
private MarCheBiz biz;
public void setBiz(MarCheBiz biz) {
this.biz = biz;
}
private StandardBiz standBiz;
public void setStandBiz(StandardBiz standBiz) {
this.standBiz = standBiz;
}
/**
* 跳到搜索页面
*
* 输入:调动管理界面
*
* 执行:加载搜索页面的相关信息(I机构,II机构,III机构的集合)
*
* 输出:搜索页面 [显示I机构,II机构,III机构的集合]
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward toSearch(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
return mapping.findForward("toSearch");
}
/**
* 跳转到
*
* 输入: 搜索界面/调动员工列表界面 参数:发送过来的相关参数即第几页
*
* 执行:并根据参数到人力档案表中查询出状态'正常'的员工列表
*
* 输出:调动员工列表界面 [显示调动员工列表]
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward doHumanList(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String first = request.getParameter("first");
String second = request.getParameter("second");
String third = request.getParameter("third");
String time = request.getParameter("time");
List humanList = biz.getHumanList(first, second, third, time);
request.setAttribute("humanList", humanList);
return mapping.findForward("toHumanList");
}
/**
* 转向登记页面
*
* 输入:调动员工列表界面 参数:需调动员工的档案编号
*
* 执行:根据参数查询出员工档案的相关信息
*
* 输出:登记界面 [显示员工档案的相关信息]
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward toRegister(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
@SuppressWarnings("unused")
MarCheForm marForm = (MarCheForm) form;
String hufId = request.getParameter("hufId");
List<?> salaryStandList = standBiz.getSalaryStand();
request.setAttribute("salaryStandList", salaryStandList);
HumanFile humanFile = biz.getHumanFile(hufId);
request.setAttribute("human", humanFile);
return mapping.findForward("toRegister");
}
/**
* 登记 调动登记
*
* 输入:登记界面 参数:填写好的调动登记信息
*
* 执行:将调动的登记信息保存到调动信息表中
*
* 输出:保存成功?成功界面:失败界面
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward doRegister(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
MarCheForm marForm = (MarCheForm) form;
MajorChange marChe = new MajorChange();
BeanUtils.copyProperties(marChe, marForm);
marChe.setRegistTime(Common.format(marForm.getReTime()));
double newSalarySum = standBiz.getSalarySum(marChe
.getNewSalaryStandardId());
marChe.setNewSalarySum(newSalarySum);
boolean boo = biz.add(marChe);
request.setAttribute("boo", boo);
return mapping.findForward("register");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -