Browse Source

实验分页查询接口增加查询对应流水线

tags/v20240126
西大锐 2 years ago
parent
commit
35e40fdf0b
3 changed files with 14 additions and 2 deletions
  1. +3
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java
  2. +4
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java
  3. +7
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java

+ 3
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java View File

@@ -57,6 +57,9 @@ public interface ExperimentInsService {
* @return 实例对象 * @return 实例对象
*/ */
ExperimentIns update(ExperimentIns experimentIns); ExperimentIns update(ExperimentIns experimentIns);



/** /**
* 逻辑删除数据 * 逻辑删除数据
*/ */


+ 4
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java View File

@@ -244,6 +244,8 @@ public class ExperimentInsServiceImpl implements ExperimentInsService {
Date startTime = DateUtils.convertUTCtoShanghaiDate((String) status.get("startedAt")); Date startTime = DateUtils.convertUTCtoShanghaiDate((String) status.get("startedAt"));
experimentIns.setStartTime(startTime); experimentIns.setStartTime(startTime);




//解析流水线结束时间 //解析流水线结束时间
String finishedAtString = (String) status.get("finishedAt"); String finishedAtString = (String) status.get("finishedAt");
if (finishedAtString != null && !finishedAtString.isEmpty()) { if (finishedAtString != null && !finishedAtString.isEmpty()) {
@@ -340,7 +342,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService {
} }


/** /**
* 查询实验实例日志
* 查询实验实例日志的单个节点日志
* *
* @return 运行日志 * @return 运行日志
*/ */
@@ -384,6 +386,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService {
throw new RuntimeException("日志为空。"); throw new RuntimeException("日志为空。");
} }
//返回日志内容 //返回日志内容

return experimentInsLog; return experimentInsLog;
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("查询实验日志失败: " + e.getMessage(), e); throw new RuntimeException("查询实验日志失败: " + e.getMessage(), e);


+ 7
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java View File

@@ -87,7 +87,13 @@ public class ExperimentServiceImpl implements ExperimentService {
public Page<Experiment> queryByPage(Experiment experiment, PageRequest pageRequest) { public Page<Experiment> queryByPage(Experiment experiment, PageRequest pageRequest) {
List<Experiment> experimentList = this.experimentDao.queryAllByLimit(experiment, pageRequest); List<Experiment> experimentList = this.experimentDao.queryAllByLimit(experiment, pageRequest);
long total = this.experimentDao.count(experiment); 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); return new PageImpl<>(experimentList,pageRequest,total);
} }


Loading…
Cancel
Save