|
|
|
@@ -1,7 +1,78 @@ |
|
|
|
package com.ruoyi.platform.service.impl; |
|
|
|
|
|
|
|
import com.ruoyi.platform.domain.ExperimentIns; |
|
|
|
import com.ruoyi.platform.mapper.*; |
|
|
|
import com.ruoyi.platform.service.ExperimentInsService; |
|
|
|
import com.ruoyi.platform.service.ModelsService; |
|
|
|
import com.ruoyi.platform.service.WorkflowService; |
|
|
|
import com.ruoyi.platform.service.WorkspaceService; |
|
|
|
import lombok.val; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
public class WorkspaceServiceImpl implements ModelsService { |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@Service("WorkspaceService") |
|
|
|
public class WorkspaceServiceImpl implements WorkspaceService { |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
private WorkflowService workflowService; |
|
|
|
@Resource |
|
|
|
private WorkflowDao workflowDao; |
|
|
|
@Resource |
|
|
|
private ExperimentDao experimentDao; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private ExperimentInsDao experimentInsDao; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private ExperimentInsService experimentInsService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private ModelsService modelsService; |
|
|
|
@Resource |
|
|
|
private ModelsDao modelsDao; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private DatasetDao datasetDao; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private ImageDao imageDao; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private ComponentDao componentDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> getOverview() { |
|
|
|
Map<String, Object> resMap = new HashMap<String, Object>(); |
|
|
|
|
|
|
|
// 获取流水线数量 |
|
|
|
Long workflowCount = workflowDao.workflowCount(); |
|
|
|
resMap.put("workflowCount", workflowCount); |
|
|
|
|
|
|
|
// 获取运行中实验实例数量 |
|
|
|
List<ExperimentIns> experimentInsList = experimentInsService.queryByExperimentIsNotTerminated(); |
|
|
|
if (experimentInsList!=null&&!experimentInsList.isEmpty()) { |
|
|
|
Integer experimentInsCount = experimentInsList.size(); |
|
|
|
resMap.put("runningExperimentInsCount", experimentInsCount); |
|
|
|
}else{ |
|
|
|
resMap.put("runningExperimentInsCount", 0); |
|
|
|
} |
|
|
|
//得到最近的三条实例记录,放进返回map |
|
|
|
List<ExperimentIns> latestExperimentInsList = experimentInsDao.getLatestInsList(); |
|
|
|
if (latestExperimentInsList != null && !latestExperimentInsList.isEmpty()) { |
|
|
|
resMap.put("latestExperimentInsList", latestExperimentInsList); |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Long> statusMap = experimentInsService.countByStatus(); |
|
|
|
resMap.put("experimentInsStatus", statusMap); |
|
|
|
|
|
|
|
return resMap; |
|
|
|
} |
|
|
|
} |