Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
376cdd87
Commit
376cdd87
authored
May 29, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整邮件没有节点的BUG
parent
0ad1da57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
26 deletions
+29
-26
RunRecordingAndEmailServiceImpl.java
...vice/mapservice/impl/RunRecordingAndEmailServiceImpl.java
+29
-26
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/mapservice/impl/RunRecordingAndEmailServiceImpl.java
View file @
376cdd87
...
@@ -71,34 +71,37 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
...
@@ -71,34 +71,37 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
public
void
saveEmailAndRunRecording
(
RunRecording
runRecording
)
{
public
void
saveEmailAndRunRecording
(
RunRecording
runRecording
)
{
//这一步是根据flowId和RunId查询对应的节点信息
//这一步是根据flowId和RunId查询对应的节点信息
List
<
JobTaskRunLogWithBLOBs
>
jobTaskRunLogByFlowIdAndRunId
=
jobTaskRunLogService
.
findJobTaskRunLogWithBLOBsByFlowIdAndRunId
(
runRecording
.
getFlowId
(),
runRecording
.
getRunId
());
List
<
JobTaskRunLogWithBLOBs
>
jobTaskRunLogByFlowIdAndRunId
=
jobTaskRunLogService
.
findJobTaskRunLogWithBLOBsByFlowIdAndRunId
(
runRecording
.
getFlowId
(),
runRecording
.
getRunId
());
String
flowName
=
runRecording
.
getFlowName
();
if
(
CollectionUtil
.
isNotEmpty
(
jobTaskRunLogByFlowIdAndRunId
))
{
//String senContentHtml = runMsgHtml(jobTaskRunLogByFlowIdAndRunId, flowName)
String
flowName
=
runRecording
.
getFlowName
();
Integer
workspaceId
=
runRecording
.
getWorkspaceId
();
//String senContentHtml = runMsgHtml(jobTaskRunLogByFlowIdAndRunId, flowName)
Workspace
workspace
=
workspaceService
.
findOneById
(
workspaceId
);
Integer
workspaceId
=
runRecording
.
getWorkspaceId
();
String
workspaceName
=
null
;
Workspace
workspace
=
workspaceService
.
findOneById
(
workspaceId
);
String
workspaceName
=
null
;
if
(
workspace
!=
null
){
if
(
workspace
!=
null
){
workspaceName
=
formatWorkspaceName
(
workspace
.
getWorkspaceName
());
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
);
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment