作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
项目介绍
基于Springboot + vue实现的蜗牛兼职网
本系统包含管理员、用户两个角色。
管理员角色:用户管理、企业管理、兼职信息管理、职位申请管理、留言板管理、系统管理。
用户角色:个人中心、职位申请管理。
使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者
由于本程序规模不大,可供课程设计,毕业设计学习演示之用
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
技术栈
后端:SpringBoot+Mybaits
前端:Vue + elementui
使用说明
项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入地址:
前台地址:http://localhost:8080/springbootc8v27/front/index.html
用户:用户1 密码:123456
后台地址
http://localhost:8080/springbootc8v27/admin/dist/index.html#/login
管理员 abo 密码 abo
用户:用户1 密码:123456
企业:企业1 密码:123456
注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。
运行截图
论文
前台界面
后台界面
相关代码
QiyeController
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.QiyeEntity;
import com.entity.view.QiyeView;
import com.service.QiyeService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 企业
* 后端接口
* @author
* @email
* @date 2021-03-06 10:03:19
*/
@RestController
@RequestMapping("/qiye")
public class QiyeController {
@Autowired
private QiyeService qiyeService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
QiyeEntity user = qiyeService.selectOne(new EntityWrapper<QiyeEntity>().eq("qiyehao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"qiye", "企业" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody QiyeEntity qiye){
//ValidatorUtils.validateEntity(qiye);
QiyeEntity user = qiyeService.selectOne(new EntityWrapper<QiyeEntity>().eq("qiyehao", qiye.getQiyehao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
qiye.setId(uId);
qiyeService.insert(qiye);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
QiyeEntity user = qiyeService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
QiyeEntity user = qiyeService.selectOne(new EntityWrapper<QiyeEntity>().eq("qiyehao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
qiyeService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,QiyeEntity qiye, HttpServletRequest request){
EntityWrapper<QiyeEntity> ew = new EntityWrapper<QiyeEntity>();
PageUtils page = qiyeService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, qiye), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,QiyeEntity qiye, HttpServletRequest request){
EntityWrapper<QiyeEntity> ew = new EntityWrapper<QiyeEntity>();
PageUtils page = qiyeService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, qiye), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( QiyeEntity qiye){
EntityWrapper<QiyeEntity> ew = new EntityWrapper<QiyeEntity>();
ew.allEq(MPUtil.allEQMapPre( qiye, "qiye"));
return R.ok().put("data", qiyeService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(QiyeEntity qiye){
EntityWrapper< QiyeEntity> ew = new EntityWrapper< QiyeEntity>();
ew.allEq(MPUtil.allEQMapPre( qiye, "qiye"));
QiyeView qiyeView = qiyeService.selectView(ew);
return R.ok("查询企业成功").put("data", qiyeView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
QiyeEntity qiye = qiyeService.selectById(id);
return R.ok().put("data", qiye);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
QiyeEntity qiye = qiyeService.selectById(id);
return R.ok().put("data", qiye);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody QiyeEntity qiye, HttpServletRequest request){
qiye.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(qiye);
QiyeEntity user = qiyeService.selectOne(new EntityWrapper<QiyeEntity>().eq("qiyehao", qiye.getQiyehao()));
if(user!=null) {
return R.error("用户已存在");
}
qiye.setId(new Date().getTime());
qiyeService.insert(qiye);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody QiyeEntity qiye, HttpServletRequest request){
qiye.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(qiye);
QiyeEntity user = qiyeService.selectOne(new EntityWrapper<QiyeEntity>().eq("qiyehao", qiye.getQiyehao()));
if(user!=null) {
return R.error("用户已存在");
}
qiye.setId(new Date().getTime());
qiyeService.insert(qiye);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody QiyeEntity qiye, HttpServletRequest request){
//ValidatorUtils.validateEntity(qiye);
qiyeService.updateById(qiye);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
qiyeService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<QiyeEntity> wrapper = new EntityWrapper<QiyeEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = qiyeService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
ZhiweishenqingController
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.ZhiweishenqingEntity;
import com.entity.view.ZhiweishenqingView;
import com.service.ZhiweishenqingService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 职位申请
* 后端接口
* @author
* @email
* @date 2021-03-06 10:03:19
*/
@RestController
@RequestMapping("/zhiweishenqing")
public class ZhiweishenqingController {
@Autowired
private ZhiweishenqingService zhiweishenqingService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ZhiweishenqingEntity zhiweishenqing, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("qiye")) {
zhiweishenqing.setQiyehao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("yonghu")) {
zhiweishenqing.setYonghuming((String)request.getSession().getAttribute("username"));
}
EntityWrapper<ZhiweishenqingEntity> ew = new EntityWrapper<ZhiweishenqingEntity>();
PageUtils page = zhiweishenqingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhiweishenqing), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ZhiweishenqingEntity zhiweishenqing, HttpServletRequest request){
EntityWrapper<ZhiweishenqingEntity> ew = new EntityWrapper<ZhiweishenqingEntity>();
PageUtils page = zhiweishenqingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhiweishenqing), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ZhiweishenqingEntity zhiweishenqing){
EntityWrapper<ZhiweishenqingEntity> ew = new EntityWrapper<ZhiweishenqingEntity>();
ew.allEq(MPUtil.allEQMapPre( zhiweishenqing, "zhiweishenqing"));
return R.ok().put("data", zhiweishenqingService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ZhiweishenqingEntity zhiweishenqing){
EntityWrapper< ZhiweishenqingEntity> ew = new EntityWrapper< ZhiweishenqingEntity>();
ew.allEq(MPUtil.allEQMapPre( zhiweishenqing, "zhiweishenqing"));
ZhiweishenqingView zhiweishenqingView = zhiweishenqingService.selectView(ew);
return R.ok("查询职位申请成功").put("data", zhiweishenqingView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ZhiweishenqingEntity zhiweishenqing = zhiweishenqingService.selectById(id);
return R.ok().put("data", zhiweishenqing);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ZhiweishenqingEntity zhiweishenqing = zhiweishenqingService.selectById(id);
return R.ok().put("data", zhiweishenqing);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ZhiweishenqingEntity zhiweishenqing, HttpServletRequest request){
zhiweishenqing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zhiweishenqing);
zhiweishenqingService.insert(zhiweishenqing);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ZhiweishenqingEntity zhiweishenqing, HttpServletRequest request){
zhiweishenqing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zhiweishenqing);
zhiweishenqingService.insert(zhiweishenqing);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ZhiweishenqingEntity zhiweishenqing, HttpServletRequest request){
//ValidatorUtils.validateEntity(zhiweishenqing);
zhiweishenqingService.updateById(zhiweishenqing);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
zhiweishenqingService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<ZhiweishenqingEntity> wrapper = new EntityWrapper<ZhiweishenqingEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("qiye")) {
wrapper.eq("qiyehao", (String)request.getSession().getAttribute("username"));
}
if(tableName.equals("yonghu")) {
wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
}
int count = zhiweishenqingService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
如果也想学习本系统,下面领取。关注并回复:223springboot
标签:vue,qiye,Springboot,return,Java,new,import,public,RequestMapping From: https://blog.csdn.net/hanyunlong1989/article/details/142664745