|
@@ -1,7 +1,6 @@
|
|
package com.css.simulation.resource.scheduler.service;
|
|
package com.css.simulation.resource.scheduler.service;
|
|
|
|
|
|
import api.common.pojo.constants.DictConstants;
|
|
import api.common.pojo.constants.DictConstants;
|
|
-import api.common.pojo.dto.ProjectMessageDTO;
|
|
|
|
import api.common.pojo.po.scheduler.SchedulerProjectPO;
|
|
import api.common.pojo.po.scheduler.SchedulerProjectPO;
|
|
import api.common.util.*;
|
|
import api.common.util.*;
|
|
import com.css.simulation.resource.scheduler.configuration.docker.DockerConfiguration;
|
|
import com.css.simulation.resource.scheduler.configuration.docker.DockerConfiguration;
|
|
@@ -97,19 +96,19 @@ public class ProjectService {
|
|
|
|
|
|
// -------------------------------- Comment --------------------------------
|
|
// -------------------------------- Comment --------------------------------
|
|
|
|
|
|
- /**
|
|
|
|
- * @param projectMessageDTO 初始接收到的项目启动信息
|
|
|
|
- * @param projectWaitingKey projectWaitingKey
|
|
|
|
- * @param projectRunningKey projectRunningKey
|
|
|
|
- */
|
|
|
|
- @Transactional
|
|
|
|
- public void prepare(ProjectMessageDTO projectMessageDTO, String projectWaitingKey, String projectRunningKey) {
|
|
|
|
- String projectId = projectMessageDTO.getProjectId();
|
|
|
|
-
|
|
|
|
- //2 将 redis 中该项目旧的信息则直接删除(包括 waitingKey)
|
|
|
|
- RedisUtil.deleteByPrefix(stringRedisTemplate, projectWaitingKey);
|
|
|
|
- RedisUtil.deleteByPrefix(stringRedisTemplate, projectRunningKey);
|
|
|
|
- }
|
|
|
|
|
|
+// /**
|
|
|
|
+// * @param projectMessageDTO 初始接收到的项目启动信息
|
|
|
|
+// * @param projectWaitingKey projectWaitingKey
|
|
|
|
+// * @param projectRunningKey projectRunningKey
|
|
|
|
+// */
|
|
|
|
+// @Transactional
|
|
|
|
+// public void prepare(ProjectMessageDTO projectMessageDTO, String projectWaitingKey, String projectRunningKey) {
|
|
|
|
+// String projectId = projectMessageDTO.getProjectId();
|
|
|
|
+//
|
|
|
|
+// //2 将 redis 中该项目旧的信息则直接删除(包括 waitingKey)
|
|
|
|
+// RedisUtil.deleteByPrefix(stringRedisTemplate, projectWaitingKey);
|
|
|
|
+// RedisUtil.deleteByPrefix(stringRedisTemplate, projectRunningKey);
|
|
|
|
+// }
|
|
|
|
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@Transactional
|
|
@Transactional
|
|
@@ -123,7 +122,7 @@ public class ProjectService {
|
|
stringRedisTemplate.opsForValue().set(allIndexPrefix, JsonUtil.listToJson(allIndexList));
|
|
stringRedisTemplate.opsForValue().set(allIndexPrefix, JsonUtil.listToJson(allIndexList));
|
|
//2 查询场景包叶子指标
|
|
//2 查询场景包叶子指标
|
|
List<IndexTemplateEntity> leafIndexList = allIndexList.stream().filter(index -> StringUtil.isNotEmpty(index.getRuleId())).collect(Collectors.toList());
|
|
List<IndexTemplateEntity> leafIndexList = allIndexList.stream().filter(index -> StringUtil.isNotEmpty(index.getRuleId())).collect(Collectors.toList());
|
|
- log.info("getSceneList() 项目 " + projectId + " 的叶子指标为:" + leafIndexList);
|
|
|
|
|
|
+ log.debug("项目 " + projectId + " 的叶子指标为:" + leafIndexList);
|
|
// FileUtil.writeStringToLocalFile(JsonUtil.listToJson(allIndexList), projectPath + "leaf-index-list.json");
|
|
// FileUtil.writeStringToLocalFile(JsonUtil.listToJson(allIndexList), projectPath + "leaf-index-list.json");
|
|
stringRedisTemplate.opsForValue().set(leafIndexPrefix, JsonUtil.listToJson(leafIndexList));
|
|
stringRedisTemplate.opsForValue().set(leafIndexPrefix, JsonUtil.listToJson(leafIndexList));
|
|
List<SceneEntity> sceneList = new ArrayList<>();
|
|
List<SceneEntity> sceneList = new ArrayList<>();
|
|
@@ -149,7 +148,7 @@ public class ProjectService {
|
|
sceneList.addAll(sceneMapper.selectGeneralizationByIdList(generalizationIdList));
|
|
sceneList.addAll(sceneMapper.selectGeneralizationByIdList(generalizationIdList));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- log.info("getSceneList() 项目" + projectId + " 共有 " + sceneList.size() + " 个任务:" + sceneList);
|
|
|
|
|
|
+ log.info("项目" + projectId + " 共有 " + sceneList.size() + " 个任务:" + sceneList);
|
|
return sceneList;
|
|
return sceneList;
|
|
}
|
|
}
|
|
|
|
|