From 35e40fdf0b21a988e0f915bc67c58e0d32e2d2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E5=A4=A7=E9=94=90?= <1070211640@qq.com> Date: Thu, 25 Jan 2024 15:02:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E5=88=86=E9=A1=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=B5=81=E6=B0=B4=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/platform/service/ExperimentInsService.java | 3 +++ .../platform/service/impl/ExperimentInsServiceImpl.java | 5 ++++- .../platform/service/impl/ExperimentServiceImpl.java | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java index fc5924c3..ebab5bb7 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java @@ -57,6 +57,9 @@ public interface ExperimentInsService { * @return 实例对象 */ ExperimentIns update(ExperimentIns experimentIns); + + + /** * 逻辑删除数据 */ diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java index 65d4eb31..7f778c10 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java @@ -244,6 +244,8 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { Date startTime = DateUtils.convertUTCtoShanghaiDate((String) status.get("startedAt")); experimentIns.setStartTime(startTime); + + //解析流水线结束时间 String finishedAtString = (String) status.get("finishedAt"); if (finishedAtString != null && !finishedAtString.isEmpty()) { @@ -340,7 +342,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { } /** - * 查询实验实例日志 + * 查询实验实例日志的单个节点日志 * * @return 运行日志 */ @@ -384,6 +386,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { throw new RuntimeException("日志为空。"); } //返回日志内容 + return experimentInsLog; } catch (Exception e) { throw new RuntimeException("查询实验日志失败: " + e.getMessage(), e); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java index a3fe600b..68575d09 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java @@ -87,7 +87,13 @@ public class ExperimentServiceImpl implements ExperimentService { public Page queryByPage(Experiment experiment, PageRequest pageRequest) { List experimentList = this.experimentDao.queryAllByLimit(experiment, pageRequest); long total = this.experimentDao.count(experiment); - // 存储所有实验的ID列表 + // 存储所有实验的ID列表,查询实验对应的流水线 + for(Experiment exp: experimentList){ + Long workflowId = exp.getWorkflowId(); + Workflow correspondingWorkflow = this.workflowService.queryById(workflowId); + String workflowName = correspondingWorkflow.getName(); + exp.setWorkflowName(workflowName); + } return new PageImpl<>(experimentList,pageRequest,total); }