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
31443c7d
Commit
31443c7d
authored
Aug 17, 2020
by
guominglei
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
b218e6ad
5322244f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
RunRecordingAndEmailServiceImpl.java
...vice/mapservice/impl/RunRecordingAndEmailServiceImpl.java
+11
-7
mail.html
...re/myth-admin-core/src/main/resources/templates/mail.html
+1
-1
ScheduleTypeEnum.java
...o-core/src/main/java/com/byit/enums/ScheduleTypeEnum.java
+12
-0
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/mapservice/impl/RunRecordingAndEmailServiceImpl.java
View file @
31443c7d
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
cn.hutool.core.date.DateUtil
;
import
com.byit.dto.EmailMappingDto
;
import
com.byit.enums.EmailEnum
;
import
com.byit.enums.ScheduleTypeEnum
;
import
com.byit.model.EmailAlarm
;
import
com.byit.model.JobTaskRunLogWithBLOBs
;
import
com.byit.model.RunRecording
;
...
...
@@ -84,7 +85,7 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
}
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
);
String
senContentHtml
=
buildHtml
(
flowName
,
workspaceName
,
jobTaskRunLogByFlowIdAndRunId
,
flowEndTime
-
flowStartTime
,
runRecording
);
EmailAlarm
emailAlarm
=
EmailAlarm
.
builder
()
.
flowId
(
runRecording
.
getFlowId
())
.
flowName
(
flowName
)
...
...
@@ -107,17 +108,20 @@ public class RunRecordingAndEmailServiceImpl implements RunRecordingAndEmailServ
/**
* 根据模板引擎构建html代码
* @param title
* @param env
* @param jobTaskRunLogs
* @param flowConsumeDate
* @return
* @param title 主题
* @param env 环境名称
* @param jobTaskRunLogs 日志节点
* @param flowConsumeDate 消耗时间
* @param runRecording 对应的运行实例
* @return 构建好的html
*/
public
String
buildHtml
(
String
title
,
String
env
,
List
<
JobTaskRunLogWithBLOBs
>
jobTaskRunLogs
,
Long
flowConsumeDate
){
public
String
buildHtml
(
String
title
,
String
env
,
List
<
JobTaskRunLogWithBLOBs
>
jobTaskRunLogs
,
Long
flowConsumeDate
,
RunRecording
runRecording
){
Map
<
String
,
Object
>
data
=
new
HashMap
<>(
4
);
data
.
put
(
"title"
,
title
);
data
.
put
(
"env"
,
env
);
data
.
put
(
"flowConsumeDate"
,
TimeFormatUtil
.
timeFormat
(
flowConsumeDate
));
int
scheduleType
=
runRecording
.
getScheduleType
();
data
.
put
(
"schedulingType"
,
ScheduleTypeEnum
.
matchScheduleType
(
scheduleType
));
List
<
EmailMappingDto
>
emailMappings
=
new
ArrayList
<>(
8
);
if
(
CollectionUtil
.
isNotEmpty
(
jobTaskRunLogs
))
{
jobTaskRunLogs
.
forEach
(
jobTaskRunLog
->
{
...
...
byit-myth-core/myth-admin-core/src/main/resources/templates/mail.html
View file @
31443c7d
...
...
@@ -9,7 +9,7 @@
<table
border=
'1'
width=
'80%'
align=
'center'
cellspacing=
'0'
cellpadding=
'6'
>
<div
style=
"margin-bottom: 20px;"
>
<h1
style=
'text-align:center;color:red;'
>
工作流执行报告
</h1>
<h1
style=
'text-align:center;color:red;'
th:text=
"${schedulingType}+'工作流执行报告'"
>
</h1>
<br/>
<span
style=
"margin-left: 10%;font-size: 16px;color: #646256;"
th:text=
"'工作流名称:'+${title}"
></span>
<span
style=
"margin-left: 10%;font-size: 16px;color: #646256;"
th:text=
"'总耗时:'+${flowConsumeDate}"
></span>
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/enums/ScheduleTypeEnum.java
View file @
31443c7d
package
com
.
byit
.
enums
;
import
java.util.Arrays
;
/**
* @description: 调度类型枚举
* @author: gml
...
...
@@ -30,4 +32,14 @@ public enum ScheduleTypeEnum {
return
this
.
msg
;
}
public
static
String
matchScheduleType
(
int
code
)
{
ScheduleTypeEnum
[]
scheduleTypeEnums
=
ScheduleTypeEnum
.
values
();
for
(
ScheduleTypeEnum
scheduleTypeEnum
:
Arrays
.
asList
(
scheduleTypeEnums
))
{
if
(
scheduleTypeEnum
.
code
==
code
)
{
return
scheduleTypeEnum
.
msg
;
}
}
return
"未知类型$"
;
}
}
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