Java Development Employment Information Management System _java

Source: Internet
Author: User

This article examples for you to share the Java Employment Information Management Platform development case, for your reference, the specific content as follows

Can inquire about the company information, student information, class information, for students employment or not information statistics, teachers and administrators log in after the rights are not equal
The Employment information management platform wants to realize the student employment situation of each class, the database has built 6 tables, namely class, company, position, student, login user .

The employment information in the interface displayed content is the combination of student information and positions, in the JSP page is stitching to achieve, if the student to find work need to fill out employment information, otherwise empty. Like a screenshot of employment.

The function that needs to be realized in enterprise information is to have planned recruitment time first. Actual recruitment time, each has a teacher, if the company recruitment end, then through the back of the editor to the actual recruitment time and the actual recruitment of teachers to fill up, the recruitment status shown as finished; There are two functions is two kinds of query: first, according to the recruitment query, using option Drop-down box selection; But according to the company name query, is in the box input company keyword query, here used like fuzzy query. And in the employment information only use option Drop-down selection in accordance with the class name query.

In the class information only uses the accurate query which the input key word. The statistics they query are paginated according to the number of bars that can be displayed per page, especially when the Drop-down box selects the query, which may be more than one message.

The basic information contains class information and student Information , and student information shows the students ' essential information.

Personal information displayed in the Change password and user information, user information is a feature of the administrator and the general teacher's permissions. General Teacher Login can only view information, but can not make any changes.

All the basic information can be realized and deleted, one of the difficulties encountered in paging query is still some--drop-down selection, in addition to the pagination used in the Page.js file, to achieve the display of the first few pages/a total of several pages, home/prev/next page/last page.

There is the issue of permissions, I was registered in the database login users have a permission permission, fill in yes/no, and then in the following procedures to determine. The only drawback is that the import and export function is not implemented, that is, the employment Information Bar in the upper right corner of an import and export button, is a template, import to achieve the bulk input of Excel student information, export to achieve the employment situation of the students export Excel form.

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 (H Ttpservletrequest req, HttpServletResponse resp) throws Servletexception, IOException {req.getrequestdispatcher ("/
 Addcompany.jsp "). Forward (req, resp); @Override protected void DoPost (HttpServletRequest req, HttpServletResponse resp) throws Servletexception, ioexcept
 Ion {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 ("recruitment");
 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.getparamete
 R ("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, ioexcept
 Ion {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 (HTTPSERVL Etrequest req, HttpServletResponse resp) throws Servletexception, IOException {classesservice cs = new Classesserviceim
 PL (); 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 ();
 Connect to the Employment information table 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", "all");
 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 ("All");
 for (classes Ele:cla) {String name = Ele.getname ();
 Lst.add (name); 
 } lst.remove (value);
 Studentservice ss = new Studentserviceimpl (); Infoservice is = new Infoserviceimpl (); 
 Connect to the Employment information table list<info> Lin = new arraylist<info> ();
 if (Value.equals ("All")) {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" >  

5. Page.js

$ (function () {
 $ (". Paginitem"). Click (subfun);
function Subfun () {  //You must know which class I'm getting, and which one I'm going to click. a label
 var id = $ (this). attr ("id");
 var value = $ ("#pageIndex"). Val (); Gets the current page
 var count = $ ("#pageCount"). Val ();//Get Last
 if (id = = "a") {
 $ ("#pageIndex"). Val (1); The current page is pageindex
 $ ("form"). Submit ()//Submit the form through a label
 }else if (id = = "previous") {//Determine if this page is the home page if the homepage Determines whether the current page is 1 = = 1 First page!=1 not home
 if (number (value) = = 1) {return
 false;
 } else{
 $ ("#pageIndex"). Val (number (value)-1);
 $ ("form"). Submit ();
 else if (id = = "next") {//To determine whether the current page is the last last end how to determine the total number of pages in the calculation database/per page show how many results are +1
 if (value = = count) {return
 false;
   }else{
 $ ("#pageIndex"). Val (number (value) +1);
 $ ("form"). Submit ();
 else{
 $ ("#pageIndex"). Val (count);
 $ ("form"). Submit ();
 return false;  Block a tab's page jump feature
}

Effect Chart:

The above is the entire content of this article, I hope to help you learn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.