@Override public EngineObjectCustomProperties getElementCustomProperties(String fileId, String uuids) { EngineModel engineModel = engineModelService.getEngineModel(fileId); if (ModelFileEnum.RFA.getValue().equalsIgnoreCase(engineModel.getFormat())) { return null; } List<String> list = new ArrayList<>(); list.add(uuids); List<EngineObject> engineObjects = engineObjectRepository.findByModelIdAndUuidIn(engineModel.getId(), list); EngineObject engineObject = null; if (!CollectionUtils.isEmpty(engineObjects)) { engineObject = engineObjects.get(0); } if (engineObject == null) { throw new CustomException(ApiReturnCodeEnum.api_2030); } EngineObjectCustomProperties engineObjectCustomProperties = packageEngineObjectCustomProperties(engineObject); //新功能不从EngineCustomProperty中获取 return engineObjectCustomProperties; }
时间: 2024-04-21 20:28:43 浏览: 87
Override错误已解决
这段代码是一个方法,用于获取指定模型文件中指定元素的自定义属性。首先通过文件ID获取模型文件,然后判断模型文件格式是否为RFA,如果是则返回null。然后通过UUID获取对应的元素对象,如果未找到则抛出自定义异常。最后通过调用packageEngineObjectCustomProperties方法,将获取到的元素对象转化为自定义属性对象并返回。
阅读全文