|
@@ -82,6 +82,8 @@ public class ProjectDomainService {
|
|
|
@Resource
|
|
|
private ApiClient apiClient;
|
|
|
@Resource
|
|
|
+ private AlgorithmMapper algorithmMapper;
|
|
|
+ @Resource
|
|
|
private AlgorithmExpandMapper algorithmExpandMapper;
|
|
|
|
|
|
|
|
@@ -956,10 +958,11 @@ public class ProjectDomainService {
|
|
|
|
|
|
/**
|
|
|
* 如果是算法平台算法则修改状态
|
|
|
+ *
|
|
|
* @param projectType
|
|
|
* @param projectId
|
|
|
*/
|
|
|
- public void checkAlgorithmIsExpand(String projectType, String projectId,String algorithmStatus) {
|
|
|
+ public void checkAlgorithmIsExpand(String projectType, String projectId, String algorithmStatus) {
|
|
|
String algorithmType;
|
|
|
String algorithmId;
|
|
|
if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
|
|
@@ -972,8 +975,29 @@ public class ProjectDomainService {
|
|
|
} else {
|
|
|
throw new RuntimeException("未知项目类型:" + projectType);
|
|
|
}
|
|
|
- if(DictConstants.ALGORITHM_UPLOAD_MODE_PLATFORM.equals(algorithmType)) {
|
|
|
+ if (DictConstants.ALGORITHM_UPLOAD_MODE_PLATFORM.equals(algorithmType)) {
|
|
|
algorithmExpandMapper.updateStatusByAlgorithmId(AlgorithmExpandEntity.builder().algorithmId(algorithmId).status(algorithmStatus).build());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public String getAlgorithmDockerImageByProjectTypeAndProjectId(String projectType, String projectId) {
|
|
|
+ String algorithmType;
|
|
|
+ String algorithmId;
|
|
|
+ if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
|
|
|
+ algorithmType = simulationManualProjectMapper.selectAlgorithmTypeById(SimulationManualProjectEntity.builder().id(projectId).build());
|
|
|
+ algorithmId = simulationManualProjectMapper.selectAlgorithmById(SimulationManualProjectEntity.builder().id(projectId).build());
|
|
|
+ } else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(projectType)) {
|
|
|
+ String automaticProjectId = simulationAutomaticSubprojectMapper.selectParentIdById(SimulationAutomaticSubprojectEntity.builder().id(projectId).build());
|
|
|
+ algorithmType = simulationAutomaticProjectMapper.selectAlgorithmTypeById(SimulationAutomaticProjectEntity.builder().id(automaticProjectId).build());
|
|
|
+ algorithmId = simulationAutomaticProjectMapper.selectAlgorithmById(SimulationAutomaticProjectEntity.builder().id(automaticProjectId).build());
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("未知项目类型:" + projectType);
|
|
|
+ }
|
|
|
+ if ( DictConstants.ALGORITHM_UPLOAD_MODE_PLATFORM.equals(algorithmType)) {
|
|
|
+ return algorithmExpandMapper.selectDockerImageByAlgorithmId(algorithmId);
|
|
|
+ } else {
|
|
|
+ return algorithmMapper.selectDockerImageById(algorithmId);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|