Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
ba220925
提交
ba220925
authored
5月 07, 2024
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
事件服务和平台事件合并
上级
54e28629
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
46 个修改的文件
包含
1751 行增加
和
144 行删除
+1751
-144
EventAnalysisController.java
...va/com/zzsn/event/controller/EventAnalysisController.java
+1
-0
EventDataController.java
...n/java/com/zzsn/event/controller/EventDataController.java
+3
-4
EventExportController.java
...java/com/zzsn/event/controller/EventExportController.java
+1
-1
EventManageController.java
...java/com/zzsn/event/controller/EventManageController.java
+1
-105
EventTypeController.java
...a/com/zzsn/event/controller/plat/EventTypeController.java
+2
-2
PlatEventManageController.java
...zzsn/event/controller/plat/PlatEventManageController.java
+0
-0
CollectionMap.java
src/main/java/com/zzsn/event/entity/CollectionMap.java
+41
-0
BindTypeEnum.java
src/main/java/com/zzsn/event/enums/BindTypeEnum.java
+35
-0
EsService.java
src/main/java/com/zzsn/event/es/EsService.java
+0
-0
KafkaConsumer.java
src/main/java/com/zzsn/event/kafka/KafkaConsumer.java
+5
-5
CollectionMapMapper.java
src/main/java/com/zzsn/event/mapper/CollectionMapMapper.java
+16
-0
EventMapper.java
src/main/java/com/zzsn/event/mapper/EventMapper.java
+94
-0
InfoSourceMapper.java
src/main/java/com/zzsn/event/mapper/InfoSourceMapper.java
+56
-2
SubjectInfoSourceMapMapper.java
...ava/com/zzsn/event/mapper/SubjectInfoSourceMapMapper.java
+20
-0
EventMapper.xml
src/main/java/com/zzsn/event/mapper/xml/EventMapper.xml
+148
-4
InfoSourceMapper.xml
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMapper.xml
+200
-2
SubjectInfoSourceMapMapper.xml
.../com/zzsn/event/mapper/xml/SubjectInfoSourceMapMapper.xml
+97
-0
SubjectTypeMapper.xml
...main/java/com/zzsn/event/mapper/xml/SubjectTypeMapper.xml
+9
-4
ICollectionMapService.java
...in/java/com/zzsn/event/service/ICollectionMapService.java
+14
-0
IEventService.java
src/main/java/com/zzsn/event/service/IEventService.java
+103
-3
IInfoSourceService.java
src/main/java/com/zzsn/event/service/IInfoSourceService.java
+30
-2
ISubjectInfoSourceMapService.java
.../com/zzsn/event/service/ISubjectInfoSourceMapService.java
+18
-0
AnalysisServiceImpl.java
...java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
+1
-1
CollectionMapServiceImpl.java
...com/zzsn/event/service/impl/CollectionMapServiceImpl.java
+18
-0
EventServiceImpl.java
...in/java/com/zzsn/event/service/impl/EventServiceImpl.java
+153
-0
InfoSourceServiceImpl.java
...va/com/zzsn/event/service/impl/InfoSourceServiceImpl.java
+79
-3
SubjectInfoSourceMapServiceImpl.java
...n/event/service/impl/SubjectInfoSourceMapServiceImpl.java
+11
-0
SubjectTypeServiceImpl.java
...a/com/zzsn/event/service/impl/SubjectTypeServiceImpl.java
+3
-1
AnalysisTask.java
src/main/java/com/zzsn/event/task/AnalysisTask.java
+1
-1
DateUtil.java
src/main/java/com/zzsn/event/util/DateUtil.java
+28
-4
ClbNewKeywordsVO.java
src/main/java/com/zzsn/event/vo/ClbNewKeywordsVO.java
+35
-0
DirectBindInfoVO.java
src/main/java/com/zzsn/event/vo/DirectBindInfoVO.java
+22
-0
DisplayInfo.java
src/main/java/com/zzsn/event/vo/DisplayInfo.java
+127
-0
EventDataCondition.java
src/main/java/com/zzsn/event/vo/EventDataCondition.java
+126
-0
EventDataVO.java
src/main/java/com/zzsn/event/vo/EventDataVO.java
+79
-0
EventNewPlatVO.java
src/main/java/com/zzsn/event/vo/EventNewPlatVO.java
+2
-0
InfoSourceCondition.java
src/main/java/com/zzsn/event/vo/InfoSourceCondition.java
+24
-0
InfoSourceVo.java
src/main/java/com/zzsn/event/vo/InfoSourceVo.java
+9
-0
LabelInfo.java
src/main/java/com/zzsn/event/vo/LabelInfo.java
+19
-0
LabelModelVo.java
src/main/java/com/zzsn/event/vo/LabelModelVo.java
+26
-0
NewKeywordsCondition.java
src/main/java/com/zzsn/event/vo/NewKeywordsCondition.java
+22
-0
NumVO.java
src/main/java/com/zzsn/event/vo/NumVO.java
+22
-0
SubjectStatisticsVo.java
src/main/java/com/zzsn/event/vo/SubjectStatisticsVo.java
+42
-0
SubjectTreeVO.java
src/main/java/com/zzsn/event/vo/SubjectTreeVO.java
+4
-0
application-dev.yml
src/main/resources/application-dev.yml
+2
-0
application-pro.yml
src/main/resources/application-pro.yml
+2
-0
没有找到文件。
src/main/java/com/zzsn/event/controller/EventAnalysisController.java
浏览文件 @
ba220925
...
@@ -12,6 +12,7 @@ import com.zzsn.event.constant.Result;
...
@@ -12,6 +12,7 @@ import com.zzsn.event.constant.Result;
import
com.zzsn.event.entity.EventAnalysisReport
;
import
com.zzsn.event.entity.EventAnalysisReport
;
import
com.zzsn.event.entity.LabelEntity
;
import
com.zzsn.event.entity.LabelEntity
;
import
com.zzsn.event.entity.SubjectAnalysis
;
import
com.zzsn.event.entity.SubjectAnalysis
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.CalculateUtil
;
import
com.zzsn.event.util.CalculateUtil
;
import
com.zzsn.event.util.HttpUtil
;
import
com.zzsn.event.util.HttpUtil
;
...
...
src/main/java/com/zzsn/event/controller/EventDataController.java
浏览文件 @
ba220925
...
@@ -3,7 +3,7 @@ package com.zzsn.event.controller;
...
@@ -3,7 +3,7 @@ package com.zzsn.event.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
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.
service
.EsService
;
import
com.zzsn.event.
es
.EsService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.vo.EventExcelVO
;
import
com.zzsn.event.vo.EventExcelVO
;
import
com.zzsn.event.vo.EventFrontVO
;
import
com.zzsn.event.vo.EventFrontVO
;
...
@@ -41,7 +41,7 @@ public class EventDataController {
...
@@ -41,7 +41,7 @@ public class EventDataController {
/**
/**
* 分页列表-门户
*
事件
分页列表-门户
*
*
* @param eventName 事件名称
* @param eventName 事件名称
* @param eventType 事件分类id
* @param eventType 事件分类id
...
@@ -131,7 +131,7 @@ public class EventDataController {
...
@@ -131,7 +131,7 @@ public class EventDataController {
*/
*/
@ApiOperation
(
value
=
"单篇文章热词"
,
notes
=
"单篇文章热词"
)
@ApiOperation
(
value
=
"单篇文章热词"
,
notes
=
"单篇文章热词"
)
@GetMapping
(
value
=
"/hotWords"
)
@GetMapping
(
value
=
"/hotWords"
)
public
Result
<?>
articleList
(
@RequestParam
(
value
=
"index"
,
required
=
false
)
String
index
,
@RequestParam
(
"id"
)
String
id
,
public
Result
<?>
articleList
(
@RequestParam
(
value
=
"index"
,
required
=
false
)
String
index
,
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
name
=
"number"
,
defaultValue
=
"200"
)
Integer
number
)
{
@RequestParam
(
name
=
"number"
,
defaultValue
=
"200"
)
Integer
number
)
{
if
(
StringUtils
.
isEmpty
(
index
))
{
if
(
StringUtils
.
isEmpty
(
index
))
{
index
=
Constants
.
SUBJECT_INDEX
;
index
=
Constants
.
SUBJECT_INDEX
;
...
@@ -159,5 +159,4 @@ public class EventDataController {
...
@@ -159,5 +159,4 @@ public class EventDataController {
List
<
SubjectDataVo
>
recommendList
=
esService
.
queryRecommendList
(
subjectId
,
id
,
title
,
pageNo
,
pageSize
);
List
<
SubjectDataVo
>
recommendList
=
esService
.
queryRecommendList
(
subjectId
,
id
,
title
,
pageNo
,
pageSize
);
return
Result
.
OK
(
recommendList
);
return
Result
.
OK
(
recommendList
);
}
}
}
}
src/main/java/com/zzsn/event/controller/EventExportController.java
浏览文件 @
ba220925
...
@@ -3,7 +3,7 @@ package com.zzsn.event.controller;
...
@@ -3,7 +3,7 @@ package com.zzsn.event.controller;
import
com.aspose.words.Document
;
import
com.aspose.words.Document
;
import
com.aspose.words.SaveFormat
;
import
com.aspose.words.SaveFormat
;
import
com.zzsn.event.config.FreeMarkerConfiguration
;
import
com.zzsn.event.config.FreeMarkerConfiguration
;
import
com.zzsn.event.
service
.EsService
;
import
com.zzsn.event.
es
.EsService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.ExcelExportUtil
;
import
com.zzsn.event.util.ExcelExportUtil
;
...
...
src/main/java/com/zzsn/event/controller/EventManageController.java
浏览文件 @
ba220925
...
@@ -11,7 +11,6 @@ import com.zzsn.event.service.*;
...
@@ -11,7 +11,6 @@ import com.zzsn.event.service.*;
import
com.zzsn.event.util.HttpUtil
;
import
com.zzsn.event.util.HttpUtil
;
import
com.zzsn.event.util.ObjectUtil
;
import
com.zzsn.event.util.ObjectUtil
;
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.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.*
;
...
@@ -20,14 +19,11 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService;
...
@@ -20,14 +19,11 @@ import com.zzsn.event.xxljob.service.IXxlJobInfoService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jsoup.internal.StringUtil
;
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.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* 事件后台管理
* 事件后台管理
...
@@ -53,8 +49,7 @@ public class EventManageController {
...
@@ -53,8 +49,7 @@ public class EventManageController {
private
ISubjectInfoSourceMapService
subjectInfoSourceMapService
;
private
ISubjectInfoSourceMapService
subjectInfoSourceMapService
;
@Autowired
@Autowired
private
EventRegionMapService
eventRegionMapService
;
private
EventRegionMapService
eventRegionMapService
;
@Autowired
private
ISubjectTypeService
subjectTypeService
;
@Autowired
@Autowired
private
ICustomerDataPermissionMapService
customerDataPermissionMapService
;
private
ICustomerDataPermissionMapService
customerDataPermissionMapService
;
@Autowired
@Autowired
...
@@ -91,106 +86,7 @@ public class EventManageController {
...
@@ -91,106 +86,7 @@ public class EventManageController {
return
Result
.
OK
(
pageList
);
return
Result
.
OK
(
pageList
);
}
}
/**
* 事件页左侧树
*
* @author lkg
* @date 2024/4/29
*/
@GetMapping
(
"/leftTypeTree"
)
public
Result
<?>
leftTree
()
{
//获取当前登录用户
UserVo
currentUser
=
UserUtil
.
getLoginUser
();
Integer
category
=
currentUser
.
getCategory
();
String
userId
=
null
;
String
customerId
=
null
;
if
(
category
.
equals
(
Constants
.
COMMON_USER
))
{
userId
=
currentUser
.
getUserId
();
}
else
if
(
category
.
equals
(
Constants
.
ADMIN_USER
))
{
customerId
=
currentUser
.
getCustomerId
();
}
List
<
SubjectTreeVO
>
tree
=
subjectTypeService
.
subjectAndTypeTree
(
userId
,
customerId
);
return
Result
.
OK
(
tree
);
}
/**
* 事件页左侧树
*
* @author lkg
* @date 2024/4/29
*/
@GetMapping
(
"/leftCustomerTree"
)
public
Result
<?>
leftCustomerTree
()
{
//获取当前登录用户
UserVo
currentUser
=
UserUtil
.
getLoginUser
();
Integer
category
=
currentUser
.
getCategory
();
String
userId
=
null
;
String
customerId
=
null
;
if
(
category
.
equals
(
Constants
.
COMMON_USER
))
{
userId
=
currentUser
.
getUserId
();
}
else
if
(
category
.
equals
(
Constants
.
ADMIN_USER
))
{
customerId
=
currentUser
.
getCustomerId
();
}
List
<
SubjectTreeVO
>
tree
=
subjectTypeService
.
subjectAndCustomerTree
(
userId
,
customerId
);
return
Result
.
OK
(
tree
);
}
/**
* 分页列表-新平台管理
*
* @param subjectCondition 筛选条件
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/28
*/
@GetMapping
(
"/newPlatPageList"
)
public
Result
<?>
newPlatPageList
(
SubjectCondition
subjectCondition
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
//获取当前登录用户
UserVo
currentUser
=
UserUtil
.
getLoginUser
();
Integer
category
=
currentUser
.
getCategory
();
if
(
category
.
equals
(
Constants
.
COMMON_USER
))
{
subjectCondition
.
setUserId
(
currentUser
.
getUserId
());
}
else
if
(
category
.
equals
(
Constants
.
ADMIN_USER
))
{
subjectCondition
.
setCustomerId
(
currentUser
.
getCustomerId
());
}
IPage
<
EventNewPlatVO
>
pageList
=
eventService
.
newPlatPageList
(
subjectCondition
,
pageNo
,
pageSize
);
return
Result
.
OK
(
pageList
);
}
/**
* 分页列表-新平台管理
*
* @param subjectCondition 筛选条件
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/28
*/
@GetMapping
(
"/newPlatCustomerPageList"
)
public
Result
<?>
newPlatCustomerPageList
(
SubjectCondition
subjectCondition
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
//获取当前登录用户
UserVo
currentUser
=
UserUtil
.
getLoginUser
();
Integer
category
=
currentUser
.
getCategory
();
if
(
category
.
equals
(
Constants
.
COMMON_USER
))
{
subjectCondition
.
setUserId
(
currentUser
.
getUserId
());
subjectCondition
.
setCustomerId
(
currentUser
.
getCustomerId
());
}
else
if
(
category
.
equals
(
Constants
.
ADMIN_USER
))
{
if
(
StringUtils
.
isEmpty
(
subjectCondition
.
getCustomerId
())
||
"0"
.
equals
(
subjectCondition
.
getCustomerId
()))
{
subjectCondition
.
setCustomerId
(
currentUser
.
getCustomerId
());
}
}
if
(
"0"
.
equals
(
subjectCondition
.
getCustomerId
()))
{
subjectCondition
.
setCustomerId
(
null
);
}
IPage
<
EventNewPlatVO
>
pageList
=
eventService
.
newPlatCustomerPageList
(
subjectCondition
,
pageNo
,
pageSize
);
return
Result
.
OK
(
pageList
);
}
/**
/**
* 地域信息-树型结构
* 地域信息-树型结构
...
...
src/main/java/com/zzsn/event/controller/EventTypeController.java
→
src/main/java/com/zzsn/event/controller/
plat/
EventTypeController.java
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
controller
;
package
com
.
zzsn
.
event
.
controller
.
plat
;
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
;
...
@@ -32,7 +32,7 @@ import java.util.List;
...
@@ -32,7 +32,7 @@ import java.util.List;
@Slf4j
@Slf4j
@Api
(
tags
=
"-事件分类"
)
@Api
(
tags
=
"-事件分类"
)
@RestController
@RestController
@RequestMapping
(
"/manage/subjectType"
)
@RequestMapping
(
"/
plat/
manage/subjectType"
)
public
class
EventTypeController
{
public
class
EventTypeController
{
@Autowired
@Autowired
...
...
src/main/java/com/zzsn/event/controller/plat/PlatEventManageController.java
0 → 100644
浏览文件 @
ba220925
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/entity/CollectionMap.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
import
java.io.Serializable
;
/**
* @Description: 文章收藏映射表
* @Author: jeecg-boot
* @Date: 2022-05-17
* @Version: V1.0
*/
@Data
@TableName
(
"collection_map"
)
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"collection_map对象"
,
description
=
"文章收藏映射表"
)
public
class
CollectionMap
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**主键*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ApiModelProperty
(
value
=
"主键"
)
private
String
id
;
/**用户id*/
@Excel
(
name
=
"用户id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"用户id"
)
private
String
userId
;
/**资讯id*/
@Excel
(
name
=
"资讯id"
,
width
=
15
)
@ApiModelProperty
(
value
=
"资讯id"
)
private
String
articleId
;
}
src/main/java/com/zzsn/event/enums/BindTypeEnum.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
enums
;
/**
* @author zs
* @Description 信息源/信息源组 枚举
* @since 2021/12/9
*/
public
enum
BindTypeEnum
{
INFO_SOURCE
(
1
,
"绑定的信息源"
),
INFO_SOURCE_GROUP
(
2
,
"绑定的信息源组"
),
EXCLUDE_INFO_SOURCE
(
3
,
"排除的信息源"
),
EXCLUDE_INFO_SOURCE_GROUP
(
4
,
"排除的信息源组"
),
DIRECTIONA_INFO_SOURCE_GROUP
(
5
,
"定向的信息源组"
);
private
Integer
value
;
private
String
des
;
BindTypeEnum
(
int
value
,
String
des
)
{
this
.
value
=
value
;
this
.
des
=
des
;
}
public
Integer
getvalue
()
{
return
value
;
}
public
String
getDes
()
{
return
des
;
}
}
src/main/java/com/zzsn/event/
service
/EsService.java
→
src/main/java/com/zzsn/event/
es
/EsService.java
浏览文件 @
ba220925
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/kafka/KafkaConsumer.java
浏览文件 @
ba220925
...
@@ -28,7 +28,7 @@ import java.util.List;
...
@@ -28,7 +28,7 @@ import java.util.List;
* @date 2022/7/15
* @date 2022/7/15
*/
*/
@Slf4j
@Slf4j
@Component
//
@Component
public
class
KafkaConsumer
{
public
class
KafkaConsumer
{
@Autowired
@Autowired
private
SubjectAnalysisService
subjectAnalysisService
;
private
SubjectAnalysisService
subjectAnalysisService
;
...
@@ -42,7 +42,7 @@ public class KafkaConsumer {
...
@@ -42,7 +42,7 @@ public class KafkaConsumer {
*
*
* @param record 接受的kafka数据
* @param record 接受的kafka数据
*/
*/
@KafkaListener
(
topics
=
{
Constants
.
VIEWPOINT_RECEIVE_TOPIC
})
//
@KafkaListener(topics = {Constants.VIEWPOINT_RECEIVE_TOPIC})
public
void
viewPointAnalysis
(
ConsumerRecord
<
String
,
String
>
record
)
{
public
void
viewPointAnalysis
(
ConsumerRecord
<
String
,
String
>
record
)
{
String
value
=
record
.
value
();
String
value
=
record
.
value
();
if
(
StringUtils
.
isNotEmpty
(
value
))
{
if
(
StringUtils
.
isNotEmpty
(
value
))
{
...
@@ -74,7 +74,7 @@ public class KafkaConsumer {
...
@@ -74,7 +74,7 @@ public class KafkaConsumer {
*
*
* @param record 接受的kafka数据
* @param record 接受的kafka数据
*/
*/
@KafkaListener
(
topics
=
{
Constants
.
EVENT_CONTEXT_RECEIVE_TOPIC
})
//
@KafkaListener(topics = {Constants.EVENT_CONTEXT_RECEIVE_TOPIC})
public
void
eventContext
(
ConsumerRecord
<
String
,
String
>
record
)
{
public
void
eventContext
(
ConsumerRecord
<
String
,
String
>
record
)
{
String
value
=
record
.
value
();
String
value
=
record
.
value
();
if
(
StringUtils
.
isNotEmpty
(
value
))
{
if
(
StringUtils
.
isNotEmpty
(
value
))
{
...
@@ -98,7 +98,7 @@ public class KafkaConsumer {
...
@@ -98,7 +98,7 @@ public class KafkaConsumer {
*
*
* @param record 接受的kafka数据
* @param record 接受的kafka数据
*/
*/
@KafkaListener
(
topics
=
{
Constants
.
FAKE_EVENT_CONTEXT_RECEIVE_TOPIC
})
//
@KafkaListener(topics = {Constants.FAKE_EVENT_CONTEXT_RECEIVE_TOPIC})
public
void
eventContext_fake
(
ConsumerRecord
<
String
,
String
>
record
)
{
public
void
eventContext_fake
(
ConsumerRecord
<
String
,
String
>
record
)
{
String
value
=
record
.
value
();
String
value
=
record
.
value
();
if
(
StringUtils
.
isNotEmpty
(
value
))
{
if
(
StringUtils
.
isNotEmpty
(
value
))
{
...
@@ -132,7 +132,7 @@ public class KafkaConsumer {
...
@@ -132,7 +132,7 @@ public class KafkaConsumer {
* @author lkg
* @author lkg
* @date 2024/4/12
* @date 2024/4/12
*/
*/
@KafkaListener
(
topics
=
{
Constants
.
EVENT_REPORT_RECEIVE_TOPIC
})
//
@KafkaListener(topics = {Constants.EVENT_REPORT_RECEIVE_TOPIC})
public
void
eventReport
(
ConsumerRecord
<
String
,
String
>
record
)
{
public
void
eventReport
(
ConsumerRecord
<
String
,
String
>
record
)
{
String
value
=
record
.
value
();
String
value
=
record
.
value
();
EventAnalysisReport
eventAnalysisReport
=
JSONObject
.
parseObject
(
value
,
EventAnalysisReport
.
class
);
EventAnalysisReport
eventAnalysisReport
=
JSONObject
.
parseObject
(
value
,
EventAnalysisReport
.
class
);
...
...
src/main/java/com/zzsn/event/mapper/CollectionMapMapper.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.CollectionMap
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @Description: 文章收藏映射表
* @Author: jeecg-boot
* @Date: 2022-05-17
* @Version: V1.0
*/
@Mapper
public
interface
CollectionMapMapper
extends
BaseMapper
<
CollectionMap
>
{
}
src/main/java/com/zzsn/event/mapper/EventMapper.java
浏览文件 @
ba220925
...
@@ -128,6 +128,7 @@ public interface EventMapper extends BaseMapper<Event> {
...
@@ -128,6 +128,7 @@ public interface EventMapper extends BaseMapper<Event> {
* @date 2024/4/30
* @date 2024/4/30
*/
*/
List
<
EventNewPlatVO
>
newPlatCustomerPageList
(
@Param
(
"subjectCondition"
)
SubjectCondition
subjectCondition
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
List
<
EventNewPlatVO
>
newPlatCustomerPageList
(
@Param
(
"subjectCondition"
)
SubjectCondition
subjectCondition
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
/**
/**
* 总数量(客户)-新平台管理
* 总数量(客户)-新平台管理
*
*
...
@@ -227,4 +228,97 @@ public interface EventMapper extends BaseMapper<Event> {
...
@@ -227,4 +228,97 @@ public interface EventMapper extends BaseMapper<Event> {
*/
*/
List
<
Node
>
projectList
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"customerId"
)
String
customerId
);
List
<
Node
>
projectList
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"customerId"
)
String
customerId
);
/**
* 分类下的事件id集合
*
* @param userId 用户id
* @param typeIds 分类id集合
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
selectSubjectByTypeIds
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"typeIds"
)
List
<
String
>
typeIds
);
/**
* 用户下的事件id集合
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
selectSubjectWithCustomer
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"customerId"
)
String
customerId
);
/**
* 专题绑定关键词的id集合
*
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
bindKeyWordsIdList
(
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
);
/**
* 专题绑定模型信息列表
*
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/5/6
*/
List
<
LabelModelVo
>
selectLabelModelBySubjectId
(
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
);
/**
* 企业标签下的企业信用代码集合
*
* @param labelIds 企业标签id集合
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
codesByLabels
(
@Param
(
"labelIds"
)
List
<
String
>
labelIds
);
/**
* 判断信息源是否在专题绑定的信息源组下
*
* @param subjectId 专题id
* @param sourceId 信息源id
* @author lkg
* @date 2024/4/24
*/
int
ynBelowBindGroup
(
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"sourceId"
)
String
sourceId
);
/**
* 判断信息源是否在专题排除的信息源组下
*
* @param subjectId 专题id
* @param sourceId 信息源id
* @author lkg
* @date 2024/4/24
*/
int
ynBelowExcludeGroup
(
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"sourceId"
)
String
sourceId
);
/**
* 专题绑定关键词信息-分页列表
*
* @param subjectIds 专题id集合
* @param groupName 词组名称
* @param wordName 关键词名称
* @param offset 偏移量
* @param pageSize 返回条数
* @author lkg
* @date 2024/5/7
*/
List
<
KeyWordsPage
>
bindKeyWordsList
(
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
,
@Param
(
"groupName"
)
String
groupName
,
@Param
(
"wordName"
)
String
wordName
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
/**
* 专题绑定关键词信息-总数量
*
* @param subjectIds 专题id集合
* @param groupName 词组名称
* @param wordName 关键词名称
* @author lkg
* @date 2024/5/7
*/
Long
bindKeyWordsCount
(
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
,
@Param
(
"groupName"
)
String
groupName
,
@Param
(
"wordName"
)
String
wordName
);
}
}
src/main/java/com/zzsn/event/mapper/InfoSourceMapper.java
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
mapper
;
package
com
.
zzsn
.
event
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.vo.InfoSourceCondition
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
com.zzsn.event.xxljob.entity.InfoSource
;
import
com.zzsn.event.xxljob.entity.InfoSource
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* @Description: 信息源表
* @Description: 信息源表
* @Author: jeecg-boot
* @Author: jeecg-boot
* @Date:
2022-01-18
* @Date: 2022-01-18
* @Version: V1.0
* @Version: V1.0
*/
*/
@Mapper
@Mapper
public
interface
InfoSourceMapper
extends
BaseMapper
<
InfoSource
>
{
public
interface
InfoSourceMapper
extends
BaseMapper
<
InfoSource
>
{
String
getNatureName
(
@Param
(
"id"
)
String
id
);
/**
* 信息源信息列表
*
* @param sourceIdList 信息源id集合
* @author lkg
* @date 2024/5/7
*/
List
<
InfoSourceVo
>
queryInfoSource
(
@Param
(
"sourceIdList"
)
List
<
String
>
sourceIdList
);
/**
* 专题绑定的信息源集合
*
* @param infoSourceCondition 筛选条件
* @param subjectIds 专题id集合
* @param offset 偏移量
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/24
*/
List
<
String
>
bindSourceIdList
(
@Param
(
"infoSourceVo"
)
InfoSourceCondition
infoSourceCondition
,
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
/**
* 专题绑定的信息源总数量
*
* @param infoSourceCondition 筛选条件
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/4/24
*/
Long
bindSourceIdCount
(
@Param
(
"infoSourceVo"
)
InfoSourceCondition
infoSourceCondition
,
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
);
/**
* 专题直接屏蔽的信息源列表(不包括专题屏蔽的信息源组下的信息源)
*
* @param infoSourceCondition 筛选条件
* @param subjectId 专题id
* @param offset 偏移量
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/30
*/
List
<
InfoSourceVo
>
unBindSourcePageList
(
@Param
(
"infoSourceVo"
)
InfoSourceCondition
infoSourceCondition
,
@Param
(
"subjectId"
)
String
subjectId
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
/**
* 专题直接屏蔽的信息源数量(不包括专题屏蔽的信息源组下的信息源)
*
* @param infoSourceCondition 筛选条件
* @param subjectId 专题id
* @author lkg
* @date 2024/4/30
*/
Long
unBindSourceCount
(
@Param
(
"infoSourceVo"
)
InfoSourceCondition
infoSourceCondition
,
@Param
(
"subjectId"
)
String
subjectId
);
}
}
src/main/java/com/zzsn/event/mapper/SubjectInfoSourceMapMapper.java
浏览文件 @
ba220925
...
@@ -3,6 +3,7 @@ package com.zzsn.event.mapper;
...
@@ -3,6 +3,7 @@ package com.zzsn.event.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zzsn.event.entity.SubjectInfoSourceMap
;
import
com.zzsn.event.entity.SubjectInfoSourceMap
;
import
com.zzsn.event.vo.SubjectStatisticsVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -33,4 +34,23 @@ public interface SubjectInfoSourceMapMapper extends BaseMapper<SubjectInfoSource
...
@@ -33,4 +34,23 @@ public interface SubjectInfoSourceMapMapper extends BaseMapper<SubjectInfoSource
List
<
String
>
selectSubjectIdsByGroupId
(
@Param
(
"infoSourceGroupId"
)
String
infoSourceGroupId
);
List
<
String
>
selectSubjectIdsByGroupId
(
@Param
(
"infoSourceGroupId"
)
String
infoSourceGroupId
);
/**
* 专题真正绑定的信息源id集合
*
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
subjectRealBindInfoSourceList
(
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
);
/**
* 专题真正绑定的信息源集合
*
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/5/7
*/
List
<
SubjectStatisticsVo
>
subjectRealBindInfoSources
(
@Param
(
"subjectIds"
)
List
<
String
>
subjectIds
);
}
}
src/main/java/com/zzsn/event/mapper/xml/EventMapper.xml
浏览文件 @
ba220925
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
<select
id=
"newPlatPageList"
resultType=
"com.zzsn.event.vo.EventNewPlatVO"
>
<select
id=
"newPlatPageList"
resultType=
"com.zzsn.event.vo.EventNewPlatVO"
>
SELECT distinct d.id,d.event_name, m.type_name as subjectTypeName, n.project_name
SELECT distinct d.id,d.event_name,
d.start_time,d.end_time,
m.type_name as subjectTypeName, n.project_name
from
from
<choose>
<choose>
<when
test=
"subjectCondition.userId !=null and subjectCondition.userId != ''"
>
<when
test=
"subjectCondition.userId !=null and subjectCondition.userId != ''"
>
...
@@ -252,8 +252,8 @@
...
@@ -252,8 +252,8 @@
</select>
</select>
<select
id=
"newPlatCustomerPageList"
resultType=
"com.zzsn.event.vo.EventNewPlatVO"
>
<select
id=
"newPlatCustomerPageList"
resultType=
"com.zzsn.event.vo.EventNewPlatVO"
>
select distinct x.id,x.event_name,st.type_name as subjectTypeName,p.project_name from (
select distinct x.id,x.event_name,
x.start_time,x.end_time,
st.type_name as subjectTypeName,p.project_name from (
select c.id, c.event_name,c.create_time
select c.id, c.event_name,c.create_time
,c.start_time,c.end_time,c.sort_order
from event c inner join
from event c inner join
(
(
select a.id, b.permission_id
select a.id, b.permission_id
...
@@ -294,7 +294,7 @@
...
@@ -294,7 +294,7 @@
<if
test=
"subjectCondition.projectId!=null and subjectCondition.projectId != ''"
>
<if
test=
"subjectCondition.projectId!=null and subjectCondition.projectId != ''"
>
and p.id = #{subjectCondition.projectId}
and p.id = #{subjectCondition.projectId}
</if>
</if>
order by x.create_time desc
order by x.
sort_order, x.
create_time desc
limit #{offset},#{pageSize}
limit #{offset},#{pageSize}
</select>
</select>
<select
id=
"newPlatCustomerCount"
resultType=
"Integer"
>
<select
id=
"newPlatCustomerCount"
resultType=
"Integer"
>
...
@@ -489,4 +489,147 @@
...
@@ -489,4 +489,147 @@
where s.is_delete = 0 and s.status = 1
where s.is_delete = 0 and s.status = 1
</select>
</select>
<select
id=
"selectSubjectByTypeIds"
resultType=
"String"
>
select distinct a.id from event a
<if
test=
"userId!=null and userId != ''"
>
inner join sys_user_data_permission b on b.permission_id = a.id and b.category = 'subject' and b.user_id = #{userId}
</if>
inner join subject_type_map c on c.subject_id = a.id
where 1=1
<if
test=
"typeIds!=null and typeIds.size()>0"
>
and c.type_id in
<foreach
collection=
"typeIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
<select
id=
"selectSubjectWithCustomer"
resultType=
"String"
>
select distinct a.id
<choose>
<when
test=
"customerId!=null and customerId != ''"
>
from customer_data_permission_map b
inner join event a on b.permission_id = a.id
inner join subject_type_map c on c.subject_id = b.permission_id
inner join project_subject_map d on b.permission_id = d.subject_id
inner join customer_project_map e on d.project_id = e.project_id
where b.category = 'subject' and b.customer_id = #{customerId}
</when>
<when
test=
"userId!=null and userId != ''"
>
from sys_user_data_permission b
inner join event a on b.permission_id = a.id
inner join subject_type_map c on c.subject_id = b.permission_id
inner join project_subject_map d on b.permission_id = d.subject_id
inner join customer_project_map e on d.project_id = e.project_id
where b.category = 'subject' and b.user_id = #{userId}
</when>
<otherwise>
from event a
</otherwise>
</choose>
</select>
<select
id=
"bindKeyWordsIdList"
resultType=
"String"
>
select distinct b.id from key_words b
left join subject_keywords_map a on a.keywords_id = b.id
left join keywords_type_map c on b.id = c.keywords_id
left join keywords_type d on d.id = c.type_id
where 1=1
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and a.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
<select
id=
"selectLabelModelBySubjectId"
resultType=
"com.zzsn.event.vo.LabelModelVo"
>
SELECT distinct a.subject_id,b.id as modelId,b.service_name as modelServiceName,b.label_id as labelId,c.label_mark,c.label_name,c.label_type
FROM subject_model_map a
inner JOIN clb_algorithm_model b ON a.model_id = b.id and a.sign = 1
LEFT JOIN sys_base_label_type c on c.id = b.label_id
WHERE b.service_name is not null and a.type = 3
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and a.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</select>
<select
id=
"codesByLabels"
resultType=
"String"
>
select e.social_credit_code from sys_base_enterprise e
inner join sys_base_label_type_map m on e.social_credit_code = m.relation_id
where 1=1
<if
test=
"labelIds!=null and labelIds.size()>0"
>
and m.label_id in
<foreach
collection=
"labelIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by e.social_credit_code
</select>
<select
id=
"ynBelowBindGroup"
resultType=
"Integer"
>
select count(1) from subject_info_source_map n
left join info_source_group_map m on n.source_id = m.group_id
where n.type in (2,5) and n.subject_id = #{subjectId} and m.source_id = #{sourceId}
</select>
<select
id=
"ynBelowExcludeGroup"
resultType=
"Integer"
>
select count(1) from subject_info_source_map n
left join info_source_group_map m on n.source_id = m.group_id
where n.type = 4 and n.subject_id = #{subjectId} and m.source_id = #{sourceId}
</select>
<select
id=
"bindKeyWordsList"
resultType=
"com.zzsn.event.vo.KeyWordsPage"
>
select x.* from (
SELECT b.*, d.id as keyWordsTypeId, d.type_name as keyWordTypeNames, a.type as type, a.id as subjectKeyWordId
FROM key_words b
LEFT JOIN subject_keywords_map a ON a.keywords_id = b.id
LEFT JOIN keywords_type_map c ON b.id = c.keywords_id
LEFT JOIN keywords_type d ON d.id = c.type_id
where 1=1
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and a.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by b.id
) x
where 1=1
<if
test=
"groupName != null and groupName !=''"
>
and x.words_name like CONCAT('%',#{groupName},'%')
</if>
<if
test=
"wordName != null and wordName !=''"
>
and x.key_word like CONCAT('%',#{wordName},'%')
</if>
order by x.create_time desc
limit #{offset},#{pageSize}
</select>
<select
id=
"bindKeyWordsCount"
resultType=
"Long"
>
select count(1) from (
SELECT b.*, d.id as keyWordsTypeId, d.type_name as keyWordTypeNames, a.type as type, a.id as subjectKeyWordId
FROM key_words b
LEFT JOIN subject_keywords_map a ON a.keywords_id = b.id
LEFT JOIN keywords_type_map c ON b.id = c.keywords_id
LEFT JOIN keywords_type d ON d.id = c.type_id
where 1=1
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and a.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by b.id
) x
where 1=1
<if
test=
"groupName != null and groupName !=''"
>
and x.words_name like CONCAT('%',#{groupName},'%')
</if>
<if
test=
"wordName != null and wordName !=''"
>
and x.key_word like CONCAT('%',#{wordName},'%')
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/java/com/zzsn/event/mapper/xml/InfoSourceMapper.xml
浏览文件 @
ba220925
...
@@ -3,7 +3,205 @@
...
@@ -3,7 +3,205 @@
<mapper
namespace=
"com.zzsn.event.mapper.InfoSourceMapper"
>
<mapper
namespace=
"com.zzsn.event.mapper.InfoSourceMapper"
>
<select
id=
"getNatureName"
resultType=
"String"
>
<select
id=
"queryInfoSource"
resultType=
"com.zzsn.event.vo.InfoSourceVo"
>
select nature_name from info_source_nature where id = #{id}
select t.*, g.infoSourceNatureIds as natureIds, g.infoSourceNatureNames, k.infoSourceGroupNames from (
select y.* from (
select a.*, c.type_name as infoSourceTypeName, c.id as infoSourceTypeId from info_source a
LEFT JOIN info_source_type_map b ON b.source_id = a.id
LEFT JOIN info_source_type c ON b.type_id = c.id
) y where 1=1
<if
test=
"sourceIdList != null and sourceIdList.size() > 0"
>
and y.id in
<foreach
collection=
"sourceIdList"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
)t
LEFT JOIN (
SELECT e.source_id, GROUP_CONCAT(f.nature_name SEPARATOR ',') as infoSourceNatureNames, GROUP_CONCAT(f.id
SEPARATOR ',') as infoSourceNatureIds from info_source_properties_map e
LEFT JOIN info_source_nature f ON f.id = e.nature_id
GROUP BY e.source_id) g ON t.id = g.source_id
LEFT JOIN (
SELECT h.source_id, GROUP_CONCAT(j.group_name SEPARATOR ',') as infoSourceGroupNames, GROUP_CONCAT(j.id
SEPARATOR ',') as infoSourceGroupIds from info_source_group_map h
LEFT JOIN info_source_group j ON j.id = h.group_id
GROUP BY h.source_id) k ON t.id = k.source_id
</select>
<select
id=
"bindSourceIdList"
resultType=
"String"
>
select distinct x.id from (
select iso.id,iso.web_site_name,iso.site_name,iso.site_uri,iso.`status`,iso.crawl_type,iso.create_time
from info_source_group_map m inner join info_source iso on m.source_id = iso.id
where m.group_id in (
select source_id from subject_info_source_map where type in(2,5)
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by source_id
)
union
select iso.id,iso.web_site_name,iso.site_name,iso.site_uri,iso.`status`,iso.crawl_type,iso.create_time
from subject_info_source_map sm inner join info_source iso on sm.source_id = iso.id where sm.type = 1
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) x where 1=1
<if
test=
"infoSourceVo.webSiteName!=null and infoSourceVo.webSiteName != ''"
>
and x.web_site_name like CONCAT('%',#{infoSourceVo.webSiteName},'%')
</if>
<if
test=
"infoSourceVo.siteName!=null and infoSourceVo.siteName != ''"
>
and x.site_name like CONCAT('%',#{infoSourceVo.siteName},'%')
</if>
<if
test=
"infoSourceVo.siteUri!=null and infoSourceVo.siteUri != ''"
>
and x.site_uri = #{infoSourceVo.siteUri}
</if>
<if
test=
"infoSourceVo.status!=null and infoSourceVo.status != ''"
>
and x.status = #{infoSourceVo.status}
</if>
<if
test=
"infoSourceVo.crawlType!=null and infoSourceVo.crawlType != 0"
>
and x.crawl_type = #{infoSourceVo.crawlType}
</if>
and x.id not in(
select distinct y.source_id from (
select m.source_id from info_source_group_map m
where m.group_id in (
select source_id from subject_info_source_map where type = 4
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by source_id
)
union
select sm.source_id from subject_info_source_map sm where type = 3
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) y
)
order by x.create_time
limit #{offset},#{pageSize}
</select>
<select
id=
"bindSourceIdCount"
resultType=
"Long"
>
select count(1) from
(
select distinct x.id,x.web_site_name,x.site_name,x.site_uri,x.`status`,x.crawl_type from (
select iso.id,iso.web_site_name,iso.site_name,iso.site_uri,iso.`status`,iso.crawl_type
from info_source_group_map m inner join info_source iso on m.source_id = iso.id
where m.group_id in (
select source_id from subject_info_source_map where type in(2,5)
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by source_id
)
union
select iso.id,iso.web_site_name,iso.site_name,iso.site_uri,iso.`status`,iso.crawl_type
from subject_info_source_map sm inner join info_source iso on sm.source_id = iso.id where sm.type = 1
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) x where 1=1
<if
test=
"infoSourceVo.webSiteName!=null and infoSourceVo.webSiteName != ''"
>
and x.web_site_name like CONCAT('%',#{infoSourceVo.webSiteName},'%')
</if>
<if
test=
"infoSourceVo.siteName!=null and infoSourceVo.siteName != ''"
>
and x.site_name like CONCAT('%',#{infoSourceVo.siteName},'%')
</if>
<if
test=
"infoSourceVo.siteUri!=null and infoSourceVo.siteUri != ''"
>
and x.site_uri = #{infoSourceVo.siteUri}
</if>
<if
test=
"infoSourceVo.status!=null and infoSourceVo.status != ''"
>
and x.status = #{infoSourceVo.status}
</if>
<if
test=
"infoSourceVo.crawlType!=null and infoSourceVo.crawlType != 0"
>
and x.crawl_type = #{infoSourceVo.crawlType}
</if>
and x.id not in(
select distinct y.source_id from (
select m.source_id from info_source_group_map m
where m.group_id in (
select source_id from subject_info_source_map where type = 4
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by source_id
)
union
select sm.source_id from subject_info_source_map sm where type = 3
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) y
)
) q
</select>
<select
id=
"unBindSourcePageList"
resultType=
"com.zzsn.event.vo.InfoSourceVo"
>
select s.id,s.info_source_code,s.web_site_name,s.site_name,s.site_uri,s.status,s.create_time from info_source s
inner join subject_info_source_map sm on s.id = sm.source_id
where sm.type = 3 and sm.subject_id = #{subjectId}
<if
test=
"infoSourceVo.webSiteName!=null and infoSourceVo.webSiteName != ''"
>
and s.web_site_name like CONCAT('%',#{infoSourceVo.webSiteName},'%')
</if>
<if
test=
"infoSourceVo.siteName!=null and infoSourceVo.siteName != ''"
>
and s.site_name like CONCAT('%',#{infoSourceVo.siteName},'%')
</if>
<if
test=
"infoSourceVo.siteUri!=null and infoSourceVo.siteUri != ''"
>
and s.site_uri = #{infoSourceVo.siteUri}
</if>
<if
test=
"infoSourceVo.status!=null and infoSourceVo.status != ''"
>
and s.status = #{infoSourceVo.status}
</if>
<if
test=
"infoSourceVo.crawlType!=null and infoSourceVo.crawlType != 0"
>
and s.crawl_type = #{infoSourceVo.crawlType}
</if>
order by s.create_time desc
limit #{offset},#{pageSize}
</select>
<select
id=
"unBindSourceCount"
resultType=
"Long"
>
select count(1) from info_source s
inner join subject_info_source_map sm on s.id = sm.source_id
where sm.type = 3 and sm.subject_id = #{subjectId}
<if
test=
"infoSourceVo.webSiteName!=null and infoSourceVo.webSiteName != ''"
>
and s.web_site_name like CONCAT('%',#{infoSourceVo.webSiteName},'%')
</if>
<if
test=
"infoSourceVo.siteName!=null and infoSourceVo.siteName != ''"
>
and s.site_name like CONCAT('%',#{infoSourceVo.siteName},'%')
</if>
<if
test=
"infoSourceVo.siteUri!=null and infoSourceVo.siteUri != ''"
>
and s.site_uri = #{infoSourceVo.siteUri}
</if>
<if
test=
"infoSourceVo.status!=null and infoSourceVo.status != ''"
>
and s.status = #{infoSourceVo.status}
</if>
<if
test=
"infoSourceVo.crawlType!=null and infoSourceVo.crawlType != 0"
>
and s.crawl_type = #{infoSourceVo.crawlType}
</if>
</select>
</select>
</mapper>
</mapper>
src/main/java/com/zzsn/event/mapper/xml/SubjectInfoSourceMapMapper.xml
浏览文件 @
ba220925
...
@@ -79,4 +79,101 @@
...
@@ -79,4 +79,101 @@
where type = 1 and subject_id = #{subjectId} and source_id in (select source_id from info_source_group_map where group_id = #{infoSourceGroupId})
where type = 1 and subject_id = #{subjectId} and source_id in (select source_id from info_source_group_map where group_id = #{infoSourceGroupId})
</update>
</update>
<select
id=
"subjectRealBindInfoSourceList"
resultType=
"String"
>
select distinct x.id from (
select iso.id
from info_source_group_map m inner join info_source iso on m.source_id = iso.id
where m.group_id in (
select source_id from subject_info_source_map where type in(2,5)
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by source_id
)
union
select iso.id
from subject_info_source_map sm inner join info_source iso on sm.source_id = iso.id where sm.type = 1
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) x
where x.id not in(
select distinct y.source_id from (
select m.source_id from info_source_group_map m
where m.group_id in (
select source_id from subject_info_source_map where type = 4
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by source_id
)
union
select sm.source_id from subject_info_source_map sm where type = 3
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) y
)
</select>
<select
id=
"subjectRealBindInfoSources"
resultType=
"com.zzsn.event.vo.SubjectStatisticsVo"
>
select distinct x.* from (
select iso.id,iso.web_site_name,iso.site_name,iso.site_uri
from info_source_group_map m inner join info_source iso on m.source_id = iso.id
where m.group_id in (
select source_id from subject_info_source_map where type in(2,5)
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by source_id
)
union
select iso.id,iso.web_site_name,iso.site_name,iso.site_uri
from subject_info_source_map sm inner join info_source iso on sm.source_id = iso.id where sm.type = 1
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) x
where x.id not in(
select distinct y.source_id from (
select m.source_id from info_source_group_map m
where m.group_id in (
select source_id from subject_info_source_map where type = 4
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
group by source_id
)
union
select sm.source_id from subject_info_source_map sm where type = 3
<if
test=
"subjectIds != null and subjectIds.size() > 0"
>
and sm.subject_id in
<foreach
collection=
"subjectIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) y
)
</select>
</mapper>
</mapper>
src/main/java/com/zzsn/event/mapper/xml/SubjectTypeMapper.xml
浏览文件 @
ba220925
...
@@ -15,7 +15,9 @@
...
@@ -15,7 +15,9 @@
<select
id=
"subjectAndTypeTree"
resultType=
"com.zzsn.event.vo.SubjectTreeVO"
>
<select
id=
"subjectAndTypeTree"
resultType=
"com.zzsn.event.vo.SubjectTreeVO"
>
select s.id,s.type_name as name,s.pid,'false' as ynSubject from subject_type s
select x.* from (
select s.id,s.type_name as name,s.pid,'false' as ynSubject,null as startTime,null as endTime,s.create_time
from subject_type s
<if
test=
"userId !=null and userId != ''"
>
<if
test=
"userId !=null and userId != ''"
>
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
</if>
</if>
...
@@ -24,7 +26,7 @@
...
@@ -24,7 +26,7 @@
</if>
</if>
where s.category = 2 and s.status = 1
where s.category = 2 and s.status = 1
union
union
select n.id,n.name,m.id as pid,'true' as ynSubject from
select n.id,n.name,m.id as pid,'true' as ynSubject
,n.start_time,n.end_time,n.create_time
from
(
(
select s.id,s.type_name as name,s.pid from subject_type s
select s.id,s.type_name as name,s.pid from subject_type s
<if
test=
"userId !=null and userId != ''"
>
<if
test=
"userId !=null and userId != ''"
>
...
@@ -38,7 +40,7 @@
...
@@ -38,7 +40,7 @@
inner join subject_type_map stm on m.id = stm.type_id
inner join subject_type_map stm on m.id = stm.type_id
inner join
inner join
(
(
select s.id,s.event_name as name from event s
select s.id,s.event_name as name
,s.start_time,s.end_time,s.create_time
from event s
<if
test=
"userId !=null and userId != ''"
>
<if
test=
"userId !=null and userId != ''"
>
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
</if>
</if>
...
@@ -47,10 +49,12 @@
...
@@ -47,10 +49,12 @@
</if>
</if>
where s.status = 1
where s.status = 1
) n on stm.subject_id = n.id
) n on stm.subject_id = n.id
) x
order by x.create_time desc
</select>
</select>
<select
id=
"subjectAndCustomerTree"
resultType=
"com.zzsn.event.vo.SubjectTreeVO"
>
<select
id=
"subjectAndCustomerTree"
resultType=
"com.zzsn.event.vo.SubjectTreeVO"
>
select c.id, c.event_name as name, m.id as pid, 'true' as ynSubject
select c.id, c.event_name as name, m.id as pid, 'true' as ynSubject
,c.start_time,c.end_time
from event c inner join
from event c inner join
(
(
select a.id, b.permission_id
select a.id, b.permission_id
...
@@ -70,6 +74,7 @@
...
@@ -70,6 +74,7 @@
<if
test=
"customerId !=null and customerId != ''"
>
<if
test=
"customerId !=null and customerId != ''"
>
and m.id = #{customerId}
and m.id = #{customerId}
</if>
</if>
order by c.create_time desc
</select>
</select>
<select
id=
"enableCustomerList"
resultType=
"com.zzsn.event.vo.SubjectTreeVO"
>
<select
id=
"enableCustomerList"
resultType=
"com.zzsn.event.vo.SubjectTreeVO"
>
...
...
src/main/java/com/zzsn/event/service/ICollectionMapService.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.entity.CollectionMap
;
/**
* @Description: 文章收藏映射表
* @Author: jeecg-boot
* @Date: 2022-05-17
* @Version: V1.0
*/
public
interface
ICollectionMapService
extends
IService
<
CollectionMap
>
{
}
src/main/java/com/zzsn/event/service/IEventService.java
浏览文件 @
ba220925
...
@@ -61,7 +61,7 @@ public interface IEventService extends IService<Event> {
...
@@ -61,7 +61,7 @@ public interface IEventService extends IService<Event> {
* @author lkg
* @author lkg
* @date 2024/4/8
* @date 2024/4/8
*/
*/
IPage
<
EventFrontVO
>
frontPageList
(
String
eventName
,
Integer
eventType
,
String
labelField
,
String
labelName
,
String
order
,
String
orderType
,
Integer
pageNo
,
Integer
pageSize
);
IPage
<
EventFrontVO
>
frontPageList
(
String
eventName
,
Integer
eventType
,
String
labelField
,
String
labelName
,
String
order
,
String
orderType
,
Integer
pageNo
,
Integer
pageSize
);
/**
/**
* 分页列表(专题类别)-新平台管理
* 分页列表(专题类别)-新平台管理
...
@@ -72,7 +72,7 @@ public interface IEventService extends IService<Event> {
...
@@ -72,7 +72,7 @@ public interface IEventService extends IService<Event> {
* @author lkg
* @author lkg
* @date 2024/4/28
* @date 2024/4/28
*/
*/
IPage
<
EventNewPlatVO
>
newPlatPageList
(
SubjectCondition
subjectCondition
,
Integer
pageNo
,
Integer
pageSize
);
IPage
<
EventNewPlatVO
>
newPlatPageList
(
SubjectCondition
subjectCondition
,
Integer
pageNo
,
Integer
pageSize
);
/**
/**
* 分页列表(客户)-新平台管理
* 分页列表(客户)-新平台管理
...
@@ -83,7 +83,7 @@ public interface IEventService extends IService<Event> {
...
@@ -83,7 +83,7 @@ public interface IEventService extends IService<Event> {
* @author lkg
* @author lkg
* @date 2024/4/28
* @date 2024/4/28
*/
*/
IPage
<
EventNewPlatVO
>
newPlatCustomerPageList
(
SubjectCondition
subjectCondition
,
Integer
pageNo
,
Integer
pageSize
);
IPage
<
EventNewPlatVO
>
newPlatCustomerPageList
(
SubjectCondition
subjectCondition
,
Integer
pageNo
,
Integer
pageSize
);
/**
/**
* 热点事件列表-前10
* 热点事件列表-前10
...
@@ -151,4 +151,104 @@ public interface IEventService extends IService<Event> {
...
@@ -151,4 +151,104 @@ public interface IEventService extends IService<Event> {
* @date 2024/4/29
* @date 2024/4/29
*/
*/
List
<
Node
>
projectList
(
String
userId
,
String
customerId
);
List
<
Node
>
projectList
(
String
userId
,
String
customerId
);
/**
* 分类下的专题id集合
*
* @param userId 用户id
* @param typeIds 分类id集合
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
selectSubjectByTypeIds
(
String
userId
,
List
<
String
>
typeIds
);
/**
* 用户下的事件id集合
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
selectSubjectWithCustomer
(
String
userId
,
String
customerId
);
/**
* 专题绑定关键词的id集合
*
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
bindKeyWordsIdList
(
List
<
String
>
subjectIds
);
/**
* 专题绑定模型信息列表
*
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/5/6
*/
List
<
LabelModelVo
>
selectLabelModelBySubjectId
(
List
<
String
>
subjectIds
);
/**
* 企业标签下的企业信用代码集合
*
* @param labelIds 企业标签id集合
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
codesByLabels
(
List
<
String
>
labelIds
);
/**
* 专题直接绑定信息源-批量
*
* @param directBindInfoVO 参数封装
* @author lkg
* @date 2024/4/24
*/
void
directBindInfoSource
(
DirectBindInfoVO
directBindInfoVO
);
/**
* 专题直接解绑信息源-批量
*
* @param directBindInfoVO 参数封装
* @author lkg
* @date 2024/4/24
*/
void
directRemoveInfoSource
(
DirectBindInfoVO
directBindInfoVO
);
/**
* 删除专题下已屏蔽的信息源(即恢复绑定关系)
*
* @param subjectId 专题id
* @param infoSourceId 信息源id
* @author lkg
* @date 2024/5/7
*/
void
removeUnBindInfoSource
(
String
subjectId
,
String
infoSourceId
);
/**
* 专题关联信息源时间段内的采集量统计
*
* @param subjectIds 专题id集合
* @param startDate 开始时间
* @param endDate 结束时间
* @author lkg
* @date 2024/5/7
*/
List
<
List
<
String
>>
subjectStatistics
(
List
<
String
>
subjectIds
,
String
startDate
,
String
endDate
);
/**
* 专题绑定的关键词组-分页列表
*
* @param subjectIds 专题id集合
* @param groupName 词组名称
* @param wordName 关键词名称
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/5/7
*/
IPage
<
KeyWordsPage
>
bindKeyWordsList
(
List
<
String
>
subjectIds
,
String
groupName
,
String
wordName
,
Integer
pageNo
,
Integer
pageSize
);
}
}
src/main/java/com/zzsn/event/service/IInfoSourceService.java
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
service
;
package
com
.
zzsn
.
event
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.zzsn.event.vo.InfoSourceCondition
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
com.zzsn.event.xxljob.entity.InfoSource
;
import
com.zzsn.event.xxljob.entity.InfoSource
;
import
java.util.List
;
/**
/**
* @Description: 信息源表
* @Description: 信息源表
* @Author: jeecg-boot
* @Author: jeecg-boot
* @Date:
2022-01-18
* @Date: 2022-01-18
* @Version: V1.0
* @Version: V1.0
*/
*/
public
interface
IInfoSourceService
extends
IService
<
InfoSource
>
{
public
interface
IInfoSourceService
extends
IService
<
InfoSource
>
{
String
getNatureName
(
String
id
);
/**
* 专题绑定信息源列表
*
* @param infoSourceCondition 筛选条件
* @param subjectIds 专题id集合
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/5/7
*/
IPage
<
InfoSourceVo
>
bindInfoSourceList
(
InfoSourceCondition
infoSourceCondition
,
List
<
String
>
subjectIds
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 专题直接屏蔽的信息源列表(不包括专题屏蔽的信息源组下的信息源)
*
* @param infoSourceCondition 筛选条件
* @param subjectId 专题id
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/30
*/
IPage
<
InfoSourceVo
>
unBindSourcePageList
(
InfoSourceCondition
infoSourceCondition
,
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
);
}
}
src/main/java/com/zzsn/event/service/ISubjectInfoSourceMapService.java
浏览文件 @
ba220925
...
@@ -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.SubjectInfoSourceMap
;
import
com.zzsn.event.entity.SubjectInfoSourceMap
;
import
com.zzsn.event.vo.SubjectStatisticsVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -54,4 +55,21 @@ public interface ISubjectInfoSourceMapService extends IService<SubjectInfoSource
...
@@ -54,4 +55,21 @@ public interface ISubjectInfoSourceMapService extends IService<SubjectInfoSource
*/
*/
List
<
String
>
querySubjectIdsByGroupId
(
String
infoSourceGroupId
);
List
<
String
>
querySubjectIdsByGroupId
(
String
infoSourceGroupId
);
/**
* 专题真正绑定的信息源id集合
*
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/5/6
*/
List
<
String
>
subjectRealBindInfoSourceList
(
List
<
String
>
subjectIds
);
/**
* 专题真正绑定的信息源集合
*
* @param subjectIds 专题id集合
* @author lkg
* @date 2024/5/6
*/
List
<
SubjectStatisticsVo
>
subjectRealBindInfoSources
(
List
<
String
>
subjectIds
);
}
}
src/main/java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
浏览文件 @
ba220925
...
@@ -7,7 +7,7 @@ import com.zzsn.event.constant.Constants;
...
@@ -7,7 +7,7 @@ import com.zzsn.event.constant.Constants;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.SubjectAnalysis
;
import
com.zzsn.event.entity.SubjectAnalysis
;
import
com.zzsn.event.service.AnalysisService
;
import
com.zzsn.event.service.AnalysisService
;
import
com.zzsn.event.
service
.EsService
;
import
com.zzsn.event.
es
.EsService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.SubjectAnalysisService
;
import
com.zzsn.event.service.SubjectAnalysisService
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.DateUtil
;
...
...
src/main/java/com/zzsn/event/service/impl/CollectionMapServiceImpl.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.entity.CollectionMap
;
import
com.zzsn.event.mapper.CollectionMapMapper
;
import
com.zzsn.event.service.ICollectionMapService
;
import
org.springframework.stereotype.Service
;
/**
* @Description: 文章收藏映射表
* @Author: jeecg-boot
* @Date: 2022-05-17
* @Version: V1.0
*/
@Service
public
class
CollectionMapServiceImpl
extends
ServiceImpl
<
CollectionMapMapper
,
CollectionMap
>
implements
ICollectionMapService
{
}
src/main/java/com/zzsn/event/service/impl/EventServiceImpl.java
浏览文件 @
ba220925
...
@@ -2,17 +2,21 @@ package com.zzsn.event.service.impl;
...
@@ -2,17 +2,21 @@ package com.zzsn.event.service.impl;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.map.MapUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
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.BindTypeEnum
;
import
com.zzsn.event.enums.CodePrefixEnum
;
import
com.zzsn.event.enums.CodePrefixEnum
;
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.CodeGenerateUtil
;
import
com.zzsn.event.util.CronUtil
;
import
com.zzsn.event.util.CronUtil
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.HanlpUtil
;
import
com.zzsn.event.util.HanlpUtil
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.util.tree.Node
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.*
;
...
@@ -296,6 +300,31 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -296,6 +300,31 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
}
}
@Override
@Override
public
List
<
String
>
selectSubjectByTypeIds
(
String
userId
,
List
<
String
>
typeIds
)
{
return
baseMapper
.
selectSubjectByTypeIds
(
userId
,
typeIds
);
}
@Override
public
List
<
String
>
codesByLabels
(
List
<
String
>
labelIds
)
{
return
baseMapper
.
codesByLabels
(
labelIds
);
}
@Override
public
List
<
LabelModelVo
>
selectLabelModelBySubjectId
(
List
<
String
>
subjectIds
)
{
return
baseMapper
.
selectLabelModelBySubjectId
(
subjectIds
);
}
@Override
public
List
<
String
>
bindKeyWordsIdList
(
List
<
String
>
subjectIds
)
{
return
baseMapper
.
bindKeyWordsIdList
(
subjectIds
);
}
@Override
public
List
<
String
>
selectSubjectWithCustomer
(
String
userId
,
String
customerId
)
{
return
baseMapper
.
selectSubjectWithCustomer
(
userId
,
customerId
);
}
@Override
public
List
<
EventExcelVO
>
frontList
(
List
<
String
>
eventIdList
,
Integer
size
)
{
public
List
<
EventExcelVO
>
frontList
(
List
<
String
>
eventIdList
,
Integer
size
)
{
return
baseMapper
.
frontList
(
eventIdList
,
size
);
return
baseMapper
.
frontList
(
eventIdList
,
size
);
}
}
...
@@ -317,6 +346,130 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
...
@@ -317,6 +346,130 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
return
rn
;
return
rn
;
}
}
@Override
public
void
directBindInfoSource
(
DirectBindInfoVO
directBindInfoVO
)
{
String
subjectId
=
directBindInfoVO
.
getSubjectId
();
List
<
String
>
bindList
=
directBindInfoVO
.
getBindList
();
Integer
type
=
BindTypeEnum
.
INFO_SOURCE
.
getvalue
();
for
(
String
infoSourceId
:
bindList
)
{
/*
* 1.先删除该信息源在专题下的所有数据
* 2.再判断该信息源在专题已绑定的信息源组下,若不在则新增绑定关系;若在则跳过
*/
LambdaQueryWrapper
<
SubjectInfoSourceMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectInfoSourceMap:
:
getSourceId
,
infoSourceId
)
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
);
iSubjectInfoSourceMapService
.
remove
(
queryWrapper
);
int
num
=
baseMapper
.
ynBelowBindGroup
(
subjectId
,
infoSourceId
);
if
(
num
==
0
)
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSourceId
(
infoSourceId
);
subjectInfoSourceMap
.
setSubjectId
(
subjectId
);
subjectInfoSourceMap
.
setType
(
type
);
iSubjectInfoSourceMapService
.
save
(
subjectInfoSourceMap
);
}
}
}
@Override
public
void
directRemoveInfoSource
(
DirectBindInfoVO
directBindInfoVO
)
{
String
subjectId
=
directBindInfoVO
.
getSubjectId
();
List
<
String
>
excludeList
=
directBindInfoVO
.
getExcludeList
();
for
(
String
infoSourceId
:
excludeList
)
{
/*
* 1.先删除该信息源在专题下的所有数据
* 2.再判断该信息源在专题已排除的信息源组下,若不在则新增绑定关系;若在则跳过
*/
LambdaQueryWrapper
<
SubjectInfoSourceMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectInfoSourceMap:
:
getSourceId
,
infoSourceId
)
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
);
iSubjectInfoSourceMapService
.
remove
(
queryWrapper
);
int
num
=
baseMapper
.
ynBelowExcludeGroup
(
subjectId
,
infoSourceId
);
if
(
num
==
0
)
{
SubjectInfoSourceMap
subjectInfoSourceMap
=
new
SubjectInfoSourceMap
();
subjectInfoSourceMap
.
setSourceId
(
infoSourceId
);
subjectInfoSourceMap
.
setSubjectId
(
subjectId
);
subjectInfoSourceMap
.
setType
(
BindTypeEnum
.
EXCLUDE_INFO_SOURCE
.
getvalue
());
iSubjectInfoSourceMapService
.
save
(
subjectInfoSourceMap
);
}
}
}
@Override
public
void
removeUnBindInfoSource
(
String
subjectId
,
String
infoSourceId
)
{
int
num
=
baseMapper
.
ynBelowExcludeGroup
(
subjectId
,
infoSourceId
);
if
(
num
==
0
)
{
LambdaUpdateWrapper
<
SubjectInfoSourceMap
>
update
=
Wrappers
.
lambdaUpdate
();
iSubjectInfoSourceMapService
.
update
(
update
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
)
.
eq
(
SubjectInfoSourceMap:
:
getSourceId
,
infoSourceId
)
.
eq
(
SubjectInfoSourceMap:
:
getType
,
3
)
.
set
(
SubjectInfoSourceMap:
:
getType
,
1
));
}
else
{
LambdaQueryWrapper
<
SubjectInfoSourceMap
>
queryWrapper
=
Wrappers
.
lambdaQuery
();
queryWrapper
.
eq
(
SubjectInfoSourceMap:
:
getSourceId
,
infoSourceId
)
.
eq
(
SubjectInfoSourceMap:
:
getSubjectId
,
subjectId
)
.
eq
(
SubjectInfoSourceMap:
:
getType
,
3
);
iSubjectInfoSourceMapService
.
remove
(
queryWrapper
);
}
}
@Override
public
List
<
List
<
String
>>
subjectStatistics
(
List
<
String
>
subjectIds
,
String
startDate
,
String
endDate
)
{
List
<
String
>
dateList
=
DateUtil
.
betweenDate
(
startDate
,
endDate
);
List
<
List
<
String
>>
dataList
=
new
ArrayList
<>();
//专题关联的信息源集合
List
<
SubjectStatisticsVo
>
infoSourceList
=
iSubjectInfoSourceMapService
.
subjectRealBindInfoSources
(
subjectIds
);
Map
<
String
,
Map
<
String
,
Long
>>
stringMapMap
=
esService
.
regetFromEs
(
infoSourceList
.
stream
().
map
(
SubjectStatisticsVo:
:
getId
).
collect
(
Collectors
.
toList
()),
startDate
,
endDate
);
//封装导出excel需要的数据集合
for
(
SubjectStatisticsVo
subjectStatisticsVo
:
infoSourceList
)
{
Map
<
String
,
Long
>
stringLongMap
=
stringMapMap
.
get
(
subjectStatisticsVo
.
getId
());
List
<
SubjectStatisticsVo
>
value
=
new
ArrayList
<>();
int
sum
=
0
;
if
(
null
!=
stringLongMap
)
{
for
(
String
s
:
stringLongMap
.
keySet
())
{
SubjectStatisticsVo
subjectStatisticsVoTemp
=
new
SubjectStatisticsVo
();
subjectStatisticsVoTemp
.
setId
(
subjectStatisticsVo
.
getId
());
subjectStatisticsVoTemp
.
setSiteName
(
subjectStatisticsVo
.
getSiteName
());
subjectStatisticsVoTemp
.
setDate
(
s
);
int
num
=
Math
.
toIntExact
(
stringLongMap
.
get
(
s
));
subjectStatisticsVoTemp
.
setCollectCount
(
num
);
value
.
add
(
subjectStatisticsVoTemp
);
sum
+=
Math
.
toIntExact
(
stringLongMap
.
get
(
s
));
}
}
List
<
String
>
list
=
new
ArrayList
<>(
subjectStatisticsVo
.
toExcelList
());
//信息源在时间段内的采集总量
list
.
add
(
String
.
valueOf
(
sum
));
//信息源采集到数据的日期集合
Set
<
String
>
collectDates
=
value
.
stream
().
collect
(
Collectors
.
groupingBy
(
SubjectStatisticsVo:
:
getDate
)).
keySet
();
//信息源未采集到数据的日期集合
List
<
String
>
noCollectDates
=
new
ArrayList
<>(
dateList
);
noCollectDates
.
removeAll
(
collectDates
);
for
(
String
date
:
noCollectDates
)
{
SubjectStatisticsVo
vo
=
new
SubjectStatisticsVo
();
BeanUtils
.
copyProperties
(
subjectStatisticsVo
,
vo
);
vo
.
setCollectCount
(
0
);
vo
.
setDate
(
date
);
value
.
add
(
vo
);
}
//根据采集时间排序(正序)
value
.
sort
(
Comparator
.
comparing
(
SubjectStatisticsVo:
:
getDate
));
value
.
forEach
(
e
->
list
.
add
(
String
.
valueOf
(
e
.
getCollectCount
())));
dataList
.
add
(
list
);
}
return
dataList
;
}
@Override
public
IPage
<
KeyWordsPage
>
bindKeyWordsList
(
List
<
String
>
subjectIds
,
String
groupName
,
String
wordName
,
Integer
pageNo
,
Integer
pageSize
)
{
int
offset
=
(
pageNo
-
1
)
*
pageSize
;
List
<
KeyWordsPage
>
wordsList
=
baseMapper
.
bindKeyWordsList
(
subjectIds
,
groupName
,
wordName
,
offset
,
pageSize
);
Long
count
=
baseMapper
.
bindKeyWordsCount
(
subjectIds
,
groupName
,
wordName
);
IPage
<
KeyWordsPage
>
page
=
new
Page
<>(
pageNo
,
pageSize
,
count
);
page
.
setRecords
(
wordsList
);
return
page
;
}
private
void
addRegionMap
(
String
eventId
,
List
<
RegionVO
>
regionList
)
{
private
void
addRegionMap
(
String
eventId
,
List
<
RegionVO
>
regionList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
regionList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
regionList
))
{
List
<
EventRegionMap
>
dataList
=
new
ArrayList
<>();
List
<
EventRegionMap
>
dataList
=
new
ArrayList
<>();
...
...
src/main/java/com/zzsn/event/service/impl/InfoSourceServiceImpl.java
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
service
.
impl
;
package
com
.
zzsn
.
event
.
service
.
impl
;
import
cn.hutool.core.date.DateField
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.mapper.InfoSourceMapper
;
import
com.zzsn.event.mapper.InfoSourceMapper
;
import
com.zzsn.event.service.IInfoSourceService
;
import
com.zzsn.event.service.IInfoSourceService
;
import
com.zzsn.event.vo.CountVO
;
import
com.zzsn.event.vo.InfoSourceCondition
;
import
com.zzsn.event.vo.InfoSourceVo
;
import
com.zzsn.event.vo.NumVO
;
import
com.zzsn.event.xxljob.entity.InfoSource
;
import
com.zzsn.event.xxljob.entity.InfoSource
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* @Description: 信息源表
* @Description: 信息源表
* @Author: jeecg-boot
* @Author: jeecg-boot
...
@@ -16,11 +32,71 @@ import org.springframework.stereotype.Service;
...
@@ -16,11 +32,71 @@ import org.springframework.stereotype.Service;
@Service
@Service
public
class
InfoSourceServiceImpl
extends
ServiceImpl
<
InfoSourceMapper
,
InfoSource
>
implements
IInfoSourceService
{
public
class
InfoSourceServiceImpl
extends
ServiceImpl
<
InfoSourceMapper
,
InfoSource
>
implements
IInfoSourceService
{
@Autowired
private
EsService
esService
;
@Override
@Override
public
String
getNatureName
(
String
id
)
{
public
IPage
<
InfoSourceVo
>
bindInfoSourceList
(
InfoSourceCondition
infoSourceCondition
,
List
<
String
>
subjectIds
,
Integer
pageNo
,
Integer
pageSize
)
{
return
baseMapper
.
getNatureName
(
id
);
int
offset
=
(
pageNo
-
1
)
*
pageSize
;
if
(
pageNo
==
0
)
{
offset
=
0
;
}
List
<
InfoSourceVo
>
pageList
=
new
ArrayList
<>();
List
<
String
>
bindList
=
baseMapper
.
bindSourceIdList
(
infoSourceCondition
,
subjectIds
,
offset
,
pageSize
);
if
(
CollectionUtils
.
isNotEmpty
(
bindList
))
{
pageList
=
baseMapper
.
queryInfoSource
(
bindList
);
for
(
InfoSourceVo
infoSourceVo1
:
pageList
)
{
//性质
if
(
StringUtils
.
isNotEmpty
(
infoSourceVo1
.
getNatureIds
()))
{
String
natureIds
=
infoSourceVo1
.
getNatureIds
();
List
<
String
>
natureIdList
=
Arrays
.
asList
(
natureIds
.
split
(
","
));
infoSourceVo1
.
setInfoSourceNatureIds
(
natureIdList
);
}
//采集量
NumVO
totalCollectCount
=
esService
.
count
(
infoSourceVo1
.
getId
(),
null
,
null
,
1
);
//总采集量
infoSourceVo1
.
setTotalCount
(
totalCollectCount
.
getCount
());
Date
endTime
=
new
Date
();
DateTime
startTime
=
DateUtil
.
offsetDay
(
endTime
,
-
30
);
//月采集量
NumVO
monthCollectCount
=
esService
.
count
(
infoSourceVo1
.
getId
(),
DateUtil
.
formatDate
(
startTime
),
DateUtil
.
formatDate
(
endTime
),
2
);
infoSourceVo1
.
setMonthCount
(
monthCollectCount
.
getCount
());
List
<
NumVO
>
children
=
monthCollectCount
.
getChildren
();
Map
<
String
,
List
<
NumVO
>>
collect
=
children
.
stream
().
collect
(
Collectors
.
groupingBy
(
NumVO:
:
getKey
));
//周采集量
long
weekCount
=
0L
;
List
<
DateTime
>
rangeToList
=
DateUtil
.
rangeToList
(
DateUtil
.
offsetDay
(
endTime
,
-
7
),
endTime
,
DateField
.
DAY_OF_YEAR
);
for
(
DateTime
dateTime
:
rangeToList
)
{
List
<
NumVO
>
countVOS
=
collect
.
get
(
DateUtil
.
formatDate
(
dateTime
));
if
(
CollectionUtils
.
isNotEmpty
(
countVOS
))
{
weekCount
+=
countVOS
.
get
(
0
).
getCount
();
}
}
infoSourceVo1
.
setWeekCount
(
weekCount
);
//昨日采集量
DateTime
yesterday
=
DateUtil
.
yesterday
();
List
<
NumVO
>
countVOS
=
collect
.
get
(
DateUtil
.
formatDate
(
yesterday
));
if
(
CollectionUtils
.
isNotEmpty
(
countVOS
))
{
infoSourceVo1
.
setYesterdayCount
(
countVOS
.
get
(
0
).
getCount
());
}
else
{
infoSourceVo1
.
setYesterdayCount
(
0L
);
}
}
}
Long
count
=
baseMapper
.
bindSourceIdCount
(
infoSourceCondition
,
subjectIds
);
IPage
<
InfoSourceVo
>
pageData
=
new
Page
<>(
pageNo
,
pageSize
,
count
);
pageData
.
setRecords
(
pageList
);
return
pageData
;
}
}
@Override
public
IPage
<
InfoSourceVo
>
unBindSourcePageList
(
InfoSourceCondition
infoSourceCondition
,
String
subjectId
,
Integer
pageNo
,
Integer
pageSize
)
{
int
offset
=
(
pageNo
-
1
)
*
pageSize
;
List
<
InfoSourceVo
>
pageList
=
baseMapper
.
unBindSourcePageList
(
infoSourceCondition
,
subjectId
,
offset
,
pageSize
);
Long
count
=
baseMapper
.
unBindSourceCount
(
infoSourceCondition
,
subjectId
);
IPage
<
InfoSourceVo
>
pageData
=
new
Page
<>(
pageNo
,
pageSize
,
count
);
pageData
.
setRecords
(
pageList
);
return
pageData
;
}
}
}
src/main/java/com/zzsn/event/service/impl/SubjectInfoSourceMapServiceImpl.java
浏览文件 @
ba220925
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.zzsn.event.entity.SubjectInfoSourceMap
;
import
com.zzsn.event.entity.SubjectInfoSourceMap
;
import
com.zzsn.event.mapper.SubjectInfoSourceMapMapper
;
import
com.zzsn.event.mapper.SubjectInfoSourceMapMapper
;
import
com.zzsn.event.service.ISubjectInfoSourceMapService
;
import
com.zzsn.event.service.ISubjectInfoSourceMapService
;
import
com.zzsn.event.vo.SubjectStatisticsVo
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -54,6 +55,16 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour
...
@@ -54,6 +55,16 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour
}
}
@Override
@Override
public
List
<
SubjectStatisticsVo
>
subjectRealBindInfoSources
(
List
<
String
>
subjectIds
)
{
return
baseMapper
.
subjectRealBindInfoSources
(
subjectIds
);
}
@Override
public
List
<
String
>
subjectRealBindInfoSourceList
(
List
<
String
>
subjectIds
)
{
return
baseMapper
.
subjectRealBindInfoSourceList
(
subjectIds
);
}
@Override
public
void
updateMain
(
SubjectInfoSourceMap
subjectInfoSourceMap
){
public
void
updateMain
(
SubjectInfoSourceMap
subjectInfoSourceMap
){
//更新信息源组信息权重
//更新信息源组信息权重
baseMapper
.
updateById
(
subjectInfoSourceMap
);
baseMapper
.
updateById
(
subjectInfoSourceMap
);
...
...
src/main/java/com/zzsn/event/service/impl/SubjectTypeServiceImpl.java
浏览文件 @
ba220925
...
@@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -86,10 +87,11 @@ public class SubjectTypeServiceImpl extends ServiceImpl<SubjectTypeMapper, Subje
...
@@ -86,10 +87,11 @@ public class SubjectTypeServiceImpl extends ServiceImpl<SubjectTypeMapper, Subje
}
}
@Override
@Override
public
List
<
SubjectTreeVO
>
subjectAndTypeTree
(
String
userId
,
String
customerId
)
{
public
List
<
SubjectTreeVO
>
subjectAndTypeTree
(
String
userId
,
String
customerId
)
{
List
<
SubjectTreeVO
>
subjectTreeVOS
=
baseMapper
.
subjectAndTypeTree
(
userId
,
customerId
);
List
<
SubjectTreeVO
>
subjectTreeVOS
=
baseMapper
.
subjectAndTypeTree
(
userId
,
customerId
);
List
<
SubjectTreeVO
>
tree
=
TreeUtil
.
tree
(
subjectTreeVOS
,
"0"
);
List
<
SubjectTreeVO
>
tree
=
TreeUtil
.
tree
(
subjectTreeVOS
,
"0"
);
tree
.
forEach
(
this
::
subjectNumCount
);
tree
.
forEach
(
this
::
subjectNumCount
);
tree
.
sort
(
Comparator
.
comparing
(
SubjectTreeVO:
:
getCreateTime
));
return
tree
;
return
tree
;
}
}
...
...
src/main/java/com/zzsn/event/task/AnalysisTask.java
浏览文件 @
ba220925
...
@@ -8,7 +8,7 @@ import com.zzsn.event.constant.Constants;
...
@@ -8,7 +8,7 @@ import com.zzsn.event.constant.Constants;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.Event
;
import
com.zzsn.event.entity.SubjectAnalysis
;
import
com.zzsn.event.entity.SubjectAnalysis
;
import
com.zzsn.event.service.AnalysisService
;
import
com.zzsn.event.service.AnalysisService
;
import
com.zzsn.event.
service
.EsService
;
import
com.zzsn.event.
es
.EsService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.service.SubjectAnalysisService
;
import
com.zzsn.event.service.SubjectAnalysisService
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.DateUtil
;
...
...
src/main/java/com/zzsn/event/util/DateUtil.java
浏览文件 @
ba220925
...
@@ -4,10 +4,7 @@ import java.text.SimpleDateFormat;
...
@@ -4,10 +4,7 @@ import java.text.SimpleDateFormat;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.ChronoUnit
;
import
java.time.temporal.ChronoUnit
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
public
class
DateUtil
{
public
class
DateUtil
{
...
@@ -116,4 +113,31 @@ public class DateUtil {
...
@@ -116,4 +113,31 @@ public class DateUtil {
return
dateToString
(
calendar
.
getTime
(),
"yyyy-MM-dd 00:00:00"
);
return
dateToString
(
calendar
.
getTime
(),
"yyyy-MM-dd 00:00:00"
);
}
}
public
static
List
<
String
>
betweenDate
(
String
startDate
,
String
endDate
)
{
List
<
String
>
dateList
=
new
ArrayList
<>();
String
formatStr
=
"yyyy-MM-dd"
;
try
{
Date
dayOne
=
stringToDate
(
startDate
,
formatStr
);
Date
dayTwo
=
stringToDate
(
endDate
,
formatStr
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
dayOne
);
dateList
.
add
(
startDate
);
while
(
dayTwo
.
after
(
calendar
.
getTime
()))
{
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
1
);
dateList
.
add
(
format
(
calendar
.
getTime
(),
formatStr
));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
dateList
;
}
public
static
String
format
(
Date
d
,
String
format
){
if
(
d
==
null
)
{
return
""
;
}
SimpleDateFormat
myFormatter
=
new
SimpleDateFormat
(
format
);
myFormatter
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"Asia/Shanghai"
));
return
myFormatter
.
format
(
d
);
}
}
}
src/main/java/com/zzsn/event/vo/ClbNewKeywordsVO.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
@Data
public
class
ClbNewKeywordsVO
{
/**主键*/
private
String
id
;
/**关键词名称*/
private
String
name
;
/**专题id*/
private
String
subjectId
;
/**父分类ID-关联本表ID*/
private
String
pid
;
/**状态(0:未审核,1:通过,2:待定,3:删除,4:修改)*/
private
Integer
status
;
/**创建人*/
private
String
createBy
;
/**创建日期*/
private
java
.
util
.
Date
createTime
;
/**更新人*/
private
String
updateBy
;
/**更新日期*/
private
java
.
util
.
Date
updateTime
;
/**所属部门*/
private
String
sysOrgCode
;
/**数据类型(1:新词 2:人名 3:热词 4:地名 5:机构名 6:热词)*/
private
Integer
type
;
/**资讯标题*/
private
String
title
;
/**资讯id*/
private
String
articleId
;
/**发布时间*/
private
java
.
util
.
Date
publishDate
;
}
src/main/java/com/zzsn/event/vo/DirectBindInfoVO.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
import
java.util.List
;
/**
*
*
* @author lkg
* @date 2024/4/24
*/
@Data
public
class
DirectBindInfoVO
{
//专题id
private
String
subjectId
;
//绑定信息源id集合
private
List
<
String
>
bindList
;
//排除信息源id集合
private
List
<
String
>
excludeList
;
}
src/main/java/com/zzsn/event/vo/DisplayInfo.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
DisplayInfo
{
//说明:...Raw 表示原文,即原语言
//作者
private
String
author
;
private
String
authorRaw
;
//正文
private
String
content
;
private
String
contentRaw
;
//带标签正文
private
String
contentWithTag
;
private
String
contentWithTagRaw
;
//入库时间
private
String
createDate
;
//信息id
private
String
id
;
//信息来源id(信息源或者关键词)
private
String
sid
;
//语言
private
String
lang
;
private
String
langRaw
;
//来源(信息来源)
private
String
origin
;
private
String
originRaw
;
//发布时间
private
String
publishDate
;
//原始时间(网页上,没有解析之前的时间)
private
String
originalTime
;
//发布地址
private
String
sourceAddress
;
//摘要
private
String
summary
;
private
String
summaryRaw
;
//关键词
private
String
keyWords
;
//标题
private
String
title
;
private
String
titleRaw
;
//采集来源(如通用、定制、微信公众号等)
private
String
source
;
//附加字段
private
String
type
;
//标签信息
private
List
<
Label
>
labels
;
//视频下载链接
private
String
downLoadUrl
;
//视频链接(原链接 网页版)
private
String
videoUrl
;
//视频链接(原链接 手机版)
private
String
videoPhoneUrl
;
//视频时长
private
Long
videoTime
;
//视频第一帧图片
private
String
videoImg
;
//自定义标签
private
List
<
String
>
customLabel
;
private
Double
score
;
//专题库类型(0: 其它 1:政策;2:领导讲话;3:专家观点;4:企业案例)
private
Integer
classificationType
;
//置顶排位(默认为0)
private
Integer
topNum
;
//删除标记(1:删除;0:保留)
private
Integer
deleteFlag
;
private
String
subjectId
;
//审核操作(0:未审核 1:审核通过 2:审核未通过 3:暂定 默认值为0)
private
Integer
checkStatus
;
//阅读数
private
Long
readNum
=
0L
;
//是否收藏
private
boolean
ynCollect
=
false
;
//重复id
private
String
repeatId
;
//(1:主条目 0:非主条目)
private
String
flag
;
//关联的主条目id
private
String
masterEntryId
;
//原始id(去重服务生成的id,因为一条信息可以属于多个专题,原始id会发生改变,所以存储一个原始id,找寻对应关系)
private
String
originalId
;
//快照地址
private
String
screenShotImg
;
//资讯更新时间
private
String
updateDate
;
//信息类别(1:报刊 2:博客 3:客户端 4:论坛 5:视频 6:外媒 7:网站 8:微博 9:微信 10:新闻 11:政务 12:其它)
private
String
infoSourceType
;
//数据类型 qbyw:情报要闻 qbnc:情报内参
private
String
dataType
;
//abi报表地址
private
String
abiUrl
;
//abi报表id
private
String
abiId
;
//栏目code列表
private
List
<
String
>
programaIds
;
//数据库code列表
private
List
<
String
>
databaseIds
;
//是否风险
private
Integer
isRisk
;
//风险类型
private
List
<
String
>
riskTypes
;
//标签集合
private
List
<
LabelInfo
>
labelInfos
;
//是否为资讯(true:资讯 false:附件类)
private
Boolean
ynArticle
=
true
;
//法规号
private
String
contentNo
;
//来源 (政策发文机关)
private
String
organ
;
//政策文件分类
private
String
topicClassification
;
//发文字号
private
String
issuedNumber
;
//成文时间
private
String
writtenDate
;
//数据所在的索引名称
private
String
index
;
/**
* 是否是主条目,0为非主条目,1为主条目
*/
private
Integer
ismain
;
}
src/main/java/com/zzsn/event/vo/EventDataCondition.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
EventDataCondition
{
private
String
id
;
//专题id
private
String
subjectId
;
//文章链接
private
String
url
;
//搜索时,全部情况下,,搜索传值
private
String
search
;
//专题标题
private
String
title
;
//专题摘要
private
String
summary
;
//内容
private
String
content
;
//作者
private
String
author
;
//发布时间
private
String
publishDate
;
//来源
private
String
origin
;
//得分
private
String
score
;
//企业名称
private
String
enterpriseName
;
//倾向性
private
String
orientation
;
//风险类型
private
String
riskType
;
//企业性质
private
String
enterpriseNature
;
//区域
private
String
area
;
//行业
private
String
trade
;
//信息类型
private
String
InfoType
;
//专题库类型
private
String
libraryType
;
//ids
private
List
<
String
>
ids
;
//置顶标识(0取消置顶 1置顶)
private
Integer
type
;
private
String
sourceAddress
;
//开始时间
private
String
startTime
;
//结束时间
private
String
endTime
;
//倾向性(前端交互参数约定 0:中性 1:负面 2:正面)
private
Integer
tendency
;
//专题库类型(1:政策;2:领导讲话;3:专家观点;4:企业案例)
private
Integer
classificationType
;
//审核操作(0:未审核 1:审核通过 2:审核未通过 3:暂定 默认值为0)
private
List
<
Integer
>
checkStatusList
;
private
Integer
checkStatus
;
//删除标记(1:删除;0:保留)
private
Integer
deleteFlag
=
0
;
//国家
private
String
countryIds
;
//城市
private
String
cityIds
;
//企业
private
String
enterpriseIds
;
//人物
private
String
characterIds
;
//字段
private
String
fields
;
//操作类型 add .update
private
String
action
;
//日期最大值
private
String
maxValue
;
//关键词检索范围 1标题 2正文 3 全部
private
Integer
searchScope
;
//精确度("精确"| --)
private
String
searchAccuracy
;
//数据所在的索引名称
private
String
index
;
private
String
operateStartTime
;
private
String
operateEndTime
;
private
String
labelName
;
}
src/main/java/com/zzsn/event/vo/EventDataVO.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* 数据
*/
@Data
public
class
EventDataVO
{
//说明:...Raw 表示原文,即原语言
//作者
private
String
author
;
private
String
authorRaw
;
//正文
private
String
content
;
private
String
contentRaw
;
//带标签正文
private
String
contentWithTag
;
private
String
contentWithTagRaw
;
//入库时间
private
String
createDate
;
private
Date
createDateTime
;
//信息id
private
String
id
;
//信息来源id(信息源或者关键词)
private
String
sid
;
//语言
private
String
lang
;
private
String
langRaw
;
//来源(信息来源)
private
String
origin
;
private
String
originRaw
;
//发布时间
private
String
publishDate
;
//原始时间(网页上,没有解析之前的时间)
private
String
originalTime
;
//发布地址
private
String
sourceAddress
;
//摘要
private
String
summary
;
private
String
summaryRaw
;
//关键词
private
String
keyWords
;
//标题
private
String
title
;
private
String
titleRaw
;
//采集来源(如通用、定制、微信公众号等)
private
String
source
;
//附加字段
private
String
type
;
//标签信息
private
List
<
Label
>
labels
;
//视频下载链接
private
String
downLoadUrl
;
//视频链接(原链接 网页版)
private
String
videoUrl
;
//视频链接(原链接 手机版)
private
String
videoPhoneUrl
;
//视频时长
private
Long
videoTime
;
//视频第一帧图片
private
String
videoImg
;
//重复id
private
String
repeatId
;
//(1:主条目 0:非主条目)
private
String
flag
;
//关联的主条目id
private
String
masterEntryId
;
//原始id(去重服务生成的id,因为一条信息可以属于多个专题,原始id会发生改变,所以存储一个原始id,找寻对应关系)
private
String
originalId
;
private
String
subjectId
;
//快照地址
private
String
screenShotImg
;
//数据所在的索引名称
private
String
index
;
}
src/main/java/com/zzsn/event/vo/EventNewPlatVO.java
浏览文件 @
ba220925
...
@@ -12,6 +12,8 @@ import lombok.Data;
...
@@ -12,6 +12,8 @@ import lombok.Data;
public
class
EventNewPlatVO
{
public
class
EventNewPlatVO
{
private
String
id
;
private
String
id
;
private
String
eventName
;
private
String
eventName
;
private
String
startTime
;
private
String
endTime
;
private
Integer
subjectInfoNum
;
private
Integer
subjectInfoNum
;
private
Integer
unCheckNum
;
private
Integer
unCheckNum
;
private
Integer
infoSourceNum
;
private
Integer
infoSourceNum
;
...
...
src/main/java/com/zzsn/event/vo/InfoSourceCondition.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
/**
* 信息源搜索条件
*
* @author lkg
* @date 2024/5/7
*/
@Data
public
class
InfoSourceCondition
{
/**信息源名称,微信公众号名称,微博名称*/
private
String
webSiteName
;
/**栏目名称*/
private
String
siteName
;
/**栏目URL,微信公众号URL,微博URL*/
private
String
siteUri
;
/**状态*/
private
String
status
;
/**爬虫类别*/
private
int
crawlType
;
}
src/main/java/com/zzsn/event/vo/InfoSourceVo.java
浏览文件 @
ba220925
...
@@ -253,4 +253,13 @@ public class InfoSourceVo {
...
@@ -253,4 +253,13 @@ public class InfoSourceVo {
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
private
Date
updateTime
;
/**总采集量*/
private
Long
totalCount
;
/**昨日采集量*/
private
Long
yesterdayCount
;
/**近一周采集量*/
private
Long
weekCount
;
/**近一月采集量*/
private
Long
monthCount
;
}
}
src/main/java/com/zzsn/event/vo/LabelInfo.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
LabelInfo
{
//标签id
private
String
labelId
;
//标签名称
private
String
labelName
;
//标签类别
private
String
labelType
;
//标签标识
private
String
labelMark
;
//标签
private
List
<
Label
>
labelList
;
}
src/main/java/com/zzsn/event/vo/LabelModelVo.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
@Data
public
class
LabelModelVo
{
/**专题id*/
private
String
subjectId
;
/**模型对应的id*/
private
String
modelId
;
/**模型服务名称*/
private
String
modelServiceName
;
/**标签id*/
private
String
labelId
;
/**模型对应的标签标识*/
private
String
labelMark
;
/**模型对应的标签名称*/
private
String
labelName
;
/**模型类别*/
private
String
labelType
;
}
src/main/java/com/zzsn/event/vo/NewKeywordsCondition.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
/**
*
*
* @author lkg
* @date 2024/5/7
*/
@Data
public
class
NewKeywordsCondition
{
/**专题id*/
private
String
subjectId
;
/**关键词名称*/
private
String
name
;
/**数据类型(1:新词 2:人名 3:热词 4:地名 5:机构名 6:热词)*/
private
Integer
type
;
/**状态(0:未审核,1:通过,2:待定,3:删除,4:修改)*/
private
Integer
status
;
}
src/main/java/com/zzsn/event/vo/NumVO.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
import
java.util.List
;
/**
*
*
* @author lkg
* @date 2024/5/7
*/
@Data
public
class
NumVO
{
//时间或者来源或者项目名称或者热词名称
private
String
key
;
//数量
private
long
count
;
//子集
private
List
<
NumVO
>
children
;
}
src/main/java/com/zzsn/event/vo/SubjectStatisticsVo.java
0 → 100644
浏览文件 @
ba220925
package
com
.
zzsn
.
event
.
vo
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author lkg
* @description: 专题关联信息源,采集数量统计封装类
* @date 2022/12/29 11:32
*/
@Data
public
class
SubjectStatisticsVo
{
//信息源id
String
id
;
//网站名称
String
webSiteName
;
//栏目名称
String
siteName
;
//栏目地址
String
siteUri
;
//采集数量
int
collectCount
;
//采集日期
String
date
;
public
List
<
String
>
toExcelList
(){
List
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
id
);
list
.
add
(
webSiteName
);
list
.
add
(
siteName
);
list
.
add
(
siteUri
);
return
list
;
}
}
src/main/java/com/zzsn/event/vo/SubjectTreeVO.java
浏览文件 @
ba220925
...
@@ -17,4 +17,8 @@ public class SubjectTreeVO extends Node {
...
@@ -17,4 +17,8 @@ public class SubjectTreeVO extends Node {
private
Boolean
ynSubject
;
private
Boolean
ynSubject
;
private
Integer
subjectCount
=
0
;
private
Integer
subjectCount
=
0
;
private
String
startTime
;
private
String
endTime
;
private
String
createTime
;
}
}
src/main/resources/application-dev.yml
浏览文件 @
ba220925
...
@@ -110,6 +110,8 @@ spring:
...
@@ -110,6 +110,8 @@ spring:
key-deserializer
:
org.apache.kafka.common.serialization.StringDeserializer
key-deserializer
:
org.apache.kafka.common.serialization.StringDeserializer
#值的反序列化器类,实现类实现了接口org.apache.kafka.common.serialization.Deserializer
#值的反序列化器类,实现类实现了接口org.apache.kafka.common.serialization.Deserializer
value-deserializer
:
org.apache.kafka.common.serialization.StringDeserializer
value-deserializer
:
org.apache.kafka.common.serialization.StringDeserializer
main
:
allow-circular-references
:
true
mybatis-plus
:
mybatis-plus
:
mapper-locations
:
classpath*:com/zzsn/event/**/xml/*.xml
mapper-locations
:
classpath*:com/zzsn/event/**/xml/*.xml
configuration
:
configuration
:
...
...
src/main/resources/application-pro.yml
浏览文件 @
ba220925
...
@@ -107,6 +107,8 @@ spring:
...
@@ -107,6 +107,8 @@ spring:
key-deserializer
:
org.apache.kafka.common.serialization.StringDeserializer
key-deserializer
:
org.apache.kafka.common.serialization.StringDeserializer
#值的反序列化器类,实现类实现了接口org.apache.kafka.common.serialization.Deserializer
#值的反序列化器类,实现类实现了接口org.apache.kafka.common.serialization.Deserializer
value-deserializer
:
org.apache.kafka.common.serialization.StringDeserializer
value-deserializer
:
org.apache.kafka.common.serialization.StringDeserializer
main
:
allow-circular-references
:
true
mybatis-plus
:
mybatis-plus
:
mapper-locations
:
classpath*:com/zzsn/event/**/xml/*.xml
mapper-locations
:
classpath*:com/zzsn/event/**/xml/*.xml
configuration
:
configuration
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论