| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.annotation.LogSave; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.entity.carManage.CarEnforcecar; |
| | | import com.ycl.entity.carManage.CarSlagcar; |
| | | import com.ycl.enums.common.ResultCode; |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.service.carManage.ICarEnforcecarService; |
| | | import com.ycl.service.carManage.ICarSlagcarService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @ApiOperation("添加执法车") |
| | | @PostMapping("/addition_enforce") |
| | | @LogSave(operationType = "车俩管理", contain = "添加执法车") |
| | | public CommonResult addEnforceCar(@RequestBody CarEnforcecar carEnforcecar) { |
| | | CarEnforcecar enforceCar = iCarEnforcecarService |
| | | .getOne(new LambdaQueryWrapper<CarEnforcecar>() |
| | | .eq(CarEnforcecar::getCarNumber, carEnforcecar.getCarNumber())); |
| | | if (enforceCar != null && StringUtils.isNotBlank(enforceCar.getCarNumber())) { |
| | | throw new ApiException(ResultCode.CAR_NUMBER_REPETITION.getMessage()); |
| | | } |
| | | return CommonResult.success(iCarEnforcecarService.save(carEnforcecar)); |
| | | } |
| | | |
| | | @ApiOperation("添加渣土车") |
| | | @PostMapping("/addition_slag") |
| | | @LogSave(operationType = "车俩管理", contain = "添加渣土车") |
| | | public CommonResult addSlagCar(@RequestBody CarSlagcar carSlagcar) { |
| | | CarSlagcar slagCar = iCarSlagcarService |
| | | .getOne(new LambdaQueryWrapper<CarSlagcar>() |
| | | .eq(CarSlagcar::getCarNumber, carSlagcar.getCarNumber())); |
| | | if (slagCar != null && StringUtils.isNotBlank(slagCar.getCarNumber())) { |
| | | throw new ApiException(ResultCode.CAR_NUMBER_REPETITION.getMessage()); |
| | | } |
| | | return CommonResult.success(iCarSlagcarService.save(carSlagcar)); |
| | | } |
| | | |
| | | @ApiOperation("删除执法车") |
| | | @DeleteMapping("/deletion_enforce") |
| | | @LogSave(operationType = "车俩管理", contain = "删除执法车") |
| | | public CommonResult deleteEnforceCar(@RequestParam Integer id) { |
| | | return CommonResult.success(iCarEnforcecarService.removeById(id)); |
| | | } |
| | | |
| | | @ApiOperation("删除渣土车") |
| | | @DeleteMapping("/deletion_slag") |
| | | @LogSave(operationType = "车俩管理", contain = "删除渣土车") |
| | | public CommonResult deleteSlagCar(@RequestParam Integer id) { |
| | | return CommonResult.success(iCarSlagcarService.removeById(id)); |
| | | } |