fix:任务下曲线文件上传记录关键结果

This commit is contained in:
2026-03-05 09:19:38 +08:00
parent 237f395f37
commit 7da5b475f1
2 changed files with 35 additions and 1 deletions

View File

@@ -138,6 +138,18 @@ public class UploadFilesReq {
@Schema(description = "是否需要覆盖同名文件")
private Boolean isConverSameNameFile = false;
@Schema(description = "x轴物理量曲线结果使用")
private String xQuantityType;
@Schema(description = "x轴结果单位曲线结果使用")
private String xUnits;
@Schema(description = "y轴物理量曲线结果使用")
private String yQuantityType;
@Schema(description = "y轴结果单位曲线结果使用")
private String yUnits;
/**
* 扩展信息
*/

View File

@@ -2774,6 +2774,28 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
Long parentId = getParentDirId(req.getUuid(), dirName);
req.setDirId(parentId);
req.setUuid(null);
return dataFeignClient.batchAddFileInfo(req);
SdmResponse<List<BatchAddFileInfoResp>> batchAddFileInfoResp = dataFeignClient.batchAddFileInfo(req);
if (batchAddFileInfoResp.isSuccess() && CollectionUtils.isNotEmpty(batchAddFileInfoResp.getData())) {
List<BatchAddFileInfoResp> batchAddFileInfoList = batchAddFileInfoResp.getData();
List<SimulationRunKeyResult> simulationRunKeyResultList = new ArrayList<>();
for (UploadFilesReq sourceFile : req.getSourceFiles()) {
BatchAddFileInfoResp addFileInfoResp = batchAddFileInfoList.stream().filter(i -> StringUtils.equals(i.getSourceFileName(), sourceFile.getFileName())).findFirst().get();
if (addFileInfoResp != null) {
// 同时生成一份keyResult到表里因为任务下的曲线预览也需要展示物理量和单位
SimulationRunKeyResult simulationRunKeyResult = new SimulationRunKeyResult();
simulationRunKeyResult.setUuid(RandomUtil.generateString(32));
simulationRunKeyResult.setXQuantityType(sourceFile.getXQuantityType());
simulationRunKeyResult.setXUnits(sourceFile.getXQuantityType());
simulationRunKeyResult.setYQuantityType(sourceFile.getXQuantityType());
simulationRunKeyResult.setYUnits(sourceFile.getXQuantityType());
simulationRunKeyResult.setFileId(addFileInfoResp.getBusinessId());
simulationRunKeyResultList.add(simulationRunKeyResult);
}
}
if (!simulationRunKeyResultList.isEmpty()) {
simulationKeyResultService.saveBatch(simulationRunKeyResultList);
}
}
return batchAddFileInfoResp;
}
}