fix:仿真参数库,同名参数对象校验
This commit is contained in:
@@ -139,6 +139,16 @@ public class SimulationParameterLibraryServiceImpl extends ServiceImpl<Simulatio
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SdmResponse addLibraryCategoryObject(SimulationParameterLibraryCategoryObjectReq req) {
|
||||
try {
|
||||
// 同名校验:检查同一参数库、同一分类下是否存在同名的参数对象
|
||||
Long existingCount = simulationParameterLibraryCategoryObjectService.lambdaQuery()
|
||||
.eq(SimulationParameterLibraryCategoryObject::getParameterLibraryId, req.getParameterLibraryId())
|
||||
.eq(SimulationParameterLibraryCategoryObject::getParameterLibraryCategoryId, req.getParameterLibraryCategoryId())
|
||||
.eq(SimulationParameterLibraryCategoryObject::getParameterLibraryCategoryObjectName, req.getParameterLibraryCategoryObjectName())
|
||||
.count();
|
||||
if (existingCount > 0) {
|
||||
return SdmResponse.failed("该分类下已存在同名参数对象:" + req.getParameterLibraryCategoryObjectName());
|
||||
}
|
||||
|
||||
MultipartFile inputFile = req.getFile();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
MultipartFile fileToUpload;
|
||||
|
||||
Reference in New Issue
Block a user