Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
d7cc7ba7
提交
d7cc7ba7
authored
1月 13, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
专题创建逻辑完善以及bug修改
上级
5ad50710
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
233 行增加
和
71 行删除
+233
-71
StatisticalAnalysisController.java
...vent/controller/common/StatisticalAnalysisController.java
+25
-41
ClbModelArrangeSubjectMap.java
...java/com/zzsn/event/entity/ClbModelArrangeSubjectMap.java
+76
-0
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+0
-0
ClbModelArrangeSubjectMapMapper.java
...om/zzsn/event/mapper/ClbModelArrangeSubjectMapMapper.java
+15
-0
SubjectMapper.xml
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
+3
-0
ClbModelArrangeSubjectMapService.java
.../zzsn/event/service/ClbModelArrangeSubjectMapService.java
+13
-0
SysDictItemService.java
src/main/java/com/zzsn/event/service/SysDictItemService.java
+11
-0
ClbModelArrangeSubjectMapServiceImpl.java
...nt/service/impl/ClbModelArrangeSubjectMapServiceImpl.java
+17
-0
EsStatisticsServiceImpl.java
.../com/zzsn/event/service/impl/EsStatisticsServiceImpl.java
+7
-6
EventServiceImpl.java
...in/java/com/zzsn/event/service/impl/EventServiceImpl.java
+3
-6
SubjectServiceImpl.java
.../java/com/zzsn/event/service/impl/SubjectServiceImpl.java
+4
-0
SubjectSimpleServiceImpl.java
...com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
+17
-12
SysDictItemServiceImpl.java
...a/com/zzsn/event/service/impl/SysDictItemServiceImpl.java
+36
-0
SubjectPage.java
src/main/java/com/zzsn/event/vo/SubjectPage.java
+6
-6
没有找到文件。
src/main/java/com/zzsn/event/controller/common/StatisticalAnalysisController.java
浏览文件 @
d7cc7ba7
...
@@ -103,10 +103,13 @@ public class StatisticalAnalysisController {
...
@@ -103,10 +103,13 @@ public class StatisticalAnalysisController {
@PostMapping
(
"/dataTrend"
)
@PostMapping
(
"/dataTrend"
)
public
Result
<
List
<
CountVO
>>
dataTrend
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
public
Result
<
List
<
CountVO
>>
dataTrend
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
List
<
SysDictItem
>
dictItemList
=
sysDictItemService
.
listByDictCode
(
"Thematic_Library"
);
List
<
String
>
includeValues
=
dictItemList
.
stream
().
map
(
SysDictItem:
:
getItemValue
).
collect
(
Collectors
.
toList
());
searchCondition
.
setIncludeValues
(
includeValues
.
toArray
(
new
String
[
0
]));
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
dataList
=
esService
.
groupByDate
(
searchCondition
);
dataList
=
esService
.
groupByDate
(
searchCondition
);
}
else
{
}
else
{
String
[]
fetchFields
=
new
String
[]{
"id"
,
"publishDate"
};
String
[]
fetchFields
=
new
String
[]{
"id"
,
"
classificationType"
,
"
publishDate"
};
searchCondition
.
setFetchFields
(
fetchFields
);
searchCondition
.
setFetchFields
(
fetchFields
);
List
<
SpecialInformation
>
informationList
=
esService
.
informationList
(
searchCondition
);
List
<
SpecialInformation
>
informationList
=
esService
.
informationList
(
searchCondition
);
String
groupType
=
searchCondition
.
getGroupType
();
String
groupType
=
searchCondition
.
getGroupType
();
...
@@ -127,11 +130,26 @@ public class StatisticalAnalysisController {
...
@@ -127,11 +130,26 @@ public class StatisticalAnalysisController {
for
(
Map
.
Entry
<
String
,
List
<
SpecialInformation
>>
entry
:
dateMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
SpecialInformation
>>
entry
:
dateMap
.
entrySet
())
{
CountVO
countVO
=
new
CountVO
();
CountVO
countVO
=
new
CountVO
();
countVO
.
setName
(
entry
.
getKey
());
countVO
.
setName
(
entry
.
getKey
());
countVO
.
setValue
((
long
)
entry
.
getValue
().
size
());
List
<
SpecialInformation
>
value
=
entry
.
getValue
();
countVO
.
setValue
((
long
)
value
.
size
());
List
<
CountVO
>
children
=
new
ArrayList
<>();
Map
<
Integer
,
List
<
SpecialInformation
>>
typeMap
=
value
.
stream
().
collect
(
Collectors
.
groupingBy
(
SpecialInformation:
:
getClassificationType
));
for
(
Map
.
Entry
<
Integer
,
List
<
SpecialInformation
>>
typeEntry
:
typeMap
.
entrySet
())
{
CountVO
typeCountVO
=
new
CountVO
();
typeCountVO
.
setName
(
typeEntry
.
getKey
().
toString
());
typeCountVO
.
setValue
((
long
)
typeEntry
.
getValue
().
size
());
children
.
add
(
typeCountVO
);
}
countVO
.
setChildren
(
children
);
dataList
.
add
(
countVO
);
dataList
.
add
(
countVO
);
}
}
}
}
}
}
for
(
CountVO
countVO
:
dataList
)
{
List
<
CountVO
>
children
=
countVO
.
getChildren
();
sysDictItemService
.
changeKey
(
children
,
dictItemList
);
}
return
Result
.
OK
(
dataList
);
return
Result
.
OK
(
dataList
);
}
}
...
@@ -145,6 +163,9 @@ public class StatisticalAnalysisController {
...
@@ -145,6 +163,9 @@ public class StatisticalAnalysisController {
@PostMapping
(
"/dataType/distribution"
)
@PostMapping
(
"/dataType/distribution"
)
public
Result
<?>
dataTypeDistribution
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
public
Result
<?>
dataTypeDistribution
(
@RequestBody
InfoDataSearchCondition
searchCondition
)
{
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
List
<
CountVO
>
dataList
=
new
ArrayList
<>();
List
<
SysDictItem
>
dictItemList
=
sysDictItemService
.
listByDictCode
(
"Thematic_Library"
);
List
<
String
>
includeValues
=
dictItemList
.
stream
().
map
(
SysDictItem:
:
getItemValue
).
collect
(
Collectors
.
toList
());
searchCondition
.
setIncludeValues
(
includeValues
.
toArray
(
new
String
[
0
]));
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
if
(
CollectionUtils
.
isEmpty
(
searchCondition
.
getIds
())
&&
searchCondition
.
getNum
()
==
null
)
{
dataList
=
esService
.
groupByClassificationType
(
searchCondition
);
dataList
=
esService
.
groupByClassificationType
(
searchCondition
);
}
else
{
}
else
{
...
@@ -159,7 +180,8 @@ public class StatisticalAnalysisController {
...
@@ -159,7 +180,8 @@ public class StatisticalAnalysisController {
dataList
.
add
(
countVO
);
dataList
.
add
(
countVO
);
}
}
}
}
changeKey
(
dataList
,
"Thematic_Library"
);
sysDictItemService
.
changeKey
(
dataList
,
dictItemList
);
return
Result
.
OK
(
dataList
);
return
Result
.
OK
(
dataList
);
}
}
...
@@ -271,44 +293,6 @@ public class StatisticalAnalysisController {
...
@@ -271,44 +293,6 @@ public class StatisticalAnalysisController {
}
}
/**
/**
* 改变key值(字典值码转为字典值)
*
* @param dataList 统计数据
* @param dictCode 字典编码
* @author lkg
* @date 2024/12/30
*/
private
void
changeKey
(
List
<
CountVO
>
dataList
,
String
dictCode
)
{
List
<
SysDictItem
>
dictItemList
=
sysDictItemService
.
listByDictCode
(
dictCode
);
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
Map
<
String
,
List
<
SysDictItem
>>
map
=
dictItemList
.
stream
().
collect
(
Collectors
.
groupingBy
(
SysDictItem:
:
getItemValue
));
for
(
CountVO
countVO
:
dataList
)
{
String
name
=
countVO
.
getName
();
List
<
SysDictItem
>
sysDictItemList
=
map
.
get
(
name
);
if
(
CollectionUtils
.
isNotEmpty
(
sysDictItemList
))
{
countVO
.
setName
(
sysDictItemList
.
get
(
0
).
getItemText
());
map
.
remove
(
name
);
}
}
if
(
MapUtils
.
isNotEmpty
(
map
))
{
dataList
.
addAll
(
map
.
values
().
stream
().
map
(
e
->
{
CountVO
countVO
=
new
CountVO
();
countVO
.
setName
(
e
.
get
(
0
).
getItemText
());
countVO
.
setValue
(
0L
);
return
countVO
;
}).
collect
(
Collectors
.
toList
()));
}
}
else
{
for
(
SysDictItem
sysDictItem
:
dictItemList
)
{
CountVO
countVO
=
new
CountVO
();
countVO
.
setName
(
sysDictItem
.
getItemText
());
countVO
.
setValue
(
0L
);
dataList
.
add
(
countVO
);
}
}
}
/**
* 绑定的标签信息
* 绑定的标签信息
*
*
* @param subjectId 专题id
* @param subjectId 专题id
...
...
src/main/java/com/zzsn/event/entity/ClbModelArrangeSubjectMap.java
0 → 100644
浏览文件 @
d7cc7ba7
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 流程编排-专题关联
*
* @author lkg
* @date 2025/1/13
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"clb_model_arrange_subject_map"
)
public
class
ClbModelArrangeSubjectMap
{
/**
* 主键id
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**
* 专题id
*/
@TableField
(
"subject_id"
)
private
String
subjectId
;
/**
* 流程id
*/
@TableField
(
"arrange_id"
)
private
String
arrangeId
;
/**
* 匹配类型 信息源、定向信息源、企业库等
*/
@TableField
(
"type"
)
private
String
type
;
/**
* 创建人
*/
@TableField
(
"create_by"
)
private
String
createBy
;
/**
* 删除标志 0-正常 1-删除
*/
@TableField
(
"del_flag"
)
private
Integer
delFlag
;
/**
* 创建日期
*/
@TableField
(
"create_time"
)
private
Date
createTime
;
/**
* 更新人
*/
@TableField
(
"update_by"
)
private
String
updateBy
;
/**
* 更新日期
*/
@TableField
(
"update_time"
)
private
Date
updateTime
;
}
src/main/java/com/zzsn/event/es/EsService.java
浏览文件 @
d7cc7ba7
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/mapper/ClbModelArrangeSubjectMapMapper.java
0 → 100644
浏览文件 @
d7cc7ba7
package
com
.
zzsn
.
event
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.ClbModelArrangeSubjectMap
;
import
org.apache.ibatis.annotations.Mapper
;
/**
*
*
* @author lkg
* @date 2025/1/13
*/
@Mapper
public
interface
ClbModelArrangeSubjectMapMapper
extends
BaseMapper
<
ClbModelArrangeSubjectMap
>
{
}
src/main/java/com/zzsn/event/mapper/xml/SubjectMapper.xml
浏览文件 @
d7cc7ba7
...
@@ -107,6 +107,9 @@
...
@@ -107,6 +107,9 @@
<if
test=
"subjectCondition.status!=null"
>
<if
test=
"subjectCondition.status!=null"
>
and d.status = #{subjectCondition.status}
and d.status = #{subjectCondition.status}
</if>
</if>
<if
test=
"subjectCondition.username!=null and subjectCondition.username != ''"
>
and d.create_by = #{subjectCondition.username}
</if>
order by d.create_time desc
order by d.create_time desc
</select>
</select>
...
...
src/main/java/com/zzsn/event/service/ClbModelArrangeSubjectMapService.java
0 → 100644
浏览文件 @
d7cc7ba7
package
com
.
zzsn
.
event
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.ClbModelArrangeSubjectMap
;
/**
*
*
* @author lkg
* @date 2025/1/13
*/
public
interface
ClbModelArrangeSubjectMapService
extends
IService
<
ClbModelArrangeSubjectMap
>
{
}
src/main/java/com/zzsn/event/service/SysDictItemService.java
浏览文件 @
d7cc7ba7
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service;
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.SysDictItem
;
import
com.zzsn.event.entity.SysDictItem
;
import
com.zzsn.event.vo.CountVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -16,4 +17,14 @@ import java.util.List;
...
@@ -16,4 +17,14 @@ import java.util.List;
public
interface
SysDictItemService
extends
IService
<
SysDictItem
>
{
public
interface
SysDictItemService
extends
IService
<
SysDictItem
>
{
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
);
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
);
/**
* 改变key值(字典值码转为字典值)
*
* @param dataList 统计数据
* @param dictItemList 字典值信息
* @author lkg
* @date 2024/12/30
*/
void
changeKey
(
List
<
CountVO
>
dataList
,
List
<
SysDictItem
>
dictItemList
);
}
}
src/main/java/com/zzsn/event/service/impl/ClbModelArrangeSubjectMapServiceImpl.java
0 → 100644
浏览文件 @
d7cc7ba7
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.ClbModelArrangeSubjectMap
;
import
com.zzsn.event.mapper.ClbModelArrangeSubjectMapMapper
;
import
com.zzsn.event.service.ClbModelArrangeSubjectMapService
;
import
org.springframework.stereotype.Service
;
/**
*
*
* @author lkg
* @date 2025/1/13
*/
@Service
public
class
ClbModelArrangeSubjectMapServiceImpl
extends
ServiceImpl
<
ClbModelArrangeSubjectMapMapper
,
ClbModelArrangeSubjectMap
>
implements
ClbModelArrangeSubjectMapService
{
}
src/main/java/com/zzsn/event/service/impl/EsStatisticsServiceImpl.java
浏览文件 @
d7cc7ba7
...
@@ -6,6 +6,7 @@ import com.zzsn.event.service.EsStatisticsService;
...
@@ -6,6 +6,7 @@ import com.zzsn.event.service.EsStatisticsService;
import
com.zzsn.event.service.LabelEntityService
;
import
com.zzsn.event.service.LabelEntityService
;
import
com.zzsn.event.util.CalculateUtil
;
import
com.zzsn.event.util.CalculateUtil
;
import
com.zzsn.event.util.EsDateUtil
;
import
com.zzsn.event.util.EsDateUtil
;
import
com.zzsn.event.util.EsIndexUtil
;
import
com.zzsn.event.vo.CountVO
;
import
com.zzsn.event.vo.CountVO
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -54,7 +55,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
...
@@ -54,7 +55,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
long
totalCount
=
0L
;
long
totalCount
=
0L
;
long
max
=
0L
;
long
max
=
0L
;
String
maxTime
=
null
;
String
maxTime
=
null
;
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchRequest
searchRequest
=
new
SearchRequest
(
EsIndexUtil
.
getIndexYear
(
Constants
.
SUBJECT_INDEX
)
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
null
,
startTime
,
endTime
,
false
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
null
,
startTime
,
endTime
,
false
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
trackTotalHits
(
true
);
searchSourceBuilder
.
trackTotalHits
(
true
);
...
@@ -102,7 +103,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
...
@@ -102,7 +103,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
CountVO
countVO
=
new
CountVO
();
CountVO
countVO
=
new
CountVO
();
countVO
.
setName
(
name
);
countVO
.
setName
(
name
);
long
count
=
0L
;
long
count
=
0L
;
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchRequest
searchRequest
=
new
SearchRequest
(
EsIndexUtil
.
getIndexYear
(
Constants
.
SUBJECT_INDEX
)
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
labelId
,
startTime
,
endTime
,
false
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
labelId
,
startTime
,
endTime
,
false
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
trackTotalHits
(
true
);
searchSourceBuilder
.
trackTotalHits
(
true
);
...
@@ -132,7 +133,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
...
@@ -132,7 +133,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
LabelEntity
labelEntity
=
labelEntityService
.
getById
(
labelId
);
LabelEntity
labelEntity
=
labelEntityService
.
getById
(
labelId
);
countVO
.
setLabelId
(
labelEntity
.
getId
());
countVO
.
setLabelId
(
labelEntity
.
getId
());
countVO
.
setName
(
labelEntity
.
getName
());
countVO
.
setName
(
labelEntity
.
getName
());
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchRequest
searchRequest
=
new
SearchRequest
(
EsIndexUtil
.
getIndexYear
(
Constants
.
SUBJECT_INDEX
)
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
labelId
,
startTime
,
endTime
,
false
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
labelId
,
startTime
,
endTime
,
false
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
trackTotalHits
(
true
);
searchSourceBuilder
.
trackTotalHits
(
true
);
...
@@ -171,7 +172,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
...
@@ -171,7 +172,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
@Override
@Override
public
List
<
CountVO
>
origin
(
String
subjectId
,
String
startTime
,
String
endTime
)
{
public
List
<
CountVO
>
origin
(
String
subjectId
,
String
startTime
,
String
endTime
)
{
List
<
CountVO
>
list
=
new
ArrayList
<>();
List
<
CountVO
>
list
=
new
ArrayList
<>();
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchRequest
searchRequest
=
new
SearchRequest
(
EsIndexUtil
.
getIndexYear
(
Constants
.
SUBJECT_INDEX
)
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
null
,
startTime
,
endTime
,
true
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
null
,
startTime
,
endTime
,
true
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
trackTotalHits
(
true
);
searchSourceBuilder
.
trackTotalHits
(
true
);
...
@@ -322,7 +323,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
...
@@ -322,7 +323,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
@Override
@Override
public
List
<
CountVO
>
flowData
(
String
subjectId
,
String
startTime
,
String
endTime
,
Integer
type
)
{
public
List
<
CountVO
>
flowData
(
String
subjectId
,
String
startTime
,
String
endTime
,
Integer
type
)
{
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchRequest
searchRequest
=
new
SearchRequest
(
EsIndexUtil
.
getIndexYear
(
Constants
.
SUBJECT_INDEX
)
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
null
,
startTime
,
endTime
,
false
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
subjectId
,
null
,
startTime
,
endTime
,
false
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
trackTotalHits
(
true
);
searchSourceBuilder
.
trackTotalHits
(
true
);
...
@@ -358,7 +359,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
...
@@ -358,7 +359,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
@Override
@Override
public
long
totalCount
(
List
<
String
>
eventIdList
,
String
startTime
,
String
endTime
)
{
public
long
totalCount
(
List
<
String
>
eventIdList
,
String
startTime
,
String
endTime
)
{
long
count
=
0
;
long
count
=
0
;
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchRequest
searchRequest
=
new
SearchRequest
(
EsIndexUtil
.
getIndexYear
(
Constants
.
SUBJECT_INDEX
)
);
String
eventIds
=
String
.
join
(
","
,
eventIdList
);
String
eventIds
=
String
.
join
(
","
,
eventIdList
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
eventIds
,
null
,
startTime
,
endTime
,
false
);
SearchSourceBuilder
searchSourceBuilder
=
formatSourceBuilder
(
eventIds
,
null
,
startTime
,
endTime
,
false
);
searchSourceBuilder
.
size
(
0
);
searchSourceBuilder
.
size
(
0
);
...
...
src/main/java/com/zzsn/event/service/impl/EventServiceImpl.java
浏览文件 @
d7cc7ba7
...
@@ -12,10 +12,7 @@ import com.zzsn.event.enums.CodePrefixEnum;
...
@@ -12,10 +12,7 @@ import com.zzsn.event.enums.CodePrefixEnum;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.mapper.EventMapper
;
import
com.zzsn.event.mapper.EventMapper
;
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.DateUtil
;
import
com.zzsn.event.util.HanlpUtil
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.tree.TreeUtil
;
import
com.zzsn.event.util.tree.TreeUtil
;
import
com.zzsn.event.util.user.UserUtil
;
import
com.zzsn.event.util.user.UserUtil
;
...
@@ -239,7 +236,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -239,7 +236,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
List
<
String
>
eventIdList
=
new
ArrayList
<>();
List
<
String
>
eventIdList
=
new
ArrayList
<>();
pageList
.
forEach
(
e
->
eventIdList
.
add
(
e
.
getId
()));
pageList
.
forEach
(
e
->
eventIdList
.
add
(
e
.
getId
()));
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchRequest
searchRequest
=
new
SearchRequest
(
EsIndexUtil
.
getIndexYear
(
Constants
.
SUBJECT_INDEX
)
);
//根据设备查询设备的相关信息
//根据设备查询设备的相关信息
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
searchSourceBuilder
.
from
(
0
);
searchSourceBuilder
.
from
(
0
);
...
@@ -472,7 +469,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -472,7 +469,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
//查询每个专题的数量
//查询每个专题的数量
private
Map
<
String
,
Integer
>
subjectInfoCountMap
(
List
<
String
>
subjectIdList
,
List
<
Integer
>
checkStatusList
)
{
private
Map
<
String
,
Integer
>
subjectInfoCountMap
(
List
<
String
>
subjectIdList
,
List
<
Integer
>
checkStatusList
)
{
Map
<
String
,
Integer
>
map
=
new
HashMap
<>(
subjectIdList
.
size
());
Map
<
String
,
Integer
>
map
=
new
HashMap
<>(
subjectIdList
.
size
());
SearchRequest
searchRequest
=
new
SearchRequest
(
Constants
.
SUBJECT_INDEX
);
SearchRequest
searchRequest
=
new
SearchRequest
(
EsIndexUtil
.
getIndexYear
(
Constants
.
SUBJECT_INDEX
)
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
//默认最大数量是10000,设置为true后,显示准确数量
//默认最大数量是10000,设置为true后,显示准确数量
searchSourceBuilder
.
trackTotalHits
(
true
);
searchSourceBuilder
.
trackTotalHits
(
true
);
...
...
src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
浏览文件 @
d7cc7ba7
...
@@ -81,6 +81,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
...
@@ -81,6 +81,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
private
ClbSubjectModelDetailTaskService
subjectModelDetailTaskService
;
private
ClbSubjectModelDetailTaskService
subjectModelDetailTaskService
;
@Autowired
@Autowired
private
IAlgorithmModelService
modelService
;
private
IAlgorithmModelService
modelService
;
@Autowired
private
ClbModelArrangeSubjectMapService
clbModelArrangeSubjectMapService
;
@Value
(
"${python.subjectProcessorUrl}"
)
@Value
(
"${python.subjectProcessorUrl}"
)
...
@@ -231,6 +233,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
...
@@ -231,6 +233,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
subjectModelMapService
.
remove
(
Wrappers
.<
SubjectModelMap
>
lambdaQuery
().
eq
(
SubjectModelMap:
:
getSubjectId
,
subjectId
));
subjectModelMapService
.
remove
(
Wrappers
.<
SubjectModelMap
>
lambdaQuery
().
eq
(
SubjectModelMap:
:
getSubjectId
,
subjectId
));
//删除事件-搜索引擎关系
//删除事件-搜索引擎关系
subjectSearchEnginesMapService
.
remove
(
Wrappers
.<
SubjectSearchEnginesMap
>
lambdaQuery
().
eq
(
SubjectSearchEnginesMap:
:
getSubjectId
,
subjectId
));
subjectSearchEnginesMapService
.
remove
(
Wrappers
.<
SubjectSearchEnginesMap
>
lambdaQuery
().
eq
(
SubjectSearchEnginesMap:
:
getSubjectId
,
subjectId
));
//删除专题/事件-tpu流程关系
clbModelArrangeSubjectMapService
.
remove
(
Wrappers
.<
ClbModelArrangeSubjectMap
>
lambdaQuery
().
eq
(
ClbModelArrangeSubjectMap:
:
getSubjectId
,
subjectId
));
//向python发送消息结束
//向python发送消息结束
send
(
subjectId
,
"-1"
);
send
(
subjectId
,
"-1"
);
});
});
...
...
src/main/java/com/zzsn/event/service/impl/SubjectSimpleServiceImpl.java
浏览文件 @
d7cc7ba7
...
@@ -4,10 +4,7 @@ import com.alibaba.fastjson2.JSON;
...
@@ -4,10 +4,7 @@ import com.alibaba.fastjson2.JSON;
import
com.alibaba.fastjson2.JSONObject
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.zzsn.event.entity.KeyWords
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.entity.KeywordsTypeMap
;
import
com.zzsn.event.entity.Subject
;
import
com.zzsn.event.entity.SubjectKeywordsGroupRelation
;
import
com.zzsn.event.enums.CodePrefixEnum
;
import
com.zzsn.event.enums.CodePrefixEnum
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.CodeGenerateUtil
;
import
com.zzsn.event.util.CodeGenerateUtil
;
...
@@ -44,6 +41,8 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -44,6 +41,8 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
private
SubjectKeywordsGroupRelationService
subjectKeywordsGroupRelationService
;
private
SubjectKeywordsGroupRelationService
subjectKeywordsGroupRelationService
;
@Autowired
@Autowired
private
ISubjectKeywordsMapService
subjectKeywordsMapService
;
private
ISubjectKeywordsMapService
subjectKeywordsMapService
;
@Autowired
private
ClbModelArrangeSubjectMapService
clbModelArrangeSubjectMapService
;
@Autowired
@Autowired
private
CodeGenerateUtil
codeGenerateUtil
;
private
CodeGenerateUtil
codeGenerateUtil
;
...
@@ -60,6 +59,12 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -60,6 +59,12 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
//关键词绑定 todo 关键词创建时是否还需要 创建定时任务、redis缓存以及发送kafka消息
//关键词绑定 todo 关键词创建时是否还需要 创建定时任务、redis缓存以及发送kafka消息
List
<
SearchWordVO
>
keywords
=
subjectSimpleVO
.
getKeywords
();
List
<
SearchWordVO
>
keywords
=
subjectSimpleVO
.
getKeywords
();
modifyKeyword
(
subject
.
getId
(),
subject
.
getSubjectName
(),
keywords
);
modifyKeyword
(
subject
.
getId
(),
subject
.
getSubjectName
(),
keywords
);
//默认绑定tpu流程
ClbModelArrangeSubjectMap
tpu
=
new
ClbModelArrangeSubjectMap
();
tpu
.
setSubjectId
(
subject
.
getId
());
tpu
.
setArrangeId
(
"1877652205629173761"
);
tpu
.
setType
(
"baseDateToSubject"
);
clbModelArrangeSubjectMapService
.
save
(
tpu
);
return
subject
;
return
subject
;
}
}
...
@@ -95,9 +100,9 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -95,9 +100,9 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
String
value
=
param1
.
get
(
"value"
).
toString
();
String
value
=
param1
.
get
(
"value"
).
toString
();
String
relationStr
=
null
;
String
relationStr
=
null
;
if
(
"&"
.
equals
(
value
))
{
if
(
"&"
.
equals
(
value
))
{
relationStr
=
"
AND
"
;
relationStr
=
"
and
"
;
}
else
if
(
"|"
.
equals
(
value
))
{
}
else
if
(
"|"
.
equals
(
value
))
{
relationStr
=
"
OR
"
;
relationStr
=
"
or
"
;
}
}
JSONObject
param2
=
params
.
get
(
i
+
1
);
JSONObject
param2
=
params
.
get
(
i
+
1
);
String
id
=
param2
.
get
(
"value"
).
toString
();
String
id
=
param2
.
get
(
"value"
).
toString
();
...
@@ -106,11 +111,11 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -106,11 +111,11 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
}
}
}
else
if
(
"3"
.
equals
(
relationType
))
{
}
else
if
(
"3"
.
equals
(
relationType
))
{
String
valueStr
=
params
.
get
(
0
).
get
(
"value"
).
toString
();
String
valueStr
=
params
.
get
(
0
).
get
(
"value"
).
toString
();
map
.
get
(
valueStr
).
setSearchLogicRelationship
(
"
AND
"
);
map
.
get
(
valueStr
).
setSearchLogicRelationship
(
"
and
"
);
for
(
int
i
=
1
;
i
<
params
.
size
()
-
2
;
i
+=
2
)
{
for
(
int
i
=
1
;
i
<
params
.
size
()
-
2
;
i
+=
2
)
{
JSONObject
param
=
params
.
get
(
i
+
1
);
JSONObject
param
=
params
.
get
(
i
+
1
);
String
id
=
param
.
get
(
"value"
).
toString
();
String
id
=
param
.
get
(
"value"
).
toString
();
map
.
get
(
id
).
setSearchLogicRelationship
(
"
AND
"
);
map
.
get
(
id
).
setSearchLogicRelationship
(
"
and
"
);
}
}
}
}
}
}
...
@@ -202,7 +207,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -202,7 +207,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
keywordsGroupIds
.
add
(
id
);
keywordsGroupIds
.
add
(
id
);
expressionStr
.
append
(
"&"
).
append
(
id
);
expressionStr
.
append
(
"&"
).
append
(
id
);
JSONObject
relationParam
=
new
JSONObject
();
JSONObject
relationParam
=
new
JSONObject
();
relationParam
.
put
(
"title"
,
"
AND
"
);
relationParam
.
put
(
"title"
,
"
and
"
);
relationParam
.
put
(
"value"
,
"&"
);
relationParam
.
put
(
"value"
,
"&"
);
paramsStr
.
add
(
relationParam
);
paramsStr
.
add
(
relationParam
);
JSONObject
params
=
new
JSONObject
();
JSONObject
params
=
new
JSONObject
();
...
@@ -228,9 +233,9 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -228,9 +233,9 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
}
else
{
}
else
{
String
searchLogicRelationship
=
searchWordVO
.
getSearchLogicRelationship
();
String
searchLogicRelationship
=
searchWordVO
.
getSearchLogicRelationship
();
String
relationStr
=
"|"
;
String
relationStr
=
"|"
;
if
(
"
AND
"
.
equals
(
searchLogicRelationship
))
{
if
(
"
and
"
.
equals
(
searchLogicRelationship
))
{
relationStr
=
"&"
;
relationStr
=
"&"
;
}
else
if
(
"
OR
"
.
equals
(
searchLogicRelationship
))
{
}
else
if
(
"
or
"
.
equals
(
searchLogicRelationship
))
{
relationStr
=
"|"
;
relationStr
=
"|"
;
}
}
expressionStr
.
append
(
relationStr
).
append
(
id
);
expressionStr
.
append
(
relationStr
).
append
(
id
);
...
@@ -262,7 +267,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
...
@@ -262,7 +267,7 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
subjectKeywordsMap
.
setSubjectId
(
subjectId
);
subjectKeywordsMap
.
setSubjectId
(
subjectId
);
subjectKeywordsMap
.
setType
(
String
.
valueOf
(
wordVO
.
getSearchScope
()));
subjectKeywordsMap
.
setType
(
String
.
valueOf
(
wordVO
.
getSearchScope
()));
String
bindType
;
String
bindType
;
if
(
"NOT"
.
equals
(
wordVO
.
getSearchLogicRelationship
()))
{
if
(
"NOT"
.
equals
IgnoreCase
(
wordVO
.
getSearchLogicRelationship
()))
{
bindType
=
"3"
;
bindType
=
"3"
;
}
else
{
}
else
{
bindType
=
"2"
;
bindType
=
"2"
;
...
...
src/main/java/com/zzsn/event/service/impl/SysDictItemServiceImpl.java
浏览文件 @
d7cc7ba7
...
@@ -5,9 +5,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...
@@ -5,9 +5,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.zzsn.event.entity.SysDictItem
;
import
com.zzsn.event.entity.SysDictItem
;
import
com.zzsn.event.mapper.SysDictItemMapper
;
import
com.zzsn.event.mapper.SysDictItemMapper
;
import
com.zzsn.event.service.SysDictItemService
;
import
com.zzsn.event.service.SysDictItemService
;
import
com.zzsn.event.vo.CountVO
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.MapUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* <p>
* <p>
...
@@ -25,4 +30,35 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
...
@@ -25,4 +30,35 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
public
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
)
{
public
List
<
SysDictItem
>
listByDictCode
(
String
dictCode
)
{
return
this
.
baseMapper
.
listByDictCode
(
dictCode
);
return
this
.
baseMapper
.
listByDictCode
(
dictCode
);
}
}
@Override
public
void
changeKey
(
List
<
CountVO
>
dataList
,
List
<
SysDictItem
>
dictItemList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
Map
<
String
,
List
<
SysDictItem
>>
map
=
dictItemList
.
stream
().
collect
(
Collectors
.
groupingBy
(
SysDictItem:
:
getItemValue
));
for
(
CountVO
countVO
:
dataList
)
{
String
name
=
countVO
.
getName
();
List
<
SysDictItem
>
sysDictItemList
=
map
.
get
(
name
);
if
(
CollectionUtils
.
isNotEmpty
(
sysDictItemList
))
{
countVO
.
setName
(
sysDictItemList
.
get
(
0
).
getItemText
());
map
.
remove
(
name
);
}
}
if
(
MapUtils
.
isNotEmpty
(
map
))
{
dataList
.
addAll
(
map
.
values
().
stream
().
map
(
e
->
{
CountVO
countVO
=
new
CountVO
();
countVO
.
setName
(
e
.
get
(
0
).
getItemText
());
countVO
.
setValue
(
0L
);
return
countVO
;
}).
collect
(
Collectors
.
toList
()));
}
}
else
{
for
(
SysDictItem
sysDictItem
:
dictItemList
)
{
CountVO
countVO
=
new
CountVO
();
countVO
.
setName
(
sysDictItem
.
getItemText
());
countVO
.
setValue
(
0L
);
dataList
.
add
(
countVO
);
}
}
}
}
}
src/main/java/com/zzsn/event/vo/SubjectPage.java
浏览文件 @
d7cc7ba7
...
@@ -52,15 +52,15 @@ public class SubjectPage {
...
@@ -52,15 +52,15 @@ public class SubjectPage {
/**数据来源(0-平台数据;1-全网搜)*/
/**数据来源(0-平台数据;1-全网搜)*/
private
Integer
dataSource
;
private
Integer
dataSource
;
/**启用时间*/
/**启用时间*/
@Excel
(
name
=
"启用时间"
,
width
=
15
,
format
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"启用时间"
,
width
=
15
,
format
=
"yyyy-MM-dd
HH:mm:ss
"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@ApiModelProperty
(
value
=
"启用时间"
)
@ApiModelProperty
(
value
=
"启用时间"
)
private
Date
timeEnable
;
private
Date
timeEnable
;
/**停用时间*/
/**停用时间*/
@Excel
(
name
=
"停用时间"
,
width
=
15
,
format
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"停用时间"
,
width
=
15
,
format
=
"yyyy-MM-dd
HH:mm:ss
"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@ApiModelProperty
(
value
=
"停用时间"
)
@ApiModelProperty
(
value
=
"停用时间"
)
private
Date
timeDisable
;
private
Date
timeDisable
;
/**划分专题库*/
/**划分专题库*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论