package com.hrms.action;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.hrms.model.Dept;
import com.hrms.model.Employee;
import com.hrms.model.EmployeeRedeploy;
import com.hrms.model.Post;
import com.hrms.model.RedeployType;
import com.hrms.model.User;
import com.hrms.service.IDeptService;
import com.hrms.service.IEmployeeRedeployService;
import com.hrms.service.IEmployeeService;
import com.hrms.service.IPostService;
import com.hrms.service.IRedeployTypeService;
import com.hrms.util.Page;
import com.hrms.util.StringUtil;
@Component("employeeRedeployAction")
@Scope("prototype")
public class EmployeeRedeployAction extends BaseAction {
private static final long serialVersionUID = -2225907567820537339L;
private Integer redeployId;
private IEmployeeRedeployService employeeRedeployService;
private EmployeeRedeploy employeeRedeploy;
private List<EmployeeRedeploy> employeeRedeploys;
private IEmployeeService employeeService;
private Page page;
private int currentPage = 1;
private IDeptService deptService;
private IPostService postService;
private IRedeployTypeService redeployTypeService;
public String employeeRedeploy_list() {
int totalSzie = employeeRedeployService.getSize();
this.page = new Page(currentPage, totalSzie);
employeeRedeploys = employeeRedeployService.getListByPage(currentPage,
page.getPageSize());
return "success";
}
public String employeeRedeploy_my() {
User user = (User)getSession().getAttribute("user");
Integer empId = user.getEmpId();
String hql = "from EmployeeRedeploy er where er.employee.empId = " + empId + "order by applyDate desc";
int totalSzie = employeeRedeployService.getListSize(hql);
this.page = new Page(currentPage, totalSzie);
employeeRedeploys = employeeRedeployService.findAllByPage(hql, currentPage, page.getPageSize());
return "success";
}
public String employeeRedeploy_detail() {
if (redeployId != null) {
employeeRedeploy = employeeRedeployService.findById(redeployId);
return "success";
} else {
return "error";
}
}
public String employeeRedeploy_add() {
String addAction = getRequest().getParameter("addAction");
if (addAction == null) {
List<Dept> depts = deptService.findAll();
List<Post> posts = postService.findAll();
List<RedeployType> redeployTypes = redeployTypeService.findAll();
getRequest().setAttribute("depts", depts);
getRequest().setAttribute("posts", posts);
getRequest().setAttribute("redeployTypes", redeployTypes);
User user = (User)getSession().getAttribute("user");
Integer empId = user.getEmpId();
Employee employee = employeeService.findById(empId);
Dept dept = employee.getDept();
Post post = employee.getPost();
getRequest().setAttribute("empId", empId);
getRequest().setAttribute("empName", user.getUserTrueName());
getRequest().setAttribute("employeeRedeploy.deployDept",dept.getDeptName());
getRequest().setAttribute("employeeRedeploy.deployPost",post.getPostName());
getRequest().setAttribute("employeeRedeploy.transactor",dept.getDeptMan());
return "add";
}
String empId = getRequest().getParameter("employeeRedeploy.empId");
Employee employee;
if (empId != null && !empId.equals("")) {
employee = employeeService.findById(Integer.valueOf(empId));
employeeRedeploy.setEmployee(employee);
} else {
return "error";
}
String redeployTypeId = getRequest().getParameter(
"employeeRedeploy.redeployTypeId");
if (redeployTypeId != null && !redeployTypeId.equals("")) {
employeeRedeploy.setRedeployType(redeployTypeService
.findById(Integer.valueOf(redeployTypeId)));
}
String deptId = getRequest().getParameter("employeeRedeploy.deptId");
if (deptId != null && !deptId.equals("0")) {
employeeRedeploy.setDept(deptService.findById(Integer.valueOf(deptId)));
} else {
employeeRedeploy.setDept(employee.getDept());
}
String postId = getRequest().getParameter("employeeRedeploy.postId");
if (postId != null && !postId.equals("0")) {
employeeRedeploy.setPost(postService.findById(Integer.valueOf(postId)));
} else {
employeeRedeploy.setPost(employee.getPost());
}
employeeRedeployService.saveOrUpdate(employeeRedeploy);
return "success";
}
public String employeeRedeploy_update() {
employeeRedeploy = employeeRedeployService.findById(redeployId);
String state = employeeRedeploy.getState();
if (state == null || state.equals("未提交")) {
String update = getRequest().getParameter("update");
if (update != null && update.equals("update")) {
String empId = getRequest().getParameter(
"employeeRedeploy.empId");
if (empId != null && !empId.equals("")) {
employeeRedeploy.setEmployee(employeeService
.findById(Integer.valueOf(empId)));
} else {
return "error";
}
String redeployTypeId = getRequest().getParameter(
"employeeRedeploy.redeployTypeId");
if (redeployTypeId != null && !redeployTypeId.equals("")) {
employeeRedeploy.setRedeployType(redeployTypeService
.findById(Integer.valueOf(redeployTypeId)));
}
String deptId = getRequest().getParameter(
"employeeRedeploy.deptId");
if (deptId != null && !deptId.equals("")) {
employeeRedeploy.setDept(deptService.findById(Integer
.valueOf(deptId)));
}
String postId = getRequest().getParameter(
"employeeRedeploy.postId");
if (postId != null && !postId.equals("")) {
employeeRedeploy.setPost(postService.findById(Integer
.valueOf(postId)));
}
employeeRedeployService.update(employeeRedeploy);
return "success";
} else if (redeployId != null) {
employeeRedeploy = employeeRedeployService.findById(redeployId);
List<Dept> depts = deptService.findAll();
List<Post> posts = postService.findAll();
List<RedeployType> redeployTypes = redeployTypeService
.findAll();
getRequest().setAttribute("depts", depts);
getRequest().setAttribute("posts", posts);
getRequest().setAttribute("redeployTypes", redeployTypes);
return "update";
} else {
getRequest().setAttribute("errorMessage", "该申请已提交审批流程中,不需再提交,也不能修改和删除!");
getRequest().setAttribute("forwardLink", "employeeRedeploy_my?currentPage=" + currentPage);
return "error";
}
} else {
getRequest().setAttribute("errorMessage", "该申请已提交审批流程中,不需再提交,也不能修改和删除!");
getRequest().setAttribute("forwardLink", "employeeRedeploy_my?currentPage=" + currentPage);
return "error";
}
}
public String employeeRedeploy_delete() {
employeeRedeploy = employeeRedeployService.findById(redeployId);
String state = employeeRedeploy.getState();
if (state == null || state.equals("未提交")) {
employeeRedeployService.deleteById(getRedeployId());
return "success";
} else {
getRequest().setAttribute("errorMessage", "该申请已提交审批流程中,不需再提交,也不能修改和删除!");
getRequest().setAttribute("forwardLink", "employeeRedeploy_my?currentPage=" + currentPage);
return "error";
}
}
public synchronized String employeeRedeploy_submit() {
employeeRedeploy = employeeRedeployService.findById(redeployId);
String state = employeeRedeploy.getState();
if (state == null || state.equals("未提交")) {
employeeRedeploy.setTransactor(employeeRedeploy.getEmployee().getDept().getDeptMan());
employeeRedeploy.setState("已提交");
employeeRedeployService.update(employeeRedeploy);
return "success";
} else {
return "error";
}
}
public synchronized String employeeRedeploy_send() {
employeeRedeploy = employ
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 1、该资源包括项目的全部源码,下载可以直接使用! 2、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业和毕设项目,作为参考资料学习借鉴。 3、本资源作为“参考资料”如果需要实现其他功能,需要能看懂代码,并且热爱钻研,自行调试。 基于struts2、spring、hibernate框架搭建的人力资源管理系统源码+项目说明(包含模块:人事管理、招聘管理、机构管理、考勤管理、培训管理、个人办公、系统管理).zip 基于struts2、spring、hibernate框架搭建的人力资源管理系统源码+项目说明(包含模块:人事管理、招聘管理、机构管理、考勤管理、培训管理、个人办公、系统管理).zip 基于struts2、spring、hibernate框架搭建的人力资源管理系统源码+项目说明(包含模块:人事管理、招聘管理、机构管理、考勤管理、培训管理、个人办公、系统管理).zip 基于struts2、spring、hibernate框架搭建的人力资源管理系统源码+项目说明(包含模块:人事管理、招聘管理、机构管理、考勤管理、培训管理、个人办公、系统管理).zip
资源推荐
资源详情
资源评论
收起资源包目录
基于struts2、spring、hibernate框架搭建的人力资源管理系统源码+项目说明(包含人事管理等).zip (1496个子文件)
.classpath 2KB
org.eclipse.wst.common.component 744B
org.eclipse.wst.jsdt.ui.superType.container 49B
dhtmlxtree.css 5KB
dhtmlxtree.css 5KB
stylesheet.css 4KB
stylesheet.css 4KB
datepicker.css 4KB
datepicker.css 4KB
displaytag.css 2KB
displaytag.css 2KB
mainIframe.css 2KB
mainIframe.css 2KB
mainFrame.css 1KB
mainFrame.css 1KB
query.css 805B
query.css 805B
uploadJobSeeker.css 523B
uploadJobSeeker.css 523B
WdatePicker.css 158B
WdatePicker.css 158B
add.css 50B
add.css 50B
login_05.gif 13KB
login_05.gif 13KB
login_07.gif 10KB
login_07.gif 10KB
main_0ss3.gif 7KB
main_0ss3.gif 7KB
main_03.gif 7KB
main_03.gif 7KB
main_032.gif 7KB
main_032.gif 7KB
main_03ss.gif 7KB
main_03ss.gif 7KB
login_12.gif 7KB
login_12.gif 7KB
queryTitleBg.gif 5KB
queryTitleBg.gif 5KB
main_09.gif 5KB
main_09.gif 5KB
tree.gif 4KB
tree.gif 4KB
main_01.gif 3KB
main_01.gif 3KB
main_05.gif 3KB
main_05.gif 3KB
login_06.gif 3KB
login_06.gif 3KB
main_45.gif 3KB
main_45.gif 3KB
main_29.gif 3KB
main_29.gif 3KB
root.gif 2KB
main_43.gif 2KB
root.gif 2KB
main_43.gif 2KB
main_16.gif 2KB
main_16.gif 2KB
login_02.gif 2KB
login_02.gif 2KB
main_07_1.gif 2KB
main_07.gif 2KB
main_07_1.gif 2KB
main_07.gif 2KB
main_06.gif 2KB
main_06.gif 2KB
main_08_1.gif 2KB
main_08_1.gif 2KB
main_08.gif 2KB
main_08.gif 2KB
img.gif 2KB
img.gif 2KB
main_10_1.gif 2KB
main_10_1.gif 2KB
main_10.gif 2KB
main_10.gif 2KB
main_14.gif 2KB
main_14.gif 2KB
main_14_1.gif 2KB
main_14_1.gif 2KB
main_15.gif 1KB
main_15.gif 1KB
main_11_1.gif 1KB
main_11_1.gif 1KB
main_11.gif 1KB
main_11.gif 1KB
main_12.gif 1KB
main_12_1.gif 1KB
main_12.gif 1KB
main_12_1.gif 1KB
main_13.gif 1KB
main_13.gif 1KB
main_13_1.gif 1KB
main_13_1.gif 1KB
btnSubmit.gif 1KB
btnSubmit.gif 1KB
removeallfrom.gif 1KB
removeallfrom.gif 1KB
addallto.gif 1KB
共 1496 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15
资源评论
土豆片片
- 粉丝: 1518
- 资源: 5643
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功