|
@@ -1,253 +0,0 @@
|
|
|
-package com.css.simulation.resource.server.infra.runnable;
|
|
|
-
|
|
|
-import api.common.pojo.constants.DictConstants;
|
|
|
-import api.common.pojo.param.MinioParameter;
|
|
|
-import api.common.pojo.param.scene.SceneEvaluationComputeParam;
|
|
|
-import api.common.pojo.param.scene.SceneImportParam;
|
|
|
-import api.common.pojo.po.scene.SceneComplexityPO;
|
|
|
-import api.common.pojo.po.scene.SceneEvaluationRulePO;
|
|
|
-import api.common.util.CollectionUtil;
|
|
|
-import api.common.util.FileUtil;
|
|
|
-import api.common.util.StringUtil;
|
|
|
-import api.common.util.TimeUtil;
|
|
|
-import com.alibaba.druid.util.StringUtils;
|
|
|
-import com.css.simulation.resource.server.infra.db.mysql.mapper.SceneComplexityMapper;
|
|
|
-import com.css.simulation.resource.server.infra.db.mysql.mapper.SceneEvaluationRuleMapper;
|
|
|
-import com.css.simulation.resource.server.infra.feign.service.FileDownService;
|
|
|
-import com.css.simulation.resource.server.app.impl.ApplicationContextAwareImpl;
|
|
|
-import com.fasterxml.jackson.databind.JsonNode;
|
|
|
-import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
-import feign.Response;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
-
|
|
|
-import java.io.*;
|
|
|
-import java.nio.file.Files;
|
|
|
-import java.nio.file.Path;
|
|
|
-import java.nio.file.Paths;
|
|
|
-import java.nio.file.attribute.PosixFilePermission;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Set;
|
|
|
-
|
|
|
-import static api.common.pojo.enums.SceneEvaluationEnum.matchLevelEnumByLevel;
|
|
|
-
|
|
|
-
|
|
|
- * @author 15765
|
|
|
- * @date 2024/4/10 22:22
|
|
|
- */
|
|
|
-@Slf4j
|
|
|
-public class SceneEvaluationComputeRunnable implements Runnable {
|
|
|
-
|
|
|
- private final String linuxTempPath;
|
|
|
- private final SceneImportParam param;
|
|
|
- private final List<SceneEvaluationComputeParam> sceneEvaluationComputeParams;
|
|
|
-
|
|
|
- public SceneEvaluationComputeRunnable(SceneImportParam param, List<SceneEvaluationComputeParam> sceneEvaluationComputeParams, String linuxTempPath) {
|
|
|
- this.param = param;
|
|
|
- this.sceneEvaluationComputeParams = sceneEvaluationComputeParams;
|
|
|
- this.linuxTempPath = linuxTempPath;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public void copySceneComplexityResult(String taskId, String tempSceneId, List<String> copySceneIds) {
|
|
|
- SceneComplexityMapper sceneComplexityMapper = ApplicationContextAwareImpl.getApplicationContext().getBean(SceneComplexityMapper.class);
|
|
|
- List<SceneComplexityPO> sceneComplexityPOS = sceneComplexityMapper.selectSceneComplexityEvaluation(taskId, tempSceneId);
|
|
|
- List<SceneComplexityPO> saveList = new ArrayList<>();
|
|
|
- if (CollectionUtil.isNotEmpty(sceneComplexityPOS)) {
|
|
|
- for (SceneComplexityPO sceneComplexityPO : sceneComplexityPOS) {
|
|
|
- for (String copySceneId : copySceneIds) {
|
|
|
- SceneComplexityPO tempComplexityPO = new SceneComplexityPO();
|
|
|
- BeanUtils.copyProperties(sceneComplexityPO, tempComplexityPO);
|
|
|
- tempComplexityPO.setSceneId(copySceneId);
|
|
|
- tempComplexityPO.setComplexityId(StringUtil.getRandomUUID());
|
|
|
- saveList.add(tempComplexityPO);
|
|
|
- }
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(saveList)) {
|
|
|
- sceneComplexityMapper.saveSceneComplexityS(saveList);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|