|
@@ -162,220 +162,6 @@ public class ProjectService {
|
|
|
return sceneList;
|
|
|
}
|
|
|
|
|
|
- @SneakyThrows
|
|
|
- @Transactional
|
|
|
- public List<ScenePO> handlePackage(String projectRunningKey, String projectId, String packageId) {
|
|
|
- String allIndexPrefix = projectRunningKey + ":package:" + packageId + ":all";
|
|
|
- String leafIndexPrefix = projectRunningKey + ":package:" + packageId + ":leaf";
|
|
|
-
|
|
|
-
|
|
|
- List<IndexTemplatePO> allIndexList = indexTemplateMapper.selectByPackageIdIncludeDeleted(packageId);
|
|
|
- stringRedisTemplate.opsForValue().set(allIndexPrefix, JsonUtil.listToJson(allIndexList));
|
|
|
-
|
|
|
-
|
|
|
- List<IndexTemplatePO> leafIndexList = allIndexList.stream().filter(index -> StringUtil.isNotEmpty(index.getRuleId())).collect(Collectors.toList());
|
|
|
- stringRedisTemplate.opsForValue().set(leafIndexPrefix, JsonUtil.listToJson(leafIndexList));
|
|
|
- log.info("ProjectService--handlePackage 项目 " + projectId + " 的叶子指标为:" + leafIndexList);
|
|
|
- List<ScenePO> sceneList = new ArrayList<>();
|
|
|
- leafIndexList.forEach(leafIndex -> {
|
|
|
- String naturalIds = leafIndex.getSceneNaturalIds();
|
|
|
- String standardIds = leafIndex.getSceneStatueIds();
|
|
|
- String accidentIds = leafIndex.getSceneTrafficIds();
|
|
|
- String generalizationIds = leafIndex.getSceneGeneralizationIds();
|
|
|
- if (StringUtil.isNotEmpty(naturalIds)) {
|
|
|
- List<String> naturalIdList = new ArrayList<>(Arrays.asList(naturalIds.split(",")));
|
|
|
- sceneList.addAll(sceneMapper.selectNaturalByIdList(naturalIdList));
|
|
|
- }
|
|
|
- if (StringUtil.isNotEmpty(standardIds)) {
|
|
|
- List<String> standardIdList = new ArrayList<>(Arrays.asList(standardIds.split(",")));
|
|
|
- sceneList.addAll(sceneMapper.selectStandardByIdList(standardIdList));
|
|
|
- }
|
|
|
- if (StringUtil.isNotEmpty(accidentIds)) {
|
|
|
- List<String> accidentIdList = new ArrayList<>(Arrays.asList(accidentIds.split(",")));
|
|
|
- sceneList.addAll(sceneMapper.selectAccidentByIdList(accidentIdList));
|
|
|
- }
|
|
|
- if (StringUtil.isNotEmpty(generalizationIds)) {
|
|
|
- List<String> generalizationIdList = new ArrayList<>(Arrays.asList(generalizationIds.split(",")));
|
|
|
- sceneList.addAll(sceneMapper.selectGeneralizationByIdList(generalizationIdList));
|
|
|
- }
|
|
|
- });
|
|
|
- log.info("ProjectService--handlePackage 项目" + projectId + " 共有 " + sceneList.size() + " 个任务!");
|
|
|
- return sceneList;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
@@ -439,13 +225,15 @@ public class ProjectService {
|
|
|
if (DictConstants.ALGORITHM_UPLOAD_MODE_FILE.equals(uploadMode)) {
|
|
|
algorithmTarLinuxTempPath = linuxTempPath + "algorithm-file/" + algorithmCode + "/" + algorithmCode + ".tar";
|
|
|
String minioPath = algorithmPO.getMinioPath();
|
|
|
- MinioUtil.downloadToFile(minioClient, bucketName, minioPath, algorithmTarLinuxTempPath);
|
|
|
+ log.info("handleAlgorithm() 下载 minio 算法文件 " + minioPath + " 到本地 " + algorithmTarLinuxTempPath);
|
|
|
+ MinioUtil.downloadToFile(minioClient, bucketName, minioPath, algorithmTarLinuxTempPath);
|
|
|
} else if (DictConstants.ALGORITHM_UPLOAD_MODE_GIT.equals(uploadMode)) {
|
|
|
algorithmDirectoryLinuxTempPath = linuxTempPath + "algorithm-git/" + algorithmCode + "/";
|
|
|
String gitUrl = algorithmPO.getGitUrl().replace(gitConfiguration.getName(), gitConfiguration.getUrl());
|
|
|
String gitUserName = algorithmPO.getGitUserName();
|
|
|
String gitPassword = algorithmPO.getGitPassword();
|
|
|
- GitUtil.clone(gitUrl, gitUserName, gitPassword, algorithmDirectoryLinuxTempPath, true);
|
|
|
+ log.info("handleAlgorithm() 下载 git 算法文件 " + gitUrl + " 到本地 " + algorithmDirectoryLinuxTempPath);
|
|
|
+ GitUtil.clone(gitUrl, gitUserName, gitPassword, algorithmDirectoryLinuxTempPath, true);
|
|
|
for (String filename : Objects.requireNonNull(new File(algorithmDirectoryLinuxTempPath).list())) {
|
|
|
if (filename.endsWith(".tar")) {
|
|
|
algorithmTarLinuxTempPath = algorithmDirectoryLinuxTempPath + filename;
|
|
@@ -501,8 +289,6 @@ public class ProjectService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
|
|
|
* @param projectId 手动项目 id 或自动项目子id
|
|
|
* @param projectType 项目类型
|