3.3 停车位模块
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询停车位") public Result<IPage<ParkingSpace>> getByPage(@ModelAttribute ParkingSpace parkingSpace ,@ModelAttribute PageVo page){ QueryWrapper<ParkingSpace> qw = new QueryWrapper<>(); if(!ZwzNullUtils.isNull(parkingSpace.getTitle())) { qw.like("title",parkingSpace.getTitle()); } if(!ZwzNullUtils.isNull(parkingSpace.getStatus())) { qw.eq("status",parkingSpace.getStatus()); } IPage<ParkingSpace> data = iParkingSpaceService.page(PageUtil.initMpPage(page),qw); return new ResultUtil<IPage<ParkingSpace>>().setData(data); }
@RequestMapping(value = "/insert", method = RequestMethod.POST) @ApiOperation(value = "新增停车位") public Result<ParkingSpace> insert(ParkingSpace parkingSpace){ if(Objects.equals(0, parkingSpace.getSortOrder().compareTo(BigDecimal.ZERO))) { parkingSpace.setSortOrder(BigDecimal.valueOf(iParkingSpaceService.count() + 1L)); } iParkingSpaceService.saveOrUpdate(parkingSpace); return new ResultUtil<ParkingSpace>().setData(parkingSpace); }
3.4 停车数据模块
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询停车记录") public Result<IPage<ParkingData>> getByPage(@ModelAttribute ParkingData parkingData ,@ModelAttribute PageVo page){ QueryWrapper<ParkingData> qw = new QueryWrapper<>(); User currUser = securityUtil.getCurrUser(); QueryWrapper<User> userQw = new QueryWrapper<>(); userQw.eq("id",currUser.getId()); userQw.inSql("id","SELECT user_id FROM a_user_role WHERE del_flag = 0 AND role_id = '1536606659751841799'"); if(iUserService.count(userQw) < 1L) { qw.eq("owner_id",currUser.getId()); } if(!ZwzNullUtils.isNull(parkingData.getCarNumber())) { qw.like("car_number",parkingData.getCarNumber()); } if(!ZwzNullUtils.isNull(parkingData.getOwner())) { qw.like("owner",parkingData.getOwner()); } IPage<ParkingData> data = iParkingDataService.page(PageUtil.initMpPage(page),qw); return new ResultUtil<IPage<ParkingData>>().setData(data); }
@RequestMapping(value = "/insert", method = RequestMethod.POST) @ApiOperation(value = "新增停车记录") public Result<ParkingData> insert(ParkingData parkingData){ Vehicle car = iVehicleService.getById(parkingData.getCarId()); if(car == null) { return ResultUtil.error("车辆不存在"); } // 判断余额 QueryWrapper<IcCard> icQw = new QueryWrapper<>(); icQw.eq("user_id",car.getOwnerId()); icQw.last("limit 1"); IcCard ic = iIcCardService.getOne(icQw); if(ic == null) { return ResultUtil.error("您没有IC卡,请申请"); } if(parkingData.getCost().compareTo(ic.getBalance()) > 0) { return ResultUtil.error("您IC卡余额不足"); } // 记录数据 parkingData.setCarNumber(car.getCarNumber()); parkingData.setOwnerId(car.getOwnerId()); parkingData.setOwner(car.getOwnerName()); iParkingDataService.saveOrUpdate(parkingData); ic.setBalance(ic.getBalance().subtract(parkingData.getCost())); iIcCardService.saveOrUpdate(ic); return new ResultUtil<ParkingData>().setData(parkingData); }
3.5 IC卡档案模块
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询IC卡") public Result<IPage<IcCard>> getByPage(@ModelAttribute IcCard icCard ,@ModelAttribute PageVo page){ QueryWrapper<IcCard> qw = new QueryWrapper<>(); User currUser = securityUtil.getCurrUser(); QueryWrapper<User> userQw = new QueryWrapper<>(); userQw.eq("id",currUser.getId()); userQw.inSql("id","SELECT user_id FROM a_user_role WHERE del_flag = 0 AND role_id = '1536606659751841799'"); if(iUserService.count(userQw) < 1L) { qw.eq("user_id",currUser.getId()); } if(!ZwzNullUtils.isNull(icCard.getCarNumber())) { qw.like("car_number",icCard.getCarNumber()); } if(!ZwzNullUtils.isNull(icCard.getWorkUser())) { qw.like("work_user",icCard.getWorkUser()); } IPage<IcCard> data = iIcCardService.page(PageUtil.initMpPage(page),qw); return new ResultUtil<IPage<IcCard>>().setData(data); }
@RequestMapping(value = "/insert", method = RequestMethod.POST) @ApiOperation(value = "新增IC卡") public Result<IcCard> insert(IcCard icCard){ User user = iUserService.getById(icCard.getUserId()); if(user == null) { return ResultUtil.error("归属人不存在"); } icCard.setUserName(user.getNickname()); User currUser = securityUtil.getCurrUser(); icCard.setWorkUser(currUser.getNickname()); icCard.setDate(DateUtil.today()); iIcCardService.saveOrUpdate(icCard); return new ResultUtil<IcCard>().setData(icCard); }
@RequestMapping(value = "/recharge", method = RequestMethod.POST) @ApiOperation(value = "充值") public Result<Object> recharge(@RequestParam String id, @RequestParam BigDecimal number){ IcCard ic = iIcCardService.getById(id); if(ic == null) { return ResultUtil.error("IC卡不存在"); } ic.setBalance(ic.getBalance().add(number)); iIcCardService.saveOrUpdate(ic); return ResultUtil.success(); }
3.6 IC卡挂失模块
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询IC卡挂失") public Result<IPage<IcCardLoss>> getByPage(@ModelAttribute IcCardLoss icCardLoss ,@ModelAttribute PageVo page){ QueryWrapper<IcCardLoss> qw = new QueryWrapper<>(); User currUser = securityUtil.getCurrUser(); QueryWrapper<User> userQw = new QueryWrapper<>(); userQw.eq("id",currUser.getId()); userQw.inSql("id","SELECT user_id FROM a_user_role WHERE del_flag = 0 AND role_id = '1536606659751841799'"); if(iUserService.count(userQw) < 1L) { qw.eq("apply_id",currUser.getId()); } if(!ZwzNullUtils.isNull(icCardLoss.getCarNumber())) { qw.like("car_number",icCardLoss.getCarNumber()); } if(!ZwzNullUtils.isNull(icCardLoss.getApplyUser())) { qw.like("apply_user",icCardLoss.getApplyUser()); } if(!ZwzNullUtils.isNull(icCardLoss.getStatus())) { qw.eq("status",icCardLoss.getStatus()); } IPage<IcCardLoss> data = iIcCardLossService.page(PageUtil.initMpPage(page),qw); return new ResultUtil<IPage<IcCardLoss>>().setData(data); }
@RequestMapping(value = "/insert", method = RequestMethod.POST) @ApiOperation(value = "新增IC卡挂失") public Result<IcCardLoss> insert(IcCardLoss icCardLoss){ IcCard ic = iIcCardService.getById(icCardLoss.getCarId()); if(ic == null) { return ResultUtil.error("IC卡不存在"); } icCardLoss.setCarNumber(ic.getCarNumber()); User currUser = securityUtil.getCurrUser(); icCardLoss.setApplyId(currUser.getId()); icCardLoss.setApplyUser(currUser.getNickname()); iIcCardLossService.saveOrUpdate(icCardLoss); return new ResultUtil<IcCardLoss>().setData(icCardLoss); }
@RequestMapping(value = "/audit", method = RequestMethod.POST) @ApiOperation(value = "审核IC卡挂失") public Result<Object> audit(@RequestParam String id){ IcCardLoss cl = iIcCardLossService.getById(id); if(cl == null) { return ResultUtil.error("挂失单不存在"); } cl.setStatus("已审核"); iIcCardLossService.saveOrUpdate(cl); IcCard ic = iIcCardService.getById(cl.getCarId()); if(ic != null) { ic.setCarNumber(cl.getNewNumber()); iIcCardService.saveOrUpdate(ic); } return ResultUtil.success(); }
3.7 系统基础模块
智能停车场管理系统是一款高科技软件产品,用于在计算机管理下对停车场进行全面维护,据专家称,智能停车场管理系统始于2013年,该系统不断改进,其功能日益满足当地的实际需求,智能停车场管理系统的运行变得更加人性化。
在我国,智能停车场管理系统随着中国大量公共停车场的出现而逐渐发展,中国最初的智能停车场管理系统是在引进和消化类似外国系统的基础上逐步发展起来的,并在此基础上不断改进,具有更为综合的重要性。总体而言,智能停车管理系统和标准软件的开发正处于较高阶段,但这些要求并不是一成不变的,随着时间的推移,智能停车场管理系统会继续发展。