基于Springboot+vue开发实现自行车租赁管理系统

作者主页:编程千纸鹤

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

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

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

项目编号:BS-XX-156

一,项目简介

近年来随着科技技术的进步与发展,“共享”、“租车”等相关的APP陆续出现在我们的生活中。随着城市机动车数量的增加,环境污染、交通拥堵等问题日渐严重,因此,发展新的绿色出行模式,引导人们减少机动车出行成为解决这一问题的新思路。在这种背景下,“公共自行车+公共交通”的出行模式逐渐在我国发展起来,它鼓励人们更多的采用公共自行车这一出行工具。相较于机动车出行,这种方式在节能减排的同时,也能提高居民的出行效率,已经在我国许多城市流行起来。

基于这种背景,设计和开发一个功能全面,界面友好、稳定高效的自行车租赁管理系统。本文主要论述了一个基于JAVAWEB技术的自行车租赁管理系统,概述了课题研究背景、国内外发展现状,以及系统的设计原理、设计思想和具体实现过程。对在设计过程中涉及到的关键设计思想及重要作业流程做了具体分析和介绍,并对系统各个模块的设计思想及设计过程做了详细阐述。

本系统设计采用了JAVAWEB技术,使用SpringBoot框架,以Mysql5.0作为数据库支撑平台,应用到的技术包括JAVA、MyBatis、Vue、软件工程思想等

本系统使用B/S结构,配合MySql数据库开发,以IDEA开发平台为主导的系统。可实现在线管理自行车、在线选择自行车、数据分析对比等功能,让用户选择自己喜欢的自行车。系统涉及到的技术主要由Vue制作前端页面和Java作为后端主要技术,并采用SpringBoot、Mybatis后端架构。

本自行车租赁管理系统,系统主要分为用户权限和管理员权限,权限不一样对应的功能也不一样,大致分为:自行车模块、信息模块、租赁地址模块、订单模块等,各模块预计功能概述如下:

自行车管理:此模块对于系统管理员,主要可以添加自行车删除自行车等功能。对于用户,可以浏览自己喜欢的自行车查看具体自行车信息。

信息管理:此模块对于系统管理员,既可以查看修改自己的个人信息,也可以查看用户的信息,还可以对用户的权限进行修改,可以将普通用户的权限提高至系统管理员。对于用户,只能查看或者修改自己的个人信息。

订单管理:此模块对于系统管理员和用户,都可以查看订单明细,申请退单,对订单进行评价等操作。

问题反馈管理:此模块包括用户在租赁过程中出现的问题进行提交、管理员针对相关问题进行用户反馈的操作。

卡券包管理:此模块对于系统管理员,可以发放一些优惠券,对于用户可以查询自己的所有卡券,可以使用这些卡券。

地址管理:对于系统管理员,可以新添加地址和废除不使用的地址,对于用户,可以查询所有地址信息,根据自己的位置选定最适合的地址进行取车和还车。

信息统计管理:此模块对于系统管理员,对用户信息、自行车信息、地址信息等进行可视化数据分析。对于用户,对订单,历史记录、钱包等进行可视化的数据分析。

二,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

后台开发技术:Springboot+mybatis+springmvc+swagger

前台开发技术:Vue+ElementUI+Axios

其它:支付宝沙箱支付

三,系统展示

管理员登陆系统进行管理

用户管理

自行车管理

自行车回收

故障车维护

地址管理

优惠卷管理

用户投诉

订单管理

退款处理

用户注册登陆后进行租车

用户注册登陆后进行租车

租车

还车

支付:注册支付宝沙箱账户进行支付

购买优惠卷

上报故障

投诉建议

四,核心代码展示

package com.wxh.bicyclerental.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wxh.bicyclerental.entity.Advise;
import com.wxh.bicyclerental.entity.User;
import com.wxh.bicyclerental.service.IAdviseService;
import com.wxh.bicyclerental.service.IUserService;
import com.wxh.bicyclerental.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * 投诉意见管理
 */
@Api
@RestController
@RequestMapping("/advise")
@CrossOrigin
public class AdviseController {

    @Autowired
    private IAdviseService adviseService;

    @Autowired
    private IUserService userService;

    /**
     * 添加新投诉
     */
    @PostMapping("/addAdvise")
    @ApiOperation("添加新投诉")
    public Result addAdvise(@RequestBody Advise advise,@RequestParam String username) {
        //根据用户名查询用户id
        User user = userService.selectByUserName(username);
        Integer id = user.getId();
        advise.setUserId(id);
        //设置状态为0
        advise.setState(0);
        if(adviseService.insert(advise) > 0) {
            return Result.ok().data("添加成功");
        }else {
            return Result.error().data("添加失败");
        }
    }

    /**
     * 根据状态分页查询投诉建议
     */
    @GetMapping("/findByState")
    @ApiOperation("根据状态分页查询投诉建议")
    public Result findByState(@RequestParam Integer state, @RequestParam int pageNo, @RequestParam int pageSize) {
        Map map = new HashMap<>();
        //使用PageHelper分页插件
        PageHelper.offsetPage(pageNo, pageSize);
        PageInfo<Advise> adviseList = PageInfo.of(adviseService.select(state));
        map.put("total", adviseList.getTotal());
        map.put("data", adviseList.getList());
        return Result.ok().data(map);
    }

    /**
     * 修改投诉状态
     */
    @PostMapping("/updateState")
    @ApiOperation("修改投诉状态")
    public Result updateState(@RequestBody Advise advise) {
        Integer id = advise.getId();
        if(adviseService.delete(id) > 0) {
            return Result.ok().data("修改成功");
        }else {
            return Result.error().data("修改失败");
        }
    }
}

package com.wxh.bicyclerental.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wxh.bicyclerental.entity.Bicycle;
import com.wxh.bicyclerental.service.IBicycleService;
import com.wxh.bicyclerental.utils.CodeUtil;
import com.wxh.bicyclerental.utils.Result;
import com.wxh.bicyclerental.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;

/**
 * 自行车管理
 */
@Api
@RestController
@RequestMapping("/bicycle")
@CrossOrigin
public class BicycleController {
    @Autowired
    private IBicycleService bicycleService;

    /**
     * 新车录入
     */
    @PostMapping("/addBicycle")
    @ApiOperation("新车录入")
    public Result addBicycle(@RequestBody Bicycle bicycle) {
        //设置状态为1
        bicycle.setState(1);
        //生成16位id
        Long id = CodeUtil.RundCode();
        bicycle.setBicycleCode(id);
        if(bicycleService.insert(bicycle) > 0) {
            return Result.ok().data("添加成功");
        }else {
            return Result.error().data("添加失败");
        }
    }

    /**
     * 查询所有自行车信息
     */
    @GetMapping("/findAll")
    @ApiOperation("查询所有自行车信息")
    public Result findAll() {
        return Result.ok().data(bicycleService.select());
    }

    /**
     * 分页查询自行车信息
     */
    @GetMapping("/pageQueryBicycle")
    @ApiOperation("分页查询自行车信息")
    public Result pageQueryBicycle(@RequestParam int pageNo, @RequestParam int pageSize) {
        Map map = new HashMap<>();
        //使用PageHelper分页插件
        PageHelper.offsetPage(pageNo, pageSize);
        PageInfo<Bicycle> bicycleList = PageInfo.of(bicycleService.select());
        map.put("total", bicycleList.getTotal());
        map.put("data", bicycleList.getList());
        return Result.ok().data(map);
    }

    /**
     * 根据自行车编码查询自行车信息
     */
    @PostMapping("/findByCode")
    @ApiOperation("根据自行车编码查询自行车信息")
    public Result findByCode(@RequestBody Bicycle bicycle) {
        if(StringUtils.isNull(bicycle)) {
            return Result.error().data("失败");
        }else {
            Long bicycleCode = bicycle.getBicycleCode();
            return Result.ok().data(bicycleService.selectOne(bicycleCode));
        }
    }

    /**
     * 将自行车状态设为2(报废)删除操作
     */
    @GetMapping("/removeBicycle")
    @ApiOperation("删除自行车")
    public Result removeBicycle(@RequestParam Long bicycleCode) {
        if(bicycleService.removeBicycle(bicycleCode) > 0) {
            return Result.ok().data("删除成功");
        }else {
            return Result.error().data("删除失败");
        }
    }
}
package com.wxh.bicyclerental.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wxh.bicyclerental.entity.Coupon;
import com.wxh.bicyclerental.entity.Order;
import com.wxh.bicyclerental.entity.User;
import com.wxh.bicyclerental.entity.UserCoupon;
import com.wxh.bicyclerental.service.ICouponService;
import com.wxh.bicyclerental.service.IUserCouponService;
import com.wxh.bicyclerental.service.IUserService;
import com.wxh.bicyclerental.utils.CodeUtil;
import com.wxh.bicyclerental.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;

/**
 * 优惠券管理
 */
@Api
@RestController
@RequestMapping("/coupon")
@CrossOrigin
public class CouponController {

    @Autowired
    private ICouponService couponService;

    @Autowired
    private IUserService userService;

    @Autowired
    private IUserCouponService userCouponService;

    /**
     * 发布新优惠券
     */
    @PostMapping("/addCoupon")
    @ApiOperation("发布新优惠券")
    public Result addCoupon(@RequestBody Coupon coupon) {
        //设置状态为1
        coupon.setState(1);
        //生成16位id
        Long id = CodeUtil.RundCode();
        coupon.setCouponId(id);
        if (couponService.insert(coupon) > 0) {
            return Result.ok().data("添加成功");
        } else {
            return Result.error().data("添加失败");
        }
    }

    /**
     * 分页查询所有优惠券
     */
    @GetMapping("/findAllCoupon")
    @ApiOperation("分页查询所有优惠券")
    public Result findAllCoupon(@RequestParam Integer state, @RequestParam int pageNo, @RequestParam int pageSize) {
        Map map = new HashMap<>();
        //使用PageHelper分页插件
        PageHelper.offsetPage(pageNo, pageSize);
        PageInfo<Coupon> couponList = PageInfo.of(couponService.selectByState(state));
        map.put("total", couponList.getTotal());
        map.put("data", couponList.getList());
        return Result.ok().data(map);
    }

    /**
     * 查询所有优惠券
     */
    @GetMapping("/findAll")
    @ApiOperation("查询所有优惠券")
    public Result findAll() {
        return Result.ok().data(couponService.select());
    }

    /**
     * 根据id查询优惠券
     */
    @PostMapping("/findByCouponId")
    @ApiOperation("根据id查询优惠券")
    public Result findByCouponId(@RequestBody Coupon coupon) {
        Long couponId = coupon.getCouponId();
        return Result.ok().data(couponService.selectOne(couponId));
    }

    /**
     * 更改优惠券状态
     */
    @PostMapping("/updateCouponState")
    @ApiOperation("更改优惠券状态")
    public Result updateCouponState(@RequestBody Coupon coupon) {
        if (couponService.update(coupon) > 0) {
            return Result.ok().data("修改成功");
        } else {
            return Result.error().data("修改失败");
        }
    }

    /**
     * 购买优惠券
     */
    @PostMapping("/buyCoupon")
    @ApiOperation("购买优惠券")
    public Result buyCoupon(@RequestBody Coupon coupon,@RequestParam String username) {
        //向中间表中插入数据
        UserCoupon userCoupon = new UserCoupon();
        //根据用户名查询用户id
        User user = userService.selectByUserName(username);
        Integer userId = user.getId();
        Long couponId = coupon.getCouponId();
        userCoupon.setCouponId(couponId);
        userCoupon.setUserId(userId);
        //将状态设置成未支付
        userCoupon.setState(2);
        int result = userCouponService.insert(userCoupon);
        if(result>0){
            return Result.ok().data("成功");
        }else {
            return Result.error().data("失败");
        }
    }
}
package com.wxh.bicyclerental.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wxh.bicyclerental.entity.User;
import com.wxh.bicyclerental.service.IUserService;
import com.wxh.bicyclerental.utils.JwtUtils;
import com.wxh.bicyclerental.utils.Result;
import com.wxh.bicyclerental.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.*;

/**
 * 用户管理
 */
@Api
@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserController {
    @Autowired
    private IUserService userService;

    /**
     * 新用户注册
     */
    @PostMapping("/register")
    @ApiOperation("注册")
    public Result registerUser(@RequestBody User user) {
        if (StringUtils.isNull(userService.selectByUserName(user.getUsername()))) {
            //默认是用户注册
            user.setIdentity("user");
            userService.insert(user);
            return Result.ok().data("注册成功");
        }
        return Result.error().data("该用户已存在");
    }

    /**
     * 用户登录
     */
    @PostMapping("/login")
    @ApiOperation("登录")
    public Result login(@RequestBody User requestUser) {
        String username = requestUser.getUsername();
        String password = requestUser.getPassword();
        User user = userService.selectByUserName(username);
        if (StringUtils.isNotNull(user)) {
            String id = user.getId().toString();
            String psw = user.getPassword();
            if (password.equals(psw)) {
                String token = JwtUtils.getJwtToken(id, username);
                Map map = new HashMap(16);
                map.put("token", token);
                return Result.ok().data(map);
            } else {
                return Result.error().data("密码错误");
            }
        }
        return Result.error().data("用户名输入错误");
    }

    /**
     * 获取用户信息
     *
     * @return
     */
    @GetMapping("info")
    @ApiOperation("获取用户信息")
    public Result getInfo(HttpServletRequest request) {
        // 获取jwt解析的信息(用户的id)
        Integer memberIdByJwtToken = Integer.parseInt(JwtUtils.getMemberIdByJwtToken(request));
        // 根据id,查询用户的信息,并将他放入data数据中
        User user = userService.selectOne(memberIdByJwtToken);
        Map map = new HashMap<>();
        ArrayList<String> rolesList = new ArrayList<String>();
        if (StringUtils.isNotNull(user)) {
            rolesList.add(user.getIdentity());
            map.put("roles", JSONArray.parseArray(JSONObject.toJSONString(rolesList)));
            map.put("password", user.getPassword());
            map.put("name", user.getUsername());
            map.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
            return Result.ok().data(map);
        }
        return Result.error();
    }

    /**
     * 授权为系统管理员或取消管理员权限
     */
    @PostMapping("/updateIdentity")
    @ApiOperation("授权或取消权限")
    public Result updateIdentity(@RequestBody User params) {
        Integer id = params.getId();
        String identity = params.getIdentity();
        User user = new User();
        user.setId(id);
        user.setIdentity(identity);
        if (userService.updateIdentity(user) != 0) {
            return Result.ok().data("更新成功");
        }
        return Result.error();
    }

    /**
     * 分页查询指定权限用户信息
     */
    @GetMapping("/pageQueryUser")
    @ApiOperation("分页查询指定权限用户信息")
    public Result pageQueryUser(@RequestParam int pageNo, @RequestParam int pageSize, @RequestParam String identity) {
        Map map = new HashMap<>();
        //使用PageHelper分页插件
        PageHelper.offsetPage(pageNo, pageSize);
        PageInfo<User> userList = PageInfo.of(userService.selectUserByIdentity(identity));
        map.put("total", userList.getTotal());
        map.put("data", userList.getList());
        return Result.ok().data(map);
    }

    /**
     * 查询所有用户信息
     */
    @GetMapping("/queryUser")
    @ApiOperation("查询所有用户信息")
    public Result queryUser() {
        List<User> userList = userService.select();
        if (null == userList || userList.size() == 0) {
            return Result.error().data("查询失败");
        } else {
            return Result.ok().data(userList);
        }
    }

    /**
     * 根据用户名查询用户信息
     */
    @GetMapping("/queryUserByUserName")
    @ApiOperation("根据用户名查询用户信息")
    public Result queryUserByUserName(@RequestParam String username) {
        User user = userService.selectByUserName(username);
        if(StringUtils.isNotNull(user)) {
            return Result.ok().data(user);
        }else {
            return Result.error().data("查询失败");
        }
    }

    /**
     * 更新用户信息
     */
    @PostMapping("/updateUser")
    @ApiOperation("更新用户信息")
    public Result updateUser(@RequestBody User params) {
       if(userService.update(params)>0) {
           return Result.ok().data("更新成功");
       }else {
           return Result.error().data("更新失败");
       }
    }
}

五,项目总结

首先,原有单个区域自行车租赁管理系统在跨区域网点的管理能力上相对薄弱。由于不同自行车租赁区域的计费方式往往是不同的,原有系统经常会发生计费规则混用,导致扣款(或扣诚信分)错误,因此,用户投诉也比较多。除此之外,对于一些完全独立的小型自行车租赁区域,采用原有系统过于庞大和显得累赘。因此,迫切需要一套在运营规模上具有较大伸缩性,既可用于完全独立的小型自行车租赁区域的运营管理,又可以用于将相对独立的各运营区域租赁子系统组合起来集中管理的应用平台。

目前市面上虽然出现了很多共享单车的app,骑车租赁的系统,但是关于自行车租赁的系统还很少。其次,现有存在的系统技术相对落后,在当前大数据的时代,分布式,微服务的开发架构中,这些系统技术落后,对于一些复杂的、高并发的场景并不能很好的处理。本文主要研究的内容是,开发一个技术较新、扩展性更好、综合性更强、业务较为完善的自行车租赁管理系统,一方面方便人们的出行,为城市节能减排做更多的贡献,另一方面,提高自行车租赁管理系统的管理效率和服务水平。

本文主要完成自行车租赁管理系统的设计与开发工作,站在用户和管理员的角度,根据真实的用户使用体验,采用模块化和层次化的设计思想,结合计算机软件、计算机网络、信息安全、数据库等先进技术,开发一个功能全面、界面友好、稳定高效的综合业务租赁管理系统,为自行车租赁系统运营提供强健的业务管理支撑。

  • 4
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
学生管理系统是一个常见的项目,可以使用Spring Boot作为后端框架,Vue作为前端框架,MySQL作为数据库。下面是一个简单的实现步骤: 1. 创建数据库表结构: - 学生表:包含学生的ID、姓名、年龄、性别等信息。 - 可以使用MySQL Workbench或者命令行创建表结构。 2. 创建Spring Boot项目: - 使用Spring Initializr创建一个新的Spring Boot项目,添加必要的依赖。 - 配置数据库连接信息,包括URL、用户名和密码等。 3. 创建学生实体类: - 在Spring Boot项目中创建一个学生实体类,包含与数据库表对应的属性。 4. 创建学生Controller: - 创建一个RESTful API的Controller类,处理学生相关的HTTP请求。 - 使用Spring注解标记Controller类和接口方法。 5. 创建学生Service: - 创建一个Service类,处理业务逻辑,例如增删改查学生信息。 - 使用@Autowired注解将Service类注入到Controller中。 6. 创建Vue前端项目: - 使用Vue CLI创建一个新的Vue项目,配置路由和组件等。 - 可以使用Element UI等UI库来美化界面。 7. 编写前端页面: - 创建学生列表、添加学生、编辑学生等页面,使用axios发送HTTP请求与后端交互。 8. 测试运行: - 启动Spring Boot项目和Vue项目,测试学生管理系统的功能。 这只是一个简单的实现示例,实际项目中可能还需要加入权限控制、分页查询、数据校验等功能。希望对你有所帮助!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程千纸鹤

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值