系统概述
本系统给招聘者和求职者提供一个便利、高效、准确的网络招聘平台,使得双方可以在把成本降到最低的前提下,在更快的时间获得更加准确的信息,从而满足企业的用人需求,实现求职者的自我价值。
实现功能
主要实现了个人用户、企业用户的不同流程,个人用户:信息管理、简历管理、求职申请;企业用户:企业信息管理、招聘管理。
详细功能看下图:
部分功能的截图如下:
登录界面:
个人登录页面:
个人简历填写:
个人简历下载:
技术点
电脑型号:惠普242 G1 64位笔记本电脑
操作系统:Windows10专业版
数据库版本:Oracle10g XE
JDK版本:JDK1.8
服务器版本:apache-tomcat-8.0.24-windows-x64
(注意:Oracle数据库也没有那么大,我这里有压缩版的,直接下载安装就可以使用的。)
在后端,主要靠Core Java、Servlet、Jsp、MyBatis实现逻辑功能。
在前端,由HTML+CSS实现页面布局,部分功能使用Jquery和Ajax减轻服务器端的压力。
用例图、
1、用例图:
2、数据流图:
3、E-R图
部分关键代码
1、实体类Person.java:
package tyut.bean;
import java.util.Date;
public class Person {
private Long id;
private String username;
private String password;
private String name;
private String sex;
private String birthday;
private String phone;
private String email;
private String school;
private String trade;
private String salary;
private String tip;
private Date pubtime;
public Person() {
super();
}
public Person(String username, String password, String name, String sex, String birthday, String phone,
String email, String school, String trade, String salary, String tip) {
super();
this.username = username;
this.password = password;
this.name = name;
this.sex = sex;
this.birthday = birthday;
this.phone = phone;
this.email = email;
this.school = school;
this.trade = trade;
this.salary = salary;
this.tip = tip;
}
public Person(Long id, String username, String password, String name, String sex, String birthday, String phone,
String email, String school, String trade, String salary, String tip,Date pubtime) {
super();
this.id = id;
this.username = username;
this.password = password;
this.name = name;
this.sex = sex;
this.birthday = birthday;
this.phone = phone;
this.email = email;
this.school = school;
this.trade = trade;
this.salary = salary;
this.tip = tip;
this.pubtime = pubtime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getSchool() {
return school;
}
public void setSchool(String school) {
this.school = school;
}
public String getTrade() {
return trade;
}
public void setTrade(String trade) {
this.trade = trade;
}
public String getSalary() {
return salary;
}
public void setSalary(String salary) {
this.salary = salary;
}
public String getTip() {
return tip;
}
public void setTip(String tip) {
this.tip = tip;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Date getPubtime() {
return pubtime;
}
public void setPubtime(Date pubtime) {
this.pubtime = pubtime;
}
@Override
public String toString() {
return "Person [id=" + id + ", username=" + username + ", password=" + password + ", name=" + name + ", sex="
+ sex + ", birthday=" + birthday + ", phone=" + phone + ", email=" + email + ", school=" + school
+ ", trade=" + trade + ", salary=" + salary + ", tip=" + tip + ", pubtime=" + pubtime + "]";
}
}
Company.java
package tyut.bean;
import java.util.Date;
public class Company {
private Long id;
private String username;
private String password;
private String name;
private String phone;
private String email;
private String location;
private String trade;
private String salary;
private String tip;
private Date pubtime;
public Company(Long id, String username, String password, String name, String phone, String email, String location,
String trade, String salary, String tip, Date pubtime) {
super();
this.id = id;
this.username = username;
this.password = password;
this.name = name;
this.phone = phone;
this.email = email;
this.location = location;
this.trade = trade;
this.salary = salary;
this.tip = tip;
this.pubtime = pubtime;
}
public Company(String username, String password, String name, String phone, String email, String location,
String trade, String salary, String tip) {
super();
this.username = username;
this.password = password;
this.name = name;
this.phone = phone;
this.email = email;
this.location = location;
this.trade = trade;
this.salary = salary;
this.tip = tip;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getTrade() {
return trade;
}
public void setTrade(String trade) {
this.trade = trade;
}
public String getSalary() {
return salary;
}
public void setSalary(String salary) {
this.salary = salary;
}
public String getTip() {
return tip;
}
public void setTip(String tip) {
this.tip = tip;
}
public Date getPubtime() {
return pubtime;
}
public void setPubtime(Date pubtime) {
this.pubtime = pubtime;
}
public Company() {
super();
}
}
2、PersonMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="tyut.dao.IPersonDao">
<insert id="savePerson" parameterType="Person">
<selectKey keyProperty="id" resultType="long" order="BEFORE">
select seq.nextval from dual
</selectKey>
insert into person (id,username,password,name,sex,birthday,school,phone,email,trade,salary,tip)
values
(#{id},#{username},#{password},#{name},#{sex},#{birthday},#{school},#{phone},#{email},#{trade},#{salary},#{tip})
</insert>
<select id="findPersonByName" parameterType="string" resultType="Person">
select * from person where username=#{username}
</select>
<select id="findPersonByNameAndPassword" resultType="Person">
select * from person where username=#{0} and password=#{1}
</select>
<select id="findPersonById" parameterType="long" resultType="Person">
select * from person where id=#{id}
</select>
<update id="updatePerson" parameterType="Person">
update person set name=#{name},sex=#{sex},birthday=#{birthday},school=#{school},
phone=#{phone},email=#{email},trade=#{trade},salary=#{salary},tip=#{tip}
where id=#{id}
</update>
<update id="udpatePubtime" parameterType="Person">
update person set pubtime=#{pubtime,jdbcType=TIMESTAMP}
where id=#{id}
</update>
<update id="ZeroPubtime" parameterType="Person">
update person set pubtime=null
where id=#{id}
</update>
<select id="findAllPersons" resultType="Person">
select * from person where pubtime is not null order by pubtime desc
</select>
<select id="findPersonsByParams" parameterType="java.util.Map" resultType="Person">
select * from person
where pubtime is not null
<if test="trade != null">
AND trade = #{trade}
</if>
<if test="school != null">
AND school = #{school}
</if>
<if test="salary != null">
AND salary = #{salary}
</if>
<if test="pubtime != null">
AND to_char(pubtime,'YYYY-MM-DD HH24:MI:SS') < #{pubtime}
</if>
</select>
</mapper>
3、个人业务逻辑类:IPersonServiceImpl.java:
package tyut.service.imp;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.SqlSession;
import tyut.bean.Person;
import tyut.dao.IPersonDao;
import tyut.service.IPersonService;
import tyut.tools.MyBatisSqlSessionFactory;
public class IPersonServiceImp implements IPersonService {
@Override
public boolean register(Person person) {
// TODO Auto-generated method stub
SqlSession session = MyBatisSqlSessionFactory.getSqlSessionFactory();
IPersonDao personDao = session.getMapper(IPersonDao.class);
Person p = personDao.findPersonByName(person.getUsername());
if(p==null){
personDao.savePerson(person);
session.commit();
return true;
}else{
return false;
}
}
@Override
public Person login(String username, String password) {
// TODO Auto-generated method stub
SqlSession session = MyBatisSqlSessionFactory.getSqlSessionFactory();
IPersonDao personDao = session.getMapper(IPersonDao.class);
Person p = personDao.findPersonByNameAndPassword(username, password);
if(p!=null){
return p;
}else{
return null;
}
}
@Override
public void update(Person person) {
// TODO Auto-generated method stub
SqlSession session = MyBatisSqlSessionFactory.getSqlSessionFactory();
IPersonDao personDao = session.getMapper(IPersonDao.class);
personDao.updatePerson(person);
session.commit();
}
@Override
public void publish(Person person) {
// TODO Auto-generated method stub
SqlSession session = MyBatisSqlSessionFactory.getSqlSessionFactory();
IPersonDao personDao = session.getMapper(IPersonDao.class);
personDao.udpatePubtime(person);
session.commit();
}
@Override
public void deleteResume(Person person) {
// TODO Auto-generated method stub
SqlSession session = MyBatisSqlSessionFactory.getSqlSessionFactory();
IPersonDao personDao = session.getMapper(IPersonDao.class);
personDao.ZeroPubtime(person);
session.commit();
}
@Override
public List<Person> listAllPersons() {
// TODO Auto-generated method stub
SqlSession session = MyBatisSqlSessionFactory.getSqlSessionFactory();
IPersonDao personDao = session.getMapper(IPersonDao.class);
List<Person> persons = personDao.findAllPersons();
return persons;
}
@Override
public List<Person> listAllPersonsByParams(Map<String, String> map) {
// TODO Auto-generated method stub
SqlSession session = MyBatisSqlSessionFactory.getSqlSessionFactory();
IPersonDao personDao = session.getMapper(IPersonDao.class);
List<Person> persons = personDao.findPersonsByParams(map);
return persons;
}
@Override
public Person query(long id) {
// TODO Auto-generated method stub
SqlSession session = MyBatisSqlSessionFactory.getSqlSessionFactory();
IPersonDao personDao = session.getMapper(IPersonDao.class);
Person person = personDao.findPersonById(id);
return person;
}
}
4、申请简历Servlet处理类:ApplyServlet.java:
package tyut.web;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import tyut.bean.Employee;
import tyut.service.imp.IEmployeeServiceImp;
/**
* Servlet implementation class ApplyServlet
*/
public class ApplyServlet extends HttpServlet implements Servlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public ApplyServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doPost(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<script>");
long p_id = Long.parseLong(request.getParameter("p_id"));
long c_id = Long.parseLong(request.getParameter("c_id"));
IEmployeeServiceImp iEmployeeServiceImp = new IEmployeeServiceImp();
Employee employee = iEmployeeServiceImp.query(p_id, c_id);
if(employee==null){
iEmployeeServiceImp.insert(p_id, c_id);
out.println("alert('申请成功')");
}else{
out.println("alert('您已申请过该公司!不能重复申请!')");
}
out.println("window.open ('"+request.getContextPath()+"/index.jsp','_top')");
out.println("</script>");
out.println("</html>");
out.flush();
out.close();
}
}
写在最后
由于完整源码不能全部贴出来,如果需要全部源码和系统的文档详细资料,可以+博主v交流: Code2Life2