修改:手动获取求解文件代码优化

This commit is contained in:
yangyang01000846
2026-01-20 15:57:02 +08:00
parent 86b77884cc
commit 73abfce1ce

View File

@@ -15,7 +15,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.nio.charset.StandardCharsets;
import java.util.*;
@@ -29,6 +28,7 @@ public class TaskAdapter implements ITaskFeignClient {
private static final String EXECUTE_MODE_AUTO = "AUTO";
private static final String EXECUTE_MODE_MANUAL = "MANUAL";
private static final String FLOWABLE_SIMULATION_BASEDIR = "/home/simulation/";
@Autowired
private TaskController taskController;
@@ -74,11 +74,17 @@ public class TaskAdapter implements ITaskFeignClient {
// 手动
if (Objects.equals(req.getExecuteMode(),EXECUTE_MODE_MANUAL)) {
masterFilepath = req.getManualMasterFilepaths().get(0);
masterFilepath=FLOWABLE_SIMULATION_BASEDIR+masterFilepath;
// 本地主文件
submitHpcTaskReq.setMasterFilePath(masterFilepath);
inputFilePaths= req.getManualInputFilePaths();
List<String> finalInputFilePaths = new ArrayList<>();
for(String inputFilePath:inputFilePaths){
finalInputFilePaths.add(FLOWABLE_SIMULATION_BASEDIR+inputFilePath);
}
// 本地从文件
submitHpcTaskReq.setInputFilePaths(inputFilePaths);
log.info("getSimulationFile 手动主文件:{},从文件:{}",masterFilepath,JSONObject.toJSONString(finalInputFilePaths));
}
// 自动
if (Objects.equals(req.getExecuteMode(),EXECUTE_MODE_AUTO)) {