puzhibing
2026-05-11 b7bb5daa5f4ffe1764a363a051a5d6f868168cf9
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehicleModelController.java
@@ -69,7 +69,7 @@
    public R<String> add(@RequestBody @Valid XpVehicleModel dto) {
        // 根据名称查询车辆型号,验证是否已存在
        List<XpVehicleModel> existingModel = xpVehicleModelService.queryByName(dto.getName());
        if (existingModel != null) {
        if (CollUtil.isNotEmpty(existingModel)) {
            return R.fail("车辆型号名称已存在");
        }
        boolean b = xpVehicleModelService.save(dto);
@@ -91,7 +91,7 @@
        }
        if(!model.getName().equals(dto.getName())){
            List<XpVehicleModel> existingModel = xpVehicleModelService.queryByName(dto.getName());
            if (existingModel != null) {
            if (CollUtil.isNotEmpty(existingModel)) {
                return R.fail("车辆型号名称已存在");
            }
        }
@@ -104,7 +104,7 @@
    @ApiOperation(value = "车型删除", tags = "管理后台-资产-车型管理")
    @DeleteMapping("/logan/inner/xpVehicleModel/deleteById")
    public R<String> deleteById(@RequestParam String id) {
    public R<String> deleteById(@RequestParam Long id) {
        /*
        1.判断车型是否被 车辆 xp_vehicle使用。
        2.判断车型是否被 定价管理 xp_pricing使用。
@@ -113,14 +113,14 @@
        if (vehicleCount > 0) {
            return R.fail("车辆型号已被车辆使用");
        }
        R<Long> priceCountByVmidR = xpPricingClient.getPriceCountByVmid(id);
        R<Long> priceCountByVmidR = xpPricingClient.getPriceCountByVmid(id+"");
        if (priceCountByVmidR.getCode() != R.SUCCESS || priceCountByVmidR.getData() == null) {
            return R.fail("根据车型获取定价策略失败");
        }
        if(priceCountByVmidR.getData()>0){
            return R.fail("车辆型号已被定价策略使用");
        }
        boolean b = xpVehicleModelService.logicalRemoveById(id);
        boolean b = xpVehicleModelService.removeById(id);
        if(b){
            return R.ok();
        }