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 (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
资源评论
龙年行大运
- 粉丝: 999
- 资源: 3854
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 冯璐阳 42105650—祝福.docx
- 基于多种算法及改进算法实现的移动机器人路径规划matlab源码(含A星算法+PRM+RRT的改进等).zip
- 布里斯托尔纸细分市场、总体规模、先进性、市占率行业分析报告2024年.docx
- Obi绳子插件,好用的很 6.5.4版本
- openjfx-22.0.1-windows-x64-bin-sdk.zip
- 基于ros和stm32f1的小车代码(含串口通信)+项目说明.zip
- 人体姿态估计-基于Tensorflow实现的人体姿态估计算法-附项目源码-优质项目分享.zip
- java实现所有算法大全
- JDBC DAO模式 (复习)
- Proteus仿真AT89C51电子密码锁
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功