大家好!我是职场程序猿,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发运行环境
- 框架:ssm
- JDK版本:JDK1.8
- 服务器:tomcat7
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:eclipse/myeclipse/idea
- Maven包:Maven3.3.9
- 浏览器:谷歌浏览器
源码下载地址:
https://download.csdn.net/download/m0_46388260/89282148
论文目录
【如需全文请按文末获取联系】
目录
一、项目简介
本系统的结构分为管理员、前台、用户中心三部分。前台的内容为管理员管理的内容。前台的内容可以供用户浏览。用户在用户中心里可以管理自己的操作信息。本系统的主要内容包括汽车信息、新闻资讯信息、类别信息、租赁信息和管理员信息、用户信息等。管理员负责用户信息、车辆信息、租赁信息、新闻资讯信息的管理。用户负责车辆信息、租赁信息的管理。前台界面展示了车辆信息、新闻资讯信息、用户注册功能、用户登录功能。
二、系统设计
2.1软件功能模块设计
本系统的功能结构图如下图4.1所示:
2.2数据库设计
(1)管理员信息为管理员身份的资料,包括编号和密码、账号。管理员信息ER图如下图4.2所示:
(2)用户信息为用户身份的资料。用户身份的资料有账号、密码、电话、住址等。用户信息ER图如下图4.3所示:
(3)汽车信息由管理员发布,用户浏览,汽车信息包括车型、名称、配置、价格等,汽车信息ER图如下图4.4所示:
(4)租赁信息也是由用户发布,管理员审核。租赁信息包括类型、汽车名称、租赁人等。租赁信息ER图如下图4.5所示:
(5)系统总ER图如下图4.6所示:
三、系统项目部分截图
3.1用户登录功能模块的实现界面
本系统需要登录才可以使用相关功能。用户登录功能的操作步骤为,用户点击用户登录功能,可以跳转到用户登录的窗口界面里,在用户登录的窗口界面里输入账号和密码,输入验证码选择身份,然后点击登录按钮。如果信息填写出错,将会提示登录失败。用户登录窗口的界面实现如下图5.1所示:
3.2在线租赁功能实现界面
在车辆详情界面里可以看到详细的车辆信息,包括类型、名称、数量、价格等。用户可以点击租赁按钮进行车辆的租赁。在线租赁功能的实现界面如下图5.7所示:
还车功能界面的实现
用户租赁完成后可以实现在线还车。在线还车功能的实现界面如下图5.8所示:
用户中心模块的实现界面
用户在用户中心里可以管理租赁信息、个人信息。用户中心功能的实现界面如下图5.9所示:
3.3管理员功能的实现
用户管理功能模块的界面实现
对用户信息的管理包括添加用户信息、修改用户信息和删除用户信息、查询用户信息。用户信息管理的流程如下图5.10所示:
租赁管理功能模块的实现界面
租赁管理功能里可以看到租赁的具体时间、租赁人等信息。还可以进行还车操作。租赁管理功能的实现界面如下图5.13所示:
四、部分核心代码
package com.controller;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.entity.CheliangEntity;
import com.service.CheliangService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ZulinEntity;
import com.service.ZulinService;
import com.utils.PageUtils;
import com.utils.R;
/**
* 租赁模块
* 后端接口
* @author
* @email
* @date 2021-03-20
*/
@RestController
@Controller
@RequestMapping("/zulin")
public class ZulinController {
private static final Logger logger = LoggerFactory.getLogger(ZulinController.class);
@Autowired
private CheliangService cheliangService;
@Autowired
private ZulinService zulinService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("Controller:"+this.getClass().getName()+",page方法");
if(request.getSession().getAttribute("role").equals("用户")){
params.put("yhTypes",request.getSession().getAttribute("userId"));
}
PageUtils page = zulinService.queryPage(params);
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("Controller:"+this.getClass().getName()+",info方法");
ZulinEntity zulin = zulinService.selectById(id);
if(zulin!=null){
return R.ok().put("data", zulin);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ZulinEntity zulin, HttpServletRequest request){
logger.debug("Controller:"+this.getClass().getName()+",save");
Wrapper<ZulinEntity> queryWrapper = new EntityWrapper<ZulinEntity>()
.eq("cl_types", zulin.getClTypes())
.eq("yh_types", zulin.getYhTypes())
.eq("day", zulin.getDay())
.eq("sf_types", zulin.getSfTypes())
.eq("maxmoney", zulin.getMaxmoney())
.eq("pledge", zulin.getPledge())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZulinEntity zulinEntity = zulinService.selectOne(queryWrapper);
if(zulinEntity==null){
zulinService.insert(zulin);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ZulinEntity zulin, HttpServletRequest request){
logger.debug("Controller:"+this.getClass().getName()+",update");
//根据字段查询是否有相同数据
Wrapper<ZulinEntity> queryWrapper = new EntityWrapper<ZulinEntity>()
.notIn("id",zulin.getId())
.eq("cl_types", zulin.getClTypes())
.eq("yh_types", zulin.getYhTypes())
.eq("day", zulin.getDay())
.eq("sf_types", zulin.getSfTypes())
.eq("maxmoney", zulin.getMaxmoney())
.eq("pledge", zulin.getPledge())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZulinEntity zulinEntity = zulinService.selectOne(queryWrapper);
if(zulinEntity==null){
zulinService.updateById(zulin);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/detail")
public R detail(Integer ids){
ZulinEntity zulin = zulinService.selectById(ids);
if(zulin == null){
return R.error();
}
zulin.setPledge(0);
zulin.setZhuangtai(1);
boolean b = zulinService.updateById(zulin);
if(b){
CheliangEntity cheliang = cheliangService.selectById(zulin.getClTypes());
if(cheliang == null){
return R.error();
}
cheliang.setZtTypes(2);
cheliangService.updateById(cheliang);
return R.ok();
}
return R.error();
}
/**
* 还车
*/
@RequestMapping("/huanche")
public R huanche(Integer ids){
ZulinEntity zulin = zulinService.selectById(ids);
if(zulin == null){
return R.error();
}
CheliangEntity cheliang = cheliangService.selectById(zulin.getClTypes());
if(cheliang == null){
return R.error();
}
zulin.setZhuangtai(1);
boolean b = zulinService.updateById(zulin);
if(b){
cheliang.setZtTypes(2);
cheliangService.updateById(cheliang);
return R.ok();
}
return R.error();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(Integer ids){
ZulinEntity zulin = zulinService.selectById(ids);
if(zulin == null){
return R.error();
}
CheliangEntity cheliang = cheliangService.selectById(zulin.getClTypes());
if(cheliang == null){
return R.error();
}
cheliang.setZtTypes(2);
boolean b = cheliangService.updateById(cheliang);
if(b){
zulinService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
return R.error();
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微信联系我。