Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenjunjie
brandkbs2
Commits
ef37d1a7
Commit
ef37d1a7
authored
Dec 06, 2023
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
非人工项目-舆情库舆情数据聚合修复
parent
fb2a085f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
115 additions
and
10 deletions
+115
-10
src/main/java/com/zhiwei/brandkbs2/controller/admin/EventController.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/controller/app/AppEventController.java
+12
-6
src/main/java/com/zhiwei/brandkbs2/pojo/Event.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/pojo/EventData.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/pojo/EventDisseminationTrend.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/pojo/EventTopArticlesAnalysis.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/pojo/NonManualProjectPlan.java
+3
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+2
-1
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
+93
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/controller/admin/EventController.java
View file @
ef37d1a7
...
...
@@ -41,7 +41,7 @@ import java.util.Set;
* @date: 2022-05-16 14:30
*/
@RestController
@RequestMapping
(
"/admin/event"
)
//
@RequestMapping("/admin/event")
@Api
(
tags
=
"事件管理"
,
description
=
"提供事件的增、删、改、查等功能"
)
@Auth
(
role
=
RoleEnum
.
COMMON_ADMIN
)
@Deprecated
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppEventController.java
View file @
ef37d1a7
...
...
@@ -71,34 +71,39 @@ public class AppEventController extends BaseController {
}
@ApiOperation
(
"前台事件库-搜索条件"
)
@GetMapping
(
"/search/criteria"
)
// @GetMapping("/search/criteria")
@Deprecated
public
ResponseResult
getEventsSearchCriteria
()
{
return
ResponseResult
.
success
(
eventService
.
getEventsSearchCriteria
());
}
@ApiOperation
(
"前台事件库-品牌事件库"
)
@PostMapping
(
"/list"
)
// @PostMapping("/list")
@Deprecated
public
ResponseResult
getEventList
(
@RequestBody
EventSearchDTO
eventSearchDTO
)
{
return
ResponseResult
.
success
(
eventService
.
getEventList
(
eventSearchDTO
));
}
@ApiOperation
(
"前台事件库-事件详情-基础信息"
)
@GetMapping
(
"/info/base/{id}"
)
//
@GetMapping("/info/base/{id}")
@Auth
(
role
=
RoleEnum
.
NO_AUTHORISE
)
@Deprecated
public
ResponseResult
getEventBaseInfo
(
@PathVariable
String
id
)
{
return
ResponseResult
.
success
(
eventService
.
getEventBaseInfo
(
id
));
}
@ApiOperation
(
"前台事件库-事件详情-传播趋势图"
)
@GetMapping
(
"/info/dissemination-trends/{id}"
)
//
@GetMapping("/info/dissemination-trends/{id}")
@Auth
(
role
=
RoleEnum
.
NO_AUTHORISE
)
@Deprecated
public
ResponseResult
getEventDisseminationTrends
(
@PathVariable
String
id
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"小时"
)
String
type
)
{
return
ResponseResult
.
success
(
eventService
.
getEventDisseminationTrends
(
id
,
type
));
}
@ApiOperation
(
"前台事件库-事件详情-渠道发声"
)
@GetMapping
(
"/info/channel-voices/{id}"
)
//
@GetMapping("/info/channel-voices/{id}")
@Auth
(
role
=
RoleEnum
.
NO_AUTHORISE
)
@Deprecated
public
ResponseResult
getEventChannelVoices
(
@PathVariable
String
id
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"重要渠道"
)
String
type
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
...
...
@@ -108,8 +113,9 @@ public class AppEventController extends BaseController {
}
@ApiOperation
(
"前台事件库-事件详情-热门文章分析"
)
@GetMapping
(
"/info/top-articles-analysis/{id}"
)
//
@GetMapping("/info/top-articles-analysis/{id}")
@Auth
(
role
=
RoleEnum
.
NO_AUTHORISE
)
@Deprecated
public
ResponseResult
getEventTopArticlesAnalysis
(
@PathVariable
String
id
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"按时间"
)
String
type
,
@RequestParam
(
value
=
"emotion"
,
defaultValue
=
"全部"
)
String
emotion
,
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/Event.java
View file @
ef37d1a7
...
...
@@ -19,6 +19,7 @@ import java.util.Objects;
@Getter
@Setter
@Document
(
collection
=
"brandkbs_event"
)
@Deprecated
public
class
Event
extends
AbstractBaseMongo
{
/**
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/EventData.java
View file @
ef37d1a7
...
...
@@ -23,6 +23,7 @@ import java.util.Optional;
*/
@Getter
@Setter
@Deprecated
public
class
EventData
extends
AbstractBaseMongo
{
/**
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/EventDisseminationTrend.java
View file @
ef37d1a7
...
...
@@ -19,6 +19,7 @@ import java.util.Map;
@Getter
@Setter
@Document
(
collection
=
"brandkbs_event_dissemination_trend"
)
@Deprecated
public
class
EventDisseminationTrend
extends
AbstractBaseMongo
{
/**
* 负面稿件传播
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/EventTopArticlesAnalysis.java
View file @
ef37d1a7
...
...
@@ -12,6 +12,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
@Getter
@Setter
@Document
(
collection
=
"brandkbs_event_top_articles_analysis"
)
@Deprecated
public
class
EventTopArticlesAnalysis
extends
AbstractBaseMongo
{
/**
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/NonManualProjectPlan.java
View file @
ef37d1a7
...
...
@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.pojo;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.pojo.dto.NonManualProjectPlanDTO
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
...
...
@@ -63,8 +64,8 @@ public class NonManualProjectPlan extends AbstractBaseMongo{
this
.
id
=
dto
.
getId
();
this
.
projectId
=
UserThreadLocal
.
getProjectId
();
this
.
name
=
dto
.
getName
();
this
.
keyword
=
dto
.
getKeyword
(
);
this
.
filterWord
=
dto
.
getFilterWord
(
);
this
.
keyword
=
Tools
.
canonicalKeyword
(
dto
.
getKeyword
()
);
this
.
filterWord
=
Tools
.
canonicalKeyword
(
dto
.
getFilterWord
()
);
this
.
lasting
=
dto
.
getLasting
();
this
.
endTime
=
dto
.
getEndTime
();
this
.
type
=
dto
.
getType
();
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
ef37d1a7
...
...
@@ -2076,6 +2076,7 @@ public class MarkDataServiceImpl implements MarkDataService {
@Override
public
PageVO
<
MarkFlowEntity
>
getNonManualMarkAggreeList
(
MarkSearchDTO
dto
)
{
try
{
dto
.
setGid
(-
1L
);
PageVO
<
MarkFlowEntity
>
aggreeList
=
getAggreeList
(
dto
,
markFlowService:
:
createNonManualMarkFlowInfo
,
false
);
JSONObject
jsonObject
=
new
JSONObject
();
// 统计平台进量(声量)
...
...
@@ -2608,7 +2609,7 @@ public class MarkDataServiceImpl implements MarkDataService {
List
<
MarkFlowEntity
>
markFlowEntities
=
new
ArrayList
<>();
MarkFlowEntity
instance
=
new
MarkFlowEntity
(
aggreeResult
.
getData
(),
dto
.
getLinkedGroupId
());
instance
.
setInfo
(
createMarkFlowInfo
.
create
(
new
MarkFlowService
.
MarkInfoSource
(
aggreeResult
.
getData
(),
dto
.
getProjectId
(),
dto
.
getContendId
(),
dto
.
get
PlanId
(),
dto
.
getLinkedGroup
Id
(),
dto
.
getGid
())));
dto
.
get
LinkedGroupId
(),
dto
.
getPlan
Id
(),
dto
.
getGid
())));
markFlowEntities
.
add
(
instance
);
// 添加父标题集下的子标题集
resList
.
add
(
MarkFlowEntity
.
getAggreeInstance
(
markFlowEntities
,
aggreeResult
,
sonDetails
));
...
...
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
View file @
ef37d1a7
...
...
@@ -1245,4 +1245,96 @@ public class Tools {
return
null
;
}
}
/**
* 是否为null
*
* @param @param obj
* @param @return 设定文件
* @return boolean 返回类型
* @Title: isNull
* @Description: 是否为null
*/
public
static
boolean
isNull
(
Object
obj
)
{
return
!
nonNull
(
obj
);
}
/**
* 关键词规范 空格且丨或
*
* @param str
* @return String
*/
public
static
String
canonicalKeyword
(
String
str
)
{
if
(
isNull
(
str
))
{
return
null
;
}
// 回车、换行处理
str
=
str
.
replaceAll
(
"(\r\n|\r|\n|\n\r)"
,
"|"
);
// 空格处理
str
=
checkAndUniteStringBlankOnce
(
str
);
// 前后空格去除
str
=
str
.
trim
();
// 多余|去除
str
=
checkAndUniteStringVerticalOnce
(
str
);
// 前后|去除
str
=
trimSpecial
(
str
,
'|'
);
return
str
;
}
/**
* 特殊trim
*
* @param str
* @param c
* @return String
*/
public
static
String
trimSpecial
(
String
str
,
char
c
)
{
char
[]
chars
=
str
.
toCharArray
();
int
len
=
chars
.
length
;
int
st
=
0
;
while
((
st
<
len
)
&&
(
chars
[
st
]
==
c
))
{
st
++;
}
while
((
st
<
len
)
&&
(
chars
[
len
-
1
]
==
c
))
{
len
--;
}
return
(
st
>
0
)
&&
(
len
<
chars
.
length
)
?
str
.
substring
(
st
,
len
)
:
str
;
}
/**
* 空格处理(多空格-》1,特殊空格去除)
*
* @param str
* @return
*/
public
static
String
checkAndUniteStringBlankOnce
(
String
str
)
{
//全角空格替换
if
(
str
.
split
(
"[\\u3000]+"
).
length
>
1
)
{
str
=
str
.
replaceAll
(
"[\\u3000]+"
,
" "
);
}
//不间断空格替换
if
(
str
.
split
(
"[\\u00A0]+"
).
length
>
1
)
{
str
=
str
.
replaceAll
(
"[\\u00A0]+"
,
" "
);
}
// XSL中的空格
if
(
str
.
split
(
"(\\u0026\\u0023\\u0031\\u0036\\u0030\\u003b)+"
).
length
>
1
)
{
str
=
str
.
replaceAll
(
"(\\u0026\\u0023\\u0031\\u0036\\u0030\\u003b)+"
,
" "
);
}
return
Arrays
.
stream
(
str
.
split
(
"[\\u0020]+"
)).
filter
(
StringUtils:
:
isNotBlank
).
collect
(
Collectors
.
joining
(
" "
));
}
/**
* 丨处理
*
* @param str
* @return
*/
public
static
String
checkAndUniteStringVerticalOnce
(
String
str
)
{
//丨替换
if
(
str
.
split
(
"[\\u4e28]+"
).
length
>
1
)
{
str
=
str
.
replaceAll
(
"[\\u4e28]+"
,
"|"
);
}
return
Arrays
.
stream
(
str
.
split
(
"[\\u007c]+"
)).
filter
(
StringUtils:
:
isNotBlank
).
collect
(
Collectors
.
joining
(
"|"
));
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment