修改:hpc节点命令前端没有传递,后端代码测试190环境兜底mock

This commit is contained in:
yangyang01000846
2026-01-06 12:42:40 +08:00
parent f7264c845e
commit 58fec93111
2 changed files with 16 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
@@ -50,6 +51,10 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
@Autowired
private MessageFeignClientImpl messageFeignClient;
@Value("${hpc.mockCommand:}")
private String mockCommand;
/*
* params:业务参数
* config框架属性
@@ -228,6 +233,7 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
* 将参数Map转换为SubmitHpcTaskRemoteReq对象的工具方法
*/
private SubmitHpcTaskRemoteReq convertParamsToReq(Map<String, Object> params,String command) {
CoreLogger.error("convertParamsToReq start command:{}",command);
SubmitHpcTaskRemoteReq req = new SubmitHpcTaskRemoteReq();
if (params == null) {
return req;
@@ -255,6 +261,14 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
// mock 时暂时自己传递,后面根据软件名称查询命令 todo 后面从表配置查询
// String command =(params.get("command")==null||StringUtils.isBlank(params.get("command").toString()))?
// "\\\\CARSAFE\\share\\solver\\RLithium\\reta.exe -i %s" : params.get("command").toString();
// 只是测试环境用于兜底mock
if(StringUtils.isBlank(command)){
command = mockCommand;
}
if(StringUtils.isBlank(command)){
CoreLogger.error("command is empty!!!!!");
throw new RuntimeException("command is empty");
}
req.setCommand(command);
req.setProjectname(params.get("projectname").toString());
// req.setFeatchFileType(params.get("featchFileType").toString());

View File

@@ -38,3 +38,5 @@ security:
paths:
- /process/testHpc
- /process/asyncCallback
hpc:
mockCommand: '\\HPC-COMPUTE-01\share\RLithium\RLithium\reta.exe -i %s'