末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SpringBoot
前端:采用HTML和Vue技术开发
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是


目录

一、项目简介

二、系统功能

三、系统项目截图

3.1前台首页

3.2后台管理

四、核心代码

4.1登录相关

4.2文件上传

4.3封装


一、项目简介

随着科学技术的飞速发展,各行各业都在努力与现代先进技术接轨,通过科技手段提高自身的优势;对于共享单车管理系统当然也不能排除在外,随着网络技术的不断成熟,带动了共享单车管理系统,它彻底改变了过去传统的管理方式,不仅使服务管理难度变低了,还提升了管理的灵活性。这种个性化的平台特别注重交互协调与管理的相互配合,激发了管理人员的创造性与主动性,对共享单车管理系统而言非常有利。

本系统采用的数据库是Mysql,使用SpringBoot技术开发,在设计过程中,充分保证了系统代码的良好可读性、实用性、易扩展性、通用性、便于后期维护、操作方便以及页面简洁等特点。


二、系统功能

本共享单车管理系统主要包括三大功能模块,即用户模块、操作员模块和管理员模块。

(1)管理员模块:首页、个人中心、用户管理、操作员管理、停车点管理、共享单车管理、车辆类型管理、租赁单车管理、归还单车管理、维修信息管理、系统简介管理、站内新闻管理、系统管理。

(2)操作员:首页、个人中心、停车点管理、共享单车管理、租赁单车管理、归还单车管理、维修信息管理。

(3)用户:首页、个人中心、停车点、共享单车、系统简介。


三、系统项目截图

3.1前台首页

共享单车管理系统,在系统首页可以查看首页、停车点、共享单车、系统简介、个人中心、后台管理等内容

用户登录、用户注册, 通过输入用户账号、密码、用户姓名、性别、手机号码等信息进行登录、注册

 共享单车,在共享单车进行查看停车点、账号、姓名、车辆类型、小时价格、状态、实施时间、点击次数等信息

停车点,在停车点页面可以查看编号、地址、点击次数等内容

3.2后台管理

管理员登录,通过填写用户名、密码、角色等信息,输入完成后选择登录即可进入共享单车管理系统

管理员登录进入共享单车管理系统可以查看首页、个人中心、用户管理、操作人员管理、停车点管理、车辆类型管理、共享单车管理、租赁单车管理、维修信息管理、归还单车管理、系统简介管理、系统管理等内容用户管理,在用户管理页面可以查看用户账号、密码、用户姓名、性别、年龄、头像、用户手机等信息,并可根据需要对用户管理进行详情,修改,删除或查看详细内容等操作操作人员管理,在操作人员管理页面可以查看人员账号、人员姓名、性别、年龄、照片、联系方式等信息,并可根据需要对操作人员管理进行详情,修改、删除或查看详细内容等操作停车点管理,在停车点管理页面可以查看编号、名称、地址、账号、姓名、封面等信息,并可根据需要对停车点管理进行详情,修改、删除或查看详细内容操作


四、核心代码

4.1登录相关


package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//      ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//      ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

4.2文件上传

package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
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 org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上传文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上传文件不能为空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下载文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    headers.setContentDispositionFormData("attachment", fileName);    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}

4.3封装

package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回数据*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知异常,请联系管理员");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}

基于SpringBoot的共享单车管理系统相关推荐

  1. 基于JAVA校园共享单车管理系统计算机毕业设计源码+数据库+lw文档+系统+部署

    基于JAVA校园共享单车管理系统计算机毕业设计源码+数据库+lw文档+系统+部署 基于JAVA校园共享单车管理系统计算机毕业设计源码+数据库+lw文档+系统+部署 本源码技术栈: 项目架构:B/S架构 ...

  2. 基于ssm高校共享单车管理系统 (源代码+数据库) 604

    部分代码地址 https://gitee.com/ynwynwy/webike-public 基于ssm高校共享单车管理系统 (源代码+数据库) 一.系统介绍 用户管理,服务点管理,单车管理,分类管理 ...

  3. 基于SSH的共享单车管理系统

    [A-013]基于SSH的共享单车管理系统/共享单车出租系统 开发环境: Eclipse/MyEclipse.Tomcat8.Jdk1.8 数据库: MySQL 适用于: 课程设计,毕业设计,学习等等 ...

  4. 基于SSM的共享单车管理系统 JAVA

    10154_基于SSM的共享单车管理系统 技术 SSM 工具 eclipse + tomact + mysql + jdk 功能详情: 用户管理.服务点管理.单车信息管理.学生信息管理.租赁信息管理. ...

  5. 基于asp.net717共享单车管理系统

    随着时代的发展,我国的国民经济一直在稳步的提升,共享单车的是用来一直在不断的攀升,为了能够更加方便快捷的管理共享单车,需要开发一套利用计算机进行管理的共享单车后台管理系统. 本文以实际运用为开发背景, ...

  6. 基于web的共享单车管理系统

    目  录 1 系统概述    5 1.1 研究背景    5 1.2 研究的意义    5 1.3 系统设计思想    6 2 系统开发环境    7 2.1 ASP.NET概述    7 2.2动态 ...

  7. 基于SpringBoot的共享汽车管理系统

    文末获取源码 开发语言:Java 框架:springboot JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7/8.0 数据库工具:Navicat11 开发软件:eclip ...

  8. 基于Springboot实现共享自习室管理系统

    作者主页:编程指南针 简介:Java领域优质创作者.CSDN博客专家  Java项目.简历模板.学习资料.面试题库.技术互助 文末获取源码 项目编号:BS-XX-083 项目介绍 项目主要功能包括: ...

  9. 共享单车拿车还车java模拟_基于java的共享单车管理系统 ssm

    本系统针对管理者提供一个管理单车和用户信息的平台.系统包括两种权限的用户:系统管理员和普通管理员.系统管理员负责审核授权,普通管理员负责数据管理,进行维修等情况的调度. 具体需求如下: 1. 系统管理 ...

最新文章

  1. echarts数据变了不重新渲染,以及重新渲染了前后数据会重叠渲染的问题
  2. LeetCode 208. 实现 Trie (前缀树) —— 提供一套前缀树模板
  3. c语言中将整数转换成字符串_在C语言中将ASCII字符串(char [])转换为八进制字符串(char [])...
  4. mysql变量 exec_MySQL slave_exec_mode 参数说明
  5. Python的os模块常用文件夹的增删改查详解
  6. 白鹭引擎写入文字图层方法实例
  7. 织梦内核风吟导航QQ导航天下网址管理源码
  8. Linux 配置vim编辑器
  9. Java开发微信支付实践
  10. 树莓派部署yolov3
  11. 使用Nmap扫描目标主机
  12. iphone没有计算机功能,苹果iPad为什么没有计算器应用程序
  13. 小米6怎么刷入鸿蒙,小米6成功刷入统信UOS系统 刷机包开放下载
  14. win10开启cpu虚拟化
  15. 查询2021高考成绩位次,2021年江苏高考位次表及高考个人成绩排名查询
  16. 厨房里的ERP(MRP)
  17. Python之数据加密与解密及相关操作(hashlib、hmac、random、base64、pycrypto)
  18. Carsim工况设置:道路场景的构建
  19. unity实现绳子效果(绳索插件Obi Rope)
  20. Latex(1.1)——符号表

热门文章

  1. svn: E155010: 提交失败问题解决
  2. 怎样调用星图地球数据云的开发接口?
  3. python网络编程——UDP通信附实例参考
  4. UEFI开发与调试---QEMU虚拟盘的创建与修改
  5. 硬件编解码开发 linux,Intel平台硬件加速视频编解码开发
  6. vue AES加密(URLEncode加密)
  7. 智慧养老解决方案配合服务守护老人
  8. Py之skimage:Python库之skimage的简介、安装、使用方法之详细攻略
  9. js 的 onblur 事件
  10. 机器翻译:使用小牛翻译API进行中英文翻译实战