/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.compensation.webapp.employeeManage.action;
import java.util.ArrayList;
import java.util.Calendar;
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.compensation.model.Employeeinfo;
import com.compensation.model.Empout;
import com.compensation.model.Users;
import com.compensation.service.common.CreateExcelService;
import com.compensation.service.employeeManage.EmpAccess;
import com.compensation.service.employeeManage.EmpInfoEntity;
import com.compensation.service.powercontrol.IPowerService;
import com.compensation.webapp.employeeManage.form.EmpManagerForm;
/**
* MyEclipse Struts Creation date: 04-23-2008
*
* XDoclet definition:
*
* @struts.action validate="true"
*/
public class HrefActionAction extends DispatchAction {
/*
* Generated Methods
*/
private CreateExcelService createExcelService;
private EmpAccess empAccess;
public EmpAccess getEmpAccess() {
return empAccess;
}
public void setEmpAccess(EmpAccess empAccess) {
this.empAccess = empAccess;
}
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
// 人员调出前数据查询
public ActionForward redeploy(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EmpManagerForm empManagerForm = (EmpManagerForm) form;// TODO
// Auto-generated
// method stub
int empid = Integer.parseInt(request.getParameter("objempid")
.toString());
//给出调出日期默认值 默认当前时间
Date dt=new Date();
int outDate=dt.toLocaleString().lastIndexOf("-")+2;
empManagerForm.setOutdate(dt.toLocaleString().substring(0, outDate).trim());
List ls = (List) request.getSession().getAttribute("rst");
for (int i = 0; i < ls.size(); i++) {
EmpInfoEntity objEmpInfoEntity = (EmpInfoEntity) ls.get(i);
if (objEmpInfoEntity.getEmpId() == empid) {
request.setAttribute("outinfo", objEmpInfoEntity);
}
// 查询流出原因
request.setAttribute("outcousers", this.getEmpAccess()
.queryOutcause(1, 0));
Users userinfo = (Users) request.getSession().getAttribute(IPowerService.WHO_ATTRIBUTE);
String userEmpName=this.getEmpAccess().queryEmpName(userinfo.getUsersEmpId()).get(0).toString();
request.setAttribute("user", userEmpName);
}
return mapping.findForward("perOut");
}
// 人员调出
public ActionForward redeployOut(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EmpManagerForm empManagerForm = (EmpManagerForm) form;// TODO
// Auto-generated
// method stub
// 员工编号
int empid = Integer.parseInt(empManagerForm.getEmpId());
// 员工原机构名称
int fromOrgId = Integer.parseInt(request.getSession().getAttribute(
"org_Id").toString());
// 调出日期
Date outDate = this.getEmpAccess().dateParse(
empManagerForm.getOutdate());
// 调出原因编号
int outCauseId = Integer.parseInt(empManagerForm.getOutcouser());
Users userinfo = (Users) request.getSession().getAttribute(IPowerService.WHO_ATTRIBUTE);
int userId=userinfo.getUserId();
// 向人员流出信息表插入一条记录
this.getEmpAccess().savaEmpOut(empid, fromOrgId, outDate, userId,
outCauseId);
Employeeinfo employeeinfo = new Employeeinfo();
// 更改人员状态
employeeinfo.setEmpStateId(2);
this.getEmpAccess().updateEmpInfo(employeeinfo, empid, 1);
return mapping.findForward("outOk");
}
// 人员调入前数据查询
public ActionForward redeployto(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EmpManagerForm empManagerForm = (EmpManagerForm) form;// TODO
// Auto-generated
// method stub
List ls = this.getEmpAccess().queryOutPer(
Integer.parseInt(request.getSession().getAttribute("org_Id")
.toString()), 0);
List outPers = new ArrayList();
for (int i = 0; i < ls.size(); i++) {
EmpInfoEntity objEmpInfoEntity = new EmpInfoEntity();
Empout obj = (Empout) ls.get(i);
objEmpInfoEntity.setEmpId(obj.getEmpId());
objEmpInfoEntity.setEmpName(this.getEmpAccess().queryEmpName(
obj.getEmpId()).get(0).toString());
objEmpInfoEntity.setFromOrgName(this.getEmpAccess().queryframework(
obj.getFromOrgId()).get(0).toString());
int lastOutDate=obj.getOutDate().toLocaleString().lastIndexOf("-")+2;
objEmpInfoEntity.setOutDate(obj.getOutDate().toLocaleString().substring(0, lastOutDate));
objEmpInfoEntity.setOutCauseName(this.getEmpAccess().queryOutcause(
obj.getOutCauseId(), 1).get(0).toString());
outPers.add(objEmpInfoEntity);
}
if(outPers.size()==0)
{
return mapping.findForward("noEmp");
}
request.setAttribute("outPers", outPers);
return mapping.findForward("findOut");
}
// 人员调入
public ActionForward redeployIn(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EmpManagerForm empManagerForm = (EmpManagerForm) form;// TODO
// Auto-generated
// method stub
// 员工编号
int empid = Integer.parseInt(request.getParameter("objempid")
.toString());
// 调入日期
Date inDate = Calendar.getInstance().getTime();
Empout empout = (Empout) this.getEmpAccess().queryOneOutPer(empid).get(
0);
empout.setInDate(inDate);
empout.setInEmpId(10002);
empout.setToOrgId(Integer.parseInt(request.getSession().getAttribute(
"org_Id").toString()));
this.getEmpAccess().perIn(empout);
// 更改人员状态
Employeeinfo employeeinfo = new Employeeinfo();
employeeinfo.setEmpStateId(0);
System.out.println(request.getSession().getAttribute("org_Id")
.toString());
employeeinfo.setFrameworkId(Integer.parseInt(request.getSession()
.getAttribute("org_Id").toString()));
this.getEmpAccess().updateEmpInfo(employeeinfo, empid, 2);
return mapping.findForward("redIn");
}
// 人员恢复前数据查询
public ActionForward perRenew(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EmpManagerForm empManagerForm = (EmpManagerForm) form;// TODO
// Auto-generated
// method stub
List ls = this.getEmpAccess().queryOutPer(
Integer.parseInt(request.getSession().getAttribute("org_Id")
.toString()), 1);
List renewPers = new ArrayList();
for (int i = 0; i < ls.size(); i++) {
EmpInfoEntity objEmpInfoEntity = new EmpInfoEntity();
Empout obj = (Empout) ls.get(i);
objEmpInfoEntity.setEmpId(obj.getEmpId());
objEmpInfoEntity.setEmpName(this.getEmpAccess().queryEmpName(
obj.getEmpId()).get(0).toString());
objEmpInfoEntity.setFromOrgName(this.getEmpAccess().queryframework(
obj.getFromOrgId()).get(0).toString());
int lastOutDate=obj.getOutDate().toLocaleString().lastIndexOf("-")+2;
objEmpInfoEntity.setOutDate(obj.getOutDate().toLocaleString().substring(0, lastOutDate).trim());
objEmpInfoEntity.setOutCauseName(this.getEmpAccess().queryOutcause(
obj.getOutCauseId(), 1).get(0).toString());
renewPers.add(objEmpInfoEntity);
}
if(renewPers.size()==0)
{
return mapping.findForward("noEmp");
}
request.setAttribute("renewPers", renewPers);
return mapping.findForward("renew");
}
// 人员恢复
public ActionForward redeployRenew(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse respo
没有合适的资源?快使用搜索试试~ 我知道了~
ssh项目源码
共1685个文件
svn-base:664个
class:156个
java:155个
4星 · 超过85%的资源 需积分: 10 1.3k 下载量 181 浏览量
2008-07-29
17:09:51
上传
评论 12
收藏 9.53MB RAR 举报
温馨提示
这是一个银行系统的源码,使用了struts,spring,hibernate 及ajax
资源推荐
资源详情
资源评论
收起资源包目录
ssh项目源码 (1685个子文件)
all-wcprops 15KB
all-wcprops 15KB
all-wcprops 5KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 2KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1024B
all-wcprops 1022B
all-wcprops 916B
all-wcprops 916B
all-wcprops 854B
all-wcprops 854B
all-wcprops 837B
all-wcprops 837B
all-wcprops 811B
all-wcprops 811B
all-wcprops 811B
all-wcprops 811B
all-wcprops 806B
all-wcprops 806B
all-wcprops 785B
all-wcprops 785B
all-wcprops 782B
all-wcprops 782B
all-wcprops 778B
all-wcprops 778B
all-wcprops 740B
all-wcprops 733B
all-wcprops 733B
all-wcprops 641B
all-wcprops 641B
all-wcprops 631B
all-wcprops 631B
all-wcprops 625B
all-wcprops 621B
all-wcprops 621B
all-wcprops 619B
all-wcprops 619B
all-wcprops 611B
all-wcprops 611B
all-wcprops 496B
all-wcprops 496B
all-wcprops 492B
all-wcprops 492B
all-wcprops 482B
all-wcprops 482B
all-wcprops 462B
all-wcprops 462B
all-wcprops 462B
all-wcprops 462B
all-wcprops 454B
all-wcprops 454B
all-wcprops 432B
all-wcprops 432B
all-wcprops 375B
all-wcprops 362B
all-wcprops 362B
all-wcprops 335B
all-wcprops 332B
all-wcprops 323B
all-wcprops 323B
all-wcprops 323B
all-wcprops 323B
all-wcprops 321B
all-wcprops 321B
all-wcprops 319B
all-wcprops 319B
all-wcprops 317B
all-wcprops 317B
all-wcprops 315B
all-wcprops 315B
all-wcprops 313B
all-wcprops 313B
all-wcprops 313B
all-wcprops 313B
all-wcprops 311B
all-wcprops 311B
all-wcprops 309B
all-wcprops 309B
all-wcprops 305B
all-wcprops 305B
all-wcprops 305B
all-wcprops 305B
all-wcprops 305B
all-wcprops 305B
all-wcprops 303B
all-wcprops 303B
all-wcprops 297B
共 1685 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
tywyh2008
- 粉丝: 5
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页