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.rhkb.cn/news/484036.html

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

相关文章

猎板 PCB特殊工艺:铸就电子行业核心竞争力新高度

在当今竞争激烈且技术驱动的电子制造领域&#xff0c;印制电路板&#xff08;PCB&#xff09;作为电子产品的关键基石&#xff0c;其特殊工艺的发展水平直接影响着整个行业的创新步伐与产品品质。猎板 PCB 凭借在厚铜板、孔口铺铜、HDI 板、大尺寸板以及高频高速板等特殊工艺方…

STM32 进阶 定时器3 通用定时器 案例2:测量PWM的频率/周期

需求分析 上一个案例我们输出了PWM波&#xff0c;这个案例我们使用输入捕获功能&#xff0c;来测试PWM波的频率/周期。 把测到的结果通过串口发送到电脑&#xff0c;检查测试的结果。 如何测量 1、输入捕获功能主要是&#xff1a;测量输入通道的上升沿和下降沿 2、让第一个…

Android平台GB28181设备接入模块如何支持GB28181云端录像补录

技术背景 GB28181 的补录功能是一种用于弥补视频数据缺失的重要机制。在实际的视频监控场景中&#xff0c;由于网络不稳定、设备故障等多种因素&#xff0c;可能会导致视频数据在上云或存储过程中出现缺失&#xff0c;无法保证数据的完整性。GB28181 的补录功能就是为了解决这…

如何将python项目导出为docker镜像

如何将python项目导出为docker镜像 前提条件步骤 1: 创建并准备 Python 项目步骤 2: 创建 `setup.py`步骤 3: 打包项目步骤 4: 创建 Dockerfile步骤 5: 构建 Docker 镜像步骤 6: 运行 Docker 容器步骤 7: 保存修改并继续开发总结要将修改后的Python代码导出为 .tar.gz 格式,并…

Lua使用点号和冒号的区别

首先建立一个table&#xff0c;再分别定义两个方法&#xff0c;如下&#xff1a; local meta {}function meta:test1(...)print(self)print("")for k,v in pairs({...}) doprint(v)end endfunction meta.test2(...)print(self)print("")for k,v in pairs…

OpenGL ES详解——文字渲染

目录 一、文字渲染 二、经典文字渲染&#xff1a;位图字体 1.概念 2.优缺点 三、现代文字渲染&#xff1a;FreeType 1.着色器 2.渲染一行文字 四、关于未来 一、文字渲染 当你在图形计算领域冒险到了一定阶段以后你可能会想使用OpenGL来绘制文字。然而&#xff0c;可能…

【数据中心建设资料】数据中心安全建设解决方案,数据中心整理解决方案,数据中心如何做到安全保障,数据中台全方案(Word全原件)

第一章 解决方案 1.1 建设需求 1.2 建设思路 1.3 总体方案 信息安全系统整体部署架构图 1.3.1 IP准入控制系统 1.3.2 防泄密技术的选择 1.3.3 主机账号生命周期管理系统 1.3.4 数据库账号生命周期管理系统 1.3.5 双因素认证系统 1.3.6 数据库审计系统 1.3.7 数据脱敏系统 1.3.8…

菲涅尔透镜加工:倚光科技的光学创新之路

在光学元件的广袤星空中&#xff0c;菲涅尔透镜以其独特的设计和卓越的性能闪耀着独特光芒。菲涅尔透镜通过将透镜表面由一系列同心棱纹组成&#xff0c;大幅减少了材料的使用量&#xff0c;却依然能够有效地汇聚或发散光线&#xff0c;在众多领域展现出无可比拟的优势&#xf…

OSCP:我理解的Web环境知识

你需要特别关注以下模块所涵盖的知识点&#xff0c;因为它们在考试中出现的概率很高。 1、SQL 注入&#xff08;SQL Injection&#xff09; ●允许攻击者注入自定义的、潜在恶意的 SQL 代码&#xff0c;由底层数据库执行。 ●可能导致数据泄露或目标服务器上的远程代码执行&…

flink-connector-mysql-cdc:01 mysql-cdc础配置代码演示

flink-connector-mysql-cdc&#xff1a; 01 mysql-cdc基础配置代码演示02 mysql-cdc高级扩展03 mysql-cdc常见问题汇总04 mysql-cdc-kafka生产级代码分享05 flink-kafka-doris生产级代码分享06 flink-kafka-hudi生产级代码分享 flink-cdc版本&#xff1a;3.2.0 flink版本&…

c++数据结构算法复习基础--11--高级排序算法-快速排序-归并排序-堆排序

高阶排序 1、快速排序 冒泡排序的升级算法 每次选择一个基准数&#xff0c;把小于基准数的放到基准数的左边&#xff0c;把大于基准数的放到基准数的右边&#xff0c;采用 “ 分治算法 ”处理剩余元素&#xff0c;直到整个序列变为有序序列。 最好和平均的复杂度&#xff1a…

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

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

GPS模块/SATES-ST91Z8LR:电路搭建;直接用电脑的USB转串口进行通讯;模组上报定位数据转换地图识别的坐标手动查询地图位置

从事嵌入式单片机的工作算是符合我个人兴趣爱好的,当面对一个新的芯片我即想把芯片尽快搞懂完成项目赚钱,也想着能够把自己遇到的坑和注意事项记录下来,即方便自己后面查阅也可以分享给大家,这是一种冲动,但是这个或许并不是原厂希望的,尽管这样有可能会牺牲一些时间也有哪天原…

AVL树:自平衡的二叉搜索树

AVL树是一种自平衡的二叉搜索树&#xff08;BST&#xff09;。它最早由G.M. Adelson-Velsky和E.M. Landis在1962年提出。AVL树的特点是任何节点的两个子树的高度最多相差1&#xff0c;这确保了树的平衡性&#xff0c;从而保证了树的操作&#xff08;如查找、插入和删除&#xf…

AMR移动机器人赋能制造业仓储自动化升级

在当今制造业的激烈竞争中&#xff0c;智能化、数字化已成为企业转型升级的关键路径。一家制造业巨头&#xff0c;凭借其庞大的生产体系和多个仓库资源&#xff0c;正以前所未有的决心和行动力&#xff0c;在制造业智能化浪潮中勇立潮头&#xff0c;开启了降本增效的新篇章。这…

IIC相关介绍及oled实验(二)

//模块&#xff1a;OLED显示屏 1. 0.96寸OLED屏幕介绍 0.96 寸 4P OLED 屏幕模块是一种显示屏模块&#xff0c;它包括一个 0.96 英寸的 OLED 显示屏和四个引脚。这种 OLED 屏幕模块通常用于嵌入式系统和小型电子设备中&#xff0c;可以显示文本、图像和其他类型的信息。由于其…

Python 数据分析用库 获取数据(二)

Beautiful Soup Python的Beautiful Soup&#xff08;常被称为“美丽汤”&#xff09;是一个用于解析HTML和XML文档的第三方库&#xff0c;它在网页爬虫和数据提取领域具有广泛的应用。 作用 HTML/XML解析&#xff1a; Beautiful Soup能够解析HTML和XML文档&#xff0c;包括不…

数据链路层(四)---PPP协议的工作状态

1 PPP链路的初始化 通过前面几章的学习&#xff0c;我们学了了PPP协议帧的格式以及组成&#xff0c;那么对于使用PPP协议的链路是怎么初始化的呢&#xff1f; 当用户拨号上网接入到ISP后&#xff0c;就建立起了一条个人用户到ISP的物理链路。这时&#xff0c;用户向ISP发送一…

QT 实现QStackedWidget切换页面右移动画

1.实现效果 以下是一个QStackedWidget,放了两个QPushButton在上面,点击切换不同的界面。 为了方便查看动画特效,设置了每个界面的背景图片。 2.实现思路 首先截取当前界面的图片,渲染到一个QLabel上,然后设置QPropertyAnimation动画,动画的作用对象就是这个QLabel,不断…

开源C代码之路:一、Gitee

开源c代码之路&#xff1a;一&#xff0c;Gitee 前言1、开源项目2、从哪里找&#xff1f;3、举个例子4、总结&#xff1a; 本系列回顾清单开源代码示例 前言 从开源开发的角度&#xff0c;由浅入深&#xff0c;一步步初探C语言编程的入门之路。 本篇讲解&#xff1a;Gitee 1…