微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java开发就业信息管理系统

这篇文章主要为大家详细介绍了java开发就业信息管理平台,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

本文实例为大家分享了java就业信息管理平台开发案例,供大家参考,具体内容如下

查询公司信息,学生信息,班级信息,针对学生就业与否信息的统计,老师和管理员登录后的权限不同等

就业信息管理平台想要实现的是各个班级的学生就业情况,数据库里建有6张表,分别是班级,公司,职位,学生,登录用户

其中就业信息在界面上显示内容是学生信息和职位的组合,在jsp页面中是拼接来实现,如果这个学生找到工作则需要填写就业信息,否则空着。如就业截图。

在企业信息中,需要实现的功能是首先有计划招聘时间,实际招聘时间,每个都有老师,如果这个公司招聘结束,则要通过后面的编辑把实际招聘时间和实际招聘老师填写上去,招聘状态显示为已结束;否则不填,招聘状态为招聘中。还有两个功能就是两种查询:一是根据招聘查询,采用option下拉框中的选择;而是根据公司名称查询,是在框中输入公司关键字查询,这里用到了like模糊查询。而在就业信息中只用到了option下拉选择中的根据班级名的查询

在班级信息只用到了输入关键字的精确查询。他们查询到的统计信息都会根据每页能够显示的条数进行分页,尤其是下拉框选择查询,它们可能不只一条信息。

基础信息里有班级信息学生信息,学生信息显示的是学生的基本信息。

个人信息里显示修改密码用户信息,用户信息的一个特点是管理员和普通教师的权限问题。普通教师登录只能查看信息,但不能作任何修改

所有基本信息都能实现增删改查,其中作分页查询时遇到的难点还是有的――下拉选择,此外就是分页时用到的page.js文件,实现的是显示第几页/共几页,首页/上一页/下一页/尾页。

还有就是权限问题,我是在数据库注册登录用户时都有一个permission权限,填yes/no,然后在后面的程序中判断出来。本项目唯一缺憾就是没有实现导入导出功能,就是在就业信息栏右上角设置一个导入和导出按钮,就是一个模板,导入实现的是批量输入excel中的学生信息,导出实现的是把学生的就业情况导出excel表格形式。

1. addCompany_action.java 

package com.ben.emp.action; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import javax.servlet.servletexception; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.ben.emp.model.company; import com.ben.emp.model.user; import com.ben.emp.service.companyService; import com.ben.emp.service.impl.companyServiceImpl; @WebServlet("/addCompany.action") public class addCompany_action extends HttpServlet{ @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws servletexception, IOException { req.getRequestdispatcher("/addCompany.jsp").forward(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws servletexception, IOException { String name = req.getParameter("name"); String introduce = req.getParameter("introduce"); String requirement = req.getParameter("requirement"); String address = req.getParameter("address"); String plantime = req.getParameter("plantime"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); companyService cs = new companyServiceImpl(); company com = new company(); HttpSession session = req.getSession(true); user user = (user) session.getAttribute("user"); com.setName(name); com.setIntroduce(introduce); com.setRequirement(requirement); com.setAddress(address); try { com.setPlantime(sdf.parse(plantime)); } catch (ParseException e) { // Todo Auto-generated catch block e.printstacktrace(); } com.setState("招聘中"); com.setTeach1(user.getName()); com.setTeach2(""); com.setId(0); cs.addCompany(com); resp.sendRedirect(req.getcontextpath()+"/company.action"); } }

2. editStudent_action.java

package com.ben.emp.action; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import javax.servlet.servletexception; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.ben.emp.model.classes; import com.ben.emp.model.student; import com.ben.emp.service.classesService; import com.ben.emp.service.studentService; import com.ben.emp.service.impl.classesServiceImpl; import com.ben.emp.service.impl.studentServiceImpl; @WebServlet("/editStudent.action") public class editStudent_action extends HttpServlet{ @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws servletexception, IOException { String strid = req.getParameter("id"); int studentId = Integer.valueOf(strid); studentService ss = new studentServiceImpl(); student stu = ss.getStudentById(studentId); req.setAttribute("stu", stu); req.getRequestdispatcher("/editStudent.jsp").forward(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws servletexception, IOException { String strid = req.getParameter("id"); int studentId = Integer.valueOf(strid); String name = req.getParameter("studentname"); String sex = req.getParameter("sex"); String school = req.getParameter("school"); String major = req.getParameter("major"); String bytime = req.getParameter("bytime"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String tel = req.getParameter("telephone"); String qq = req.getParameter("qq"); studentService ss = new studentServiceImpl(); student stu = new student(); // HttpSession session = req.getSession(true); // user user = (user)session.getAttribute("user"); String classname = req.getParameter("selectclass"); classesService cs = new classesServiceImpl(); classes cla = cs.getClassesByName(classname); stu.setName(name); stu.setSex(sex); stu.setSchool(school); stu.setMajor(major); try { stu.setBytime(sdf.parse(bytime)); } catch (ParseException e) { // Todo Auto-generated catch block e.printstacktrace(); } stu.setTel(tel); stu.setQq(qq); stu.setClassid(cla.getId()); stu.setId(studentId); ss.editStudent(stu); resp.sendRedirect(req.getcontextpath()+"/student.action"); } }

3. employ_action.java

package com.ben.emp.action; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.servletexception; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.ben.emp.model.classes; import com.ben.emp.model.info; import com.ben.emp.model.student; import com.ben.emp.service.classesService; import com.ben.emp.service.infoService; import com.ben.emp.service.studentService; import com.ben.emp.service.impl.classesServiceImpl; import com.ben.emp.service.impl.infoServiceImpl; import com.ben.emp.service.impl.studentServiceImpl; @WebServlet("/employ.action") public class employ_action extends HttpServlet{ @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws servletexception, IOException { classesService cs = new classesServiceImpl(); List cla = cs.getClasses(); List lst = new ArrayList(); for(classes ele : cla){ String name = ele.getName(); lst.add(name); } studentService ss = new studentServiceImpl(); List lstu = ss.getStudentPage(1, 10); infoService is = new infoServiceImpl(); //连接到就业信息表里 List lin = new ArrayList(); for(student ele : lstu){ info info = new info(); info = is.getInfoByStudentId(ele.getId()); lin.add(info); } List count = ss.getStudentPage(1, Integer.MAX_VALUE); int number = count.size(); int page = number % 10 == 0 ? number / 10 : (number/10) + 1; req.setAttribute("lst", lst); req.setAttribute("value", "全部"); req.setAttribute("number", number); req.setAttribute("page", page); req.setAttribute("index", 1); req.setAttribute("list", lstu); req.setAttribute("lin", lin); req.getRequestdispatcher("/employ.jsp").forward(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws servletexception, IOException { String value = req.getParameter("select"); classesService cs = new classesServiceImpl(); List cla = cs.getClasses(); List lst = new ArrayList(); lst.add("全部"); for(classes ele : cla){ String name = ele.getName(); lst.add(name); } lst.remove(value); studentService ss = new studentServiceImpl(); infoService is = new infoServiceImpl(); //连接到就业信息表里 List lin = new ArrayList(); if(value.equals("全部")){ List count = ss.getStudentPage(1, Integer.MAX_VALUE); int number = count.size(); int page = number % 10 == 0 ? number / 10 : (number/10) + 1; String strpageIndex = req.getParameter("pageIndex"); int index = Integer.valueOf(strpageIndex); List lstu = ss.getStudentPage(index, 10); for(student ele : lstu){ info info = new info(); info = is.getInfoByStudentId(ele.getId()); lin.add(info); } req.setAttribute("number", number); req.setAttribute("page", page); req.setAttribute("index", index); req.setAttribute("list", lstu); req.setAttribute("lin", lin); }else{ List count = ss.getStudentByClassName(value, 1, Integer.MAX_VALUE); int number = count.size(); int page = number % 10 == 0 ? number / 10 : (number/10) + 1; String strpageIndex = req.getParameter("pageIndex"); int index = Integer.valueOf(strpageIndex); List lstu = ss.getStudentByClassName(value, index, 10); for(student ele : lstu){ info info = new info(); info = is.getInfoByStudentId(ele.getId()); lin.add(info); } req.setAttribute("number", number); req.setAttribute("page", page); req.setAttribute("index", index); req.setAttribute("list", lstu); req.setAttribute("lin", lin); } req.setAttribute("value", value); req.setAttribute("lst", lst); req.getRequestdispatcher("/employ.jsp").forward(req, resp); } }

4. employ.jsp

标题文档 位置:

就业信息

班级名称: ${requestScope.value }

${ele }

下载

姓名

性别

毕业院校

专业

毕业时间

电话

就业单位

职位

工资

就业时间

${stu.name }

${stu.sex }

${stu.school }

${stu.major }

${stu.bytime }

${stu.tel }

填写就业信息${requestScope.lin[s.index].companyname }

${requestScope.lin[s.index].post }

${requestScope.lin[s.index].salary }

${requestScope.lin[s.index].worktime }

共 ${requestScope.number } 条记录,共  ${requestScope.page } 页,当前显示第 ${requestScope.index } 页

上一页

下一页

5. page.js

$(function(){ $(".paginItem").click(subfun); }); function subfun(){ //必须要知道我获取的是哪一个class,我点的是哪一个a标签 var id = $(this).attr("id"); var value = $("#pageIndex").val(); //获取当前页 var count = $("#pageCount").val(); //获取尾页 if(id == "first"){ $("#pageIndex").val(1); //将pageIndex当前页 $("form").submit(); //通过a标签进行表单提交 }else if(id == "prevIoUs"){ //判断 本页是否为首页 如果为首页 如果部位首页的话 判断当前页是否为1 ==1首页 !=1 不是首页 if(Number(value) == 1){ return false; }else{ $("#pageIndex").val(Number(value)-1); $("form").submit(); } }else if(id == "next"){ //判断当前页是否为尾页 尾页如何判断 计算尾页 计算数据库的总条数 / 每页显示多少条 结果是否+1 if(value == count){ return false; }else{ $("#pageIndex").val(Number(value)+1); $("form").submit(); } }else{ $("#pageIndex").val(count); $("form").submit(); } return false; //阻止a标签的网页跳转功能 }

效果图:

更多学习资料请关注专题《管理系统开发》。

以上就是本文的全部内容,希望对大家的学习有所帮助。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐