zhanghua
2023-09-08 7ef4892f9f24f941aca37e6b3991b808a0aca619
ycl-platform/src/main/java/com/ycl/controller/carManage/CarManageController.java
@@ -7,6 +7,7 @@
import com.ycl.annotation.LogSave;
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.dto.carManage.CarEnforcecarVo;
import com.ycl.entity.carManage.CarEnforcecar;
import com.ycl.entity.carManage.CarSlagcar;
import com.ycl.enums.common.ResultCode;
@@ -17,6 +18,8 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * <p>
@@ -38,15 +41,11 @@
    @ApiOperation(value = "查询执法车")
    @GetMapping("/query_enforce")
    public CommonResult searchEnforceCar(@RequestParam(required = false) String carNum,
                                         @RequestParam Integer size,
                                         @RequestParam Integer current) {
        Page<CarEnforcecar> carEnforcecarPage = new Page<>();
        carEnforcecarPage.setSize(size);
        carEnforcecarPage.setCurrent(current);
        return CommonResult.success(iCarEnforcecarService
                .page(carEnforcecarPage, new LambdaQueryWrapper<CarEnforcecar>()
                        .like(StringUtils.isNotBlank(carNum), CarEnforcecar::getCarNumber, carNum)));
    public CommonResult<Page<CarEnforcecarVo>> searchEnforceCar(@RequestParam(required = false) String carNum,
                                                                @RequestParam Integer size,
                                                                @RequestParam Integer current) {
        Page<CarEnforcecarVo> page = iCarEnforcecarService.searchEnforceCar(size, current, carNum);
        return CommonResult.success(page);
    }
    @ApiOperation(value = "查询渣土车")
@@ -98,7 +97,7 @@
        CarEnforcecar enforceCar = iCarEnforcecarService
                .getOne(new LambdaQueryWrapper<CarEnforcecar>()
                        .eq(CarEnforcecar::getCarNumber, carEnforcecar.getCarNumber()));
        if (StringUtils.isNotBlank(enforceCar.getCarNumber())) {
        if (enforceCar != null && StringUtils.isNotBlank(enforceCar.getCarNumber())) {
            throw new ApiException(ResultCode.CAR_NUMBER_REPETITION.getMessage());
        }
        return CommonResult.success(iCarEnforcecarService.save(carEnforcecar));
@@ -111,7 +110,7 @@
        CarSlagcar slagCar = iCarSlagcarService
                .getOne(new LambdaQueryWrapper<CarSlagcar>()
                        .eq(CarSlagcar::getCarNumber, carSlagcar.getCarNumber()));
        if (StringUtils.isNotBlank(slagCar.getCarNumber())) {
        if (slagCar != null && StringUtils.isNotBlank(slagCar.getCarNumber())) {
            throw new ApiException(ResultCode.CAR_NUMBER_REPETITION.getMessage());
        }
        return CommonResult.success(iCarSlagcarService.save(carSlagcar));
@@ -130,4 +129,18 @@
    public CommonResult deleteSlagCar(@RequestParam Integer id) {
        return CommonResult.success(iCarSlagcarService.removeById(id));
    }
    @ApiOperation("批量删除执法车")
    @DeleteMapping("/batch_deletion_enforce")
    @LogSave(operationType = "车辆管理", contain = "批量删除执法车")
    public CommonResult batchDeleteEnforce(@RequestParam List<Long> ids) {
        return CommonResult.success(iCarEnforcecarService.removeBatchByIds(ids));
    }
    @ApiOperation("批量删除渣土车")
    @DeleteMapping("/batch_deletion_slag")
    @LogSave(operationType = "车辆管理", contain = "批量删除渣土车")
    public CommonResult batchDeleteSlag(@RequestParam List<Long> ids) {
        return CommonResult.success(iCarSlagcarService.removeBatchByIds(ids));
    }
}