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
628bd882
Commit
628bd882
authored
Aug 22, 2022
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/8/22 15:22 修改竞品库相关接口错误
parent
bb6734c5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
17 deletions
+43
-17
src/main/java/com/zhiwei/brandkbs2/controller/app/AppContendController.java
+17
-7
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
+7
-7
src/main/java/com/zhiwei/brandkbs2/es/EsQueryTools.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
+18
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+0
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/controller/app/AppContendController.java
View file @
628bd882
...
@@ -2,14 +2,17 @@ package com.zhiwei.brandkbs2.controller.app;
...
@@ -2,14 +2,17 @@ package com.zhiwei.brandkbs2.controller.app;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
import
com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.ExportAppYuqingDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.service.MarkDataService
;
import
com.zhiwei.brandkbs2.service.MarkDataService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.tuple.Pair
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -34,26 +37,33 @@ public class AppContendController extends BaseController {
...
@@ -34,26 +37,33 @@ public class AppContendController extends BaseController {
@ApiOperation
(
"竞品库-竞品舆情-搜索条件"
)
@ApiOperation
(
"竞品库-竞品舆情-搜索条件"
)
@GetMapping
(
"/searchCriteria"
)
@GetMapping
(
"/searchCriteria"
)
public
ResponseResult
getContendSearchCriteria
(
@RequestParam
(
required
=
false
)
String
linkedGroup
Id
)
{
public
ResponseResult
getContendSearchCriteria
(
@RequestParam
(
required
=
false
)
String
contend
Id
)
{
return
ResponseResult
.
success
(
markDataService
.
getContendSearchCriteria
(
linkedGroup
Id
));
return
ResponseResult
.
success
(
markDataService
.
getContendSearchCriteria
(
contend
Id
));
}
}
@ApiOperation
(
"竞品库-竞品舆情-搜索结果列表"
)
@ApiOperation
(
"竞品库-竞品舆情-搜索结果列表"
)
@
Ge
tMapping
(
"/list"
)
@
Pos
tMapping
(
"/list"
)
public
ResponseResult
getContendSearchList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
throws
IOException
{
public
ResponseResult
getContendSearchList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
throws
IOException
{
return
ResponseResult
.
success
(
markDataService
.
getContendSearchList
(
markSearchDTO
));
return
ResponseResult
.
success
(
markDataService
.
getContendSearchList
(
markSearchDTO
));
}
}
@ApiOperation
(
"竞品库-竞品分析-舆情总结页面"
)
@ApiOperation
(
"竞品库-竞品分析-舆情总结页面"
)
@
Ge
tMapping
(
"/summary"
)
@
Pos
tMapping
(
"/summary"
)
public
ResponseResult
getSummary
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
throws
IOException
{
public
ResponseResult
getSummary
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
throws
IOException
{
return
ResponseResult
.
success
(
markDataService
.
getContendSummary
(
markSearchDTO
,
true
));
return
ResponseResult
.
success
(
markDataService
.
getContendSummary
(
markSearchDTO
,
true
));
// 测试时关闭缓存,记得打开
}
}
@ApiOperation
(
"竞品库-竞品对比-传播分析页面"
)
@ApiOperation
(
"竞品库-竞品对比-传播分析页面"
)
@
Ge
tMapping
(
"/spread/analyze"
)
@
Pos
tMapping
(
"/spread/analyze"
)
public
ResponseResult
getSpreadAnalyze
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
throws
IOException
{
public
ResponseResult
getSpreadAnalyze
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
throws
IOException
{
return
ResponseResult
.
success
(
markDataService
.
getContendSpreadAnalyze
(
markSearchDTO
,
5
,
true
));
return
ResponseResult
.
success
(
markDataService
.
getContendSpreadAnalyze
(
markSearchDTO
,
5
,
true
));
// 测试时关闭缓存,记得打开
}
}
@ApiOperation
(
"竞品库-竞品舆情-舆情导出"
)
@PostMapping
(
value
=
"/list/export"
)
public
ResponseResult
exportContendMarkList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
Pair
<
String
,
List
<
ExportAppYuqingDTO
>>
stringListPair
=
markDataService
.
downloadContendMarkList
(
markSearchDTO
);
EasyExcelUtil
.
download
(
stringListPair
.
getLeft
()
+
"_舆情列表数据"
,
"sheet1"
,
ExportAppYuqingDTO
.
class
,
stringListPair
.
getRight
(),
response
);
return
ResponseResult
.
success
();
}
}
}
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
View file @
628bd882
...
@@ -49,9 +49,9 @@ public class AppSearchController {
...
@@ -49,9 +49,9 @@ public class AppSearchController {
@RequestParam
(
value
=
"type"
,
defaultValue
=
"weibo"
)
String
type
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"weibo"
)
String
type
,
@RequestParam
(
value
=
"word"
)
String
word
){
@RequestParam
(
value
=
"word"
)
String
word
){
ResponseEntity
<
JSONObject
>
jsonObjectResponseEntity
=
restTemplate
.
getForEntity
(
trendsSearchUrl
,
JSONObject
.
class
,
limit
,
page
,
type
,
word
);
ResponseEntity
<
JSONObject
>
jsonObjectResponseEntity
=
restTemplate
.
getForEntity
(
trendsSearchUrl
,
JSONObject
.
class
,
limit
,
page
,
type
,
word
);
JSONObject
body
=
jsonObjectResponseEntity
.
getBody
();
JSONObject
result
=
jsonObjectResponseEntity
.
getBody
();
if
(
Objects
.
nonNull
(
body
)){
if
(
Objects
.
nonNull
(
result
)){
return
ResponseResult
.
success
(
body
);
return
ResponseResult
.
success
(
result
);
}
else
{
}
else
{
return
ResponseResult
.
failure
(
"响应超时"
);
return
ResponseResult
.
failure
(
"响应超时"
);
}
}
...
@@ -63,8 +63,8 @@ public class AppSearchController {
...
@@ -63,8 +63,8 @@ public class AppSearchController {
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"3"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"3"
)
Integer
pageSize
,
@RequestParam
(
"keyword"
)
String
keyword
){
@RequestParam
(
"keyword"
)
String
keyword
){
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
crisisSearchUrl
,
String
.
class
,
page
,
pageSize
,
keyword
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
crisisSearchUrl
,
String
.
class
,
page
,
pageSize
,
keyword
);
Object
data
=
JSON
.
parseObject
(
responseEntity
.
getBody
()).
get
(
"data"
);
Object
result
=
JSON
.
parseObject
(
responseEntity
.
getBody
()).
get
(
"data"
);
return
ResponseResult
.
success
(
data
);
return
ResponseResult
.
success
(
result
);
}
}
@ApiOperation
(
"搜索-全网事件库-查事件"
)
@ApiOperation
(
"搜索-全网事件库-查事件"
)
...
@@ -73,7 +73,7 @@ public class AppSearchController {
...
@@ -73,7 +73,7 @@ public class AppSearchController {
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
){
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
){
String
name
=
keyword
.
trim
();
String
name
=
keyword
.
trim
();
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getEfSearchUrl
,
String
.
class
,
name
,
page
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getEfSearchUrl
,
String
.
class
,
name
,
page
);
JSONObject
jsonObjec
t
=
JSON
.
parseObject
(
responseEntity
.
getBody
());
JSONObject
resul
t
=
JSON
.
parseObject
(
responseEntity
.
getBody
());
return
ResponseResult
.
success
(
jsonObjec
t
);
return
ResponseResult
.
success
(
resul
t
);
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/es/EsQueryTools.java
View file @
628bd882
...
@@ -92,7 +92,7 @@ public class EsQueryTools {
...
@@ -92,7 +92,7 @@ public class EsQueryTools {
public
static
BoolQueryBuilder
assembleMediaTypeQuery
(
List
<
String
>
mediaTypes
)
{
public
static
BoolQueryBuilder
assembleMediaTypeQuery
(
List
<
String
>
mediaTypes
)
{
BoolQueryBuilder
tagQuery
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
tagQuery
=
QueryBuilders
.
boolQuery
();
mediaTypes
.
forEach
(
e
->
{
mediaTypes
.
forEach
(
e
->
{
tagQuery
.
should
(
QueryBuilders
.
termQuery
(
"brandkbs_
mark_
cache_maps.channel_type.keyword"
,
e
));
tagQuery
.
should
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.channel_type.keyword"
,
e
));
});
});
return
tagQuery
;
return
tagQuery
;
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
View file @
628bd882
...
@@ -6,9 +6,11 @@ import com.zhiwei.brandkbs2.pojo.Event;
...
@@ -6,9 +6,11 @@ import com.zhiwei.brandkbs2.pojo.Event;
import
com.zhiwei.brandkbs2.pojo.MarkFlowEntity
;
import
com.zhiwei.brandkbs2.pojo.MarkFlowEntity
;
import
com.zhiwei.brandkbs2.pojo.dto.ExportAppYuqingDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ExportAppYuqingDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.SearchFilterDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
org.apache.commons.lang3.tuple.Pair
;
import
org.apache.commons.lang3.tuple.Pair
;
import
javax.naming.directory.SearchControls
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -166,10 +168,10 @@ public interface MarkDataService {
...
@@ -166,10 +168,10 @@ public interface MarkDataService {
/**
/**
* 竞品库-获取搜索条件
* 竞品库-获取搜索条件
*
*
* @param
linkedGroupId 关联组
Id
* @param
contendId 竞品
Id
* @return 搜索条件
* @return 搜索条件
*/
*/
JSONObject
getContendSearchCriteria
(
String
linkedGroup
Id
);
JSONObject
getContendSearchCriteria
(
String
contend
Id
);
/**
/**
* 竞品库-获取搜索结果列表
* 竞品库-获取搜索结果列表
...
@@ -200,6 +202,20 @@ public interface MarkDataService {
...
@@ -200,6 +202,20 @@ public interface MarkDataService {
JSONObject
getContendSpreadAnalyze
(
MarkSearchDTO
markSearchDTO
,
int
hotArticleSize
,
boolean
cache
)
throws
IOException
;
JSONObject
getContendSpreadAnalyze
(
MarkSearchDTO
markSearchDTO
,
int
hotArticleSize
,
boolean
cache
)
throws
IOException
;
/**
/**
* 竞品库-舆情导出
* @param markSearchDTO 标注数据搜索传输类
* @return
*/
Pair
<
String
,
List
<
ExportAppYuqingDTO
>>
downloadContendMarkList
(
MarkSearchDTO
markSearchDTO
);
/**
* 搜索-全网搜
* @param searchFilterDTO
* @return
*/
JSONObject
searchWholeNetwork
(
SearchFilterDTO
searchFilterDTO
);
/**
* 时间段内稿件数
* 时间段内稿件数
*
*
* @param startTime
* @param startTime
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
628bd882
This diff is collapsed.
Click to expand it.
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