java開發(fā)就業(yè)信息管理系統(tǒng)
本文實(shí)例為大家分享了java就業(yè)信息管理平臺開發(fā)案例,供大家參考,具體內(nèi)容如下
可查詢公司信息,學(xué)生信息,班級信息,針對學(xué)生就業(yè)與否信息的統(tǒng)計,老師和管理員登錄后的權(quán)限不同等
就業(yè)信息管理平臺想要實(shí)現(xiàn)的是各個班級的學(xué)生就業(yè)情況,數(shù)據(jù)庫里建有6張表,分別是班級,公司,職位,學(xué)生,登錄用戶。
其中就業(yè)信息在界面上顯示的內(nèi)容是學(xué)生信息和職位的組合,在jsp頁面中是拼接來實(shí)現(xiàn),如果這個學(xué)生找到工作則需要填寫就業(yè)信息,否則空著。如就業(yè)截圖。
在企業(yè)信息中,需要實(shí)現(xiàn)的功能是首先有計劃招聘時間,實(shí)際招聘時間,每個都有老師,如果這個公司招聘結(jié)束,則要通過后面的編輯把實(shí)際招聘時間和實(shí)際招聘老師填寫上去,招聘狀態(tài)顯示為已結(jié)束;否則不填,招聘狀態(tài)為招聘中。還有兩個功能就是兩種查詢:一是根據(jù)招聘查詢,采用option下拉框中的選擇;而是根據(jù)公司名稱查詢,是在框中輸入公司關(guān)鍵字查詢,這里用到了like模糊查詢。而在就業(yè)信息中只用到了option下拉選擇中的根據(jù)班級名的查詢。
在班級信息只用到了輸入關(guān)鍵字的精確查詢。他們查詢到的統(tǒng)計信息都會根據(jù)每頁能夠顯示的條數(shù)進(jìn)行分頁,尤其是下拉框選擇查詢,它們可能不只一條信息。
基礎(chǔ)信息里有班級信息和學(xué)生信息,學(xué)生信息顯示的是學(xué)生的基本信息。
個人信息里顯示的修改密碼和用戶信息,用戶信息的一個特點(diǎn)是管理員和普通教師的權(quán)限問題。普通教師登錄只能查看信息,但不能作任何修改。
所有基本信息都能實(shí)現(xiàn)增刪改查,其中作分頁查詢時遇到的難點(diǎn)還是有的——下拉選擇,此外就是分頁時用到的page.js文件,實(shí)現(xiàn)的是顯示第幾頁/共幾頁,首頁/上一頁/下一頁/尾頁。
還有就是權(quán)限問題,我是在數(shù)據(jù)庫中注冊登錄用戶時都有一個permission權(quán)限,填yes/no,然后在后面的程序中判斷出來。本項(xiàng)目唯一缺憾就是沒有實(shí)現(xiàn)導(dǎo)入導(dǎo)出功能,就是在就業(yè)信息欄右上角設(shè)置一個導(dǎo)入和導(dǎo)出按鈕,就是一個模板,導(dǎo)入實(shí)現(xiàn)的是批量輸入excel中的學(xué)生信息,導(dǎo)出實(shí)現(xiàn)的是把學(xué)生的就業(yè)情況導(dǎo)出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<classes> cla = cs.getClasses();
List<String> lst = new ArrayList<String>();
for(classes ele : cla){
String name = ele.getName();
lst.add(name);
}
studentService ss = new studentServiceImpl();
List<student> lstu = ss.getStudentPage(1, 10);
infoService is = new infoServiceImpl(); //連接到就業(yè)信息表里
List<info> lin = new ArrayList<info>();
for(student ele : lstu){
info info = new info();
info = is.getInfoByStudentId(ele.getId());
lin.add(info);
}
List<student> 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<classes> cla = cs.getClasses();
List<String> lst = new ArrayList<String>();
lst.add("全部");
for(classes ele : cla){
String name = ele.getName();
lst.add(name);
}
lst.remove(value);
studentService ss = new studentServiceImpl();
infoService is = new infoServiceImpl(); //連接到就業(yè)信息表里
List<info> lin = new ArrayList<info>();
if(value.equals("全部")){
List<student> 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<student> 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<student> 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<student> 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
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="base.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>無標(biāo)題文檔</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<!-- 自己加的一行 jquery.js -->
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/page.js"></script>
<script type="text/javascript">
$(function(){
$("select").change(function(){
$("#pageIndex").val(1);
$("form").submit();
});
$(".pg").click(subfun);
});
function subfun(){
var id = $(this).attr("id");
var value = $("#pageIndex").val();
var count = $("#pageCount").val();
if(id == "first"){
$("#pageIndex").val(1);
$("form").submit();
}else if(id == "previous"){
if(Number(value) == 1){
return false;
}else{
$("#pageIndex").val(Number(value)-1);
$("form").submit();
}
}else if(id == "next"){
if(value == count){
return false;
}else{
$("#pageIndex").val(Number(value)+1);
$("form").submit();
}
}else{
$("#pageIndex").val(count);
$("form").submit();
}
return false;//阻止a標(biāo)簽的網(wǎng)頁跳轉(zhuǎn)的功能
}
</script>
</head>
<body>
<div class="place">
<span>位置:</span>
<ul class="placeul">
<li><a href="#">首頁</a></li>
<li><a href="#">就業(yè)信息</a></li>
</ul>
</div>
<form action="employ.action" method="post">
<div class="rightinfo">
<div class="tools">
<ul class="toolbar">
<li><span>班級名稱:
<select style="border:1px solid #056dae" id="select" name="select">
<option>${requestScope.value }</option>
<c:forEach items="${requestScope.lst }" var="ele">
<option>${ele }</option>
</c:forEach>
</select>
</span></li>
</ul>
<ul class="toolbar1">
<li><span><img src="images/t05.png" /></span>下載</li>
</ul>
</div>
<table class="imgtable">
<thead>
<tr>
<th width="100px;">姓名</th>
<th>性別</th>
<th>畢業(yè)院校</th>
<th>專業(yè)</th>
<th>畢業(yè)時間</th>
<th>電話</th>
<th>就業(yè)單位</th>
<th>職位</th>
<th>工資</th>
<th>就業(yè)時間</th>
</tr>
</thead>
<tbody>
<c:forEach items="${requestScope.list }" var="stu" varStatus="s">
<tr>
<td class="imgtd">${stu.name }</td>
<td>${stu.sex }</td>
<td>${stu.school }</td>
<td>${stu.major }</td>
<td>${stu.bytime }</td>
<td>${stu.tel }</td>
<c:if test="${requestScope.lin[s.index] == null }" >
<td colspan="4" style="text-align:center;"><a href="addInfo.action?id=${stu.id }">填寫就業(yè)信息</a></td>
</c:if>
<c:if test="${requestScope.lin[s.index] != null }">
<td>${requestScope.lin[s.index].companyname }</td>
<td>${requestScope.lin[s.index].post }</td>
<td>${requestScope.lin[s.index].salary }</td>
<td>${requestScope.lin[s.index].worktime }</td>
</c:if>
</tr>
</c:forEach>
</tbody>
</table>
<input type="hidden" name="pageIndex" id="pageIndex" value="${requestScope.index }">
<input type="hidden" name="pageCount" id="pageCount" value="${requestScope.page }">
<input type="hidden" name="pageNumber" id="pageNumber" value="${requestScope.number }">
<div class="pagin" id="page">
<div class="message">共<i class="blue"> ${requestScope.number } </i>條記錄,共<i class="blue">
${requestScope.page }</i> 頁,當(dāng)前顯示第 <i class="blue">${requestScope.index } </i>頁</div>
<ul class="paginList">
<li class="paginItem"><a href="javascript:;" class="paginItem" id="first"><span class="pagepre"></span></a></li>
<li class="paginItem"><a href="javascript:;" class="paginItem" id="previous">上一頁</a></li>
<li class="paginItem"><a href="javascript:;" class="paginItem" id="next">下一頁</a></li>
<li class="paginItem"><a href="javascript:;" class="paginItem" id="last"><span class="pagenxt"></span></a></li>
</ul>
</div>
</div>
</form>
</body>
</html>
5. page.js
$(function(){
$(".paginItem").click(subfun);
});
function subfun(){ //必須要知道我獲取的是哪一個class,我點(diǎn)的是哪一個a標(biāo)簽
var id = $(this).attr("id");
var value = $("#pageIndex").val(); //獲取當(dāng)前頁
var count = $("#pageCount").val(); //獲取尾頁
if(id == "first"){
$("#pageIndex").val(1); //將pageIndex當(dāng)前頁
$("form").submit(); //通過a標(biāo)簽進(jìn)行表單提交
}else if(id == "previous"){ //判斷 本頁是否為首頁 如果為首頁 如果部位首頁的話 判斷當(dāng)前頁是否為1 ==1首頁 !=1 不是首頁
if(Number(value) == 1){
return false;
}else{
$("#pageIndex").val(Number(value)-1);
$("form").submit();
}
}else if(id == "next"){ //判斷當(dāng)前頁是否為尾頁 尾頁如何判斷 計算尾頁 計算數(shù)據(jù)庫的總條數(shù) / 每頁顯示多少條 結(jié)果是否+1
if(value == count){
return false;
}else{
$("#pageIndex").val(Number(value)+1);
$("form").submit();
}
}else{
$("#pageIndex").val(count);
$("form").submit();
}
return false; //阻止a標(biāo)簽的網(wǎng)頁跳轉(zhuǎn)的功能
}
效果圖:



更多學(xué)習(xí)資料請關(guān)注專題《管理系統(tǒng)開發(fā)》。
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助。
- 圖書管理系統(tǒng)java版
- Java+Mysql學(xué)生管理系統(tǒng)源碼
- 一個簡陋的java圖書管理系統(tǒng)
- 簡單實(shí)現(xiàn)Java版學(xué)生管理系統(tǒng)
- java學(xué)生信息管理系統(tǒng)設(shè)計
- java聯(lián)系人管理系統(tǒng)簡單設(shè)計
- Java設(shè)計模塊系列之書店管理系統(tǒng)單機(jī)版(一)
- 相冊管理系統(tǒng)(Java表單+xml數(shù)據(jù)庫存儲)
- Java+MySQL實(shí)現(xiàn)學(xué)生信息管理系統(tǒng)源碼
- java實(shí)現(xiàn)科研信息管理系統(tǒng)
相關(guān)文章
Java數(shù)據(jù)庫操作庫DButils類的使用方法與實(shí)例詳解
這篇文章主要介紹了JDBC數(shù)據(jù)庫操作庫DButils類的使用方法詳解,需要的朋友可以參考下2020-02-02
SWT(JFace) 體驗(yàn)之FontRegistry
測試代碼如下:2009-06-06
Java?Zookeeper分布式分片算法超詳細(xì)講解流程
ZooKeeper是一個分布式的,開放源碼的分布式應(yīng)用程序協(xié)調(diào)服務(wù),是Google的Chubby一個開源的實(shí)現(xiàn),是Hadoop和Hbase的重要組件。它是一個為分布式應(yīng)用提供一致性的軟件,提供的功能包括:配置維護(hù)、域名服務(wù)、分布式同步、組服務(wù)等2023-03-03
mybatis-plus使用generator實(shí)現(xiàn)逆向工程
mybatis-plus-generator在3.5.0以及以后的版本使用新的方式逆向生成代碼,本文主要介紹了mybatis-plus使用generator實(shí)現(xiàn)逆向工程,具有一定的參考價值,感興趣的可以了解一下2022-05-05
Eclipse+Maven構(gòu)建Hadoop項(xiàng)目的方法步驟
這篇文章主要介紹了Eclipse+Maven構(gòu)建Hadoop項(xiàng)目的方法步驟,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-02-02
Spring websocket并發(fā)發(fā)送消息異常的解決
本文主要介紹了 Spring websocket并發(fā)發(fā)送消息異常的解決,當(dāng)多個線程同時嘗試通過 WebSocket 會話發(fā)送消息時,會拋出異常,下面就來解決一下,感興趣的可以了解一下2023-09-09
基于mybatis中<include>標(biāo)簽的作用說明
這篇文章主要介紹了基于mybatis中<include>標(biāo)簽的作用說明,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2021-02-02
復(fù)雜JSON字符串轉(zhuǎn)換為Java嵌套對象的實(shí)現(xiàn)
這篇文章主要介紹了復(fù)雜JSON字符串轉(zhuǎn)換為Java嵌套對象的實(shí)現(xiàn),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-09-09

