基于java+SpringBoot+Vue的共享汽车管理体系筹划与实现

  金牌会员 | 2024-12-3 06:25:04 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 994|帖子 994|积分 2982

项目运行

环境设置:

Jdk1.8 + Tomcat7.0 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。
项目技能:

Springboot+ mybatis + Maven +mysql5.7或8.0等等构成,B/S模式 + Maven管理等等。
环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 4G内存以上;或者 Mac OS;
5.是否Maven项目: 否;检察源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目
6.数据库:MySql 5.7/8.0等版本均可;
毕设帮助,指导,本源码分享,调试摆设(见文末)
体系介绍:

共享汽车管理体系是一个基于互联网环境的B/S架构体系,旨在提高共享汽车的管理效率和服务质量。体系通过信息技能的应用,实现了共享汽车的信息化管理,包罗用户管理、汽车信息管理、订单管理等功能,使得管理职员能够高效地进行日常管理工作。
团体功能包含:
  1. 用户注册与登录
  2. 汽车信息管理
  3. 订单管理
  4. 汽车投放与归还管理
  5. 数据库设计与管理
复制代码
前台模块:
  1. 用户注册与登录模块:允许用户创建账户并进行身份验证。
  2. 汽车投放模块:展示可使用的共享汽车信息,用户可以进行预约和使用。
  3. 订单管理模块:用户可以查看自己的订单信息,进行支付和订单状态跟踪。
  4. 汽车归还模块:用户完成用车后,可以在此模块进行汽车归还操作。
复制代码
背景模块:
  1. 管理员登录模块:管理员登录后台进行系统管理。
  2. 用户信息管理模块:管理员可以查看、编辑和删除用户信息。
  3. 投放地区管理模块:管理员可以管理共享汽车的投放地区信息。
  4. 汽车信息管理模块:管理员可以添加、编辑和删除共享汽车信息。
  5. 汽车入库管理模块:管理员可以管理汽车入库信息。
  6. 使用订单管理模块:管理员可以查看和审核用户订单。
  7. 汽车归还管理模块:管理员可以查看和管理汽车归还信息。
复制代码

功能截图:







代码实现:

  1. package com.controller;
  2. import java.util.Arrays;
  3. import java.util.Calendar;
  4. import java.util.Date;
  5. import java.util.Map;
  6. import javax.servlet.http.HttpServletRequest;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.stereotype.Controller;
  9. import org.springframework.web.bind.annotation.GetMapping;
  10. import org.springframework.web.bind.annotation.PathVariable;
  11. import org.springframework.web.bind.annotation.PostMapping;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RequestParam;
  15. import org.springframework.web.bind.annotation.ResponseBody;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import com.annotation.IgnoreAuth;
  18. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  19. import com.entity.TokenEntity;
  20. import com.entity.UserEntity;
  21. import com.service.TokenService;
  22. import com.service.UserService;
  23. import com.utils.CommonUtil;
  24. import com.utils.MPUtil;
  25. import com.utils.PageUtils;
  26. import com.utils.R;
  27. import com.utils.ValidatorUtils;
  28. /**
  29. * 登录相关
  30. */
  31. @RequestMapping("users")
  32. @RestController
  33. public class UserController{
  34.        
  35.         @Autowired
  36.         private UserService userService;
  37.        
  38.         @Autowired
  39.         private TokenService tokenService;
  40.         /**
  41.          * 登录
  42.          */
  43.         @IgnoreAuth
  44.         @PostMapping(value = "/login")
  45.         public R login(String username, String password, String captcha, HttpServletRequest request) {
  46.                 UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
  47.                 if(user==null || !user.getPassword().equals(password)) {
  48.                         return R.error("账号或密码不正确");
  49.                 }
  50.                 String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
  51.                 return R.ok().put("token", token);
  52.         }
  53.        
  54.         /**
  55.          * 注册
  56.          */
  57.         @IgnoreAuth
  58.         @PostMapping(value = "/register")
  59.         public R register(@RequestBody UserEntity user){
  60. //            ValidatorUtils.validateEntity(user);
  61.             if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
  62.                     return R.error("用户已存在");
  63.             }
  64.         userService.insert(user);
  65.         return R.ok();
  66.     }
  67.         /**
  68.          * 退出
  69.          */
  70.         @GetMapping(value = "logout")
  71.         public R logout(HttpServletRequest request) {
  72.                 request.getSession().invalidate();
  73.                 return R.ok("退出成功");
  74.         }
  75.        
  76.         /**
  77.      * 密码重置
  78.      */
  79.     @IgnoreAuth
  80.         @RequestMapping(value = "/resetPass")
  81.     public R resetPass(String username, HttpServletRequest request){
  82.             UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
  83.             if(user==null) {
  84.                     return R.error("账号不存在");
  85.             }
  86.             user.setPassword("123456");
  87.         userService.update(user,null);
  88.         return R.ok("密码已重置为:123456");
  89.     }
  90.        
  91.         /**
  92.      * 列表
  93.      */
  94.     @RequestMapping("/page")
  95.     public R page(@RequestParam Map<String, Object> params,UserEntity user){
  96.         EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
  97.             PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
  98.         return R.ok().put("data", page);
  99.     }
  100.         /**
  101.      * 列表
  102.      */
  103.     @RequestMapping("/list")
  104.     public R list( UserEntity user){
  105.                EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
  106.               ew.allEq(MPUtil.allEQMapPre( user, "user"));
  107.         return R.ok().put("data", userService.selectListView(ew));
  108.     }
  109.     /**
  110.      * 信息
  111.      */
  112.     @RequestMapping("/info/{id}")
  113.     public R info(@PathVariable("id") String id){
  114.         UserEntity user = userService.selectById(id);
  115.         return R.ok().put("data", user);
  116.     }
  117.    
  118.     /**
  119.      * 获取用户的session用户信息
  120.      */
  121.     @RequestMapping("/session")
  122.     public R getCurrUser(HttpServletRequest request){
  123.             Long id = (Long)request.getSession().getAttribute("userId");
  124.         UserEntity user = userService.selectById(id);
  125.         return R.ok().put("data", user);
  126.     }
  127.     /**
  128.      * 保存
  129.      */
  130.     @PostMapping("/save")
  131.     public R save(@RequestBody UserEntity user){
  132. //            ValidatorUtils.validateEntity(user);
  133.             if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
  134.                     return R.error("用户已存在");
  135.             }
  136.         userService.insert(user);
  137.         return R.ok();
  138.     }
  139.     /**
  140.      * 修改
  141.      */
  142.     @RequestMapping("/update")
  143.     public R update(@RequestBody UserEntity user){
  144. //        ValidatorUtils.validateEntity(user);
  145.         userService.updateById(user);//全部更新
  146.         return R.ok();
  147.     }
  148.     /**
  149.      * 删除
  150.      */
  151.     @RequestMapping("/delete")
  152.     public R delete(@RequestBody Long[] ids){
  153.         userService.deleteBatchIds(Arrays.asList(ids));
  154.         return R.ok();
  155.     }
  156. }
复制代码
论文参考:


源码获取:

私信获取

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表