| | |
| | | import com.xiaopeng.api.model.maintenance.XpVehicleModel; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | import com.xiaopeng.maintenance.model.query.XpVehicleModelPageQuery; |
| | | import com.xiaopeng.maintenance.service.IXpVehicleModelService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @ApiOperation(value = "车型新增", tags = "管理后台-资产-车型管理") |
| | | @PostMapping("/logan/inner/xpVehicleModel/add") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.VEHICLE_MODEL_MANAGEMENT, |
| | | operationType = AdminOperationType.ADD, |
| | | content = "车型新增", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> add(@RequestBody @Valid XpVehicleModel dto) { |
| | | // 根据名称查询车辆型号,验证是否已存在 |
| | | List<XpVehicleModel> existingModel = xpVehicleModelService.queryByName(dto.getName()); |
| | |
| | | |
| | | @ApiOperation(value = "车型编辑", tags = "管理后台-资产-车型管理") |
| | | @PostMapping("/logan/inner/xpVehicleModel/edit") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.VEHICLE_MODEL_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "车型编辑", |
| | | appendRequestData = true |
| | | ) |
| | | public R<String> edit(@RequestBody @Valid XpVehicleModel dto) { |
| | | if(dto.getId() == null){ |
| | | return R.fail("参数错误"); |
| | |
| | | |
| | | @ApiOperation(value = "车型删除", tags = "管理后台-资产-车型管理") |
| | | @DeleteMapping("/logan/inner/xpVehicleModel/deleteById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.VEHICLE_MODEL_MANAGEMENT, |
| | | operationType = AdminOperationType.DELETE, |
| | | contentExpression = "'车型删除,id=' + #p0", |
| | | appendRequestData = false |
| | | ) |
| | | public R<String> deleteById(@RequestParam Long id) { |
| | | /* |
| | | 1.判断车型是否被 车辆 xp_vehicle使用。 |