Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
72b14c93
提交
72b14c93
authored
5月 09, 2025
作者:
yanxin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/event_fusion' into event_fusion
上级
dd1ad20b
fa3936d3
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
106 行增加
和
17 行删除
+106
-17
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+0
-1
ReportDataController.java
...zsn/event/controller/reportData/ReportDataController.java
+57
-0
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+2
-8
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+24
-0
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+19
-2
SubjectSimpleServiceImpl.java
...com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
+4
-6
没有找到文件。
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
72b14c93
...
@@ -96,7 +96,6 @@ public class InformationController {
...
@@ -96,7 +96,6 @@ public class InformationController {
@GetMapping
(
value
=
"/collectionQueryById"
)
@GetMapping
(
value
=
"/collectionQueryById"
)
public
Result
<?>
collectionQueryById
(
@RequestParam
String
id
,
@RequestParam
String
index
)
{
public
Result
<?>
collectionQueryById
(
@RequestParam
String
id
,
@RequestParam
String
index
)
{
DisplayInfo
info
=
informationService
.
queryInfo
(
1
,
index
,
id
);
DisplayInfo
info
=
informationService
.
queryInfo
(
1
,
index
,
id
);
//todo 浏览记录
return
Result
.
OK
(
info
);
return
Result
.
OK
(
info
);
}
}
...
...
src/main/java/com/zzsn/event/controller/reportData/ReportDataController.java
浏览文件 @
72b14c93
...
@@ -4,8 +4,10 @@ import cn.hutool.json.JSONUtil;
...
@@ -4,8 +4,10 @@ import cn.hutool.json.JSONUtil;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.SysDictItem
;
import
com.zzsn.event.service.CommonService
;
import
com.zzsn.event.service.CommonService
;
import
com.zzsn.event.service.SubjectService
;
import
com.zzsn.event.service.SubjectService
;
import
com.zzsn.event.service.SysDictItemService
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.EsDateUtil
;
import
com.zzsn.event.util.EsDateUtil
;
import
com.zzsn.event.util.EsIndexUtil
;
import
com.zzsn.event.util.EsIndexUtil
;
...
@@ -27,6 +29,8 @@ import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggre
...
@@ -27,6 +29,8 @@ import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggre
import
org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval
;
import
org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval
;
import
org.elasticsearch.search.aggregations.bucket.histogram.Histogram
;
import
org.elasticsearch.search.aggregations.bucket.histogram.Histogram
;
import
org.elasticsearch.search.aggregations.bucket.histogram.ParsedDateHistogram
;
import
org.elasticsearch.search.aggregations.bucket.histogram.ParsedDateHistogram
;
import
org.elasticsearch.search.aggregations.bucket.nested.NestedAggregationBuilder
;
import
org.elasticsearch.search.aggregations.bucket.nested.ParsedNested
;
import
org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude
;
import
org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
...
@@ -56,6 +60,8 @@ public class ReportDataController {
...
@@ -56,6 +60,8 @@ public class ReportDataController {
private
SubjectService
subjectService
;
private
SubjectService
subjectService
;
@Autowired
@Autowired
private
CommonService
commonService
;
private
CommonService
commonService
;
@Autowired
private
SysDictItemService
dictItemService
;
/**
/**
* 检索字段集合
* 检索字段集合
...
@@ -227,6 +233,57 @@ public class ReportDataController {
...
@@ -227,6 +233,57 @@ public class ReportDataController {
}
}
return
Result
.
OK
(
list
);
return
Result
.
OK
(
list
);
}
}
/**
* 标签分析(按标签分组)
*
* @param searchCondition 筛选条件
* @author lkg
* @date 2024/12/26
*/
@PostMapping
(
"/labelAnalysis"
)
public
Result
<?>
labelAnalysis
(
@RequestBody
SearchCondition
searchCondition
)
{
String
composeSearchLabelIds
=
searchCondition
.
getComposeSearchLabelIds
();
if
(
StringUtils
.
isBlank
(
composeSearchLabelIds
))
{
return
Result
.
FAIL
(
"请选择标签"
);
}
List
<
CountVO
>
list
=
new
ArrayList
<>();
String
[]
indexArr
=
getIndex
(
searchCondition
.
getSubjectId
());
SearchRequest
searchRequest
=
new
SearchRequest
(
indexArr
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
searchSourceBuilder
.
trackTotalHits
(
true
);
searchSourceBuilder
.
size
(
0
);
BoolQueryBuilder
boolQuery
=
buildQuery
(
searchCondition
);
searchSourceBuilder
.
query
(
boolQuery
);
String
[]
labelIdArr
=
composeSearchLabelIds
.
replace
(
";"
,
","
).
split
(
","
);
NestedAggregationBuilder
nestedAggregationBuilder
=
AggregationBuilders
.
nested
(
"labels"
,
"labels"
)
.
subAggregation
(
AggregationBuilders
.
terms
(
"groupLabel"
)
.
field
(
"labels.relationId"
)
.
size
(
labelIdArr
.
length
)
.
includeExclude
(
new
IncludeExclude
(
labelIdArr
,
null
)));
searchSourceBuilder
.
aggregation
(
nestedAggregationBuilder
);
searchRequest
.
source
(
searchSourceBuilder
);
try
{
SearchResponse
searchResponse
=
client
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
Aggregations
aggregations
=
searchResponse
.
getAggregations
();
ParsedNested
labels
=
aggregations
.
get
(
"labels"
);
Aggregations
labelsAggregations
=
labels
.
getAggregations
();
Terms
groupTag
=
labelsAggregations
.
get
(
"groupLabel"
);
List
<?
extends
Terms
.
Bucket
>
buckets
=
groupTag
.
getBuckets
();
for
(
Terms
.
Bucket
bucket
:
buckets
)
{
String
key
=
bucket
.
getKeyAsString
();
SysDictItem
byId
=
dictItemService
.
getById
(
key
);
if
(
byId
!=
null
)
{
CountVO
countVO
=
new
CountVO
();
countVO
.
setName
(
byId
.
getItemText
());
countVO
.
setValue
(
bucket
.
getDocCount
());
list
.
add
(
countVO
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
Result
.
OK
(
list
);
}
...
...
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
72b14c93
...
@@ -13,26 +13,20 @@ import com.google.common.base.Charsets;
...
@@ -13,26 +13,20 @@ import com.google.common.base.Charsets;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.entity.SubjectStatisticInfo
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.EsDateUtil
;
import
com.zzsn.event.util.EsIndexUtil
;
import
com.zzsn.event.util.EsOpUtil
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.DisplayInfo
;
import
com.zzsn.event.vo.es.DisplayInfo
;
import
com.zzsn.event.vo.es.Label
;
import
com.zzsn.event.vo.es.Label
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.val
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.lucene.search.join.ScoreMode
;
import
org.apache.lucene.search.join.ScoreMode
;
import
org.elasticsearch.action.get.GetRequest
;
import
org.elasticsearch.action.get.GetRequest
;
import
org.elasticsearch.action.get.GetResponse
;
import
org.elasticsearch.action.get.GetResponse
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.action.update.UpdateRequest
;
import
org.elasticsearch.client.HttpAsyncResponseConsumerFactory
;
import
org.elasticsearch.client.HttpAsyncResponseConsumerFactory
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
...
@@ -40,7 +34,6 @@ import org.elasticsearch.common.text.Text;
...
@@ -40,7 +34,6 @@ import org.elasticsearch.common.text.Text;
import
org.elasticsearch.index.query.*
;
import
org.elasticsearch.index.query.*
;
import
org.elasticsearch.search.SearchHit
;
import
org.elasticsearch.search.SearchHit
;
import
org.elasticsearch.search.SearchHits
;
import
org.elasticsearch.search.SearchHits
;
import
org.elasticsearch.search.aggregations.Aggregation
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.Aggregations
;
import
org.elasticsearch.search.aggregations.Aggregations
;
import
org.elasticsearch.search.aggregations.BucketOrder
;
import
org.elasticsearch.search.aggregations.BucketOrder
;
...
@@ -2771,6 +2764,7 @@ public class EsService {
...
@@ -2771,6 +2764,7 @@ public class EsService {
public
void
updateLabelsById
(
String
index
,
String
id
,
List
<
Label
>
labels
)
{
public
void
updateLabelsById
(
String
index
,
String
id
,
List
<
Label
>
labels
)
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"labels"
,
labels
);
jsonObject
.
put
(
"labels"
,
labels
);
jsonObject
.
put
(
"updateDate"
,
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
esOpUtil
.
docUpdateById
(
index
,
id
,
jsonObject
.
toString
());
esOpUtil
.
docUpdateById
(
index
,
id
,
jsonObject
.
toString
());
}
}
}
}
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
72b14c93
...
@@ -438,6 +438,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -438,6 +438,7 @@ public class InformationServiceImpl implements InformationService {
labels
.
add
(
dataSet
);
labels
.
add
(
dataSet
);
}
}
information
.
setLabels
(
labels
);
information
.
setLabels
(
labels
);
information
.
setUpdateDate
(
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
if
(
map
.
containsKey
(
index
))
{
if
(
map
.
containsKey
(
index
))
{
map
.
get
(
index
).
add
(
information
);
map
.
get
(
index
).
add
(
information
);
}
else
{
}
else
{
...
@@ -462,6 +463,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -462,6 +463,7 @@ public class InformationServiceImpl implements InformationService {
}
}
}
}
information
.
setLabels
(
newLabels
);
information
.
setLabels
(
newLabels
);
information
.
setUpdateDate
(
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
if
(
map
.
containsKey
(
index
))
{
if
(
map
.
containsKey
(
index
))
{
map
.
get
(
index
).
add
(
information
);
map
.
get
(
index
).
add
(
information
);
}
else
{
}
else
{
...
@@ -841,6 +843,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -841,6 +843,7 @@ public class InformationServiceImpl implements InformationService {
int
topNum
=
esService
.
getTopNum
(
index
,
subjectInfoVo
.
getSubjectId
());
int
topNum
=
esService
.
getTopNum
(
index
,
subjectInfoVo
.
getSubjectId
());
updateFields
.
put
(
"topNum"
,
topNum
+
1
);
updateFields
.
put
(
"topNum"
,
topNum
+
1
);
}
}
updateFields
.
put
(
"updateDate"
,
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
esOpUtil
.
updateById
(
index
,
id
,
updateFields
);
esOpUtil
.
updateById
(
index
,
id
,
updateFields
);
//发送 人工操作 日志
//发送 人工操作 日志
CompletableFuture
.
runAsync
(()
->
{
CompletableFuture
.
runAsync
(()
->
{
...
@@ -1080,6 +1083,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1080,6 +1083,7 @@ public class InformationServiceImpl implements InformationService {
}
}
}
}
specialInformation
.
setLabels
(
newLabels
);
specialInformation
.
setLabels
(
newLabels
);
specialInformation
.
setUpdateDate
(
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
dataList
.
add
(
specialInformation
);
dataList
.
add
(
specialInformation
);
}
}
}
else
{
}
else
{
...
@@ -1193,6 +1197,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1193,6 +1197,7 @@ public class InformationServiceImpl implements InformationService {
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
modifyParams
.
put
(
"checkStatus"
,
1
);
modifyParams
.
put
(
"checkStatus"
,
1
);
modifyParams
.
put
(
"deleteFlag"
,
0
);
modifyParams
.
put
(
"deleteFlag"
,
0
);
modifyParams
.
put
(
"updateDate"
,
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
log
.
info
(
"添加到精选,耗时:{}"
,
System
.
currentTimeMillis
()-
start
);
log
.
info
(
"添加到精选,耗时:{}"
,
System
.
currentTimeMillis
()-
start
);
...
@@ -1214,6 +1219,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1214,6 +1219,7 @@ public class InformationServiceImpl implements InformationService {
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
modifyParams
.
put
(
"checkStatus"
,
3
);
modifyParams
.
put
(
"checkStatus"
,
3
);
modifyParams
.
put
(
"deleteFlag"
,
0
);
modifyParams
.
put
(
"deleteFlag"
,
0
);
modifyParams
.
put
(
"updateDate"
,
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
log
.
info
(
"添加到待定,耗时:{}"
,
System
.
currentTimeMillis
()-
start
);
log
.
info
(
"添加到待定,耗时:{}"
,
System
.
currentTimeMillis
()-
start
);
...
@@ -1234,6 +1240,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1234,6 +1240,7 @@ public class InformationServiceImpl implements InformationService {
}
}
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
modifyParams
.
put
(
"deleteFlag"
,
1
);
modifyParams
.
put
(
"deleteFlag"
,
1
);
modifyParams
.
put
(
"updateDate"
,
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
log
.
info
(
"添加到删除,耗时:{}"
,
System
.
currentTimeMillis
()-
start
);
log
.
info
(
"添加到删除,耗时:{}"
,
System
.
currentTimeMillis
()-
start
);
...
@@ -1249,6 +1256,7 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1249,6 +1256,7 @@ public class InformationServiceImpl implements InformationService {
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
modifyParams
.
put
(
"checkStatus"
,
0
);
modifyParams
.
put
(
"checkStatus"
,
0
);
modifyParams
.
put
(
"deleteFlag"
,
0
);
modifyParams
.
put
(
"deleteFlag"
,
0
);
modifyParams
.
put
(
"updateDate"
,
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
log
.
info
(
"初始化数据,耗时:{}"
,
System
.
currentTimeMillis
()-
start
);
log
.
info
(
"初始化数据,耗时:{}"
,
System
.
currentTimeMillis
()-
start
);
...
@@ -1289,6 +1297,14 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1289,6 +1297,14 @@ public class InformationServiceImpl implements InformationService {
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
esOpUtil
.
batchReplaceScript
(
indexArr
,
buildQuery
,
modifyFields
,
oldWord
,
newWord
);
esOpUtil
.
batchReplaceScript
(
indexArr
,
buildQuery
,
modifyFields
,
oldWord
,
newWord
);
log
.
info
(
"字符串替换-{},耗时:{}"
,
oldWord
,
System
.
currentTimeMillis
()-
start
);
log
.
info
(
"字符串替换-{},耗时:{}"
,
oldWord
,
System
.
currentTimeMillis
()-
start
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
modifyParams
.
put
(
"updateDate"
,
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
}
}
@Override
@Override
...
@@ -1316,6 +1332,14 @@ public class InformationServiceImpl implements InformationService {
...
@@ -1316,6 +1332,14 @@ public class InformationServiceImpl implements InformationService {
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
Map
<
String
,
Object
>
modifyParams
=
new
HashMap
<>();
modifyParams
.
put
(
"updateDate"
,
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
esOpUtil
.
batchUpdateScript
(
indexArr
,
buildQuery
,
modifyParams
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
...
...
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
72b14c93
...
@@ -212,13 +212,29 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
...
@@ -212,13 +212,29 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
List
<
StatisticVO
>
unCheckNumList
=
esService
.
subjectStatisticInfo
(
subjectIds
,
0
,
null
);
List
<
StatisticVO
>
unCheckNumList
=
esService
.
subjectStatisticInfo
(
subjectIds
,
0
,
null
);
Map
<
String
,
StatisticVO
>
unCheckNumMap
=
unCheckNumList
.
stream
().
collect
(
Collectors
.
toMap
(
StatisticVO:
:
getSubjectId
,
e
->
e
));
Map
<
String
,
StatisticVO
>
unCheckNumMap
=
unCheckNumList
.
stream
().
collect
(
Collectors
.
toMap
(
StatisticVO:
:
getSubjectId
,
e
->
e
));
//绑定全部信息源的专题
Map
<
String
,
Integer
>
infoSourceNumMap
=
new
HashMap
<>();
List
<
Subject
>
subjects
=
baseMapper
.
selectBatchIds
(
subjectIds
);
Optional
<
Subject
>
any
=
subjects
.
stream
().
filter
(
f
->
StrUtil
.
isNotBlank
(
f
.
getDataScope
())).
findAny
();
if
(
any
.
isPresent
())
{
int
count
=
infoSourceService
.
count
();
subjects
.
forEach
(
e
->
{
if
(
StrUtil
.
isNotBlank
(
e
.
getDataScope
())
&&
e
.
getDataScope
().
contains
(
"1"
))
{
infoSourceNumMap
.
put
(
e
.
getId
(),
count
);
}
});
}
for
(
String
subjectId
:
subjectIds
)
{
for
(
String
subjectId
:
subjectIds
)
{
SubjectStatisticInfo
subjectStatisticInfo
=
new
SubjectStatisticInfo
();
SubjectStatisticInfo
subjectStatisticInfo
=
new
SubjectStatisticInfo
();
subjectStatisticInfo
.
setSubjectId
(
subjectId
);
subjectStatisticInfo
.
setSubjectId
(
subjectId
);
subjectStatisticInfo
.
setTotalNum
(
totalAndLatestDateMap
.
get
(
subjectId
).
getCount
());
subjectStatisticInfo
.
setTotalNum
(
totalAndLatestDateMap
.
get
(
subjectId
).
getCount
());
subjectStatisticInfo
.
setLatestDataDate
(
totalAndLatestDateMap
.
get
(
subjectId
).
getPublishDate
());
subjectStatisticInfo
.
setLatestDataDate
(
totalAndLatestDateMap
.
get
(
subjectId
).
getPublishDate
());
subjectStatisticInfo
.
setUnCheckNum
(
unCheckNumMap
.
get
(
subjectId
).
getCount
());
subjectStatisticInfo
.
setUnCheckNum
(
unCheckNumMap
.
get
(
subjectId
).
getCount
());
subjectStatisticInfo
.
setBindSourceNum
(
sourceCountMap
.
get
(
subjectId
)
==
null
?
0
:
sourceCountMap
.
get
(
subjectId
));
if
(
infoSourceNumMap
.
containsKey
(
subjectId
))
{
subjectStatisticInfo
.
setBindSourceNum
(
infoSourceNumMap
.
get
(
subjectId
));
}
else
{
subjectStatisticInfo
.
setBindSourceNum
(
sourceCountMap
.
get
(
subjectId
)
==
null
?
0
:
sourceCountMap
.
get
(
subjectId
));
}
subjectStatisticInfo
.
setBindKeywordNum
(
keyWordsNumMap
.
get
(
subjectId
)
==
null
?
0
:
keyWordsNumMap
.
get
(
subjectId
));
subjectStatisticInfo
.
setBindKeywordNum
(
keyWordsNumMap
.
get
(
subjectId
)
==
null
?
0
:
keyWordsNumMap
.
get
(
subjectId
));
list
.
add
(
subjectStatisticInfo
);
list
.
add
(
subjectStatisticInfo
);
}
}
...
@@ -785,8 +801,9 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
...
@@ -785,8 +801,9 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
String
format
=
date
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
format
=
date
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
dateList
.
add
(
format
);
dateList
.
add
(
format
);
}
}
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_SUBJECT_DATE_QUEUE
+
subject
.
getSubjectCode
(),
"noPublishDate"
);
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_SUBJECT_DATE_QUEUE
+
subject
.
getSubjectCode
(),
dateList
.
toArray
(
new
String
[
0
]));
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_SUBJECT_DATE_QUEUE
+
subject
.
getSubjectCode
(),
dateList
.
toArray
(
new
String
[
0
]));
redisUtil
.
rpushMultipleValues
(
Constants
.
HISTORY_SUBJECT_DATE_QUEUE
+
subject
.
getSubjectCode
(),
"noPublishDate"
);
}
}
/**
/**
...
...
src/main/java/com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
浏览文件 @
72b14c93
...
@@ -10,13 +10,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...
@@ -10,13 +10,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.enums.CodePrefixEnum
;
import
com.zzsn.event.enums.CodePrefixEnum
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.feign.api.RemoteModelService
;
import
com.zzsn.event.feign.api.RemoteModelService
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.CodeGenerateUtil
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.CronUtil
;
import
com.zzsn.event.util.EsOpUtil
;
import
com.zzsn.event.util.PythonUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
...
@@ -30,7 +26,6 @@ import org.elasticsearch.index.query.QueryBuilders;
...
@@ -30,7 +26,6 @@ import org.elasticsearch.index.query.QueryBuilders;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -464,6 +459,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -464,6 +459,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
}
}
}
}
information
.
setLabels
(
labels
);
information
.
setLabels
(
labels
);
information
.
setUpdateDate
(
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
}
}
if
(
updateMap
.
containsKey
(
index
))
{
if
(
updateMap
.
containsKey
(
index
))
{
updateMap
.
get
(
index
).
add
(
information
);
updateMap
.
get
(
index
).
add
(
information
);
...
@@ -485,6 +481,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -485,6 +481,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
for
(
SpecialInformation
information
:
informationList
)
{
for
(
SpecialInformation
information
:
informationList
)
{
String
index
=
information
.
getDbIndex
();
String
index
=
information
.
getDbIndex
();
information
.
setCheckStatus
(
0
);
information
.
setCheckStatus
(
0
);
information
.
setUpdateDate
(
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
if
(
updateMap
.
containsKey
(
index
))
{
if
(
updateMap
.
containsKey
(
index
))
{
updateMap
.
get
(
index
).
add
(
information
);
updateMap
.
get
(
index
).
add
(
information
);
}
else
{
}
else
{
...
@@ -505,6 +502,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -505,6 +502,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
for
(
SpecialInformation
information
:
informationList
)
{
for
(
SpecialInformation
information
:
informationList
)
{
String
index
=
information
.
getDbIndex
();
String
index
=
information
.
getDbIndex
();
information
.
setDeleteFlag
(
1
);
information
.
setDeleteFlag
(
1
);
information
.
setUpdateDate
(
EsDateUtil
.
esFieldDateFormat
(
DateUtils
.
formatDateTime
()));
if
(
updateMap
.
containsKey
(
index
))
{
if
(
updateMap
.
containsKey
(
index
))
{
updateMap
.
get
(
index
).
add
(
information
);
updateMap
.
get
(
index
).
add
(
information
);
}
else
{
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论