修改:hpc任务表增加minio文件夹dirId,用于回传通知

This commit is contained in:
yangyang01000846
2026-01-13 17:00:54 +08:00
parent dced220371
commit 8e53c52cd6
6 changed files with 25 additions and 5 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE `simulation_job` ADD COLUMN `dirId` bigint DEFAULT NULL COMMENT '文件的minio系统的id' ;

View File

@@ -77,4 +77,7 @@ public class SubmitHpcTaskRemoteReq implements Serializable {
@Schema(description = "任务流用户传递的参数,用于动态替换命令")
private Map<String,Object> params;
@Schema(description = "当前hpc节点文件目录id用于hpc文件回传")
private Long dirId;
}

View File

@@ -23,6 +23,7 @@ import com.sdm.flowable.service.IProcessNodeParamService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -166,7 +167,8 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
submitHpcTaskRemoteReq.setExecuteMode(executeMode);
if(Objects.equals(executeMode,FlowableConfig.EXECUTE_MODE_AUTO)){
ProcessNodeParam beforeNode = beforeNodeParams.get(0);
String beforeNodeJectKey = getNodeObjectKey(beforeNode);
Pair<String, Long> beforePair = getNodeObjectKey(beforeNode);
String beforeNodeJectKey = beforePair.getLeft();
// 本地求解文件路径 taskLocalBaseDir
String simulationFilePath = simulationBaseDir + beforeNodeJectKey;
submitHpcTaskRemoteReq.setSimulationFileLocalPath(simulationFilePath);
@@ -185,7 +187,11 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
}
// hpc 节点回传路径
ProcessNodeParam currentNode = currentNodeParams.get(0);
String currentNodeJectKey = getNodeObjectKey(currentNode);
Pair<String, Long> currentNodePair = getNodeObjectKey(currentNode);
String currentNodeJectKey = currentNodePair.getLeft();
Long curDirId = currentNodePair.getRight();
// 当前节点的minio文件夹id,用于hpc文件回传走data服务的接口
submitHpcTaskRemoteReq.setDirId(curDirId);
// hpc 回传minio文件路径,桶和租户绑定
submitHpcTaskRemoteReq.setStdoutSpdmMinoFilePath(currentNodeJectKey);
// hpc 回传本地文件路径
@@ -210,8 +216,8 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
.orElse(List.of());
}
private String getNodeObjectKey(ProcessNodeParam processNodeParam){
// String 当前的objectKey Long 节点对应的dirId
private Pair<String,Long> getNodeObjectKey(ProcessNodeParam processNodeParam){
String paramJson = processNodeParam.getParamJson();
JSONObject paramJsonObject = JSONObject.parseObject(paramJson);
// outputDirId
@@ -226,7 +232,7 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
}
FileMetadataInfoResp fileMetadataInfoResp = fileBaseInfoResp.getData();
String objectKey = fileMetadataInfoResp.getObjectKey();
return objectKey;
return Pair.of(objectKey,outputDirId);
}
/**

View File

@@ -168,4 +168,9 @@ public class SimulationJob implements Serializable {
@TableField(value = "updateTime", fill = FieldFill.INSERT_UPDATE)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
@Schema(description = "当前节点minio文件夹id")
@TableField("dirId")
private Long dirId;
}

View File

@@ -92,4 +92,7 @@ public class SubmitHpcTaskReq {
@Schema(description = "hpc结果输出文件comsol文件定制如原来是123_dianxin.mph --》123_dianxin_result.mph用于动态替换命令")
private String comsolResultName;
@Schema(description = "当前hpc节点文件目录id用于hpc文件回传")
private Long dirId;
}

View File

@@ -312,6 +312,8 @@ public class PbsServiceDecorator implements IPbsServiceDecorator {
simulationJob.setCreateTime(LocalDateTime.now());
simulationJob.setUpdaterId(userId);
simulationJob.setUpdateTime(LocalDateTime.now());
// 当前节点minio的文件夹id
simulationJob.setDirId(req.getDirId());
simulationJobService.save(simulationJob);
}
}