Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
middleware-automatic
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
shenjunjie
middleware-automatic
Commits
d5f5b798
Commit
d5f5b798
authored
May 23, 2023
by
liuyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!51
parents
a263f028
d9370ff8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
middleware-automatic-center-client/src/main/java/com/zhiwei/middleware/automatic/server/pojo/TemplateTitleVo.java
+2
-1
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/config/TaskPoolConfig.java
+1
-1
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/service/impl/TemplateTitleServiceImpl.java
+5
-0
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/task/service/TaskServiceTemplate.java
+9
-6
No files found.
middleware-automatic-center-client/src/main/java/com/zhiwei/middleware/automatic/server/pojo/TemplateTitleVo.java
View file @
d5f5b798
...
@@ -127,9 +127,10 @@ public class TemplateTitleVo implements Serializable {
...
@@ -127,9 +127,10 @@ public class TemplateTitleVo implements Serializable {
}
}
public
void
accSum
(
long
markSum
,
long
daySum
)
{
public
void
accSum
(
long
markSum
,
long
daySum
)
{
this
.
markSum
=
markSum
+
this
.
daySum
;
// daySum就不需要更新
if
(
this
.
daySum
!=
0
)
{
if
(
this
.
daySum
!=
0
)
{
this
.
daySum
+=
daySum
;
this
.
daySum
+=
daySum
;
this
.
markSum
=
markSum
+
this
.
daySum
;
}
}
}
}
}
}
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/config/TaskPoolConfig.java
View file @
d5f5b798
...
@@ -32,6 +32,6 @@ public class TaskPoolConfig {
...
@@ -32,6 +32,6 @@ public class TaskPoolConfig {
@Bean
(
"templateExecutor"
)
@Bean
(
"templateExecutor"
)
public
ThreadPoolExecutorTimeout
templateExecutor
()
{
public
ThreadPoolExecutorTimeout
templateExecutor
()
{
return
new
ThreadPoolExecutorTimeout
(
1000L
*
60
*
30
,
32
,
32
,
10000L
,
return
new
ThreadPoolExecutorTimeout
(
1000L
*
60
*
30
,
32
,
32
,
10000L
,
TimeUnit
.
MILLISECONDS
,
2
00
,
"模板任务线程池"
);
TimeUnit
.
MILLISECONDS
,
4
00
,
"模板任务线程池"
);
}
}
}
}
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/service/impl/TemplateTitleServiceImpl.java
View file @
d5f5b798
...
@@ -189,12 +189,17 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
...
@@ -189,12 +189,17 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
if
(
Objects
.
isNull
(
titleVo
))
{
if
(
Objects
.
isNull
(
titleVo
))
{
return
;
return
;
}
}
// templateTitleVo,fixTag 必定只有一个有值
// 当传入的模板为空,表示不需要修改模板
if
(
Objects
.
isNull
(
templateTitleVo
))
{
if
(
Objects
.
isNull
(
templateTitleVo
))
{
templateTitleVo
=
titleVo
;
templateTitleVo
=
titleVo
;
}
}
// 标签为null表示需要更新模板
if
(
Objects
.
isNull
(
fixTag
))
{
if
(
Objects
.
isNull
(
fixTag
))
{
// templateTitleVo.daySum = 0 代表清空day模板,场景:大聚合时清空daySum。daySum != 0代表更新数值,场景:自动标注数值统计
templateTitleVo
.
accSum
(
titleVo
.
getMarkSum
(),
titleVo
.
getDaySum
());
templateTitleVo
.
accSum
(
titleVo
.
getMarkSum
(),
titleVo
.
getDaySum
());
}
else
{
}
else
{
// 修改标签
String
oldTag
=
templateTitleVo
.
getMtag
();
String
oldTag
=
templateTitleVo
.
getMtag
();
templateTitleVo
.
setMtag
(
fixTag
);
templateTitleVo
.
setMtag
(
fixTag
);
log
.
info
(
"修改模板标签成功: group:{} templateTitle:{} oldTag:{} fixTag:{}"
,
group
,
title
,
oldTag
,
log
.
info
(
"修改模板标签成功: group:{} templateTitle:{} oldTag:{} fixTag:{}"
,
group
,
title
,
oldTag
,
...
...
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/task/service/TaskServiceTemplate.java
View file @
d5f5b798
...
@@ -84,15 +84,18 @@ public class TaskServiceTemplate extends BaseTaskTypePair<TaskServiceTemplate.Ta
...
@@ -84,15 +84,18 @@ public class TaskServiceTemplate extends BaseTaskTypePair<TaskServiceTemplate.Ta
long
now
=
System
.
currentTimeMillis
();
long
now
=
System
.
currentTimeMillis
();
TaskTemplateFunctional
pair
=
getPairValue
(
autoTask
.
getType
());
TaskTemplateFunctional
pair
=
getPairValue
(
autoTask
.
getType
());
pair
.
template
(
autoTask
);
pair
.
template
(
autoTask
);
// log.info("{}结束, 项目:{},开始时间:{},结束时间:{},耗时:{}", getPairKey(autoTask.getType()).getMessage(), autoTask.getGroup(),
Long
startTime
=
autoTask
.
getParamSource
().
getLong
(
GenericAttribute
.
START_PARAM
);
// Tools.TIME_FORMAT.format(autoTask.getParamSource().getLong(GenericAttribute.START_PARAM)),
if
(
Objects
.
nonNull
(
startTime
))
{
// Tools.TIME_FORMAT.format(autoTask.getParamSource().getLong(GenericAttribute.START_PARAM)), System.currentTimeMillis() - now);
log
.
info
(
"{}结束, 项目:{},开始时间:{},结束时间:{},耗时:{}"
,
getPairKey
(
autoTask
.
getType
()).
getMessage
(),
autoTask
.
getGroup
(),
Tools
.
TIME_FORMAT
.
format
(
startTime
),
Tools
.
TIME_FORMAT
.
format
(
startTime
),
System
.
currentTimeMillis
()
-
now
);
}
},
autoTask
));
},
autoTask
));
}
}
@Override
@Override
public
void
executorStatus
()
{
public
void
executorStatus
()
{
log
.
info
(
executorLog
,
"模板聚合"
,
executor
.
getActiveCount
(),
executor
.
getQueue
().
size
());
log
.
info
(
executorLog
,
"模板聚合"
,
executor
.
getActiveCount
(),
executor
.
getQueue
().
size
());
}
}
/**
/**
...
@@ -176,7 +179,7 @@ public class TaskServiceTemplate extends BaseTaskTypePair<TaskServiceTemplate.Ta
...
@@ -176,7 +179,7 @@ public class TaskServiceTemplate extends BaseTaskTypePair<TaskServiceTemplate.Ta
sourceBuilder
.
query
(
boolQueryBuilder
).
size
(
10000
)
sourceBuilder
.
query
(
boolQueryBuilder
).
size
(
10000
)
.
fetchSource
(
new
String
[]
{
"ind_full_text"
,
"mtime"
,
"mtag"
,
"mperson"
,
"url"
,
"id"
},
null
);
.
fetchSource
(
new
String
[]
{
"ind_full_text"
,
"mtime"
,
"mtag"
,
"mperson"
,
"url"
,
"id"
},
null
);
return
esDao
.
afterSearch
(
esIndexes
.
getIndexes
(
Index
.
mark
.
name
()).
toArray
(
new
String
[]{}),
sourceBuilder
,
1000
).
stream
().
map
(
SearchHit:
:
getSourceAsMap
).
collect
(
Collectors
.
toList
());
return
esDao
.
afterSearch
(
esIndexes
.
getIndexes
(
Index
.
mark
2
.
name
()).
toArray
(
new
String
[]{}),
sourceBuilder
,
1000
).
stream
().
map
(
SearchHit:
:
getSourceAsMap
).
collect
(
Collectors
.
toList
());
}
}
/**
/**
...
@@ -197,7 +200,7 @@ public class TaskServiceTemplate extends BaseTaskTypePair<TaskServiceTemplate.Ta
...
@@ -197,7 +200,7 @@ public class TaskServiceTemplate extends BaseTaskTypePair<TaskServiceTemplate.Ta
}
}
long
updateTime
=
templateTitleVo
.
getUpdateTime
().
getTime
();
long
updateTime
=
templateTitleVo
.
getUpdateTime
().
getTime
();
// 移除7天有效期外的数据
// 移除7天有效期外的数据
if
(
System
.
currentTimeMillis
()
-
updateTime
>
ONE_DAY
*
7
*
1000
)
{
if
(
System
.
currentTimeMillis
()
-
updateTime
>
ONE_DAY
*
1000
)
{
log
.
info
(
"{}-移除过期模板标题:{},最后更新时间:{}"
,
group
,
title
,
updateTime
);
log
.
info
(
"{}-移除过期模板标题:{},最后更新时间:{}"
,
group
,
title
,
updateTime
);
templateTitleService
.
deleteTemplate
(
group
,
title
);
templateTitleService
.
deleteTemplate
(
group
,
title
);
return
false
;
return
false
;
...
...
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