Web 毕设篇-适合小白、初级入门练手的 Spring Boot Web 毕业设计项目:智行无忧停车场管理系统(前后端源码 + 数据库 sql 脚本)

🔥博客主页: 【小扳_-CSDN博客】
❤感谢大家点赞👍收藏⭐评论✍

 

文章目录

        1.0 项目介绍

        1.1 项目功能

        2.0 用户登录功能

        3.0 首页界面

        4.0 车辆信息管理功能

        5.0 停车位管理功能

        6.0 入场登记管理功能

        7.0 预约管理功能

        8.0 收费规则功能

        9.0 出场登记管理功能

        10.0 用户信息管理功能

        11.0 SQL 数据库设计


        1.0 项目介绍

        开发工具:IDEA、VScode

        服务器:Tomcat, JDK 17

        项目构建:maven

        数据库:mysql 8.0

系统用户前台和管理后台两部分,项目采用前后端分离

        前端技术:vue + elementUI

        服务端技术:springboot + mybatis + redis + mysql

        1.1 项目功能

后台功能:

        1)登录、退出系统、首页

        2)用户信息管理

                (1) 用户信息管理:添加、修改、删除、查询等功能。

        3)车辆信息管理

                (1) 车辆信息管理:添加、修改、删除、查询等功能。

        4)停车位管理

                (1) 停车位管理:添加、修改、删除、查询、安排车位等功能。

        5)入场登记管理

                (1)入场登记管理:添加、修改、删除、查询等功能。

        6)预约管理

                (1) 车位预约管理:添加、修改、删除、查询等功能。

        7)收费规则

                (1) 收费规则:添加、修改、删除、查询等功能。

        8)出场登记管理

                (1) 出场登记管理:添加、修改、删除、查询等功能。

        9)权限管理

                (1)角色信息管理:添加、修改、删除、分配权限等功能。

                (2)资源信息管理:添加、修改、删除等功能。

        注意:不一定非要完全符合开发环境,有稍微的差别也是可以开发的。

         若需要项目完整源码,可以在 CSDN 私信给我,我每天都有查看消息的,感谢大家支持,希望可以帮助到大家!

        2.0 用户登录功能

        用户根据正确的用户名、密码且通过正确的校验码进行登录。

        实现了登录校验,还有用户注册功能:

        用到了 Spring Security 框架来实现登录、校验、验证等功能。 

相关的部分源码:

@RestController
public class SysLoginController
{@Autowiredprivate SysLoginService loginService;@Autowiredprivate ISysMenuService menuService;@Autowiredprivate SysPermissionService permissionService;/*** 登录方法* * @param loginBody 登录信息* @return 结果*/@PostMapping("/login")public AjaxResult login(@RequestBody LoginBody loginBody){AjaxResult ajax = AjaxResult.success();// 生成令牌String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),loginBody.getUuid());ajax.put(Constants.TOKEN, token);return ajax;}/*** 获取用户信息* * @return 用户信息*/@GetMapping("getInfo")public AjaxResult getInfo(){SysUser user = SecurityUtils.getLoginUser().getUser();// 角色集合Set<String> roles = permissionService.getRolePermission(user);// 权限集合Set<String> permissions = permissionService.getMenuPermission(user);AjaxResult ajax = AjaxResult.success();ajax.put("user", user);ajax.put("roles", roles);ajax.put("permissions", permissions);return ajax;}/*** 获取路由信息* * @return 路由信息*/@GetMapping("getRouters")public AjaxResult getRouters(){Long userId = SecurityUtils.getUserId();List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);return AjaxResult.success(menuService.buildMenus(menus));}
}
    public String login(String username, String password, String code, String uuid){// 验证码校验validateCaptcha(username, code, uuid);// 登录前置校验loginPreCheck(username, password);// 用户验证Authentication authentication = null;try{UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);AuthenticationContextHolder.setContext(authenticationToken);// 该方法会去调用UserDetailsServiceImpl.loadUserByUsernameauthentication = authenticationManager.authenticate(authenticationToken);}catch (Exception e){if (e instanceof BadCredentialsException){AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));throw new UserPasswordNotMatchException();}else{AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));throw new ServiceException(e.getMessage());}}finally{AuthenticationContextHolder.clearContext();}AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));LoginUser loginUser = (LoginUser) authentication.getPrincipal();recordLoginInfo(loginUser.getUserId());// 生成tokenreturn tokenService.createToken(loginUser);}

        3.0 首页界面

        统计相关车辆的信息,使用柱状图和圆饼图来展示出来,会更加直观。

相关的源码:

<template><div class="statistics-container"><!-- <h1>智行无忧停车场</h1> --><div class="data-summary"><div class="summary-item"><h2>今日车辆总数</h2><p>{{ totalVehicles }}</p></div><div class="summary-item"><h2>今日车辆进入数</h2><p>{{ todayEntries }}</p></div><div class="summary-item"><h2>今日车辆离开数</h2><p>{{ todayExits }}</p></div><div class="summary-item"><h2>当前空闲车位数</h2><p>{{ availableSpots }}</p></div></div><div class="chart-container"><div id="vehicleEntryExitChart" style="width: 100%; height: 400px;"></div></div><div class="chart-container"><div id="spotUsageChart" style="width: 100%; height: 400px;"></div></div></div>
</template><script setup>
import * as echarts from 'echarts';
import { onMounted, ref, computed } from 'vue';const vehicleEntryExitChart = ref(null);
const spotUsageChart = ref(null);// 模拟数据
const mockVehicleEntryExitData = {dates: ['2024-12-04', '2024-12-05', '2024-12-06'],entries: [120, 200, 150],exits: [90, 180, 130]
};const mockSpotUsageData = {spotUsages: [{ value: 335, name: '已使用' },{ value: 310, name: '未使用' }]
};const totalVehicles = computed(() => mockVehicleEntryExitData.entries.reduce((a, b) => a + b, 0));
const todayEntries = computed(() => mockVehicleEntryExitData.entries[mockVehicleEntryExitData.entries.length - 1]);
const todayExits = computed(() => mockVehicleEntryExitData.exits[mockVehicleEntryExitData.exits.length - 1]);
const availableSpots = computed(() => mockSpotUsageData.spotUsages.find(item => item.name === '未使用')?.value || 0);onMounted(() => {initVehicleEntryExitChart();initSpotUsageChart();
});function initVehicleEntryExitChart() {const chartDom = document.getElementById('vehicleEntryExitChart');if (chartDom) {const myChart = echarts.init(chartDom);const option = {title: {text: '车辆进出统计'},tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'}},xAxis: {type: 'category',data: mockVehicleEntryExitData.dates},yAxis: {type: 'value'},series: [{name: '车辆进入',data: mockVehicleEntryExitData.entries,type: 'bar'},{name: '车辆离开',data: mockVehicleEntryExitData.exits,type: 'bar'}]};myChart.setOption(option);}
}function initSpotUsageChart() {const chartDom = document.getElementById('spotUsageChart');if (chartDom) {const myChart = echarts.init(chartDom);const option = {title: {text: '车位使用情况'},tooltip: {trigger: 'item'},legend: {top: '5%',left: 'center'},series: [{name: '车位使用情况',type: 'pie',radius: '50%',data: mockSpotUsageData.spotUsages,emphasis: {itemStyle: {shadowBlur: 10,shadowOffsetX: 0,shadowColor: 'rgba(0, 0, 0, 0.5)'}}}]};myChart.setOption(option);}
}
</script>

        4.0 车辆信息管理功能

        上传图片使用了第三方接口:x-File-Storage 框架。

相关源码:

@RestController
@RequestMapping("/manage/vehicle")
public class VehicleController extends BaseController
{@Autowiredprivate IVehicleService vehicleService;/*** 查询车辆信息列表*/@PreAuthorize("@ss.hasPermi('manage:vehicle:list')")@GetMapping("/list")public TableDataInfo list(Vehicle vehicle){startPage();List<Vehicle> list = vehicleService.selectVehicleList(vehicle);return getDataTable(list);}/*** 导出车辆信息列表*/@PreAuthorize("@ss.hasPermi('manage:vehicle:export')")@Log(title = "车辆信息", businessType = BusinessType.EXPORT)@PostMapping("/export")public void export(HttpServletResponse response, Vehicle vehicle){List<Vehicle> list = vehicleService.selectVehicleList(vehicle);ExcelUtil<Vehicle> util = new ExcelUtil<Vehicle>(Vehicle.class);util.exportExcel(response, list, "车辆信息数据");}/*** 获取车辆信息详细信息*/@PreAuthorize("@ss.hasPermi('manage:vehicle:query')")@GetMapping(value = "/{vehicleId}")public AjaxResult getInfo(@PathVariable("vehicleId") Long vehicleId){return success(vehicleService.selectVehicleByVehicleId(vehicleId));}/*** 新增车辆信息*/@PreAuthorize("@ss.hasPermi('manage:vehicle:add')")@Log(title = "车辆信息", businessType = BusinessType.INSERT)@PostMappingpublic AjaxResult add(@RequestBody Vehicle vehicle){return toAjax(vehicleService.insertVehicle(vehicle));}/*** 修改车辆信息*/@PreAuthorize("@ss.hasPermi('manage:vehicle:edit')")@Log(title = "车辆信息", businessType = BusinessType.UPDATE)@PutMappingpublic AjaxResult edit(@RequestBody Vehicle vehicle){return toAjax(vehicleService.updateVehicle(vehicle));}/*** 删除车辆信息*/@PreAuthorize("@ss.hasPermi('manage:vehicle:remove')")@Log(title = "车辆信息", businessType = BusinessType.DELETE)@DeleteMapping("/{vehicleIds}")public AjaxResult remove(@PathVariable Long[] vehicleIds){return toAjax(vehicleService.deleteVehicleByVehicleIds(vehicleIds));}
}

        5.0 停车位管理功能

相关源码:

@RestController
@RequestMapping("/manage/spot")
public class ParkingSpotController extends BaseController
{@Autowiredprivate IParkingSpotService parkingSpotService;/*** 查询停车位列表*/@PreAuthorize("@ss.hasPermi('manage:spot:list')")@GetMapping("/list")public TableDataInfo list(ParkingSpot parkingSpot){startPage();List<ParkingSpot> list = parkingSpotService.selectParkingSpotList(parkingSpot);return getDataTable(list);}/*** 导出停车位列表*/@PreAuthorize("@ss.hasPermi('manage:spot:export')")@Log(title = "停车位", businessType = BusinessType.EXPORT)@PostMapping("/export")public void export(HttpServletResponse response, ParkingSpot parkingSpot){List<ParkingSpot> list = parkingSpotService.selectParkingSpotList(parkingSpot);ExcelUtil<ParkingSpot> util = new ExcelUtil<ParkingSpot>(ParkingSpot.class);util.exportExcel(response, list, "停车位数据");}/*** 获取停车位详细信息*/@PreAuthorize("@ss.hasPermi('manage:spot:query')")@GetMapping(value = "/{spotId}")public AjaxResult getInfo(@PathVariable("spotId") Long spotId){return success(parkingSpotService.selectParkingSpotBySpotId(spotId));}/*** 新增停车位*/@PreAuthorize("@ss.hasPermi('manage:spot:add')")@Log(title = "停车位", businessType = BusinessType.INSERT)@PostMappingpublic AjaxResult add(@RequestBody ParkingSpot parkingSpot){return toAjax(parkingSpotService.insertParkingSpot(parkingSpot));}/*** 修改停车位*/@PreAuthorize("@ss.hasPermi('manage:spot:edit')")@Log(title = "停车位", businessType = BusinessType.UPDATE)@PutMappingpublic AjaxResult edit(@RequestBody ParkingSpot parkingSpot){return toAjax(parkingSpotService.updateParkingSpot(parkingSpot));}/*** 删除停车位*/@PreAuthorize("@ss.hasPermi('manage:spot:remove')")@Log(title = "停车位", businessType = BusinessType.DELETE)@DeleteMapping("/{spotIds}")public AjaxResult remove(@PathVariable Long[] spotIds){return toAjax(parkingSpotService.deleteParkingSpotBySpotIds(spotIds));}
}

        6.0 入场登记管理功能

相关源码:

@RestController
@RequestMapping("/manage/record")
public class EntryRecordController extends BaseController
{@Autowiredprivate IEntryRecordService entryRecordService;/*** 查询入场记录列表*/@PreAuthorize("@ss.hasPermi('manage:record:list')")@GetMapping("/list")public TableDataInfo list(EntryRecord entryRecord){startPage();List<EntryRecord> list = entryRecordService.selectEntryRecordList(entryRecord);return getDataTable(list);}/*** 导出入场记录列表*/@PreAuthorize("@ss.hasPermi('manage:record:export')")@Log(title = "入场记录", businessType = BusinessType.EXPORT)@PostMapping("/export")public void export(HttpServletResponse response, EntryRecord entryRecord){List<EntryRecord> list = entryRecordService.selectEntryRecordList(entryRecord);ExcelUtil<EntryRecord> util = new ExcelUtil<EntryRecord>(EntryRecord.class);util.exportExcel(response, list, "入场记录数据");}/*** 获取入场记录详细信息*/@PreAuthorize("@ss.hasPermi('manage:record:query')")@GetMapping(value = "/{entryId}")public AjaxResult getInfo(@PathVariable("entryId") Long entryId){return success(entryRecordService.selectEntryRecordByEntryId(entryId));}/*** 新增入场记录*/@PreAuthorize("@ss.hasPermi('manage:record:add')")@Log(title = "入场记录", businessType = BusinessType.INSERT)@PostMappingpublic AjaxResult add(@RequestBody EntryRecord entryRecord){return toAjax(entryRecordService.insertEntryRecord(entryRecord));}/*** 修改入场记录*/@PreAuthorize("@ss.hasPermi('manage:record:edit')")@Log(title = "入场记录", businessType = BusinessType.UPDATE)@PutMappingpublic AjaxResult edit(@RequestBody EntryRecord entryRecord){return toAjax(entryRecordService.updateEntryRecord(entryRecord));}/*** 删除入场记录*/@PreAuthorize("@ss.hasPermi('manage:record:remove')")@Log(title = "入场记录", businessType = BusinessType.DELETE)@DeleteMapping("/{entryIds}")public AjaxResult remove(@PathVariable Long[] entryIds){return toAjax(entryRecordService.deleteEntryRecordByEntryIds(entryIds));}
}

        7.0 预约管理功能

相关源码:

@RestController
@RequestMapping("/manage/reservation")
public class ReservationController extends BaseController
{@Autowiredprivate IReservationService reservationService;/*** 查询预约记录列表*/@PreAuthorize("@ss.hasPermi('manage:reservation:list')")@GetMapping("/list")public TableDataInfo list(Reservation reservation){startPage();List<Reservation> list = reservationService.selectReservationList(reservation);return getDataTable(list);}/*** 导出预约记录列表*/@PreAuthorize("@ss.hasPermi('manage:reservation:export')")@Log(title = "预约记录", businessType = BusinessType.EXPORT)@PostMapping("/export")public void export(HttpServletResponse response, Reservation reservation){List<Reservation> list = reservationService.selectReservationList(reservation);ExcelUtil<Reservation> util = new ExcelUtil<Reservation>(Reservation.class);util.exportExcel(response, list, "预约记录数据");}/*** 获取预约记录详细信息*/@PreAuthorize("@ss.hasPermi('manage:reservation:query')")@GetMapping(value = "/{reservationId}")public AjaxResult getInfo(@PathVariable("reservationId") Long reservationId){return success(reservationService.selectReservationByReservationId(reservationId));}/*** 新增预约记录*/@PreAuthorize("@ss.hasPermi('manage:reservation:add')")@Log(title = "预约记录", businessType = BusinessType.INSERT)@PostMappingpublic AjaxResult add(@RequestBody Reservation reservation){return toAjax(reservationService.insertReservation(reservation));}/*** 修改预约记录*/@PreAuthorize("@ss.hasPermi('manage:reservation:edit')")@Log(title = "预约记录", businessType = BusinessType.UPDATE)@PutMappingpublic AjaxResult edit(@RequestBody Reservation reservation){return toAjax(reservationService.updateReservation(reservation));}/*** 删除预约记录*/@PreAuthorize("@ss.hasPermi('manage:reservation:remove')")@Log(title = "预约记录", businessType = BusinessType.DELETE)@DeleteMapping("/{reservationIds}")public AjaxResult remove(@PathVariable Long[] reservationIds){return toAjax(reservationService.deleteReservationByReservationIds(reservationIds));}
}

        8.0 收费规则功能

相关源码:

@RestController
@RequestMapping("/manage/rule")
public class FeeRuleController extends BaseController
{@Autowiredprivate IFeeRuleService feeRuleService;/*** 查询收费规则列表*/@PreAuthorize("@ss.hasPermi('manage:rule:list')")@GetMapping("/list")public TableDataInfo list(FeeRule feeRule){startPage();List<FeeRule> list = feeRuleService.selectFeeRuleList(feeRule);return getDataTable(list);}/*** 导出收费规则列表*/@PreAuthorize("@ss.hasPermi('manage:rule:export')")@Log(title = "收费规则", businessType = BusinessType.EXPORT)@PostMapping("/export")public void export(HttpServletResponse response, FeeRule feeRule){List<FeeRule> list = feeRuleService.selectFeeRuleList(feeRule);ExcelUtil<FeeRule> util = new ExcelUtil<FeeRule>(FeeRule.class);util.exportExcel(response, list, "收费规则数据");}/*** 获取收费规则详细信息*/@PreAuthorize("@ss.hasPermi('manage:rule:query')")@GetMapping(value = "/{ruleId}")public AjaxResult getInfo(@PathVariable("ruleId") Long ruleId){return success(feeRuleService.selectFeeRuleByRuleId(ruleId));}/*** 新增收费规则*/@PreAuthorize("@ss.hasPermi('manage:rule:add')")@Log(title = "收费规则", businessType = BusinessType.INSERT)@PostMappingpublic AjaxResult add(@RequestBody FeeRule feeRule){return toAjax(feeRuleService.insertFeeRule(feeRule));}/*** 修改收费规则*/@PreAuthorize("@ss.hasPermi('manage:rule:edit')")@Log(title = "收费规则", businessType = BusinessType.UPDATE)@PutMappingpublic AjaxResult edit(@RequestBody FeeRule feeRule){return toAjax(feeRuleService.updateFeeRule(feeRule));}/*** 删除收费规则*/@PreAuthorize("@ss.hasPermi('manage:rule:remove')")@Log(title = "收费规则", businessType = BusinessType.DELETE)@DeleteMapping("/{ruleIds}")public AjaxResult remove(@PathVariable Long[] ruleIds){return toAjax(feeRuleService.deleteFeeRuleByRuleIds(ruleIds));}
}

        9.0 出场登记管理功能

相关源码:

@RestController
@RequestMapping("/manage/exitRecord")
public class ExitRecordController extends BaseController
{@Autowiredprivate IExitRecordService exitRecordService;/*** 查询出场记录列表*/@PreAuthorize("@ss.hasPermi('manage:exitRecord:list')")@GetMapping("/list")public TableDataInfo list(ExitRecord exitRecord){startPage();List<ExitRecord> list = exitRecordService.selectExitRecordList(exitRecord);return getDataTable(list);}/*** 导出出场记录列表*/@PreAuthorize("@ss.hasPermi('manage:exitRecord:export')")@Log(title = "出场记录", businessType = BusinessType.EXPORT)@PostMapping("/export")public void export(HttpServletResponse response, ExitRecord exitRecord){List<ExitRecord> list = exitRecordService.selectExitRecordList(exitRecord);ExcelUtil<ExitRecord> util = new ExcelUtil<ExitRecord>(ExitRecord.class);util.exportExcel(response, list, "出场记录数据");}/*** 获取出场记录详细信息*/@PreAuthorize("@ss.hasPermi('manage:exitRecord:query')")@GetMapping(value = "/{exitId}")public AjaxResult getInfo(@PathVariable("exitId") Long exitId){return success(exitRecordService.selectExitRecordByExitId(exitId));}/*** 新增出场记录*/@PreAuthorize("@ss.hasPermi('manage:exitRecord:add')")@Log(title = "出场记录", businessType = BusinessType.INSERT)@PostMappingpublic AjaxResult add(@RequestBody ExitRecord exitRecord){return toAjax(exitRecordService.insertExitRecord(exitRecord));}/*** 修改出场记录*/@PreAuthorize("@ss.hasPermi('manage:exitRecord:edit')")@Log(title = "出场记录", businessType = BusinessType.UPDATE)@PutMappingpublic AjaxResult edit(@RequestBody ExitRecord exitRecord){return toAjax(exitRecordService.updateExitRecord(exitRecord));}/*** 删除出场记录*/@PreAuthorize("@ss.hasPermi('manage:exitRecord:remove')")@Log(title = "出场记录", businessType = BusinessType.DELETE)@DeleteMapping("/{exitIds}")public AjaxResult remove(@PathVariable Long[] exitIds){return toAjax(exitRecordService.deleteExitRecordByExitIds(exitIds));}
}

        10.0 用户信息管理功能

相关源码:

@RestController
@RequestMapping("/system/user")
public class SysUserController extends BaseController
{@Autowiredprivate ISysUserService userService;@Autowiredprivate ISysRoleService roleService;@Autowiredprivate ISysDeptService deptService;@Autowiredprivate ISysPostService postService;/*** 获取用户列表*/@PreAuthorize("@ss.hasPermi('system:user:list')")@GetMapping("/list")public TableDataInfo list(SysUser user){startPage();List<SysUser> list = userService.selectUserList(user);return getDataTable(list);}@Log(title = "用户管理", businessType = BusinessType.EXPORT)@PreAuthorize("@ss.hasPermi('system:user:export')")@PostMapping("/export")public void export(HttpServletResponse response, SysUser user){List<SysUser> list = userService.selectUserList(user);ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);util.exportExcel(response, list, "用户数据");}@Log(title = "用户管理", businessType = BusinessType.IMPORT)@PreAuthorize("@ss.hasPermi('system:user:import')")@PostMapping("/importData")public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception{ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);List<SysUser> userList = util.importExcel(file.getInputStream());String operName = getUsername();String message = userService.importUser(userList, updateSupport, operName);return success(message);}@PostMapping("/importTemplate")public void importTemplate(HttpServletResponse response){ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);util.importTemplateExcel(response, "用户数据");}/*** 根据用户编号获取详细信息*/@PreAuthorize("@ss.hasPermi('system:user:query')")@GetMapping(value = { "/", "/{userId}" })public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId){userService.checkUserDataScope(userId);AjaxResult ajax = AjaxResult.success();List<SysRole> roles = roleService.selectRoleAll();ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));ajax.put("posts", postService.selectPostAll());if (StringUtils.isNotNull(userId)){SysUser sysUser = userService.selectUserById(userId);ajax.put(AjaxResult.DATA_TAG, sysUser);ajax.put("postIds", postService.selectPostListByUserId(userId));ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));}return ajax;}/*** 新增用户*/@PreAuthorize("@ss.hasPermi('system:user:add')")@Log(title = "用户管理", businessType = BusinessType.INSERT)@PostMappingpublic AjaxResult add(@Validated @RequestBody SysUser user){if (!userService.checkUserNameUnique(user)){return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");}else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)){return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");}else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)){return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");}user.setCreateBy(getUsername());user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));return toAjax(userService.insertUser(user));}/*** 修改用户*/@PreAuthorize("@ss.hasPermi('system:user:edit')")@Log(title = "用户管理", businessType = BusinessType.UPDATE)@PutMappingpublic AjaxResult edit(@Validated @RequestBody SysUser user){userService.checkUserAllowed(user);userService.checkUserDataScope(user.getUserId());if (!userService.checkUserNameUnique(user)){return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");}else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)){return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");}else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)){return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");}user.setUpdateBy(getUsername());return toAjax(userService.updateUser(user));}/*** 删除用户*/@PreAuthorize("@ss.hasPermi('system:user:remove')")@Log(title = "用户管理", businessType = BusinessType.DELETE)@DeleteMapping("/{userIds}")public AjaxResult remove(@PathVariable Long[] userIds){if (ArrayUtils.contains(userIds, getUserId())){return error("当前用户不能删除");}return toAjax(userService.deleteUserByIds(userIds));}/*** 重置密码*/@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")@Log(title = "用户管理", businessType = BusinessType.UPDATE)@PutMapping("/resetPwd")public AjaxResult resetPwd(@RequestBody SysUser user){userService.checkUserAllowed(user);userService.checkUserDataScope(user.getUserId());user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));user.setUpdateBy(getUsername());return toAjax(userService.resetPwd(user));}/*** 状态修改*/@PreAuthorize("@ss.hasPermi('system:user:edit')")@Log(title = "用户管理", businessType = BusinessType.UPDATE)@PutMapping("/changeStatus")public AjaxResult changeStatus(@RequestBody SysUser user){userService.checkUserAllowed(user);userService.checkUserDataScope(user.getUserId());user.setUpdateBy(getUsername());return toAjax(userService.updateUserStatus(user));}/*** 根据用户编号获取授权角色*/@PreAuthorize("@ss.hasPermi('system:user:query')")@GetMapping("/authRole/{userId}")public AjaxResult authRole(@PathVariable("userId") Long userId){AjaxResult ajax = AjaxResult.success();SysUser user = userService.selectUserById(userId);List<SysRole> roles = roleService.selectRolesByUserId(userId);ajax.put("user", user);ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));return ajax;}/*** 用户授权角色*/@PreAuthorize("@ss.hasPermi('system:user:edit')")@Log(title = "用户管理", businessType = BusinessType.GRANT)@PutMapping("/authRole")public AjaxResult insertAuthRole(Long userId, Long[] roleIds){userService.checkUserDataScope(userId);userService.insertUserAuth(userId, roleIds);return success();}/*** 获取部门树列表*/@PreAuthorize("@ss.hasPermi('system:user:list')")@GetMapping("/deptTree")public AjaxResult deptTree(SysDept dept){return success(deptService.selectDeptTreeList(dept));}
}

        11.0 SQL 数据库设计

CREATE TABLE vehicle (vehicle_id INT AUTO_INCREMENT,license_plate VARCHAR(20) NOT NULL UNIQUE COMMENT '车牌号',vehicle_type INT COMMENT '车型: 1-轿车, 2-SUV, 3-MPV',user_id INT NOT NULL COMMENT '用户ID (逻辑外键,关联到User表)',contact_info VARCHAR(100) COMMENT '联系方式',PRIMARY KEY (vehicle_id)
) COMMENT='车辆信息表';INSERT INTO vehicle (license_plate, vehicle_type, user_id, contact_info) VALUES
('A123BC', 1, 1, 'john.doe@example.com'),  -- 用户ID 1 的轿车
('B456DE', 2, 1, 'john.doe@example.com'),  -- 用户ID 1 的SUV
('C789FG', 3, 2, 'jane.smith@example.com'),  -- 用户ID 2 的MPV
('D012HI', 1, 2, 'jane.smith@example.com');  -- 用户ID 2 的轿车CREATE TABLE parking_spot (spot_id INT AUTO_INCREMENT,spot_status INT DEFAULT 1 COMMENT '车位状态: 1-空闲, 2-占用, 3-预约',location VARCHAR(100) COMMENT '车位位置',PRIMARY KEY (spot_id)
) COMMENT='停车位表';CREATE TABLE vehicle (vehicle_id INT AUTO_INCREMENT,license_plate VARCHAR(20) NOT NULL UNIQUE COMMENT '车牌号',vehicle_type INT COMMENT '车型: 1-轿车, 2-SUV, 3-MPV',user_id INT NOT NULL COMMENT '用户ID (逻辑外键,关联到User表)',contact_info VARCHAR(100) COMMENT '联系方式',vehicle_image_path VARCHAR(255) COMMENT '车辆图片路径或URL',PRIMARY KEY (vehicle_id)
) COMMENT='车辆信息表';INSERT INTO vehicle (license_plate, vehicle_type, user_id, contact_info, vehicle_image_path) VALUES
('ABC123', 1, 1, 'John Doe, 123-456-7890', '/images/vehicles/abc123.jpg'),
('XYZ456', 2, 1, 'Jane Smith, 987-654-3210', '/images/vehicles/xyz456.jpg'),
('JKL789', 3, 2, 'Alice Johnson, 555-555-5555', '/images/vehicles/jkl789.jpg'),
('MNO012', 1, 2, 'Bob Brown, 111-222-3333', '/images/vehicles/mno012.jpg');INSERT INTO parking_spot (spot_status, location) VALUES
(1, 'A座 - 一层 - 车位 1'),
(1, 'A座 - 一层 - 车位 2'),
(2, 'A座 - 一层 - 车位 3'),
(1, 'A座 - 一层 - 车位 4'),
(3, 'B座 - 一层 - 车位 1'),
(1, 'B座 - 一层 - 车位 2'),
(2, 'B座 - 一层 - 车位 3'),
(1, 'C座 - 一层 - 车位 1'),
(3, 'C座 - 一层 - 车位 2'),
(2, 'C座 - 一层 - 车位 3');CREATE TABLE entry_record (entry_id INT AUTO_INCREMENT comment '自增ID',vehicle_id INT NOT NULL COMMENT '车辆ID (逻辑外键,关联到vehicle表)',entry_time DATETIME COMMENT '入场时间',spot_id INT COMMENT '分配的车位ID (逻辑外键,关联到parking_spot表)',is_reserved INT DEFAULT 1 COMMENT '1表示预约入场、2表示非预约入场',PRIMARY KEY (entry_id)
) COMMENT='入场记录表';CREATE TABLE fee_rule (rule_id INT AUTO_INCREMENT,vehicle_type INT COMMENT '车型: 1-轿车, 2-SUV, 3-MPV',base_fee DECIMAL(8,2) COMMENT '基础费用',additional_fee_per_hour DECIMAL(8,2) COMMENT '每小时额外费用',PRIMARY KEY (rule_id)
) COMMENT='收费规则表';CREATE TABLE reservation (reservation_id INT AUTO_INCREMENT comment '预约表ID',vehicle_id INT NOT NULL COMMENT '车辆ID (逻辑外键,关联到vehicle表)',spot_id INT NOT NULL COMMENT '车位ID (逻辑外键,关联到parking_spot表)',start_time DATETIME NOT NULL COMMENT '预约开始时间',end_time DATETIME NOT NULL COMMENT '预约结束时间',status INT DEFAULT 1 COMMENT '预约状态: 1-已确认, 2-已取消',PRIMARY KEY (reservation_id)
) COMMENT='预约记录表';INSERT INTO fee_rule (vehicle_type, base_fee, additional_fee_per_hour) VALUES
(1, 50.00, 10.00),  -- 轿车, 基础费用50.00元, 每小时额外费用10.00元
(2, 80.00, 15.00),  -- SUV, 基础费用80.00元, 每小时额外费用15.00元
(3, 100.00, 20.00); -- MPV, 基础费用100.00元, 每小时额外费用20.00元CREATE TABLE exit_record (exit_id INT AUTO_INCREMENT COMMENT '出场ID',vehicle_id INT NOT NULL COMMENT '车辆ID (逻辑外键,关联到vehicle表)',exit_time DATETIME COMMENT '出场时间',fee_charged DECIMAL(8,2) COMMENT '收费金额',is_reserved BOOLEAN DEFAULT FALSE COMMENT '是否基于预约入场',PRIMARY KEY (exit_id)
) COMMENT='出场记录表';

         若需要项目完整源码,可以在 CSDN 私信给我,我每天都有查看消息的,感谢大家支持,希望可以帮助到大家!

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

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

相关文章

365天深度学习训练营-第P7周:马铃薯病害识别(VGG-16复现)

文为「365天深度学习训练营」内部文章 参考本文所写记录性文章&#xff0c;请在文章开头带上「&#x1f449;声明」 &#x1f37a; 要求&#xff1a; 自己搭建VGG-16网络框架【达成√】调用官方的VGG-16网络框架【达成√】如何查看模型的参数量以及相关指标【达成√】 &#…

芯食代冻干科技研究院:创新与品质并重,推动家用冻干机高质量发展

11月25日,芯食代首届食品冻干前沿与智能化升级创新大会在江苏常州成功举办。本次大会由芯食代冻干科技研究院(江苏)有限公司与芯食代(上海)科技发展有限公司联合主办,云集学界专家教授、商界企业精英,共议家用冻干机的未来创新发展。作为创新大会,芯食代冻干科技研究院也在本次…

项目基于oshi库快速搭建一个cpu监控面板

后端&#xff1a; <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>com.github.oshi</groupId><artifactId>oshi-…

【数据结构】手搓链表

一、定义 typedef struct node_s {int _data;struct node_s *_next; } node_t;typedef struct list_s {node_t *_head;node_t *_tail; } list_t;节点结构体&#xff08;node_s&#xff09;&#xff1a; int _data;存储节点中的数据struct node_s *_next;&#xff1a;指向 node…

毕设记录_音圈电机及电磁学相关_20241204

前言 提醒&#xff1a; 文章内容为方便作者自己后日复习与查阅而进行的书写与发布&#xff0c;其中引用内容都会使用链接表明出处&#xff08;如有侵权问题&#xff0c;请及时联系&#xff09;。 其中内容多为一次书写&#xff0c;缺少检查与订正&#xff0c;如有问题或其他拓展…

UPLOAD LABS | PASS 10 - 黑名单绕过(Windows . 绕过 - 变体)

关注这个靶场的其它相关笔记&#xff1a;UPLOAD LABS —— 靶场笔记合集-CSDN博客 0x01&#xff1a;过关流程 本关的目标是上传一个 WebShell 到目标服务器上&#xff0c;并成功访问&#xff1a; 通过查看源码&#xff0c;可以发现&#xff0c;本关在之前所有关卡的基础上做了…

【Elasticsearch】实现分布式系统日志高效追踪

&#x1f9d1; 博主简介&#xff1a;CSDN博客专家&#xff0c;历代文学网&#xff08;PC端可以访问&#xff1a;https://literature.sinhy.com/#/literature?__c1000&#xff0c;移动端可微信小程序搜索“历代文学”&#xff09;总架构师&#xff0c;15年工作经验&#xff0c;…

FoldX(FoldX5)的安装流程

下载地址:官网 https://foldxsuite.crg.eu/] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] zip解压yasaraPlugin.zip 我将foldx_20241231改为foldx vim ~/.bashrc 将foldx文件所在路径写进PATH vim ~/.bashrc我的…

利用红黑树封装map,和set,实现主要功能

如果不知道红黑树是什么的时候可以去看看这个红黑树 思路 首先我们可以把封装分为两个层面理解&#xff0c;上层代码就是set,和map&#xff0c;底层就是红黑树 就相当于根据红黑树上面套了两个map,set的壳子&#xff0c;像下面这张图一样 对于map和set&#xff0c;map里面存…

分类算法中的样本不平衡问题及其解决方案

一、样本不平衡问题概述 在机器学习的分类任务中&#xff0c;样本不平衡是指不同类别训练样本数量存在显著差异的现象。这一差异会给模型训练和性能评估带来挑战&#xff0c;尤其在处理少数类样本时&#xff0c;模型可能难以有效学习其特征。 以二分类为例&#xff0c;理想情况…

通过HTML Canvas 在图片上绘制文字

目录 前言 一、HTML Canvas 简介 二、准备工作 三、绘制图片 四、绘制文字 五、完整代码 效果演示&#xff1a; 前言 HTML canvas 为我们提供了无限的创意可能性。今天&#xff0c;我们就来探索一下如何通过 HTML canvas 将图片和文字绘制到图片上&#xff0c;创造出独特…

MBox20边缘计算网关:氢能车间数据采集的智慧引擎

氢能作为未来能源体系的重要组成部分&#xff0c;其安全、高效、环保的特性备受瞩目。在氢能车间的日常运营中&#xff0c;数据采集是确保生产流程优化、设备稳定运行及能效提升的关键环节。然而&#xff0c;面对氢能车间复杂多变的生产环境和海量数据&#xff0c;如何实现高效…

linux环境GitLab服务部署安装及使用

一、GitLab介绍 GitLab是利用Ruby onRails一个开源的版本管理系统&#xff0c;实现一个自托管的Git项目仓库&#xff0c;可通过Web界面进行访问公开的或者私人项目。 二、GitLab安装 1、先安装相关依赖 yum -y install policycoreutils openssh-server openssh-clients postf…

Gartner报告解读(四)| 如何运用上升期的基础设施自动化(IA)为企业数字化转型赋能?

近期&#xff0c;Gartner发布的《2024年中国基础设施战略技术成熟度曲线》显示&#xff0c;未来5-10年&#xff0c;大量具有颠覆性或较高影响力的创新技术可能会实现主流采用&#xff0c;其中就包括基础设施自动化&#xff08;IA&#xff09;。 基础设施自动化Gartner评估情况 …

请求响应:常见参数接收及封装(Json参数及路径参数)

Json参数 Json格式的数据具有轻量级、易于阅读和编写、易于解析等诸多优点。在前后端交互时&#xff0c;大部分情况下请求体中的数据会以JSON格式进行传递。前端的请求在请求体中携带了Json格式数据&#xff0c;后端程序需要对其进行解析并封装使用&#xff0c;而接收Json参数…

大舍传媒-关于海外媒体宣发的探讨

关于海外媒体宣发的探讨 一、海外媒体宣发的重要性 在当今全球化的时代&#xff0c;海外媒体宣发对于企业、组织和个人来说具有至关重要的意义。通过有效的海外媒体宣发&#xff0c;可以提升品牌知名度&#xff0c;拓展国际市场&#xff0c;增强影响力&#xff0c;吸引更多的潜…

项目开发之Jenkins

文章目录 思考基础概述JenkinsMavenGit集成开发部署GitLab服务 实战1 新建任务需要的配置pipeline最后 思考 jenkis怎么连接github仓库&#xff1f; jenkis的作用是什么&#xff1f;基础 概述 定义&#xff1a;Jenkins是一款开源的持续集成(Continuous Integration&#xff…

在VSCode中搭建Python开发环境

在VSCode中搭建Python开发环境 1、安装 首先确保电脑已经安装好Python和VSCode。 2、安装VSCode的Python插件 3、选择python解释器 ctrlshiftP打开VSCode的命令行&#xff0c;输入python: select Interpreter选择合适的python版本。 4、运行代码 在windows下你可以直接使用…

Windows 11 如何配置node.js

一&#xff0c;官网下载 官网首页 下载最新LTS版本&#xff0c;比较稳定&#xff0c;如果想探索更新的版本去探索新的nodejs功能。 1. 下载完成后&#xff0c;双击运行程序&#xff0c;点击next 2. 勾选接受协议&#xff0c;点击next 3. 选择自己的安装路径&#xff08;默认是…

1-12 GD32基于定时器输入捕获

前言&#xff1a; 基于本人对相关知识回顾与思考&#xff0c;仅供学习参考 目录 前言&#xff1a; 1.0 输入捕获 2.0 信号周期 3.0 定时器配置 4.0 定时器配置 5.0 定时器中断 后记&#xff1a; 1.0 输入捕获 2.0 信号周期 获取信号周期的方法&#xff0c;在第一次捕获与…