|
@ -55,6 +55,11 @@ public class MatrixController { |
|
|
@Operation(summary = "基质更新") |
|
|
@Operation(summary = "基质更新") |
|
|
@PutMapping |
|
|
@PutMapping |
|
|
public Result<Boolean> update(@RequestBody Matrix matrix) { |
|
|
public Result<Boolean> update(@RequestBody Matrix matrix) { |
|
|
|
|
|
String name = matrix.getName(); |
|
|
|
|
|
// 如果名称和除了当前的重复, 则返回失败 |
|
|
|
|
|
if (matrixService.getOne(new LambdaQueryWrapper<Matrix>().eq(Matrix::getName, name).ne(Matrix::getId, matrix.getId())) != null) { |
|
|
|
|
|
return Result.failed("基质名称重复"); |
|
|
|
|
|
} |
|
|
return Result.success(matrixService.updateMatrix(matrix)); |
|
|
return Result.success(matrixService.updateMatrix(matrix)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|