基于SSM的汽车租赁系统业务管理子系统设计实现

news2024/10/7 10:18:12

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


目录

一、项目简介

二、系统功能

三、系统项目截图

用户管理

员工管理

车型管理

汽车出租

汽车维修

四、核心代码

登录相关

文件上传

封装


一、项目简介

随着信息互联网购物的飞速发展,一般企业都去创建属于自己的管理系统。本文介绍了汽车租赁系统业务管理子系统的开发全过程。通过分析企业对于汽车租赁系统业务管理子系统的需求,创建了一个计算机管理汽车租赁系统业务管理子系统的方案。文章介绍了汽车租赁系统业务管理子系统的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。

本汽车租赁系统业务管理子系统管理员功能有个人中心,用户管理,员工管理,车型管理,租赁信息管理,汽车出租管理,汽车续租管理,汽车加油管理,还车结算管理,汽车维修管理,事故登记管理,系统管理等。员工功能有个人中心,车型管理,租赁信息管理,汽车出租管理,汽车续租管理,汽车加油管理,还车结算管理,汽车维修管理,事故登记管理等。

用户功能有个人中心,车型管理,租赁信息管理,汽车出租管理,汽车续租管理,汽车加油管理,还车结算管理,汽车维修管理,事故登记管理等。因而具有一定的实用性。

本站是一个B/S模式系统,采用SSM框架作为开发技术,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得汽车租赁系统业务管理子系统管理工作系统化、规范化。

关键词:汽车租赁系统业务管理子系统;SSM框架;MYSQL数据库


二、系统功能

本系统是基于B/S架构的网站系统,设计的功能结构图如下图所示:



三、系统项目截图

用户管理

汽车租赁系统业务管理子系统的系统管理员可以管理用户信息,可以对用户信息添加修改删除操作。

员工管理

系统管理员可以对员工进行管理操作。

 

车型管理

系统管理员可以对车型进行管理。

汽车出租

管理员可以管理汽车出租信息。

 

汽车维修

管理员可以管理汽车维修信息。


四、核心代码

登录相关


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{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private 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();
    }
}

文件上传

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{
	@Autowired
    private 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);
	}
	
}

封装

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;
	}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1193072.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

[每周一更]-(第71期):DevOps 是什么?

Wiki的解释&#xff1a; DevOps&#xff08;Development和Operations的混成词&#xff09;是一种重视“软件开发人员&#xff08;Dev&#xff09;”和“IT运维技术人员&#xff08;Ops&#xff09;”之间沟通合作的文化、运动或惯例。 通过自动化“软件交付”和“架构变更”的…

Redis客户端-引入jedis

ssh端口转发 Redis服务器在官网公开了使用的协议(RESP),此时任何一个第三方都可以通过上述协议,来实现出一个和redis服务器通信的客户端程序. 现在,已经有很多库可以让我们直接调用,就不必关注redis协议的细节了. 在java的生态中,封装了RESP协议,实现的redis客户端有很多,我…

亚数受邀参加第六届进博会配套论坛,获评“2023年度上海重点产业提升国际竞争力示范案例”!

11月8日&#xff0c;由上海市商务委指导&#xff0c;上海社科院和临港集团主办&#xff0c;上海社科院应用经济研究所、徐汇虹梅街道和上海市漕河泾新兴技术开发区开发总公司联合承办&#xff0c;长三角产业国际竞争力联盟协办的第六届中国国际进口博览会提升上海产业国际竞争力…

整车级虚拟标定:降本增效

随着社会发展和用户对汽车产品要求的提高&#xff0c;在排放油耗法规逐步加严与新能源汽车凶猛来势的双重夹击下&#xff0c;动力系统配置、车辆配置以及目标市场的多样化正在为汽车产品开发工作带来巨大挑战&#xff0c;也给整车厂研发带来巨大压力。自2005年实施的CAFC&#…

白嫖阿里云服务器教程来了,薅秃阿里云!

白嫖阿里云服务器攻略来了&#xff0c;在阿里云免费试用中心可以申请免费服务器&#xff0c;但是阿里云百科不建议选择免费的&#xff0c;只有3个月使用时长&#xff0c;选择99元服务器不是更香&#xff0c;2核2G配置3M固定带宽&#xff0c;一年99元&#xff0c;重点是新老用户…

操作系统第一次实验——短作业优先调度算法(SJF)

一、实验目的&#xff1a; 目的&#xff1a;了解并掌握作业调度的功能&#xff0c;熟悉并掌握各种作业调度算法。 任务&#xff1a;模拟实现先来先服务或者短作业优先调度算法。 二、实验内容&#xff1a; 1、实验内容 模拟实现SJF调度。 设置作业体&#xff1a;作业名&#x…

解决:Git报错same change IDs

当使用git review的时候&#xff0c;review失败&#xff0c;报错multi commit …same change ids。。 错误&#xff1a; same Change-Id in multiple changes 意思是说&#xff0c;有多个commit记录的change ids是相同的&#xff0c;这change id概念出现在gerrit&#xff0…

将VS工程转为pro工程及VS安装Qt插件后没有create basic .pro file菜单问题解决

目录 1. 前言 2. VS工程转为pro工程 3. 没有create basic .pro file菜单 1. 前言 很多小伙伴包括本人&#xff0c;如果是在Windows下开发Qt程序&#xff0c;偏好用Visual Studio外加装个Qt插件进行Qt开发&#xff0c;毕竟Visual Studio确实是功能强大的IDE&#xff0c;但有时…

国际阿里云:Windows系统ECS实例中CPU使用率较高问题的排查及解决方案!!

问题现象 Windows系统ECS实例中CPU使用率较高&#xff0c;即CPU使用率≥80%。 问题原因 CPU使用率较高可能有以下原因。 ECS实例遭到病毒木马入侵。 ECS实例中第三方杀毒软件运行。 ECS实例中应用程序异常、驱动异常、高I/O使用率或高中断处理的应用程序。 解决方案 步骤…

OAuth2.0和1.0的区别

OAuth2.0的最大改变就是不需要临时token了&#xff0c;直接authorize生成授权code&#xff0c;用code就可以换取accesstoken了&#xff0c;同时accesstoken加入过期&#xff0c;刷新机制&#xff0c;为了安全&#xff0c;要求第三方的授权接口必须是https的。OAuth2.0不能向下兼…

基础课27——人工智能训练师人才画像

1.什么是人工智能训练师 根据《人工智能训练师》国家职业技能标准&#xff08;2021年版&#xff09;&#xff0c;人工智能训练师是指“使用智能训练软件&#xff0c;在人工智能产品使用过程中进行数据库管理、算法参数设置、人机交互设计、性能测试跟踪及其他辅助作业的人员”…

社区治理进化史!拓世法宝化身“虚拟社工”,点亮智能社区的每一个角落

时光流转、技术猛进&#xff0c;社区不再只是在制度层面作为城市治理的最小单元&#xff0c;更是在民生层面成为政府联系、服务群众的“神经末梢”。城市的脚步越来越匆忙&#xff0c;人们对于社区的服务期待也愈发高涨。面对日益复杂的社区治理和服务需求&#xff0c;我们迫切…

建设大型综合运维平台,对接集成多厂商网管系统

当前&#xff0c;云计算、大数据、人工智能等IT技术迅猛发展&#xff0c;企业的信息化步入了一个崭新的时代&#xff0c;企业规模不断壮大&#xff0c;业务不断拓展&#xff0c;企业信息化依赖的网络结构和IT技术越来越复杂。因建设时期等原因&#xff0c;企业网络中分布着不同…

Springboot SpringCloudAlibaba Nacos 项目搭建

依赖版本&#xff1a; spring-boot&#xff1a;2.3.12.RELEASE spring-cloud-alibaba&#xff1a;2.2.7.RELEASE spring-cloud&#xff1a;Hoxton.SR12 nacos&#xff1a;2.0.3 1.部署搭建Nacos注册中心 Linux Nacos 快速启动_nacos linux快速启动-CSDN博客 2.构建项目 源码地…

美国突传两件大事!大饼单日涨跌2500美元,以太走出“独立行情”!

​ 受「比特币ETF正式进入批准窗口期」利好消息刺激&#xff0c;比特币持续攀升&#xff0c;并最终于9日晚间23点突破38000美元关口&#xff0c;创下自2022年5月22日以来最高水平。 据了解&#xff0c;彭博ETF分析师James Seyffart发文称&#xff0c;比特币ETF正式进入批准窗…

mysql的sql_mode参数

msql修改了这个参数&#xff0c;首先mysql需要重新才能生效&#xff0c;还有就是java连接的springboot项目也需要重新启动。之前是遇到了下面的这个报错。只需要把sql_mode设置为空&#xff0c;重启mysql和服务就行 报错 In aggregated query without GROUP BY, expression #1…

网络安全(黑客)自学笔记1.0

前言 今天给大家分享一下&#xff0c;很多人上来就说想学习黑客&#xff0c;但是连方向都没搞清楚就开始学习&#xff0c;最终也只是会无疾而终&#xff01;黑客是一个大的概念&#xff0c;里面包含了许多方向&#xff0c;不同的方向需要学习的内容也不一样。 算上从学校开始学…

NSS [HUBUCTF 2022 新生赛]checkin

NSS [HUBUCTF 2022 新生赛]checkin 判断条件是if ($data_unserialize[username]$username&&$data_unserialize[password]$password)&#xff0c;满足则给我们flag。正常思路来说&#xff0c;我们要使序列化传入的username和password等于代码中的两个同名变量&#xff0…

高斯分布-最大似然估计公式白板推导

由上述推导得出结论&#xff1a; μ M L E 1 N ∑ i 1 N x i \mu_{MLE}\frac{1}{N}\sum\limits _{i1}^{N}x_{i} μMLE​N1​i1∑N​xi​ σ ^ 2 1 N − 1 ∑ i 1 N ( x i − μ ) 2 \hat{\sigma}^{2}\frac{1}{N-1}\sum\limits _{i1}^{N}(x_{i}-\mu)^{2} σ^2N−11​i1∑N…

数字滤波器分析---零极点分析

数字滤波器分析---零极点分析 zplane 函数绘制线性系统的极点和零点。 例如&#xff0c;在 -1/2 处为零且在 0.9e−j2π0.3 和 0.9ej2π0.3 处有一对复极点的简单滤波器为 zer -0.5; pol 0.9*exp(j*2*pi*[-0.3 0.3]); 要查看该滤波器的零极点图&#xff0c;您可以使用 z…