基于SSH框架的人力资源管理系统设计与实现

员工管理

在这里插入图片描述

招聘管理

在这里插入图片描述

在这里插入图片描述

奖罚管理

在这里插入图片描述

薪资管理

在这里插入图片描述

个人信息管理

在这里插入图片描述

06 主要代码


部门管理

package com.wy.action;

import java.util.List;

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.actions.DispatchAction;

import com.wy.dao.ObjectDao;

import com.wy.form.DepartmentForm;

import com.wy.form.ManagerForm;

public class DepartmentAction extends DispatchAction {

private ObjectDao objectDao;

public ObjectDao getObjectDao() {

return objectDao;

}

public void setObjectDao(ObjectDao objectDao) {

this.objectDao = objectDao;

}

// 部门察看操作

public ActionForward queryDepartment(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

List list = objectDao.getObjectList(“from DepartmentForm order by id desc”);

request.setAttribute(“list”, list);

request.setAttribute(“employeeList”, objectDao.getObjectList(“from EmployeeForm”));

return mapping.findForward(“queryDepartment”);

}

// 部门信息保存

public ActionForward insertDepartment(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

DepartmentForm departmentForm = (DepartmentForm) form;

DepartmentForm departmentform = (DepartmentForm)objectDao

.getObjectForm(“from DepartmentForm where dt_name='”

  • departmentForm.getDt_name() + “'”);

if (departmentform== null) {

objectDao.insertObjectForm(departmentForm);

return queryDepartment(mapping, form, request, response);

} else {

request.setAttribute(“result”, “不能够重复提交!!!”);

return mapping.findForward(“operationDepartment”);

}

}

//部门信息删除

public ActionForward deleteDepartment(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

DepartmentForm departmentform = (DepartmentForm)objectDao

.getObjectForm(“from DepartmentForm where id='”

  • request.getParameter(“id”) + “'”);

if(objectDao.deleteObjectForm(departmentform)){

}else{

request.setAttribute(“result”, “删除部门信息失败!!!”);

}

return mapping.findForward(“operationDepartment”);

}

}

培训管理

package com.wy.action;

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.wy.dao.ObjectDao;

import com.wy.form.TrainForm;

public class TrainAction extends DispatchAction {

private ObjectDao objectDao;

public ObjectDao getObjectDao() {

return objectDao;

}

public void setObjectDao(ObjectDao objectDao) {

this.objectDao = objectDao;

}

// 培训察看操作

public ActionForward queryTrain(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

List list = objectDao.getObjectList(“from TrainForm order by id desc”);

request.setAttribute(“list”, list);

return mapping.findForward(“queryTrain”);

}

// 添加培训操作

public ActionForward deleteTrain(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

String id=request.getParameter(“id”);

TrainForm trainForm=(TrainForm)objectDao.getObjectForm(“from TrainForm where id='”+id+“'”);

this.objectDao.deleteObjectForm(trainForm);

return this.queryTrain(mapping, form, request, response);

}

//添加培训操作

public ActionForward saveTrain(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

TrainForm trainForm=(TrainForm)form;

this.objectDao.insertObjectForm(trainForm);

return mapping.findForward(“operationTrain”);

}

//培训详细查询

public ActionForward queryOneTrain(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

String id=request.getParameter(“id”);

TrainForm trainForm=(TrainForm)objectDao.getObjectForm(“from TrainForm where id='”+id+“'”);

request.setAttribute(“trainForm”, trainForm);

return mapping.findForward(“queryOneTrain”);

}

}

薪资管理

package com.wy.action;

import java.util.List;

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.actions.DispatchAction;

import com.wy.dao.ObjectDao;

import com.wy.form.DepartmentForm;

import com.wy.form.EmployeeForm;

import com.wy.form.ManagerForm;

import com.wy.form.PayForm;

import com.wy.tool.GetAutoNumber;

public class PayAction extends DispatchAction {

private ObjectDao objectDao;

public ObjectDao getObjectDao() {

return objectDao;

}

public void setObjectDao(ObjectDao objectDao) {

this.objectDao = objectDao;

}

//薪资删除

public ActionForward deletePay(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

String condition = “from PayForm where id='”+request.getParameter(“id”)+“'”;

PayForm payForm=(PayForm)objectDao.getObjectForm(condition);

if(payForm!=null)

objectDao.deleteObjectForm(payForm);

return queryPay(mapping,form,request,response);

}

// 薪资查看

public ActionForward queryPay(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

List list = objectDao.getObjectList(“from PayForm”);

if(request.getParameter(“emNumber”)!=null){

String emNumber= request.getParameter(“emNumber”);

list = objectDao.getObjectList(“from PayForm where pay_emNumber='”+emNumber+“'”);

request.setAttribute(“result1”,emNumber);

}

if(request.getParameter(“pay_month”)!=null){

String pay_month= request.getParameter(“pay_month”);

list = objectDao.getObjectList(“from PayForm where pay_month='”+pay_month+“'”);

request.setAttribute(“result2”,pay_month);

}

request.setAttribute(“list”, list);

String condition = “from EmployeeForm order by id desc”;

request.setAttribute(“employeeList”,objectDao.getObjectList(condition));

return mapping.findForward(“queryPay”);

}

// 转向添加新姿的页面

public ActionForward forwardInsertPay(ActionMapping mapping,

ActionForm form, HttpServletRequest request,

HttpServletResponse response) {

this.saveToken(request);

String condition = “from EmployeeForm order by id desc”;

List list = objectDao.getObjectList(condition);

request.setAttribute(“employeeList”,list);

return mapping.findForward(“forwardInsertPay”);

写在最后

很多人感叹“学习无用”,实际上之所以产生无用论,是因为自己想要的与自己所学的匹配不上,这也就意味着自己学得远远不够。无论是学习还是工作,都应该有主动性,所以如果拥有大厂梦,那么就要自己努力去实现它。

最后祝愿各位身体健康,顺利拿到心仪的offer!

由于文章的篇幅有限,所以这次的蚂蚁金服和京东面试题答案整理在了PDF文档里

蚂蚁、京东Java岗4面:原理+索引+底层+分布式+优化等,已拿offer

蚂蚁、京东Java岗4面:原理+索引+底层+分布式+优化等,已拿offer

蚂蚁、京东Java岗4面:原理+索引+底层+分布式+优化等,已拿offer
ng condition = “from EmployeeForm order by id desc”;

List list = objectDao.getObjectList(condition);

request.setAttribute(“employeeList”,list);

return mapping.findForward(“forwardInsertPay”);

写在最后

很多人感叹“学习无用”,实际上之所以产生无用论,是因为自己想要的与自己所学的匹配不上,这也就意味着自己学得远远不够。无论是学习还是工作,都应该有主动性,所以如果拥有大厂梦,那么就要自己努力去实现它。

最后祝愿各位身体健康,顺利拿到心仪的offer!

由于文章的篇幅有限,所以这次的蚂蚁金服和京东面试题答案整理在了PDF文档里

[外链图片转存中…(img-srIUtiAe-1721178388292)]

[外链图片转存中…(img-TTrcPP5R-1721178388293)]

[外链图片转存中…(img-Wynz3IZl-1721178388293)]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值