Browse Source

标准化测试

LingxinMeng 2 years ago
parent
commit
ebea4a9741

+ 5 - 2
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/application/service/ProjectService.java

@@ -788,14 +788,17 @@ public class ProjectService {
     public void stopProject(String projectType, String projectId) {
         String isChoiceGpu = projectDomainService.getIsChoiceGpuByProjectId(projectId);
         //* -------------------------------- Comment --------------------------------
-        ProjectEntity projectEntity;
+        ProjectEntity projectEntity = projectDomainService.getProjectByProjectId(projectId);
+        if (projectEntity == null) {
+            log.info("项目未运行:" + projectId);
+            return;
+        }
         String projectUserId, clusterUserId, modelType, projectRunningKeyPrefix;
         int parallelism;
         PrefixEntity redisPrefix;
         Set<String> projectRunningKeySet;
         boolean isRunning;
         //* -------------------------------- Comment --------------------------------
-        projectEntity = projectDomainService.getProjectByProjectId(projectId);
         parallelism = Integer.parseInt(projectEntity.getParallelism());
         redisPrefix = projectDomainService.getRedisPrefixByProjectIdAndProjectType(projectId, projectType);
         projectRunningKeyPrefix = redisPrefix.getProjectRunningKey();

+ 1 - 12
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java

@@ -134,16 +134,10 @@ public interface SimulationProjectMapper {
 
     SimulationManualProjectPO selectProjectReportIdByAlgorithmId(String algorithmId);
 
-
-    @Update("update simulation_manual_project\n" +
-            "set details = #{details}\n" +
-            "where id = #{projectId}")
-    void updateDetailsById(@Param("projectId") String projectId, @Param("details") String details);
-
     @Update("update simulation_manual_project\n" +
             "set details = #{details},now_run_state = #{nowRunState}\n" +
             "where id = #{id}")
-    void updateDetailsAndNowRunStateById(@Param("id") String projectId, @Param("details") String details, @Param("nowRunState") String nowRunState);
+    void updateDetailsAndNowRunStateById(@Param("id") String id, @Param("details") String details, @Param("nowRunState") String nowRunState);
 
     @Update("update simulation_manual_project\n" +
             "set id = #{newId}, details = #{details},now_run_state = #{nowRunState}\n" +
@@ -151,11 +145,6 @@ public interface SimulationProjectMapper {
     void updateIdAndDetailsAndNowRunStateById(@Param("oldId") String oldId,@Param("newId") String newId, @Param("details") String details, @Param("nowRunState") String nowRunState);
 
 
-    @Update("update simulation_manual_project\n" +
-            "set id = #{newId}\n" +
-            "where id = #{id}")
-    void updateIdById(SimulationManualProjectPO simulationManualProjectPo);
-
     @Select("select report from simulation_manual_project where id = #{id}")
     String selectReportById(@Param("id") String id);
 }

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

@@ -303,7 +303,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 // 如果是重新运行的项目,修改项目ID
                 String newProjectId = StringUtil.getRandomUUID();
                 String projectDetailsVOJson = JsonUtil.beanToJson(projectDetailsVO);
-                simulationProjectMapper.updateIdAndDetailsAndNowRunStateById(oldProjectId, newProjectId, projectDetailsVOJson, DictConstants.RUNNING);
+                simulationProjectMapper.updateIdAndDetailsAndNowRunStateById(oldProjectId, newProjectId, projectDetailsVOJson, DictConstants.PROJECT_RUNNING);
             } else { // 启动已保存的新项目
                 log.info("启动已保存的新项目");
             }