فهرست منبع

项目详情和项目报告BUG

LingxinMeng 2 سال پیش
والد
کامیت
bbda0bd825
13فایلهای تغییر یافته به همراه149 افزوده شده و 60 حذف شده
  1. 0 14
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/configuration/constant/ConstantConfiguration.java
  2. 20 0
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/configuration/custom/CustomConfiguration.java
  3. 2 1
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/configuration/feign/WebServerClient.java
  4. 6 0
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/mapper/AutoSubProjectMapper.java
  5. 5 0
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/mapper/ManualProjectMapper.java
  6. 4 4
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/service/FileService.java
  7. 60 6
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/util/ProjectUtil.java
  8. 17 25
      simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/util/TaskUtil.java
  9. 9 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/controller/SimulationProjectController.java
  10. 2 6
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationAutomaticSubProjectMapper.java
  11. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java
  12. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/SimulationProjectService.java
  13. 20 4
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/impl/SimulationProjectServiceImpl.java

+ 0 - 14
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/configuration/constant/ConstantConfiguration.java

@@ -1,14 +0,0 @@
-package com.css.simulation.resource.scheduler.configuration.constant;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-@Data
-@Configuration
-@ConfigurationProperties(prefix = "constant")
-public class ConstantConfiguration {
-    private String temporaryDirectory;
-    private String uploadOsgbUrl;
-    private String generateVideoUrl;
-}

+ 20 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/configuration/custom/CustomConfiguration.java

@@ -0,0 +1,20 @@
+package com.css.simulation.resource.scheduler.configuration.custom;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration
+@ConfigurationProperties(prefix = "custom")
+public class CustomConfiguration {
+    private String clientId;
+    private String clientSecret;
+    private String tokenUri;
+    private String evaluationLevelUri;
+    private String projectDetailsUri;
+    private String projectReportUri;
+    private String temporaryDirectory;
+    private String uploadOsgbUrl;
+    private String generateVideoUrl;
+}

+ 2 - 1
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/configuration/feign/WebServerClient.java

@@ -3,11 +3,12 @@ package com.css.simulation.resource.scheduler.configuration.feign;
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.param.project.SimulationManualProjectParam;
 import api.common.pojo.vo.project.ProjectDetailsVO;
+import com.css.simulation.resource.scheduler.configuration.feign.fallback.WebServerClientFallBack;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
-@FeignClient(contextId = "server", value = "simulation-resource-server", path = "/simulation/resource/server", fallback = WebServerClient.class)
+@FeignClient(contextId = "server", value = "simulation-resource-server", path = "/simulation/resource/server", fallback = WebServerClientFallBack.class)
 public interface WebServerClient {
 
     @GetMapping(value = "/simulationProject/selectProjectDetailsByIdForScheduler")

+ 6 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/mapper/AutoSubProjectMapper.java

@@ -61,4 +61,10 @@ public interface AutoSubProjectMapper {
             "set details  = #{details}\n" +
             "where id = #{id}")
     void updateProjectDetails(@Param("id") String id, @Param("details") String details);
+
+
+    @Update("update simulation_automatic_subproject\n" +
+            "set report  = #{report}\n" +
+            "where id = #{id}")
+    void updateProjectReport(@Param("id") String id, @Param("report") String report);
 }

+ 5 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/mapper/ManualProjectMapper.java

@@ -58,4 +58,9 @@ public interface ManualProjectMapper {
             "set details = #{details}\n" +
             "where id = #{id}")
     void updateProjectDetails(@Param("id") String id,@Param("details") String details);
+
+    @Update("update simulation_manual_project\n" +
+            "set report = #{report}\n" +
+            "where id = #{id}")
+    void updateProjectReport(@Param("id") String id,@Param("report") String report);
 }

+ 4 - 4
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/service/FileService.java

@@ -2,7 +2,7 @@ package com.css.simulation.resource.scheduler.service;
 
 import api.common.util.FileUtil;
 import api.common.util.HttpUtil;
-import com.css.simulation.resource.scheduler.configuration.constant.ConstantConfiguration;
+import com.css.simulation.resource.scheduler.configuration.custom.CustomConfiguration;
 import com.css.simulation.resource.scheduler.configuration.kubernetes.KubernetesConfiguration;
 import com.css.simulation.resource.scheduler.data.model.NodeModel;
 import lombok.SneakyThrows;
@@ -18,13 +18,13 @@ public class FileService {
     @Resource
     KubernetesConfiguration kubernetesConfiguration;
     @Resource
-    ConstantConfiguration constantConfiguration;
+    CustomConfiguration customConfiguration;
 
     @SneakyThrows
     public void uploadOsgb(MultipartFile file) {
-        final String targetFilePath = constantConfiguration.getTemporaryDirectory() + "/esmini-osgb";
+        final String targetFilePath = customConfiguration.getTemporaryDirectory() + "/esmini-osgb";
         FileUtil.writeInputStreamToLocalFile(file.getInputStream(), targetFilePath);
         final List<NodeModel> nodeModels = kubernetesConfiguration.getCpuNodeList();
-        nodeModels.forEach(nodeModel -> HttpUtil.post(constantConfiguration.getUploadOsgbUrl().replace("simulation-resource-video", nodeModel.getIp()), new File(targetFilePath)));
+        nodeModels.forEach(nodeModel -> HttpUtil.post(customConfiguration.getUploadOsgbUrl().replace("simulation-resource-video", nodeModel.getIp()), new File(targetFilePath)));
     }
 }

+ 60 - 6
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/util/ProjectUtil.java

@@ -1,9 +1,10 @@
 package com.css.simulation.resource.scheduler.util;
 
+import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.dto.ProjectMessageDTO;
-import api.common.pojo.param.project.SimulationManualProjectParam;
 import api.common.util.*;
+import com.css.simulation.resource.scheduler.configuration.custom.CustomConfiguration;
 import com.css.simulation.resource.scheduler.configuration.feign.WebServerClient;
 import com.css.simulation.resource.scheduler.configuration.kubernetes.KubernetesConfiguration;
 import com.css.simulation.resource.scheduler.configuration.redis.CustomRedisClient;
@@ -16,11 +17,15 @@ import com.css.simulation.resource.scheduler.mapper.AutoSubProjectMapper;
 import com.css.simulation.resource.scheduler.mapper.ClusterMapper;
 import com.css.simulation.resource.scheduler.mapper.ManualProjectMapper;
 import com.css.simulation.resource.scheduler.mapper.UserMapper;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import io.kubernetes.client.openapi.ApiClient;
 import io.kubernetes.client.openapi.ApiException;
 import lombok.SneakyThrows;
 import lombok.Synchronized;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.scheduling.annotation.Async;
@@ -41,7 +46,6 @@ public class ProjectUtil {
 
     @Value("${scheduler.linux-path.pod-yaml-directory}")
     private String podYamlDirectory;
-
     @Resource
     private ManualProjectMapper manualProjectMapper;
     @Resource
@@ -60,6 +64,12 @@ public class ProjectUtil {
     private CustomRedisClient customRedisClient;
     @Resource
     private WebServerClient webServerClient;
+    @Resource
+    private CustomConfiguration customConfiguration;
+    @Resource
+    private CloseableHttpClient closeableHttpClient;
+    @Resource
+    private RequestConfig requestConfig;
 
     public String getIsChoiceGpuByProjectId(String projectId) {
         return getProjectByProjectId(projectId).getIsChoiceGpu();
@@ -739,12 +749,56 @@ public class ProjectUtil {
     @Async("pool1")
     @SneakyThrows
     public void selectProjectDetailsById(String projectType, String projectId) {
-        TimeUnit.SECONDS.sleep(10);
-        final String projectDetailsVOJson = JsonUtil.beanToJson( webServerClient.selectProjectDetailsByIdForScheduler(SimulationManualProjectParam.builder().projectType(projectType).projectId(projectId).build()).getInfo());
+        String tokenUrl = customConfiguration.getTokenUri() + "?grant_type=client_credentials" + "&client_id=" + customConfiguration.getClientId() + "&client_secret=" + customConfiguration.getClientSecret();
+        log.info("获取仿真云平台 token:" + tokenUrl);
+        String response = HttpUtil.get(tokenUrl);
+        ObjectMapper objectMapper = new ObjectMapper();
+        JsonNode jsonNode = objectMapper.readTree(response);
+        String accessToken = jsonNode.path("access_token").asText();
+        log.info("仿真云平台 token 为:" + accessToken);
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Authorization", "Bearer " + accessToken);
+        Map<String, String> params = new HashMap<>();
+        params.put("projectType", projectType);
+        params.put("id", projectId);
+        String result = HttpUtil.post(closeableHttpClient, requestConfig, customConfiguration.getProjectDetailsUri(), headers, params);
+        log.info("访问仿真云平台项目详情接口:" + customConfiguration.getProjectDetailsUri() + ",请求头为:" + headers + ",请求体为:" + params + "结果为:" + result);
+        ResponseBodyVO responseBodyVO = JsonUtil.jsonToBean(result, ResponseBodyVO.class);
+        String projectDetailsVOJson = JsonUtil.beanToJson(responseBodyVO.getInfo());
+        TimeUnit.SECONDS.sleep(5);
+        if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
+            manualProjectMapper.updateProjectDetails(projectId, projectDetailsVOJson);
+        } else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(projectType)) {
+            autoSubProjectMapper.updateProjectDetails(projectId, projectDetailsVOJson);
+        } else {
+            throw new RuntimeException("未知项目类型:" + projectType);
+        }
+    }
+
+    @Async("pool1")
+    @SneakyThrows
+    public void selectProjectReportById(String projectType, String projectId) {
+        String tokenUrl = customConfiguration.getTokenUri() + "?grant_type=client_credentials" + "&client_id=" + customConfiguration.getClientId() + "&client_secret=" + customConfiguration.getClientSecret();
+        log.info("获取仿真云平台 token:" + tokenUrl);
+        String response = HttpUtil.get(tokenUrl);
+        ObjectMapper objectMapper = new ObjectMapper();
+        JsonNode jsonNode = objectMapper.readTree(response);
+        String accessToken = jsonNode.path("access_token").asText();
+        log.info("仿真云平台 token 为:" + accessToken);
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Authorization", "Bearer " + accessToken);
+        Map<String, String> params = new HashMap<>();
+        params.put("projectType", projectType);
+        params.put("id", projectId);
+        String result = HttpUtil.post(closeableHttpClient, requestConfig, customConfiguration.getProjectDetailsUri(), headers, params);
+        log.info("访问仿真云平台项目报告接口:" + customConfiguration.getProjectReportUri() + ",请求头为:" + headers + ",请求体为:" + params + "结果为:" + result);
+        ResponseBodyVO responseBodyVO = JsonUtil.jsonToBean(result, ResponseBodyVO.class);
+        String projectReportVOJson = JsonUtil.beanToJson(responseBodyVO.getInfo());
+        TimeUnit.SECONDS.sleep(5);
         if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
-            manualProjectMapper.updateProjectDetails(projectId,projectDetailsVOJson);
+            manualProjectMapper.updateProjectReport(projectId, projectReportVOJson);
         } else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(projectType)) {
-            autoSubProjectMapper.updateProjectDetails(projectId,projectDetailsVOJson);
+            autoSubProjectMapper.updateProjectReport(projectId, projectReportVOJson);
         } else {
             throw new RuntimeException("未知项目类型:" + projectType);
         }

+ 17 - 25
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/util/TaskUtil.java

@@ -2,7 +2,7 @@ package com.css.simulation.resource.scheduler.util;
 
 import api.common.pojo.constants.DictConstants;
 import api.common.util.*;
-import com.css.simulation.resource.scheduler.configuration.constant.ConstantConfiguration;
+import com.css.simulation.resource.scheduler.configuration.custom.CustomConfiguration;
 import com.css.simulation.resource.scheduler.configuration.kubernetes.KubernetesConfiguration;
 import com.css.simulation.resource.scheduler.configuration.redis.CustomRedisClient;
 import com.css.simulation.resource.scheduler.data.entity.*;
@@ -42,14 +42,6 @@ public class TaskUtil {
     private String pyPath;
     @Value("${scheduler.linux-path.temp}")
     private String linuxTempPath;
-    @Value("${simulation-cloud.client-id}")
-    private String clientId;
-    @Value("${simulation-cloud.client-secret}")
-    private String clientSecret;
-    @Value("${simulation-cloud.token-uri}")
-    private String tokenUri;
-    @Value("${simulation-cloud.evaluation-level-uri}")
-    private String evaluationLevelUri;
     @Value("${scheduler.minio-path.project-result}")
     private String resultPathMinio;
     @Resource
@@ -69,10 +61,6 @@ public class TaskUtil {
     @Resource
     private ScoringRulesMapper scoringRulesMapper;
     @Resource
-    private CloseableHttpClient closeableHttpClient;
-    @Resource
-    private RequestConfig requestConfig;
-    @Resource
     private ProjectUtil projectUtil;
     @Resource
     private SqlSessionFactory sqlSessionFactory;
@@ -83,11 +71,13 @@ public class TaskUtil {
     @Resource(name = "myKafkaAdmin")
     private Admin admin;
     @Resource
-    private TaskUtil taskUtil;
-    @Resource
     private CustomRedisClient customRedisClient;
     @Resource
-    private ConstantConfiguration constantConfiguration;
+    private CustomConfiguration customConfiguration;
+    @Resource
+    private CloseableHttpClient closeableHttpClient;
+    @Resource
+    private RequestConfig requestConfig;
 
     public void batchInsertTask(List<TaskEntity> taskEntityList) {
         try (SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false)) {
@@ -147,7 +137,7 @@ public class TaskUtil {
                 if (DictConstants.VIDEO_CPU.equals(isChoiceGpu)) {
                     String generateVideoKey = "task:" + taskId + ":generateVideo";
                     customRedisClient.set(generateVideoKey, "0");
-                    HttpUtil.get(constantConfiguration.getGenerateVideoUrl().replace("simulation-resource-video", nodeName) + "?generateVideoKey=" + generateVideoKey + "&nodeName=" + nodeName + "&projectId=" + projectId + "&projectType=" + projectType + "&maxSimulationTime=" + maxSimulationTime + "&taskId=" + taskId);
+                    HttpUtil.get(customConfiguration.getGenerateVideoUrl().replace("simulation-resource-video", nodeName) + "?generateVideoKey=" + generateVideoKey + "&nodeName=" + nodeName + "&projectId=" + projectId + "&projectType=" + projectType + "&maxSimulationTime=" + maxSimulationTime + "&taskId=" + taskId);
 //                    HttpUtil.get("http://" + nodeName + ":8007//simulation/resource/video/generate" + "?generateVideoKey=" + generateVideoKey + "&nodeName=" + nodeName + "&projectId" + projectId + "&projectType" + projectType + "&maxSimulationTime" + maxSimulationTime + "&taskId" + taskId);
 //                    videoFeignClient.generateVideo(generateVideoKey, nodeName, projectId, projectType, maxSimulationTime, taskId);
                     log.info("任务 {} 使用 CPU 生成视频开始>>>>>>>", taskId);
@@ -182,11 +172,11 @@ public class TaskUtil {
             if (isCompleted) {
                 customRedisClient.tryLock(lock2, 10 * 60L);
                 log.info("项目 {} 开始打分。", projectId);
-                taskUtil.score(redisPrefix.getProjectRunningKey(), userId, projectId, projectType);
+                score(redisPrefix.getProjectRunningKey(), userId, projectId, projectType);
                 log.info("项目 {} 计算评价等级。", projectId);
-                taskUtil.evaluationLevel(projectId);
+                evaluationLevel(projectId);
                 log.info("项目 {} 开始释放资源。", projectId);
-                taskUtil.done(redisPrefix, projectId, projectType);
+                done(redisPrefix, projectId, projectType);
                 log.info("项目 {} 运行结束。", projectId);
             }
         } finally {
@@ -418,9 +408,9 @@ public class TaskUtil {
 
     @SneakyThrows
     public void evaluationLevel(String projectId) {
-        String tokenUrl = tokenUri + "?grant_type=client_credentials" + "&client_id=" + clientId + "&client_secret=" + clientSecret;
+        String tokenUrl = customConfiguration.getTokenUri() + "?grant_type=client_credentials" + "&client_id=" + customConfiguration.getClientId() + "&client_secret=" + customConfiguration.getClientSecret();
         log.info("获取仿真云平台 token:" + tokenUrl);
-        String response = HttpUtil.get(closeableHttpClient, requestConfig, tokenUrl);
+        String response = HttpUtil.get(tokenUrl);
         ObjectMapper objectMapper = new ObjectMapper();
         JsonNode jsonNode = objectMapper.readTree(response);
         String accessToken = jsonNode.path("access_token").asText();
@@ -429,8 +419,8 @@ public class TaskUtil {
         headers.put("Authorization", "Bearer " + accessToken);
         Map<String, String> params = new HashMap<>();
         params.put("id", projectId);
-        String post = HttpUtil.post(closeableHttpClient, requestConfig, evaluationLevelUri, headers, params);
-        log.info("访问仿真云平台评价等级接口:" + evaluationLevelUri + ",请求头为:" + headers + ",请求体为:" + params + "结果为:" + post);
+        String post = HttpUtil.post(closeableHttpClient, requestConfig, customConfiguration.getEvaluationLevelUri(), headers, params);
+        log.info("访问仿真云平台评价等级接口:" + customConfiguration.getEvaluationLevelUri() + ",请求头为:" + headers + ",请求体为:" + params + "结果为:" + post);
     }
 
 
@@ -469,8 +459,10 @@ public class TaskUtil {
         RedisUtil.deleteByPrefix(stringRedisTemplate, "project:" + projectId);
         // 删除剩余 yaml
         projectUtil.deleteYamlByProjectId(projectId);
-        // 查询项目详情
+        // 查询并保存项目详情
         projectUtil.selectProjectDetailsById(projectType, projectId);
+        // 查询并保存项目报告
+        projectUtil.selectProjectReportById(projectType, projectId);
     }
 
 

+ 9 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/controller/SimulationProjectController.java

@@ -123,6 +123,15 @@ public class SimulationProjectController {
     return simulationProjectService.selectProjectReportById(param);
   }
 
+  /**
+   * 获取测试报告详情
+   */
+  @RequestMapping("/selectProjectReportByIdForScheduler")
+  public ResponseBodyVO<ProjectReportVO> selectProjectReportByIdForScheduler(@RequestBody SimulationManualProjectParam param) {
+    return simulationProjectService.selectProjectReportByIdForScheduler(param);
+  }
+
+
   /**
    * 获取任务详情信息
    */

+ 2 - 6
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationAutomaticSubProjectMapper.java

@@ -16,12 +16,6 @@ public interface SimulationAutomaticSubProjectMapper {
 
      SimulationAutomaticSubProjectPO selectById(SimulationManualProjectParam param);
 
-     @Select("        select p.scene\n" +
-             "        from simulation_automatic_subproject s\n" +
-             "                 left join simulation_automatic_project p on s.parent_id = p.id\n" +
-             "        where s.id = #{id}")
-     String selectSceneById(@Param("id") String id);
-
      SimulationAutomaticSubProjectPO selectLastProjectId(String id);
 
      int addAutomaticSubProject(SimulationAutomaticSubProjectPO po);
@@ -39,4 +33,6 @@ public interface SimulationAutomaticSubProjectMapper {
      int updateNowRunState(SimulationManualProjectParam param);
 
 
+     @Select("select report from simulation_automatic_subproject where id = #{id}")
+     String selectReportById(@Param("id") String id);
 }

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java

@@ -145,4 +145,6 @@ public interface SimulationProjectMapper {
             "where id = #{id}")
     void updateIdById(SimulationManualProjectPO simulationManualProjectPo);
 
+    @Select("select report from simulation_manual_project where id = #{id}")
+    String selectReportById(@Param("id") String id);
 }

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/SimulationProjectService.java

@@ -27,6 +27,8 @@ public interface SimulationProjectService {
 
   ResponseBodyVO<ProjectReportVO> selectProjectReportById(SimulationManualProjectParam param);
 
+  ResponseBodyVO<ProjectReportVO> selectProjectReportByIdForScheduler(SimulationManualProjectParam param);
+
   ResponseBodyVO<List<DropDownTypeVo>> selectDropDownByType(SimulationManualProjectParam param);
 
   ResponseBodyVO<List<DropDownTypeNewVo>> selectDropDownByTypeNew(SimulationManualProjectParam param);

+ 20 - 4
simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/impl/SimulationProjectServiceImpl.java

@@ -385,7 +385,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
     /**
      * 查询项目详情,不使用详情字段中的某些字段,例如项目运行状态,并查询任务列表
-     *
      */
     @Override
     @SneakyThrows
@@ -394,17 +393,16 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         ProjectDetailsVO projectDetailsVO = null;
         if (DictConstants.PROJECT_TYPE_MANUAL.equals(param.getProjectType())) { // 手动运行任务
             SimulationManualProjectPO simulationManualProjectPO = simulationProjectMapper.selectProjectById(param);
-            projectDetailsVO = JsonUtil.jsonToBean(simulationManualProjectPO.getDetails(),ProjectDetailsVO.class);
+            projectDetailsVO = JsonUtil.jsonToBean(simulationManualProjectPO.getDetails(), ProjectDetailsVO.class);
         } else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(param.getProjectType())) {
             SimulationManualProjectVO simulationManualProjectVO = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
-            projectDetailsVO = JsonUtil.jsonToBean(simulationManualProjectVO.getDetails(),ProjectDetailsVO.class);
+            projectDetailsVO = JsonUtil.jsonToBean(simulationManualProjectVO.getDetails(), ProjectDetailsVO.class);
         }
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, projectDetailsVO);
     }
 
     /**
      * 查询项目详情,不使用详情字段中的某些字段,例如项目运行状态,并查询任务列表
-     *
      */
     @Override
     @SneakyThrows
@@ -809,6 +807,23 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
     @Override
     public ResponseBodyVO<ProjectReportVO> selectProjectReportById(SimulationManualProjectParam param) {
+        final String projectType = param.getProjectType();
+        final String id = param.getId();
+        ProjectReportVO projectReportVO;
+        if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
+            final String projectReportVOJson = simulationProjectMapper.selectReportById(id);
+            projectReportVO = JsonUtil.jsonToBean(projectReportVOJson, ProjectReportVO.class);
+        } else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(projectType)) {
+            final String projectReportVOJson = simulationAutomaticSubProjectMapper.selectReportById(id);
+            projectReportVO = JsonUtil.jsonToBean(projectReportVOJson, ProjectReportVO.class);
+        } else {
+            throw new RuntimeException("未知项目类型:" + projectType);
+        }
+        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, projectReportVO);
+    }
+
+    @Override
+    public ResponseBodyVO<ProjectReportVO> selectProjectReportByIdForScheduler(SimulationManualProjectParam param) {
         String projectType = param.getProjectType();
         // 封装要使用到的数据
         SimulationManualProjectPO poParam = new SimulationManualProjectPO();
@@ -934,6 +949,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, projectReportVo);
     }
 
+
     private AlgorithmPO getAlgorithmInfo(SimulationManualProjectPO po) {
         AlgorithmPO algorithmBaseInfoVo = null;
         String algorithmId = po.getAlgorithm();