校园跑腿|前后端分离跑腿项目Springboot+vue

作者主页:编程千纸鹤

作者简介:Java、前端、Python开发多年,做过高程,项目经理,架构师

主要内容:Java项目开发、毕业设计开发、面试技术整理、最新技术分享

收藏点赞不迷路  关注作者有好处

文末获得源码

项目编号:BS-XX-183

前言:

随着我国教育制度的改革的发展,各大高校的学生数量也在不断的增加。当前大学生的生活和消费习惯等导致他们更喜欢通过网络来获取自己想要的商品和服务,这也是导致当前校园跑腿盛行的主要原因。为了能够让更多的学生享受到校园跑腿的服务,我们通过springboot框架开发了本次的基于springboot的校园跑腿管理系统。

本系统从用户的角度出发,结合当前的校园环境而开发的,在开发语言上是使用的Java语言,在框架上我们是使用的springboot框架,数据库方面使用的是MySQL数据库,开发工具为IDEA。

基于springboot的校园跑腿管理系统根据实际情况分为前后台两部分,前台部分主要是让用户购物使用的,包括用户的注册登录,查看公告,查看招聘信息,查看配送订单并,对个人注册信息进行管理等功能;后台部分功能主要包括用户信息管理,配送员管理,发布订单管理,接取订单管理,配送订单管理,评价信息管理,招聘信息管理,在线留言,系统管理等功能。通过这些功能基本可以满足一个校园跑腿管理系统的需求。

一,项目简介

基于springboot的校园跑腿管理系统根据实际情况分为前后台两部分,前台部分主要是让用户购物使用的,包括用户的注册登录,查看公告,查看招聘信息,查看配送订单并,对个人注册信息进行管理等功能;后台部分功能主要包括用户信息管理,配送员管理,发布订单管理,接取订单管理,配送订单管理,评价信息管理,招聘信息管理,在线留言,系统管理等功能。通过这些功能基本可以满足一个校园跑腿管理系统的需求。基于springboot的校园跑腿管理系统具体功能如下图所示

二,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

开发技术:springboot+mybatis-plus+vue+ElementUI

前后端分离

三,系统展示

5.1 基于springboot的校园跑腿管理系统用户部分设计

5.1.1 系统首页

通过在浏览器中输入http://localhost:8080/springbootd7kmt/front/index.html打开本系统的首页部分,在首页部分们我设置了网站的导航,导航下面是图片轮播的功能,然后下面是推荐的一些招聘信息,新闻公告等内容。基于springboot的校园跑腿管理系统首页部分具体效果如图5-1所示

图5-1 基于springboot的校园跑腿管理系统首页界面

5.1.2用户注册登录

当校园内的学生想要发布配送订单的时候一定要注册登录否则是不可以发布订单信息的。在用户注册界面中输入用户的基本信息并点击[注册]按钮即可完成注册功能,为了让注册界面看起来更加的美观大方我们加入了一个校园的图片,这样更符合我们的主题。基于springboot的校园跑腿管理系统用户注册效果如图5-2所示

图5-2 基于springboot的校园跑腿管理系统用户注册界面

基于springboot的校园跑腿管理系统的用户在注册之后点击注册按钮下方的[已有账号登录]即可跳转到用户登录界面,在用户登录界面中输入上一步中注册的账号+密码然后点击[登录]按钮即可完成登录操作。基于springboot的校园跑腿管理系统用户登陆界面如图5-3所示

图5-3 基于springboot的校园跑腿管理系统用户登陆界面

5.1.3发布订单

用户通过本基于springboot的校园跑腿管理系统的发布订单模块,可以看到其他用户发布的订单信息,在发布订单模块中我们通过图片+任务标题的方式进行展示,用户通过点击图片可以看到任务的详细内容,基于springboot的校园跑腿管理系统任务信息效果如图5-4所示

图5-4 基于springboot的校园跑腿管理系统发布订单界面

当用户在上一步中的发布订单中点击了订单任务的图片之后系统会根据参数自动的跳转到发布订单的详细界面中来,在订单详情中可以看到订单的具体内容和悬赏金额等信息,基于springboot的校园跑腿管理系统商品详情界面如图5-5所示

图5-5 基于springboot的校园跑腿管理系统发布订单详情界面

5.1.4招聘信息

基于springboot的校园跑腿管理系统的用于还可以查看招聘信息,在招聘信息中我们通过图片+标题的形式对招聘信息进行了展示,用户通过点击招聘的图片可以查看招聘的详情信息基于springboot的校园跑腿管理系统招聘信息界面如图5-6所示

图5-6基于springboot的校园跑腿管理系统招聘信息界面

当用户在上一步中点击了招聘信息的图片之后可以看到招聘信息的详细信息,基于springboot的校园跑腿管理系统招聘信息的详细界面如图5-7所示

图5-7基于springboot的校园跑腿管理系统招聘信息详情界面

5.1.5订单信息管理  

当用户有需要配送的订单的时候可以在发布订单管理模块中发布自己的需求,在新增的配送任务中输入物品名称+物品封面+悬赏金额和具体内容等信息之后点击[提交]按钮即可完成配送订单的发布操作。基于springboot的校园跑腿管理系统订单信息界面如图5-8所示

  

图5-8基于springboot的校园跑腿管理系统订单添加界面

当用户在上一步中添加了订单之后还可以查看和管理自己的订单信息,在包括根据关键字查询自己的订单,对有误的订单进行修改很删除已经完成的订单等操作。基于springboot的校园跑腿管理系统订单管理如图5-9所示

图5-9 基于springboot的校园跑腿管理系统订单管理界面

当配送员接取了自己的订单自后可以在订单管理中查看已经被接取的订单信息。基于springboot的校园跑腿管理系统接取订单管理如图5-10所示

图5-10 基于springboot的校园跑腿管理系统接取订单管理界面

当配送员已经完成了对订单的配送之后用户可以在配送订单中看到自己的已经被配送的订单信息,同时可以对订单进行评价。基于springboot的校园跑腿管理系统配送单理如图5-11所示

图5-11 基于springboot的校园跑腿管理系统配送订单管理界面

当配送员已经完成了对订单的配送之后用户可以对订单进行评价。基于springboot的校园跑腿管理系统订单评价管理如图5-12所示

图5-12 基于springboot的校园跑腿管理系统评价管理界面

5.2 基于springboot的校园跑腿管理系统管理员部分设计

5.2.1后台登录模块的实现

 基于springboot的校园跑腿管理系统中的管理员+配送+用户都可以在后台登录。在本登录界面中输入账号+密码,并选择角色即可完成登录,同时配送员还可以在本界面中进行注册。基于springboot的校园跑腿管理系统管理员登陆界面如图5-13所示

图5-13基于springboot的校园跑腿管理系统管理员登录页面

5.2.2 用户信息管理

基于springboot的校园跑腿管理系统的管理人员登录之后可以对系统内的用户信息进行管理,主要包括对用户信息的增删改查等操作。当有新的用户需要添加的时候基于springboot的校园跑腿管理系统的管理人员输入用户账号+用户昵称+密码+性别+手机+头像等内容之后点击[提交]按钮即可完成对新的用户的添加工作。基于springboot的校园跑腿管理系统景点信息管理界面如图5-14

图5-14基于springboot的校园跑腿管理系统用户信息添加页面

在上一部中管理人员完成了对新用户的添加工作,此外还需要对用户进行查看,修改和删除等操作。当管理员打开用户管理列表时可以看都当前已经添加好的用户列表,并可以根据用户账号关键字进行模糊查询,同时可对不需要的用户进行删除,当用户有误的时候可以通过编辑按钮对其进行修改操作。基于springboot的校园跑腿管理系统用户信息列表界面如图5-15所示

图5-15基于springboot的校园跑腿管理系统用户信息管理页面

5.2.3配送员管理

基于springboot的校园跑腿管理系统的管理员用户可以管理配送员,在配送员管理中输入对应的配送工号,密码,配送姓名,性别,配送电话,头像等基本信息后点击配送员管理中的[立即提交]按钮,系统会将用户输入的信息通过peisongyuanControl中的peisongyuanadd()方法将数据添加到数据库peisongyuan表中,在页面中我们通过required来进行控件的非空验证,这样用户在没有输入信息的时候系统会给出对应的提示。基于springboot的校园跑腿管理系统配送员信息添加界面如图 5-16

图5-16配送员添加页面

基于springboot的校园跑腿管理系统的管理员在上一步中对配送员信息进行了添加操作之后还根据对配送员信息进行管理的操作,主要包括根据关键字对配送员信息进行查询,对有误的信息进行修改,对不需要的配送员信息进行删除等操作。基于springboot的校园跑腿管理系统配送员管理界面如图5-17所示

图5-17配送员管理列表页面

5.2.4公告信息管理

基于springboot的校园跑腿管理系统的管理员用户可以管理公告信息,在公告信息管理中输入对应的标题,简介,图片,内容等基本信息后点击公告信息管理中的[立即提交]按钮,系统会将用户输入的信息通过newsControl中的newsadd()方法将数据添加到数据库news表中,在页面中我们通过required来进行控件的非空验证,这样用户在没有输入信息的时候系统会给出对应的提示。基于springboot的校园跑腿管理系统公告信息添加界面如图 5-18

图5-18公告信息添加页面

基于springboot的校园跑腿管理系统的管理员在上一步中对公告信息进行了添加操作之后还根据对公告信息进行管理的操作,主要包括根据关键字对公告信息进行查询,对有误的信息进行修改,对不需要的公告信息进行删除等操作。基于springboot的校园跑腿管理系统公告信息管理界面如图5-19所示

图5-19公告信息管理列表页面

5.2.5招聘信息管理

基于springboot的校园跑腿管理系统的管理员用户可以管理招聘信息,在招聘信息管理中输入对应的招聘岗位,招聘类型,工作地点,岗位封面,薪资待遇,结算类型,工作时间,发布日期,负责人,联系电话,工作内容,最近点击时间,点击次数等基本信息后点击招聘信息管理中的[立即提交]按钮,系统会将用户输入的信息通过zhaopinxinxiControl中的zhaopinxinxiadd()方法将数据添加到数据库zhaopinxinxi表中,在页面中我们通过required来进行控件的非空验证,这样用户在没有输入信息的时候系统会给出对应的提示。基于springboot的校园跑腿管理系统招聘信息添加界面如图 5-20

图5-20招聘信息添加页面

基于springboot的校园跑腿管理系统的管理员在上一步中对招聘信息进行了添加操作之后还根据对招聘信息进行管理的操作,主要包括根据关键字对招聘信息进行查询,对有误的信息进行修改,对不需要的招聘信息进行删除等操作。基于springboot的校园跑腿管理系统招聘信息管理界面如图5-20所示

图5-21招聘信息管理列表页面

5.3 基于springboot的校园跑腿管理系统配送员部分设计

5.3.1接取任务管理

当配送人员登录之后可以查看用户发布的配送任务,并可以点击后面的接取按钮在线进行接单。基于springboot的校园跑腿管理系统配送员接单界面如图 5-22

图5-22配送员接单界面

5.3.2已接取订单管理

当配送人员在上一步中接取了自己的任务之后可以可以查看和管理自己的任务,并可以安排配送。基于springboot的校园跑腿管理系统配送员已接取订单管理界面如图 5-23

图5-23配送员已接取订单管理界面

5.3.3已配送订单管理

当配送人员在上一步中完成了配送之后可以查看已经完成的配送的订单信息。基于springboot的校园跑腿管理系统配送员已配送界面如图 5-24

图5-24配送员已配送界面

5.3.4已评价订单管理

当配送人员在完成了订单之后用于可以对配送员进行评价,配送员可以看到他人对自己的评价信息。基于springboot的校园跑腿管理系统配送员已配送界面如图 5-25

图5-25配送员已评价订单界面

四,核心代码展示

package com.controller;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
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.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
 * 通用接口
 */
@RestController
public class CommonController{
	@Autowired
	private CommonService commonService;

    private static AipFace client = null;
    
    @Autowired
    private ConfigService configService;    
	/**
	 * 获取table表中的column列表(联动接口)
	 * @param table
	 * @param column
	 * @return
	 */
	@IgnoreAuth
	@RequestMapping("/option/{tableName}/{columnName}")
	public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		if(StringUtils.isNotBlank(level)) {
			params.put("level", level);
		}
		if(StringUtils.isNotBlank(parent)) {
			params.put("parent", parent);
		}
		List<String> data = commonService.getOption(params);
		return R.ok().put("data", data);
	}
	
	/**
	 * 根据table中的column获取单条记录
	 * @param table
	 * @param column
	 * @return
	 */
	@IgnoreAuth
	@RequestMapping("/follow/{tableName}/{columnName}")
	public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		params.put("columnValue", columnValue);
		Map<String, Object> result = commonService.getFollowByOption(params);
		return R.ok().put("data", result);
	}
	
	/**
	 * 修改table表的sfsh状态
	 * @param table
	 * @param map
	 * @return
	 */
	@RequestMapping("/sh/{tableName}")
	public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
		map.put("table", tableName);
		commonService.sh(map);
		return R.ok();
	}
	
	/**
	 * 获取需要提醒的记录数
	 * @param tableName
	 * @param columnName
	 * @param type 1:数字 2:日期
	 * @param map
	 * @return
	 */
	@IgnoreAuth
	@RequestMapping("/remind/{tableName}/{columnName}/{type}")
	public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("table", tableName);
		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));
			}
		}
		
		int count = commonService.remindCount(map);
		return R.ok().put("count", count);
	}
	
	/**
	 * 单列求和
	 */
	@IgnoreAuth
	@RequestMapping("/cal/{tableName}/{columnName}")
	public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		Map<String, Object> result = commonService.selectCal(params);
		return R.ok().put("data", result);
	}
	
	/**
	 * 分组统计
	 */
	@IgnoreAuth
	@RequestMapping("/group/{tableName}/{columnName}")
	public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("column", columnName);
		List<Map<String, Object>> result = commonService.selectGroup(params);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		for(Map<String, Object> m : result) {
			for(String k : m.keySet()) {
				if(m.get(k) instanceof Date) {
					m.put(k, sdf.format((Date)m.get(k)));
				}
			}
		}
		return R.ok().put("data", result);
	}
	
	/**
	 * (按值统计)
	 */
	@IgnoreAuth
	@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
	public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("xColumn", xColumnName);
		params.put("yColumn", yColumnName);
		List<Map<String, Object>> result = commonService.selectValue(params);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		for(Map<String, Object> m : result) {
			for(String k : m.keySet()) {
				if(m.get(k) instanceof Date) {
					m.put(k, sdf.format((Date)m.get(k)));
				}
			}
		}
		return R.ok().put("data", result);
	}

	/**
 	 * (按值统计)时间统计类型
	 */
	@IgnoreAuth
	@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}/{timeStatType}")
	public R valueDay(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("table", tableName);
		params.put("xColumn", xColumnName);
		params.put("yColumn", yColumnName);
		params.put("timeStatType", timeStatType);
		List<Map<String, Object>> result = commonService.selectTimeStatValue(params);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		for(Map<String, Object> m : result) {
			for(String k : m.keySet()) {
				if(m.get(k) instanceof Date) {
					m.put(k, sdf.format((Date)m.get(k)));
				}
			}
		}
		return R.ok().put("data", result);
	}
	
    /**
     * 人脸比对
     * 
     * @param face1 人脸1
     * @param face2 人脸2
     * @return
     */
    @RequestMapping("/matchFace")
    @IgnoreAuth
    public R matchFace(String face1, String face2,HttpServletRequest request) {
        if(client==null) {
            /*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
            String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
            String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
            String token = BaiduUtil.getAuth(APIKey, SecretKey);
            if(token==null) {
                return R.error("请在配置管理中正确配置APIKey和SecretKey");
            }
            client = new AipFace(null, APIKey, SecretKey);
            client.setConnectionTimeoutInMillis(2000);
            client.setSocketTimeoutInMillis(60000);
        }
        JSONObject res = null;
        try {
            File path = new File(ResourceUtils.getURL("classpath:static").getPath());
            if(!path.exists()) {
                path = new File("");
            }
            File upload = new File(path.getAbsolutePath(),"/upload/");
            File file1 = new File(upload.getAbsolutePath()+"/"+face1);
            File file2 = new File(upload.getAbsolutePath()+"/"+face2);
            String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
            String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
            MatchRequest req1 = new MatchRequest(img1, "BASE64");
            MatchRequest req2 = new MatchRequest(img2, "BASE64");
            ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
            requests.add(req1);
            requests.add(req2);
            res = client.match(requests);
            System.out.println(res.get("result"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return R.error("文件不存在");
        } catch (IOException e) {
            e.printStackTrace();
        } 
        return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
    }
}

package com.controller;


import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

/**
 * 登录相关
 */
@RequestMapping("config")
@RestController
public class ConfigController{
   
   @Autowired
   private ConfigService configService;

   /**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
        EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
       PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
        return R.ok().put("data", page);
    }
    
   /**
     * 列表
     */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
        EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
       PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
        return R.ok().put("data", page);
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        ConfigEntity config = configService.selectById(id);
        return R.ok().put("data", config);
    }
    
    /**
     * 详情
     */
    @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        ConfigEntity config = configService.selectById(id);
        return R.ok().put("data", config);
    }
    
    /**
     * 根据name获取信息
     */
    @RequestMapping("/info")
    public R infoByName(@RequestParam String name){
        ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
        return R.ok().put("data", config);
    }
    
    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody ConfigEntity config){
//     ValidatorUtils.validateEntity(config);
       configService.insert(config);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ConfigEntity config){
//        ValidatorUtils.validateEntity(config);
        configService.updateById(config);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
       configService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

五,项目总结

猜你喜欢

转载自blog.csdn.net/BS009/article/details/129246062