作者主页:源码空间站2022
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
项目介绍
本系统包含管理员、用人单位、学生、学生处四种角色;
管理员:
登陆,岗位管理,审批管理,工资管理,用户管理等功能。
用人单位角色包含以下功能:
用人单位登陆,发布岗位管理,申请岗位管理,工资审核管理,勤工助学工资等功能。
学生角色包含以下功能:
学生登陆,岗位查看申请,查看我的申请,个人信息管理等功能。
学生处角色包含以下功能:
学生处管理员登陆,岗位审批,学生处审批管理,勤工助学工资管理等功能。
环境需要
1.运行环境:java jdk 1.7。注:本项目仅支持JDK1.7
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;
6.是否Maven项目:否;
技术栈
1. 后端:mysql+Spring+struts+hibernate
2. 前端:JSP+CSS+JavaScript+jquery
使用说明
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中src/conf/jdbc.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入http://localhost:8080/ 登录
管理员账号/密码:admin/admin
学生账号/密码: student/123456
学生处账号/密码: xueshengchu/123456
用人单位账号/密码: company/123456
运行截图
管理员角色
用人单位角色
学生角色
相关代码
登录Action
public class LoginuserWebAction extends ActionSupport {
/**
* Service层实例
*/
private LoginuserService loginuserService;
private GuanbiService guanbiService;
/**
* 日志
*/
private Logger log = Logger.getLogger(this.getClass());
private Loginuser loginuser = new Loginuser();
private Long id;
/**
* 用户注册
*
* @return
*/
public String register() {
log.debug("register" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
initSelect(request);
log.debug("register" + "结束");
return "register";
}
/**
*
* 保存注册用户信息
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String registerUser() {
log.debug("registerUser" + "开始");
try {
HttpServletRequest request = ServletActionContext.getRequest();
Loginuser user = new Loginuser();
user.setName(loginuser.getName());
List list = loginuserService.findPageInfoLoginuser(user, null);
if(list!=null && list.size()>0){
request.setAttribute("messageInfo", "用户名已经存在!");
return "register";
}
loginuser.setUserType("普通用户");
loginuserService.save(loginuser);
request.getSession().setAttribute("currentUser", loginuser);
} catch (Exception e) {
log.error("registerUser failed" + loginuser.toString());
}
log.debug("registerUser" + "结束");
return "success";
}
public String logon() {
log.debug("logon" + "开始");
List list = loginuserService.findPageInfoLoginuser(loginuser, null);
if(list == null){
HttpServletRequest request = ServletActionContext.getRequest();
request.setAttribute("messageInfo", "用户名或密码错误!");
return "fail";
}
Loginuser loginuser = (Loginuser) list.get(0);
HttpServletRequest request = ServletActionContext.getRequest();
request.getSession().setAttribute("currentUser", loginuser);
if(!loginuser.getUserType().equals("管理员")){
if(guanbiService.guanbi()){
request.setAttribute("messageInfo", "寒暑假期间,系统关闭!");
return "fail";
}
}
log.debug("logon" + "结束");
return "success";
}
岗位Action
public class GangweiWebAction extends ActionSupport {
/**
* Service层实例
*/
private GangweiService gangweiService;
/**
* 日志
*/
private Logger log = Logger.getLogger(this.getClass());
private Gangwei gangwei = new Gangwei();
private Long id;
@SuppressWarnings("unchecked")
public String queryGangwei() {
log.debug("queryGangwei" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
initSelect(request);
int resultSize = 0;
PageBean pageBean = null;
// Loginuser user = (Loginuser) request.getSession().getAttribute("currentUser");
resultSize = gangweiService.getCount(gangwei);
pageBean = PageBean.getPageBean(Constants.DISPLAYID_GANGWEI,
resultSize, request);
List list = gangweiService.findPageInfoGangwei(gangwei, pageBean);
request.setAttribute(Constants.GANGWEI_LIST, list);
log.debug("queryGangwei" + "结束");
return Constants.LIST;
}
public String queryGangweiSp() {
log.debug("queryGangwei" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
initSelect(request);
int resultSize = 0;
PageBean pageBean = null;
// Loginuser user = (Loginuser) request.getSession().getAttribute("currentUser");
resultSize = gangweiService.getCount(gangwei);
pageBean = PageBean.getPageBean(Constants.DISPLAYID_GANGWEI,
resultSize, request);
List list = gangweiService.findPageInfoGangwei(gangwei, pageBean);
request.setAttribute(Constants.GANGWEI_LIST, list);
log.debug("queryGangwei" + "结束");
return "splist";
}
public String queryGangweiSq() {
log.debug("queryGangwei" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
initSelect(request);
int resultSize = 0;
PageBean pageBean = null;
// Loginuser user = (Loginuser) request.getSession().getAttribute("currentUser");
resultSize = gangweiService.getCount(gangwei);
pageBean = PageBean.getPageBean(Constants.DISPLAYID_GANGWEI,
resultSize, request);
gangwei.setShenpi("通过");
List list = gangweiService.findPageInfoGangwei(gangwei, pageBean);
request.setAttribute(Constants.GANGWEI_LIST, list);
log.debug("queryGangwei" + "结束");
return "sqlist";
}
工资Action
public class GongziWebAction extends ActionSupport {
/**
* Service层实例
*/
private GongziService gongziService;
/**
* 日志
*/
private Logger log = Logger.getLogger(this.getClass());
private Gongzi gongzi = new Gongzi();
private Long id;
@SuppressWarnings("unchecked")
public String queryGongzi() {
log.debug("queryGongzi" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
initSelect(request);
int resultSize = 0;
PageBean pageBean = null;
// Loginuser user = (Loginuser) request.getSession().getAttribute("currentUser");
resultSize = gongziService.getCount(gongzi);
pageBean = PageBean.getPageBean(Constants.DISPLAYID_GONGZI,
resultSize, request);
List list = gongziService.findPageInfoGongzi(gongzi, pageBean);
request.setAttribute(Constants.GONGZI_LIST, list);
log.debug("queryGongzi" + "结束");
return Constants.LIST;
}
/**
*
* 进入增加界面
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String toAddGongzi() {
log.debug("toAddGongzi" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
initSelect(request);
Date date = new Date();
log.debug("toAddGongzi" + "结束");
return Constants.ADD;
}
/**
*
* 增加
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String addGongzi() {
log.debug("addGongzi" + "开始");
try {
gongziService.save(gongzi);
gongzi = new Gongzi();
} catch (Exception e) {
e.printStackTrace();
log.error("addGongzi failed" + gongzi.toString());
}
log.debug("addGongzi" + "结束");
return queryGongzi();
}
GuanBiAction
public class GuanbiWebAction extends ActionSupport {
/**
* Service层实例
*/
private GuanbiService guanbiService;
/**
* 日志
*/
private Logger log = Logger.getLogger(this.getClass());
private Guanbi guanbi = new Guanbi();
private Long id;
@SuppressWarnings("unchecked")
public String queryGuanbi() {
log.debug("queryGuanbi" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
initSelect(request);
int resultSize = 0;
PageBean pageBean = null;
// Loginuser user = (Loginuser) request.getSession().getAttribute("currentUser");
resultSize = guanbiService.getCount(guanbi);
pageBean = PageBean.getPageBean("guanbi",
resultSize, request);
List list = guanbiService.findPageInfoGuanbi(guanbi, pageBean);
request.setAttribute("guanbi_list", list);
log.debug("queryGuanbi" + "结束");
return Constants.LIST;
}
/**
*
* 进入增加界面
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String toAddGuanbi() {
log.debug("toAddGuanbi" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
initSelect(request);
Date date = new Date();
log.debug("toAddGuanbi" + "结束");
return Constants.ADD;
}
/**
*
* 增加
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String addGuanbi() {
log.debug("addGuanbi" + "开始");
try {
guanbiService.save(guanbi);
guanbi = new Guanbi();
} catch (Exception e) {
e.printStackTrace();
log.error("addGuanbi failed" + guanbi.toString());
}
log.debug("addGuanbi" + "结束");
return queryGuanbi();
}
/**
*
* 删除
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String delGuanbi() {
log.debug("delGuanbi" + "开始");
try {
guanbi.setId(id);
guanbiService.delete(guanbi);
guanbi = new Guanbi();
} catch (Exception e) {
log.error("delGuanbi failed" + guanbi.toString());
}
log.debug("delGuanbi" + "结束");
return queryGuanbi();
}
/**
*
* 进入编辑界面
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String toEditGuanbi() {
log.debug("toEditGuanbi" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
guanbi = guanbiService.getGuanbi(id);
initSelect(request);
log.debug("toEditGuanbi" + "结束");
return Constants.EDIT;
}
/**
*
* 进入调整访问周期界面
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String tomodifyZQ() {
log.debug("tomodifyZQ" + "开始");
HttpServletRequest request = ServletActionContext.getRequest();
guanbi = guanbiService.getGuanbi(id);
initSelect(request);
log.debug("tomodifyZQ" + "结束");
return "tomodifyZQ";
}
/**
*
* 查看信息
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String viewGuanbi() {
log.debug("viewGuanbi" + "开始");
guanbi = guanbiService.getGuanbi(id);
log.debug("viewGuanbi" + "结束");
return Constants.VIEW;
}
/**
*
* 编辑
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public String editGuanbi() {
log.debug("editGuanbi" + "开始");
try {
guanbiService.update(guanbi);
guanbi = new Guanbi();
} catch (Exception e) {
log.error("editGuanbi failed" + guanbi.toString());
}
log.debug("editGuanbi" + "结束");
return queryGuanbi();
}
/**
* @param GuanbiService
* the GuanbiService to set
*/
public void setGuanbiService(GuanbiService guanbiService) {
this.guanbiService = guanbiService;
}
public Guanbi getGuanbi() {
return guanbi;
}
public void setGuanbi(Guanbi guanbi) {
this.guanbi = guanbi;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void initSelect(HttpServletRequest request) {
}
}
如果也想学习本系统,下面领取。回复:024ssh