SpringBoot+Vue+Mybatis+Redis实现汽车租赁系统【毕设专用、源码、数据库设计】
一、前言
汽车租赁系统,很常见的一个系统,但是网上还是以前的老框架实现的,于是我打算从设计到开发都用现在比较流行的新框架。想学习或者做毕设的可以私信联系哦!!
二、技术栈
- 后端技术
Spring
SpringBoot
Mybatis
- 前端技术
vue
Element UI
axios
node
echarts
- 数据库
MySQL
Redis
三、管理员界面展示
管理员登录界面:
管理员修改密码界面:
添加车系界面:
添加车辆界面:
用户管理界面:
订单管理界面:
评价管理界面:
报表分析界面:
礼物管理界面:
添加修改礼物界面:
用户兑换礼物账单界面:
兑换礼物报表界面:
四、用户界面
用户注册界面:
用户登录界面:
登录后首页展示界面:
车辆出租展示界面:
车辆详情界面:
订单页面页面:
订单导出Excel界面:
Excel查看:
礼物兑换展示页面:
五、数据库设计
-- ---------------------------- -- Table structure for admin -- ---------------------------- DROP TABLE IF EXISTS `admin`; CREATE TABLE `admin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for car -- ---------------------------- DROP TABLE IF EXISTS `car`; CREATE TABLE `car` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `price` double(10, 2) NULL DEFAULT NULL, `zudate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `uid` int(12) NULL DEFAULT NULL, `typeid` int(12) NULL DEFAULT NULL, `status` int(255) NULL DEFAULT NULL, `info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `carnum` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `pic` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for comment -- ---------------------------- DROP TABLE IF EXISTS `comment`; CREATE TABLE `comment` ( `id` int(12) NOT NULL AUTO_INCREMENT, `userid` int(12) NULL DEFAULT NULL, `carid` int(12) NULL DEFAULT NULL, `context` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `pingdate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `answer` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `isok` int(255) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for gift -- ---------------------------- DROP TABLE IF EXISTS `gift`; CREATE TABLE `gift` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `count1` int(11) NULL DEFAULT NULL, `price` double(10, 2) NULL DEFAULT NULL, `pic` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for giftorder -- ---------------------------- DROP TABLE IF EXISTS `giftorder`; CREATE TABLE `giftorder` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userId` int(11) NULL DEFAULT NULL, `giftId` int(11) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for t_order -- ---------------------------- DROP TABLE IF EXISTS `t_order`; CREATE TABLE `t_order` ( `time` date NULL DEFAULT NULL, `id` int(12) NOT NULL AUTO_INCREMENT, `carid` int(12) NULL DEFAULT NULL, `userid` int(12) NULL DEFAULT NULL, `zudate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `huandate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `zumoney` double(255, 0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for types -- ---------------------------- DROP TABLE IF EXISTS `types`; CREATE TABLE `types` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `gender` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `realname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `money` double(255, 1) NULL DEFAULT NULL, `jiazhao` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `isone` int(2) NULL DEFAULT NULL, `vip` int(2) NULL DEFAULT NULL, `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `jifen` int(255) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; SET FOREIGN_KEY_CHECKS = 1;
六、上传图片代码
@PostMapping("/upload") public ETResponse upload(MultipartFile file){ ETResponse response = new ETResponse(); //为空 大小为0 都不符合 if(ObjectUtils.isEmpty(file) || file.getSize()<=0){ response.setMsg(ETEnums.ERROR.getMsg()); return response; } //拿取文件名称 String originalFilename = file.getOriginalFilename(); //拿到名字.后结尾的 String suffix = FilenameUtils.getExtension(originalFilename); if(!StringUtils.equals("JPG",suffix.toUpperCase()) && !StringUtils.equals("PNG",suffix.toUpperCase())){ response.setMsg(ETEnums.ERROR.getMsg()); return response; } //创建新的文件名字 String uuid = UUID.randomUUID().toString().replace("-",""); //组合成新的文件名字 String filename = String.format("%s%s%s",uuid,".",suffix); //文件上传路径 File uploadDir = new File(picProperties.getLocation()); //没有文件夹就创建 if(!uploadDir.exists()){ uploadDir.mkdirs(); } //目标文件 File destFile = new File(uploadDir,filename); //执行上传 try { file.transferTo(destFile); } catch (IOException e) { log.error(e.getMessage(),e); response.setMsg(ETEnums.ERROR.getMsg()); return response; } String prefix = picProperties.getMapping(); String picPath = prefix.endsWith("/") ? prefix + filename : prefix + "/" + filename; log.info("图片访问路径 {}",picPath); response.setData(picPath); response.setCode(ETEnums.SUCCESS.getCode()); response.setMsg(ETEnums.SUCCESS.getMsg()); return response; }
七、总结
总来的说项目的功能点大同小异,创新点在于报表分析和导出订单Excel。对于以前的汽车租赁系统来说还是有很大的改进,特别是框架方面。
————————————————
版权声明:本文为CSDN博主「掉发的小王」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_52423918/article/details/123470575