Commit f5a4283e by huangfusuper

日志合并

parent 1b99bf63
......@@ -127,8 +127,23 @@ public class JavaFlowFreeTaskCallbackThread implements Runnable {
List<JobTaskRunLogWithBLOBs> jobTaskRunLogWithBLOBsByFlowIdAndRunId = mythJobTaskRunLogService.findJobTaskRunLogWithBLOBsByFlowIdAndRunId(runRecording.getFlowId(), runRecording.getRunId());
JobTaskRunLogWithBLOBs jobTaskRunLogWithBLOBs = jobTaskRunLogWithBLOBsByFlowIdAndRunId.stream().filter(log -> log.getNodeName().equals(specialJavaNode.getNodeName())).findFirst().orElse(null);
if(jobTaskRunLogWithBLOBs != null) {
String logPath = mergeLog(jobTaskRunLogWithBLOBs.getLogRemotelyPath(), specialJavaNode.getThisLogUrlPath());
jobTaskRunLogWithBLOBs.setLogRemotelyPath(logPath);
String logRemotelyPath = jobTaskRunLogWithBLOBs.getLogRemotelyPath();
//平台传过来的
String thisLogUrlPath = specialJavaNode.getThisLogUrlPath();
if(StringUtils.isBlank(logRemotelyPath)) {
FileSystem fileSystem = SpringUtil.getBean(FileSystem.class);
byte[] sourceLogBytes = fileSystem.downloaderFile(thisLogUrlPath);
String runMsg = jobTaskRunLogWithBLOBs.getRunMsg();
byte[] bytes = stringToByteArray(runMsg);
byte[] mergeFile = mergeFile(sourceLogBytes, bytes);
Map<String, String> fileMate = fileSystem.getFileMate(thisLogUrlPath);
String logPath = fileSystem.uploadFile(mergeFile, "log", fileMate);
jobTaskRunLogWithBLOBs.setLogRemotelyPath(logPath);
}else{
String logPath = mergeLog(logRemotelyPath, thisLogUrlPath);
jobTaskRunLogWithBLOBs.setLogRemotelyPath(logPath);
}
return jobTaskRunLogWithBLOBs;
}
return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment