修改:hpc代码优化

This commit is contained in:
yangyang01000846
2026-01-14 17:53:46 +08:00
parent 3270ef426f
commit fb4bef1cbb
2 changed files with 11 additions and 1 deletions

View File

@@ -72,6 +72,9 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
String currentNodeId =execution.getCurrentActivityId();
String masterFileRegularStr = config.getMasterFileRegularStr();
String inputFilesRegularStr = config.getInputFilesRegularStr();
if(StringUtils.isBlank(masterFileRegularStr)){
throw new RuntimeException("Hpc任务执行失败主求解文件规则不能是空");
}
CoreLogger.info("beforeNodeId:{},currentNodeId:{},masterFileRegularStr:{},inputFilesRegularStr:{}",beforeNodeId,currentNodeId,masterFileRegularStr,inputFilesRegularStr);
// 初始化用户/租户信息
initUserInfo(execution);
@@ -138,6 +141,13 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
Long userId = (Long) execution.getVariable("userId");
String userName = (String) execution.getVariable("userName");
Long tenantId = (Long) execution.getVariable("tenantId");
log.info("Hpc流程发起用户id:{},租户id:{}",userId,tenantId);
if(Objects.isNull(tenantId)){
tenantId=ThreadLocalContext.getTenantId();
}
if(Objects.isNull(userId)){
tenantId=ThreadLocalContext.getUserId();
}
ThreadLocalContext.setUserId(userId);
ThreadLocalContext.setUserName(userName);
ThreadLocalContext.setTenantId(tenantId);