Commit 376cdd87 by huangfusuper

调整邮件没有节点的BUG

parent 0ad1da57
......@@ -71,34 +71,37 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
public void saveEmailAndRunRecording(RunRecording runRecording) {
//这一步是根据flowId和RunId查询对应的节点信息
List<JobTaskRunLogWithBLOBs> jobTaskRunLogByFlowIdAndRunId = jobTaskRunLogService.findJobTaskRunLogWithBLOBsByFlowIdAndRunId(runRecording.getFlowId(), runRecording.getRunId());
String flowName = runRecording.getFlowName();
//String senContentHtml = runMsgHtml(jobTaskRunLogByFlowIdAndRunId, flowName)
Integer workspaceId = runRecording.getWorkspaceId();
Workspace workspace = workspaceService.findOneById(workspaceId);
String workspaceName = null;
if (CollectionUtil.isNotEmpty(jobTaskRunLogByFlowIdAndRunId)) {
String flowName = runRecording.getFlowName();
//String senContentHtml = runMsgHtml(jobTaskRunLogByFlowIdAndRunId, flowName)
Integer workspaceId = runRecording.getWorkspaceId();
Workspace workspace = workspaceService.findOneById(workspaceId);
String workspaceName = null;
if(workspace != null){
workspaceName = formatWorkspaceName(workspace.getWorkspaceName());
if(workspace != null){
workspaceName = formatWorkspaceName(workspace.getWorkspaceName());
}
long flowEndTime = runRecording.getEndTime() == null? System.currentTimeMillis():runRecording.getEndTime().getTime();
long flowStartTime = runRecording.getStartTime() == null? System.currentTimeMillis():runRecording.getStartTime().getTime();
String senContentHtml = buildHtml(flowName,workspaceName,jobTaskRunLogByFlowIdAndRunId,flowEndTime-flowStartTime);
EmailAlarm emailAlarm = EmailAlarm.builder()
.flowId(runRecording.getFlowId())
.flowName(flowName)
.runId(runRecording.getRunId())
.versionName(runRecording.getFlowVersionName())
.alarmEmail(runRecording.getAlarmEmail())
.alarmContent(senContentHtml)
.alarmResult("0")
.flowRes(runRecording.getFlowRunResult())
.alarmTitle(flowName)
.build();
//保存邮箱
emailAlarmService.saveEmailAlarm(emailAlarm);
//修改为已告警
runRecording.setIsAlarm("0");
runRecordingService.updateRunRecordingById(runRecording);
}
long flowEndTime = runRecording.getEndTime() == null? System.currentTimeMillis():runRecording.getEndTime().getTime();
long flowStartTime = runRecording.getStartTime() == null? System.currentTimeMillis():runRecording.getStartTime().getTime();
String senContentHtml = buildHtml(flowName,workspaceName,jobTaskRunLogByFlowIdAndRunId,flowEndTime-flowStartTime);
EmailAlarm emailAlarm = EmailAlarm.builder()
.flowId(runRecording.getFlowId())
.flowName(flowName)
.runId(runRecording.getRunId())
.versionName(runRecording.getFlowVersionName())
.alarmEmail(runRecording.getAlarmEmail())
.alarmContent(senContentHtml)
.alarmResult("0")
.flowRes(runRecording.getFlowRunResult())
.alarmTitle(flowName)
.build();
//保存邮箱
emailAlarmService.saveEmailAlarm(emailAlarm);
//修改为已告警
runRecording.setIsAlarm("0");
runRecordingService.updateRunRecordingById(runRecording);
}
/**
......
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