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
2172f56e
Commit
2172f56e
authored
Oct 31, 2024
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!596
parents
60c28946
359721f9
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
100 additions
and
66 deletions
+100
-66
src/main/java/com/zhiwei/brandkbs2/controller/admin/BehaviorController.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
+2
-0
src/main/java/com/zhiwei/brandkbs2/controller/app/AppDownloadController.java
+24
-24
src/main/java/com/zhiwei/brandkbs2/controller/app/AppHotController.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
+8
-8
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileReportController.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/easyexcel/dto/ExportWholeSearchRecordDTO.java
+0
-1
src/main/java/com/zhiwei/brandkbs2/pojo/Project.java
+5
-0
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ProjectVO.java
+8
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+7
-6
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
+22
-5
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectWarnServiceImpl.java
+13
-14
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/ToolsetServiceImpl.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
+2
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/controller/admin/BehaviorController.java
View file @
2172f56e
...
@@ -70,7 +70,7 @@ public class BehaviorController extends BaseController {
...
@@ -70,7 +70,7 @@ public class BehaviorController extends BaseController {
@RequestParam
(
value
=
"behavior"
,
defaultValue
=
"true"
)
boolean
behavior
)
{
@RequestParam
(
value
=
"behavior"
,
defaultValue
=
"true"
)
boolean
behavior
)
{
List
<
ExportBehaviorDTO
>
downloadList
=
behaviorService
.
download
(
startTime
,
endTime
,
behavior
);
List
<
ExportBehaviorDTO
>
downloadList
=
behaviorService
.
download
(
startTime
,
endTime
,
behavior
);
String
behaviorName
=
behavior
?
"后台"
:
"前台"
;
String
behaviorName
=
behavior
?
"后台"
:
"前台"
;
String
sheetName
=
ProjectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
()
+
"_"
+
behaviorName
;
String
sheetName
=
ProjectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
()
+
"_"
+
behaviorName
;
EasyExcelUtil
.
download
(
sheetName
+
"用户行为"
,
sheetName
,
ExportBehaviorDTO
.
class
,
downloadList
,
response
);
EasyExcelUtil
.
download
(
sheetName
+
"用户行为"
,
sheetName
,
ExportBehaviorDTO
.
class
,
downloadList
,
response
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -111,7 +111,7 @@ public class BehaviorController extends BaseController {
...
@@ -111,7 +111,7 @@ public class BehaviorController extends BaseController {
public
ResponseResult
downloadLogRecordList
(
@RequestParam
(
"startTime"
)
long
startTime
,
public
ResponseResult
downloadLogRecordList
(
@RequestParam
(
"startTime"
)
long
startTime
,
@RequestParam
(
"endTime"
)
long
endTime
)
{
@RequestParam
(
"endTime"
)
long
endTime
)
{
List
<
ExportUserLogRecordDTO
>
list
=
behaviorService
.
downloadUserLogRecord
(
startTime
,
endTime
);
List
<
ExportUserLogRecordDTO
>
list
=
behaviorService
.
downloadUserLogRecord
(
startTime
,
endTime
);
String
sheetName
=
ProjectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
()
+
"_操作记录"
;
String
sheetName
=
ProjectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
()
+
"_操作记录"
;
EasyExcelUtil
.
download
(
sheetName
,
sheetName
,
ExportUserLogRecordDTO
.
class
,
list
,
response
);
EasyExcelUtil
.
download
(
sheetName
,
sheetName
,
ExportUserLogRecordDTO
.
class
,
list
,
response
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
View file @
2172f56e
...
@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.controller.admin;
...
@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.controller.admin;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.aop.LogRecord
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
...
@@ -89,6 +90,7 @@ public class ProjectController extends BaseController {
...
@@ -89,6 +90,7 @@ public class ProjectController extends BaseController {
@ApiOperation
(
"修改项目"
)
@ApiOperation
(
"修改项目"
)
@PutMapping
(
"/update"
)
@PutMapping
(
"/update"
)
@LogRecord
(
values
=
"extraProjectName"
,
description
=
"修改项目-修改别名"
,
arguments
=
true
,
entity
=
true
)
public
ResponseResult
updateProject
(
@RequestBody
ProjectVO
projectVO
)
{
public
ResponseResult
updateProject
(
@RequestBody
ProjectVO
projectVO
)
{
return
ProjectService
.
updateProject
(
projectVO
);
return
ProjectService
.
updateProject
(
projectVO
);
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppDownloadController.java
View file @
2172f56e
...
@@ -97,7 +97,7 @@ public class AppDownloadController extends BaseController {
...
@@ -97,7 +97,7 @@ public class AppDownloadController extends BaseController {
HttpEntity
<
org
.
springframework
.
core
.
io
.
Resource
>
entity
=
restTemplate
.
exchange
(
yuqingInterface
+
"/upload/template/form?projectId="
+
project
.
getBrandLinkedGroupId
(),
HttpMethod
.
GET
,
HttpEntity
<
org
.
springframework
.
core
.
io
.
Resource
>
entity
=
restTemplate
.
exchange
(
yuqingInterface
+
"/upload/template/form?projectId="
+
project
.
getBrandLinkedGroupId
(),
HttpMethod
.
GET
,
requestEntity
,
org
.
springframework
.
core
.
io
.
Resource
.
class
);
requestEntity
,
org
.
springframework
.
core
.
io
.
Resource
.
class
);
// excel写入至指定路径
// excel写入至指定路径
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
project
.
get
Project
Name
(),
UserThreadLocal
.
getNickname
(),
project
.
getBrandName
()
+
"_稿件模板"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
project
.
get
Brand
Name
(),
UserThreadLocal
.
getNickname
(),
project
.
getBrandName
()
+
"_稿件模板"
);
if
(
null
!=
entity
.
getBody
())
{
if
(
null
!=
entity
.
getBody
())
{
EasyExcelUtil
.
write
(
filePath
,
entity
.
getBody
().
getInputStream
());
EasyExcelUtil
.
write
(
filePath
,
entity
.
getBody
().
getInputStream
());
}
}
...
@@ -121,7 +121,7 @@ public class AppDownloadController extends BaseController {
...
@@ -121,7 +121,7 @@ public class AppDownloadController extends BaseController {
HttpEntity
<
JSONObject
>
requestEntity
=
new
HttpEntity
<>(
getHeaders
());
HttpEntity
<
JSONObject
>
requestEntity
=
new
HttpEntity
<>(
getHeaders
());
HttpEntity
<
org
.
springframework
.
core
.
io
.
Resource
>
entity
=
restTemplate
.
exchange
(
yuqingInterface
+
"/upload/list/download/file/"
+
id
+
"?formType="
+
formType
,
HttpMethod
.
GET
,
requestEntity
,
org
.
springframework
.
core
.
io
.
Resource
.
class
);
HttpEntity
<
org
.
springframework
.
core
.
io
.
Resource
>
entity
=
restTemplate
.
exchange
(
yuqingInterface
+
"/upload/list/download/file/"
+
id
+
"?formType="
+
formType
,
HttpMethod
.
GET
,
requestEntity
,
org
.
springframework
.
core
.
io
.
Resource
.
class
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
id
+
"_"
+
formType
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
id
+
"_"
+
formType
);
if
(
null
!=
entity
.
getBody
())
{
if
(
null
!=
entity
.
getBody
())
{
EasyExcelUtil
.
write
(
filePath
,
entity
.
getBody
().
getInputStream
());
EasyExcelUtil
.
write
(
filePath
,
entity
.
getBody
().
getInputStream
());
...
@@ -142,7 +142,7 @@ public class AppDownloadController extends BaseController {
...
@@ -142,7 +142,7 @@ public class AppDownloadController extends BaseController {
List
<
ExportWordDTO
>
list
=
highWordService
.
downloadWord
(
projectId
);
List
<
ExportWordDTO
>
list
=
highWordService
.
downloadWord
(
projectId
);
ProjectVO
projectVO
=
projectService
.
getProjectVOById
(
projectId
);
ProjectVO
projectVO
=
projectService
.
getProjectVOById
(
projectId
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectVO
.
getProjectName
();
String
projectName
=
projectVO
.
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
projectVO
.
getBrandName
()
+
"_高频关键词"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
projectVO
.
getBrandName
()
+
"_高频关键词"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportWordDTO
.
class
,
list
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportWordDTO
.
class
,
list
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -157,7 +157,7 @@ public class AppDownloadController extends BaseController {
...
@@ -157,7 +157,7 @@ public class AppDownloadController extends BaseController {
List
<
ExportWordDTO
>
list
=
highlightWordService
.
downloadWord
(
projectId
);
List
<
ExportWordDTO
>
list
=
highlightWordService
.
downloadWord
(
projectId
);
ProjectVO
projectVO
=
projectService
.
getProjectVOById
(
projectId
);
ProjectVO
projectVO
=
projectService
.
getProjectVOById
(
projectId
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectVO
.
getProjectName
();
String
projectName
=
projectVO
.
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
projectVO
.
getBrandName
()
+
"_舆情列表高亮关键词"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
projectVO
.
getBrandName
()
+
"_舆情列表高亮关键词"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportWordDTO
.
class
,
list
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportWordDTO
.
class
,
list
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -178,7 +178,7 @@ public class AppDownloadController extends BaseController {
...
@@ -178,7 +178,7 @@ public class AppDownloadController extends BaseController {
List
<
ExportBehaviorDTO
>
downloadList
=
behaviorService
.
download
(
startTime
,
endTime
,
behavior
);
List
<
ExportBehaviorDTO
>
downloadList
=
behaviorService
.
download
(
startTime
,
endTime
,
behavior
);
String
behaviorName
=
behavior
?
"后台"
:
"前台"
;
String
behaviorName
=
behavior
?
"后台"
:
"前台"
;
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
behaviorName
+
"_用户行为"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
behaviorName
+
"_用户行为"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportBehaviorDTO
.
class
,
downloadList
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportBehaviorDTO
.
class
,
downloadList
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -196,7 +196,7 @@ public class AppDownloadController extends BaseController {
...
@@ -196,7 +196,7 @@ public class AppDownloadController extends BaseController {
@RequestParam
(
"endTime"
)
long
endTime
)
{
@RequestParam
(
"endTime"
)
long
endTime
)
{
List
<
ExportUserLogRecordDTO
>
list
=
behaviorService
.
downloadUserLogRecord
(
startTime
,
endTime
);
List
<
ExportUserLogRecordDTO
>
list
=
behaviorService
.
downloadUserLogRecord
(
startTime
,
endTime
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"操作记录"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"操作记录"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportUserLogRecordDTO
.
class
,
list
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportUserLogRecordDTO
.
class
,
list
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -220,7 +220,7 @@ public class AppDownloadController extends BaseController {
...
@@ -220,7 +220,7 @@ public class AppDownloadController extends BaseController {
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
List
<
ExportChannelDTO
>
downloadChannelList
=
channelService
.
findDownloadChannelList
(
contendId
,
emotion
,
platform
,
show
,
keyword
);
List
<
ExportChannelDTO
>
downloadChannelList
=
channelService
.
findDownloadChannelList
(
contendId
,
emotion
,
platform
,
show
,
keyword
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"渠道列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"渠道列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportChannelDTO
.
class
,
downloadChannelList
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportChannelDTO
.
class
,
downloadChannelList
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -234,7 +234,7 @@ public class AppDownloadController extends BaseController {
...
@@ -234,7 +234,7 @@ public class AppDownloadController extends BaseController {
public
ResponseResult
downloadArticleList
(
@RequestParam
(
value
=
"channelId"
)
String
channelId
)
{
public
ResponseResult
downloadArticleList
(
@RequestParam
(
value
=
"channelId"
)
String
channelId
)
{
List
<
ExportAdminChannelArticleDTO
>
downloadChannelArticleList
=
channelService
.
findDownloadChannelArticleList
(
channelId
);
List
<
ExportAdminChannelArticleDTO
>
downloadChannelArticleList
=
channelService
.
findDownloadChannelArticleList
(
channelId
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
channelId
+
"_渠道稿件列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
channelId
+
"_渠道稿件列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
channelId
,
ExportAdminChannelArticleDTO
.
class
,
downloadChannelArticleList
);
EasyExcelUtil
.
write
(
filePath
,
channelId
,
ExportAdminChannelArticleDTO
.
class
,
downloadChannelArticleList
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -248,7 +248,7 @@ public class AppDownloadController extends BaseController {
...
@@ -248,7 +248,7 @@ public class AppDownloadController extends BaseController {
public
ResponseResult
downloadEventList
(
@RequestParam
(
value
=
"channelId"
)
String
channelId
)
{
public
ResponseResult
downloadEventList
(
@RequestParam
(
value
=
"channelId"
)
String
channelId
)
{
List
<
ExportAdminChannelEventDTO
>
downloadChannelEventList
=
channelService
.
findDownloadChannelEventList
(
channelId
);
List
<
ExportAdminChannelEventDTO
>
downloadChannelEventList
=
channelService
.
findDownloadChannelEventList
(
channelId
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
channelId
+
"_渠道事件列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
channelId
+
"_渠道事件列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
channelId
,
ExportAdminChannelEventDTO
.
class
,
downloadChannelEventList
);
EasyExcelUtil
.
write
(
filePath
,
channelId
,
ExportAdminChannelEventDTO
.
class
,
downloadChannelEventList
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -265,7 +265,7 @@ public class AppDownloadController extends BaseController {
...
@@ -265,7 +265,7 @@ public class AppDownloadController extends BaseController {
boolean
day
=
json
.
getBooleanValue
(
"day"
);
boolean
day
=
json
.
getBooleanValue
(
"day"
);
List
<
JSONObject
>
collect
=
extraService
.
outputUsedList
(
personal
,
startTime
,
endTime
,
day
);
List
<
JSONObject
>
collect
=
extraService
.
outputUsedList
(
personal
,
startTime
,
endTime
,
day
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"全网搜使用记录"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"全网搜使用记录"
);
if
(
personal
)
{
if
(
personal
)
{
List
<
ExportWholeSearchRecordDTO
>
list
=
collect
.
stream
().
map
(
ExportWholeSearchRecordDTO:
:
createFromJSONObject
).
collect
(
Collectors
.
toList
());
List
<
ExportWholeSearchRecordDTO
>
list
=
collect
.
stream
().
map
(
ExportWholeSearchRecordDTO:
:
createFromJSONObject
).
collect
(
Collectors
.
toList
());
...
@@ -289,7 +289,7 @@ public class AppDownloadController extends BaseController {
...
@@ -289,7 +289,7 @@ public class AppDownloadController extends BaseController {
boolean
day
=
json
.
getBooleanValue
(
"day"
);
boolean
day
=
json
.
getBooleanValue
(
"day"
);
List
<
JSONObject
>
collect
=
extraService
.
outputInteractionUsedList
(
personal
,
startTime
,
endTime
,
day
);
List
<
JSONObject
>
collect
=
extraService
.
outputInteractionUsedList
(
personal
,
startTime
,
endTime
,
day
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"互动量更新使用记录"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"互动量更新使用记录"
);
if
(
personal
)
{
if
(
personal
)
{
List
<
ExportInteractionUpdateRecordDTO
>
list
=
collect
.
stream
().
map
(
ExportInteractionUpdateRecordDTO:
:
createFromJSONObject
).
collect
(
Collectors
.
toList
());
List
<
ExportInteractionUpdateRecordDTO
>
list
=
collect
.
stream
().
map
(
ExportInteractionUpdateRecordDTO:
:
createFromJSONObject
).
collect
(
Collectors
.
toList
());
...
@@ -309,7 +309,7 @@ public class AppDownloadController extends BaseController {
...
@@ -309,7 +309,7 @@ public class AppDownloadController extends BaseController {
public
ResponseResult
downloadArticles
(
@PathVariable
(
"pid"
)
String
pid
)
{
public
ResponseResult
downloadArticles
(
@PathVariable
(
"pid"
)
String
pid
)
{
ProjectVO
project
=
projectService
.
getProjectVOById
(
pid
);
ProjectVO
project
=
projectService
.
getProjectVOById
(
pid
);
// excel写入至指定路径
// excel写入至指定路径
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
project
.
getProjectName
(),
UserThreadLocal
.
getNickname
(),
project
.
getBrandName
()
+
"_命中关键词"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
project
.
get
Extra
ProjectName
(),
UserThreadLocal
.
getNickname
(),
project
.
getBrandName
()
+
"_命中关键词"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
UploadKeywordDTO
.
class
,
UploadKeywordDTO
.
change2This
(
project
.
getHitKeywords
()));
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
UploadKeywordDTO
.
class
,
UploadKeywordDTO
.
change2This
(
project
.
getHitKeywords
()));
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
}
}
...
@@ -321,7 +321,7 @@ public class AppDownloadController extends BaseController {
...
@@ -321,7 +321,7 @@ public class AppDownloadController extends BaseController {
public
ResponseResult
exportOriginList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
public
ResponseResult
exportOriginList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
Pair
<
String
,
List
<
ExportAppYuqingDTO
>>
stringListPair
=
markDataService
.
downloadYuqingMarkList
(
markSearchDTO
);
Pair
<
String
,
List
<
ExportAppYuqingDTO
>>
stringListPair
=
markDataService
.
downloadYuqingMarkList
(
markSearchDTO
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
stringListPair
.
getLeft
()
+
"_原始数据列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
stringListPair
.
getLeft
()
+
"_原始数据列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppYuqingDTO
.
class
,
stringListPair
.
getRight
());
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppYuqingDTO
.
class
,
stringListPair
.
getRight
());
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -334,7 +334,7 @@ public class AppDownloadController extends BaseController {
...
@@ -334,7 +334,7 @@ public class AppDownloadController extends BaseController {
public
ResponseResult
exportYuqingMarkList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
public
ResponseResult
exportYuqingMarkList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
Pair
<
String
,
Pair
<
List
<
List
<
String
>>,
List
<
List
<
Object
>>>>
stringPairPair
=
markDataService
.
downloadMarkListDynamicHead
(
markSearchDTO
);
Pair
<
String
,
Pair
<
List
<
List
<
String
>>,
List
<
List
<
Object
>>>>
stringPairPair
=
markDataService
.
downloadMarkListDynamicHead
(
markSearchDTO
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
stringPairPair
.
getLeft
()
+
"_舆情列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
stringPairPair
.
getLeft
()
+
"_舆情列表数据"
);
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"sheet1"
,
stringPairPair
.
getRight
().
getLeft
(),
stringPairPair
.
getRight
().
getRight
());
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"sheet1"
,
stringPairPair
.
getRight
().
getLeft
(),
stringPairPair
.
getRight
().
getRight
());
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -347,7 +347,7 @@ public class AppDownloadController extends BaseController {
...
@@ -347,7 +347,7 @@ public class AppDownloadController extends BaseController {
public
ResponseResult
downloadNonManualMarkList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
public
ResponseResult
downloadNonManualMarkList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
Pair
<
String
,
List
<
ExportAppYuqingDTO
>>
stringListPair
=
markDataService
.
downloadNonManualMarkList
(
markSearchDTO
);
Pair
<
String
,
List
<
ExportAppYuqingDTO
>>
stringListPair
=
markDataService
.
downloadNonManualMarkList
(
markSearchDTO
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
stringListPair
.
getLeft
()
+
"_舆情列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
stringListPair
.
getLeft
()
+
"_舆情列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppYuqingDTO
.
class
,
stringListPair
.
getRight
());
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppYuqingDTO
.
class
,
stringListPair
.
getRight
());
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -368,7 +368,7 @@ public class AppDownloadController extends BaseController {
...
@@ -368,7 +368,7 @@ public class AppDownloadController extends BaseController {
@RequestParam
(
value
=
"contendId"
,
defaultValue
=
"0"
)
String
contendId
)
{
@RequestParam
(
value
=
"contendId"
,
defaultValue
=
"0"
)
String
contendId
)
{
List
<
ExportAppChannelArticleDTO
>
exportAppChannelArticleDTOS
=
channelService
.
downloadArticlesByTime
(
startTime
,
endTime
,
channelId
,
contendId
);
List
<
ExportAppChannelArticleDTO
>
exportAppChannelArticleDTOS
=
channelService
.
downloadArticlesByTime
(
startTime
,
endTime
,
channelId
,
contendId
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
channelId
+
"稿件列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
channelId
+
"稿件列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppChannelArticleDTO
.
class
,
exportAppChannelArticleDTOS
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppChannelArticleDTO
.
class
,
exportAppChannelArticleDTOS
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -389,7 +389,7 @@ public class AppDownloadController extends BaseController {
...
@@ -389,7 +389,7 @@ public class AppDownloadController extends BaseController {
@RequestParam
(
value
=
"contendId"
,
defaultValue
=
"0"
)
String
contendId
)
{
@RequestParam
(
value
=
"contendId"
,
defaultValue
=
"0"
)
String
contendId
)
{
List
<
ExportAppChannelEventDTO
>
exportAppChannelEventDTOS
=
channelService
.
downloadEventsByTime
(
startTime
,
endTime
,
channelId
,
contendId
);
List
<
ExportAppChannelEventDTO
>
exportAppChannelEventDTOS
=
channelService
.
downloadEventsByTime
(
startTime
,
endTime
,
channelId
,
contendId
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
channelId
+
"事件列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
channelId
+
"事件列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppChannelEventDTO
.
class
,
exportAppChannelEventDTOS
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppChannelEventDTO
.
class
,
exportAppChannelEventDTOS
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -404,7 +404,7 @@ public class AppDownloadController extends BaseController {
...
@@ -404,7 +404,7 @@ public class AppDownloadController extends BaseController {
// }
// }
Pair
<
String
,
List
<
ExportAppYuqingDTO
>>
stringListPair
=
markDataService
.
downloadContendMarkList
(
markSearchDTO
);
Pair
<
String
,
List
<
ExportAppYuqingDTO
>>
stringListPair
=
markDataService
.
downloadContendMarkList
(
markSearchDTO
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"舆情列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"舆情列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppYuqingDTO
.
class
,
stringListPair
.
getRight
());
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportAppYuqingDTO
.
class
,
stringListPair
.
getRight
());
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -436,7 +436,7 @@ public class AppDownloadController extends BaseController {
...
@@ -436,7 +436,7 @@ public class AppDownloadController extends BaseController {
}
}
List
<
ExportSearchWholeDTO
>
exportList
=
searchWholeService
.
exportSearchWhole
(
dto
);
List
<
ExportSearchWholeDTO
>
exportList
=
searchWholeService
.
exportSearchWhole
(
dto
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"全网搜舆情列表数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"全网搜舆情列表数据"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportSearchWholeDTO
.
class
,
exportList
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportSearchWholeDTO
.
class
,
exportList
);
if
(
dto
.
isExternalDataSource
())
{
if
(
dto
.
isExternalDataSource
())
{
...
@@ -454,7 +454,7 @@ public class AppDownloadController extends BaseController {
...
@@ -454,7 +454,7 @@ public class AppDownloadController extends BaseController {
head
.
add
(
Collections
.
singletonList
(
"链接"
));
head
.
add
(
Collections
.
singletonList
(
"链接"
));
head
.
add
(
Collections
.
singletonList
(
"文章内容"
));
head
.
add
(
Collections
.
singletonList
(
"文章内容"
));
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"摘要提取批量模板"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"摘要提取批量模板"
);
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"模板"
,
head
,
Collections
.
emptyList
());
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"模板"
,
head
,
Collections
.
emptyList
());
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -468,7 +468,7 @@ public class AppDownloadController extends BaseController {
...
@@ -468,7 +468,7 @@ public class AppDownloadController extends BaseController {
head
.
add
(
Collections
.
singletonList
(
"序号"
));
head
.
add
(
Collections
.
singletonList
(
"序号"
));
head
.
add
(
Collections
.
singletonList
(
"链接"
));
head
.
add
(
Collections
.
singletonList
(
"链接"
));
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"链接互动量更新模板"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"链接互动量更新模板"
);
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"模板"
,
head
,
Collections
.
emptyList
());
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"模板"
,
head
,
Collections
.
emptyList
());
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -489,7 +489,7 @@ public class AppDownloadController extends BaseController {
...
@@ -489,7 +489,7 @@ public class AppDownloadController extends BaseController {
head
.
add
(
Collections
.
singletonList
(
"链接"
));
head
.
add
(
Collections
.
singletonList
(
"链接"
));
}
}
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
type
+
"词云提取模板"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
type
+
"词云提取模板"
);
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"模板"
,
head
,
Collections
.
emptyList
());
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"模板"
,
head
,
Collections
.
emptyList
());
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -518,7 +518,7 @@ public class AppDownloadController extends BaseController {
...
@@ -518,7 +518,7 @@ public class AppDownloadController extends BaseController {
exportList
.
add
(
dto
);
exportList
.
add
(
dto
);
}
}
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"词云词组"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"词云词组"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
UploadHighWordKeywordDTO
.
class
,
exportList
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
UploadHighWordKeywordDTO
.
class
,
exportList
);
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
@@ -546,7 +546,7 @@ public class AppDownloadController extends BaseController {
...
@@ -546,7 +546,7 @@ public class AppDownloadController extends BaseController {
head
.
add
(
Collections
.
singletonList
(
"评论"
));
head
.
add
(
Collections
.
singletonList
(
"评论"
));
head
.
add
(
Collections
.
singletonList
(
"转发"
));
head
.
add
(
Collections
.
singletonList
(
"转发"
));
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"事件更新模板"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"事件更新模板"
);
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"模板"
,
head
,
Collections
.
emptyList
());
EasyExcelUtil
.
dynamicHeadWrite
(
filePath
,
"模板"
,
head
,
Collections
.
emptyList
());
return
ResponseResult
.
success
(
filePath
);
return
ResponseResult
.
success
(
filePath
);
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppHotController.java
View file @
2172f56e
...
@@ -392,6 +392,7 @@ public class AppHotController extends BaseController {
...
@@ -392,6 +392,7 @@ public class AppHotController extends BaseController {
CompletableFuture
.
allOf
(
resultList
.
stream
().
map
(
json
->
CompletableFuture
.
supplyAsync
(()
->
{
CompletableFuture
.
allOf
(
resultList
.
stream
().
map
(
json
->
CompletableFuture
.
supplyAsync
(()
->
{
try
{
try
{
BaseMap
firstArticle
=
markDataService
.
getFirstArticle
(
startDate
.
getTime
(),
endDate
.
getTime
(),
json
.
getString
(
"title"
),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
,
include
);
BaseMap
firstArticle
=
markDataService
.
getFirstArticle
(
startDate
.
getTime
(),
endDate
.
getTime
(),
json
.
getString
(
"title"
),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
,
include
);
json
.
put
(
"title"
,
firstArticle
.
getTitleNullOptionalContent
());
json
.
put
(
"content"
,
firstArticle
.
getContent
());
json
.
put
(
"content"
,
firstArticle
.
getContent
());
json
.
put
(
"url"
,
firstArticle
.
getUrl
());
json
.
put
(
"url"
,
firstArticle
.
getUrl
());
json
.
put
(
"realSource"
,
firstArticle
.
getRealSource
());
json
.
put
(
"realSource"
,
firstArticle
.
getRealSource
());
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
View file @
2172f56e
...
@@ -98,7 +98,7 @@ public class AppSearchController extends BaseController {
...
@@ -98,7 +98,7 @@ public class AppSearchController extends BaseController {
RedisUtil
redisUtil
;
RedisUtil
redisUtil
;
@ApiOperation
(
"搜索-查热点"
)
@ApiOperation
(
"搜索-查热点"
)
@LogRecord
(
values
=
"keyword"
,
description
=
"查热点"
,
arguments
=
true
,
entity
=
false
)
@LogRecord
(
values
=
{
"keyword"
,
"startTime"
,
"endTime"
}
,
description
=
"查热点"
,
arguments
=
true
,
entity
=
false
)
@GetMapping
(
"/hot/list"
)
@GetMapping
(
"/hot/list"
)
public
ResponseResult
searchHotList
(
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
limit
,
public
ResponseResult
searchHotList
(
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
...
@@ -118,7 +118,7 @@ public class AppSearchController extends BaseController {
...
@@ -118,7 +118,7 @@ public class AppSearchController extends BaseController {
}
}
@ApiOperation
(
"搜索-查危机"
)
@ApiOperation
(
"搜索-查危机"
)
@LogRecord
(
values
=
"keyword"
,
description
=
"查危机"
,
arguments
=
true
,
entity
=
false
)
@LogRecord
(
values
=
{
"keyword"
,
"startTime"
,
"endTime"
}
,
description
=
"查危机"
,
arguments
=
true
,
entity
=
false
)
@GetMapping
(
"/crisisSearch"
)
@GetMapping
(
"/crisisSearch"
)
public
ResponseResult
crisisSearch
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
public
ResponseResult
crisisSearch
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"3"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"3"
)
Integer
pageSize
,
...
@@ -161,7 +161,7 @@ public class AppSearchController extends BaseController {
...
@@ -161,7 +161,7 @@ public class AppSearchController extends BaseController {
}
}
@ApiOperation
(
"搜索-全网搜"
)
@ApiOperation
(
"搜索-全网搜"
)
@LogRecord
(
values
=
{
"
fans"
,
"sensitiveChannels:father,son"
,
"keyword"
,
"search
"
},
description
=
"全网搜"
,
arguments
=
true
,
entity
=
true
)
@LogRecord
(
values
=
{
"
keyword"
,
"search"
,
"fans"
,
"sensitiveChannels:father,son"
,
"startTime"
,
"endTime
"
},
description
=
"全网搜"
,
arguments
=
true
,
entity
=
true
)
@PostMapping
(
"/searchWhole"
)
@PostMapping
(
"/searchWhole"
)
public
ResponseResult
searchWholeNetwork
(
@RequestBody
SearchFilterDTO
dto
)
{
public
ResponseResult
searchWholeNetwork
(
@RequestBody
SearchFilterDTO
dto
)
{
// if (StringUtils.isNotEmpty(dto.getKeyword()) && Tools.checkUniteString(dto.getKeyword())){
// if (StringUtils.isNotEmpty(dto.getKeyword()) && Tools.checkUniteString(dto.getKeyword())){
...
@@ -201,7 +201,7 @@ public class AppSearchController extends BaseController {
...
@@ -201,7 +201,7 @@ public class AppSearchController extends BaseController {
@ApiOperation
(
"搜索-全网搜-舆情导出"
)
@ApiOperation
(
"搜索-全网搜-舆情导出"
)
@PostMapping
(
"/exportSearchWhole"
)
@PostMapping
(
"/exportSearchWhole"
)
@LogRecord
(
description
=
"全网搜-舆情导出"
,
values
=
{
"s
tartTime"
,
"endTime"
,
"fans"
,
"filterType"
,
"filterWords"
,
"search"
,
"keyword
"
,
"platforms"
,
"sensitiveChannels"
,
"sourceKeyword"
},
entity
=
true
,
arguments
=
true
)
@LogRecord
(
description
=
"全网搜-舆情导出"
,
values
=
{
"s
earch"
,
"keyword"
,
"startTime"
,
"endTime"
,
"fans"
,
"filterType"
,
"filterWords
"
,
"platforms"
,
"sensitiveChannels"
,
"sourceKeyword"
},
entity
=
true
,
arguments
=
true
)
public
ResponseResult
exportSearchWhole
(
@RequestBody
SearchFilterDTO
dto
)
{
public
ResponseResult
exportSearchWhole
(
@RequestBody
SearchFilterDTO
dto
)
{
// if (StringUtils.isNotEmpty(dto.getKeyword()) && Tools.checkUniteString(dto.getKeyword())){
// if (StringUtils.isNotEmpty(dto.getKeyword()) && Tools.checkUniteString(dto.getKeyword())){
// return ResponseResult.failure("不支持特殊符号字段查询");
// return ResponseResult.failure("不支持特殊符号字段查询");
...
@@ -231,7 +231,7 @@ public class AppSearchController extends BaseController {
...
@@ -231,7 +231,7 @@ public class AppSearchController extends BaseController {
}
}
@ApiOperation
(
"舆情列表"
)
@ApiOperation
(
"舆情列表"
)
@LogRecord
(
values
=
{
"searchType"
,
"keyword"
},
description
=
"查舆情"
,
arguments
=
true
,
entity
=
true
)
@LogRecord
(
values
=
{
"searchType"
,
"keyword"
,
"startTime"
,
"endTime"
},
description
=
"查舆情"
,
arguments
=
true
,
entity
=
true
)
@PostMapping
(
"/mark/list"
)
@PostMapping
(
"/mark/list"
)
public
ResponseResult
getYuqingMarkList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
public
ResponseResult
getYuqingMarkList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
// if (StringUtils.isNotEmpty(markSearchDTO.getKeyword()) && Tools.checkUniteString(markSearchDTO.getKeyword())){
// if (StringUtils.isNotEmpty(markSearchDTO.getKeyword()) && Tools.checkUniteString(markSearchDTO.getKeyword())){
...
@@ -292,7 +292,7 @@ public class AppSearchController extends BaseController {
...
@@ -292,7 +292,7 @@ public class AppSearchController extends BaseController {
@ApiOperation
(
"搜索-渠道列表"
)
@ApiOperation
(
"搜索-渠道列表"
)
@LogRecord
(
values
=
"keyword"
,
description
=
"查渠道"
,
arguments
=
true
,
entity
=
true
)
@LogRecord
(
values
=
{
"keyword"
,
"startTime"
,
"endTime"
}
,
description
=
"查渠道"
,
arguments
=
true
,
entity
=
true
)
@PostMapping
(
value
=
"/channel/channelList"
)
@PostMapping
(
value
=
"/channel/channelList"
)
public
ResponseResult
getChannelList
(
@RequestBody
ChannelSearchDTO
channelSearchDTO
)
{
public
ResponseResult
getChannelList
(
@RequestBody
ChannelSearchDTO
channelSearchDTO
)
{
cacheSearchKeyword
(
channelSearchDTO
.
getKeyword
(),
"channel"
);
cacheSearchKeyword
(
channelSearchDTO
.
getKeyword
(),
"channel"
);
...
@@ -331,7 +331,7 @@ public class AppSearchController extends BaseController {
...
@@ -331,7 +331,7 @@ public class AppSearchController extends BaseController {
}
}
@ApiOperation
(
"搜索-前台事件库-品牌事件库-新"
)
@ApiOperation
(
"搜索-前台事件库-品牌事件库-新"
)
@LogRecord
(
values
=
"keyword"
,
description
=
"查事件"
,
arguments
=
true
,
entity
=
true
)
@LogRecord
(
values
=
{
"keyword"
,
"startTime"
,
"endTime"
}
,
description
=
"查事件"
,
arguments
=
true
,
entity
=
true
)
@PostMapping
(
"/event/newList"
)
@PostMapping
(
"/event/newList"
)
public
ResponseResult
getEventListMiddleware
(
@RequestBody
BrandkbsEventSearchDTO
dto
){
public
ResponseResult
getEventListMiddleware
(
@RequestBody
BrandkbsEventSearchDTO
dto
){
cacheSearchKeyword
(
dto
.
getKeyword
(),
"event"
);
cacheSearchKeyword
(
dto
.
getKeyword
(),
"event"
);
...
@@ -339,7 +339,7 @@ public class AppSearchController extends BaseController {
...
@@ -339,7 +339,7 @@ public class AppSearchController extends BaseController {
}
}
@ApiOperation
(
"搜索-查竞品"
)
@ApiOperation
(
"搜索-查竞品"
)
@LogRecord
(
values
=
"keyword"
,
description
=
"查竞品"
,
arguments
=
true
,
entity
=
true
)
@LogRecord
(
values
=
{
"keyword"
,
"startTime"
,
"endTime"
}
,
description
=
"查竞品"
,
arguments
=
true
,
entity
=
true
)
@PostMapping
(
"/contend/list"
)
@PostMapping
(
"/contend/list"
)
public
ResponseResult
getContendSearchList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
public
ResponseResult
getContendSearchList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
// if (StringUtils.isNotEmpty(markSearchDTO.getKeyword()) && Tools.checkUniteString(markSearchDTO.getKeyword())){
// if (StringUtils.isNotEmpty(markSearchDTO.getKeyword()) && Tools.checkUniteString(markSearchDTO.getKeyword())){
...
...
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileReportController.java
View file @
2172f56e
...
@@ -48,7 +48,7 @@ public class MobileReportController {
...
@@ -48,7 +48,7 @@ public class MobileReportController {
dto
.
setPage
(
page
);
dto
.
setPage
(
page
);
dto
.
setPageSize
(
size
);
dto
.
setPageSize
(
size
);
dto
.
setType
(
"月报"
);
dto
.
setType
(
"月报"
);
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
PageVO
<
JSONObject
>
reportList
=
reportService
.
findReportList
(
dto
);
PageVO
<
JSONObject
>
reportList
=
reportService
.
findReportList
(
dto
);
reportList
.
getList
().
forEach
(
json
->
{
reportList
.
getList
().
forEach
(
json
->
{
Long
startTime
=
json
.
getLong
(
"endTime"
);
Long
startTime
=
json
.
getLong
(
"endTime"
);
...
...
src/main/java/com/zhiwei/brandkbs2/easyexcel/dto/ExportWholeSearchRecordDTO.java
View file @
2172f56e
...
@@ -37,7 +37,6 @@ public class ExportWholeSearchRecordDTO {
...
@@ -37,7 +37,6 @@ public class ExportWholeSearchRecordDTO {
dto
.
setKeyword
(
json
.
getString
(
"keyword"
));
dto
.
setKeyword
(
json
.
getString
(
"keyword"
));
dto
.
setUsedType
(
json
.
getString
(
"usedType"
));
dto
.
setUsedType
(
json
.
getString
(
"usedType"
));
dto
.
setUsedCount
(
json
.
getInteger
(
"usedCount"
));
dto
.
setUsedCount
(
json
.
getInteger
(
"usedCount"
));
;
dto
.
setCTime
(
new
Date
(
json
.
getLong
(
"cTime"
)));
dto
.
setCTime
(
new
Date
(
json
.
getLong
(
"cTime"
)));
dto
.
setSubmitter
(
json
.
getString
(
"submitter"
));
dto
.
setSubmitter
(
json
.
getString
(
"submitter"
));
return
dto
;
return
dto
;
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/Project.java
View file @
2172f56e
...
@@ -17,6 +17,10 @@ import java.util.*;
...
@@ -17,6 +17,10 @@ import java.util.*;
@Setter
@Setter
@Document
(
collection
=
"brandkbs_project"
)
@Document
(
collection
=
"brandkbs_project"
)
public
class
Project
extends
AbstractProject
{
public
class
Project
extends
AbstractProject
{
/**
* 项目别名
*/
private
String
extraProjectName
;
/**
/**
* 数据起始时间(能够绑定关联关系的时间点)
* 数据起始时间(能够绑定关联关系的时间点)
...
@@ -124,6 +128,7 @@ public class Project extends AbstractProject {
...
@@ -124,6 +128,7 @@ public class Project extends AbstractProject {
projectVO
.
setId
(
this
.
getId
());
projectVO
.
setId
(
this
.
getId
());
// 主品牌
// 主品牌
projectVO
.
setProjectName
(
this
.
getProjectName
());
projectVO
.
setProjectName
(
this
.
getProjectName
());
projectVO
.
setExtraProjectName
(
this
.
getExtraProjectName
());
projectVO
.
setImportTime
(
new
Date
(
this
.
getImportTime
()));
projectVO
.
setImportTime
(
new
Date
(
this
.
getImportTime
()));
projectVO
.
setBrandName
(
this
.
getBrandName
());
projectVO
.
setBrandName
(
this
.
getBrandName
());
projectVO
.
setBrandLinkedGroup
(
this
.
getBrandLinkedGroup
());
projectVO
.
setBrandLinkedGroup
(
this
.
getBrandLinkedGroup
());
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ProjectVO.java
View file @
2172f56e
...
@@ -36,6 +36,12 @@ public class ProjectVO {
...
@@ -36,6 +36,12 @@ public class ProjectVO {
private
String
projectName
;
private
String
projectName
;
/**
/**
* 项目别名
*/
@ApiModelProperty
(
"项目别名"
)
private
String
extraProjectName
;
/**
* 数据起始时间
* 数据起始时间
*/
*/
@ApiModelProperty
(
"数据起始时间"
)
@ApiModelProperty
(
"数据起始时间"
)
...
@@ -135,6 +141,7 @@ public class ProjectVO {
...
@@ -135,6 +141,7 @@ public class ProjectVO {
Project
project
=
new
Project
();
Project
project
=
new
Project
();
project
.
setId
(
this
.
getId
());
project
.
setId
(
this
.
getId
());
project
.
setProjectName
(
this
.
getProjectName
());
project
.
setProjectName
(
this
.
getProjectName
());
project
.
setExtraProjectName
(
this
.
getExtraProjectName
());
project
.
setBrandName
(
this
.
getBrandName
());
project
.
setBrandName
(
this
.
getBrandName
());
project
.
setBrandLinkedGroup
(
this
.
getBrandLinkedGroup
());
project
.
setBrandLinkedGroup
(
this
.
getBrandLinkedGroup
());
project
.
setBrandLinkedGroupId
(
this
.
getBrandLinkedGroupId
());
project
.
setBrandLinkedGroupId
(
this
.
getBrandLinkedGroupId
());
...
@@ -190,6 +197,7 @@ public class ProjectVO {
...
@@ -190,6 +197,7 @@ public class ProjectVO {
Project
project
=
new
Project
();
Project
project
=
new
Project
();
project
.
setId
(
vo
.
getId
());
project
.
setId
(
vo
.
getId
());
project
.
setProjectName
(
vo
.
getProjectName
());
project
.
setProjectName
(
vo
.
getProjectName
());
project
.
setExtraProjectName
(
vo
.
getExtraProjectName
());
project
.
setBrandName
(
vo
.
getBrandName
());
project
.
setBrandName
(
vo
.
getBrandName
());
project
.
setBrandLinkedGroup
(
vo
.
getBrandLinkedGroup
());
project
.
setBrandLinkedGroup
(
vo
.
getBrandLinkedGroup
());
project
.
setBrandLinkedGroupId
(
vo
.
getBrandLinkedGroupId
());
project
.
setBrandLinkedGroupId
(
vo
.
getBrandLinkedGroupId
());
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
2172f56e
...
@@ -1884,7 +1884,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -1884,7 +1884,7 @@ public class MarkDataServiceImpl implements MarkDataService {
}
}
List
<
ExportYuqingInteractionUpdateDTO
>
exportList
=
markInteractionUpdate
(
list
);
List
<
ExportYuqingInteractionUpdateDTO
>
exportList
=
markInteractionUpdate
(
list
);
// excel输出到指定路径
// excel输出到指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"舆情库互动量更新结果"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"舆情库互动量更新结果"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportYuqingInteractionUpdateDTO
.
class
,
exportList
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportYuqingInteractionUpdateDTO
.
class
,
exportList
);
JSONObject
res
=
new
JSONObject
();
JSONObject
res
=
new
JSONObject
();
...
@@ -2481,7 +2481,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -2481,7 +2481,7 @@ public class MarkDataServiceImpl implements MarkDataService {
}
}
List
<
ExportYuqingInteractionUpdateDTO
>
exportList
=
markInteractionUpdate
(
list
);
List
<
ExportYuqingInteractionUpdateDTO
>
exportList
=
markInteractionUpdate
(
list
);
// excel输出到指定路径
// excel输出到指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"舆情库互动量更新结果"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"舆情库互动量更新结果"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportYuqingInteractionUpdateDTO
.
class
,
exportList
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportYuqingInteractionUpdateDTO
.
class
,
exportList
);
JSONObject
res
=
new
JSONObject
();
JSONObject
res
=
new
JSONObject
();
...
@@ -3497,6 +3497,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -3497,6 +3497,7 @@ public class MarkDataServiceImpl implements MarkDataService {
CompletableFuture
.
allOf
(
markTopTitleList
.
stream
().
map
(
json
->
CompletableFuture
.
supplyAsync
(()
->
{
CompletableFuture
.
allOf
(
markTopTitleList
.
stream
().
map
(
json
->
CompletableFuture
.
supplyAsync
(()
->
{
try
{
try
{
BaseMap
firstArticle
=
getAnalyzeFirstArticle
(
dto
,
json
.
getString
(
"title"
));
BaseMap
firstArticle
=
getAnalyzeFirstArticle
(
dto
,
json
.
getString
(
"title"
));
json
.
put
(
"title"
,
firstArticle
.
getTitleNullOptionalContent
());
json
.
put
(
"content"
,
firstArticle
.
getContent
());
json
.
put
(
"content"
,
firstArticle
.
getContent
());
json
.
put
(
"url"
,
firstArticle
.
getUrl
());
json
.
put
(
"url"
,
firstArticle
.
getUrl
());
json
.
put
(
"realSource"
,
firstArticle
.
getRealSource
());
json
.
put
(
"realSource"
,
firstArticle
.
getRealSource
());
...
@@ -4039,7 +4040,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -4039,7 +4040,7 @@ public class MarkDataServiceImpl implements MarkDataService {
// 选用的模型名称
// 选用的模型名称
AccessModel
.
Model
model
=
AccessModel
.
Model
.
DOUBAO_PRO_32K
;
AccessModel
.
Model
model
=
AccessModel
.
Model
.
DOUBAO_PRO_32K
;
String
modelName
=
model
.
getModelName
();
String
modelName
=
model
.
getModelName
();
String
projectName
=
GlobalPojo
.
PROJECT_MAP
.
get
(
projectId
).
getProjectName
();
String
projectName
=
GlobalPojo
.
PROJECT_MAP
.
get
(
projectId
).
get
Extra
ProjectName
();
Pair
<
String
,
long
[]>
pair
=
standardRequest
(
question
,
modelName
,
MessageFormat
.
format
(
REFERENCE_QUESTION_PROMPT
,
size
,
projectName
));
Pair
<
String
,
long
[]>
pair
=
standardRequest
(
question
,
modelName
,
MessageFormat
.
format
(
REFERENCE_QUESTION_PROMPT
,
size
,
projectName
));
if
(
Objects
.
isNull
(
pair
)){
if
(
Objects
.
isNull
(
pair
)){
return
getAIReferenceQuestionTemplate
(
projectName
);
return
getAIReferenceQuestionTemplate
(
projectName
);
...
@@ -4066,7 +4067,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -4066,7 +4067,7 @@ public class MarkDataServiceImpl implements MarkDataService {
return
JSONObject
.
parseArray
(
resultStr
).
toJavaList
(
String
.
class
);
return
JSONObject
.
parseArray
(
resultStr
).
toJavaList
(
String
.
class
);
}
}
List
<
String
>
questionList
=
aiSearchQuestionRecordDao
.
findDistinctQuestion
(
projectId
);
List
<
String
>
questionList
=
aiSearchQuestionRecordDao
.
findDistinctQuestion
(
projectId
);
String
projectName
=
GlobalPojo
.
PROJECT_MAP
.
get
(
projectId
).
getProjectName
();
String
projectName
=
GlobalPojo
.
PROJECT_MAP
.
get
(
projectId
).
get
Extra
ProjectName
();
if
(
CollectionUtils
.
isEmpty
(
questionList
)){
if
(
CollectionUtils
.
isEmpty
(
questionList
)){
return
getAIReferenceQuestionTemplate
(
projectName
);
return
getAIReferenceQuestionTemplate
(
projectName
);
}
}
...
@@ -4122,7 +4123,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -4122,7 +4123,7 @@ public class MarkDataServiceImpl implements MarkDataService {
list
=
esClientDao
.
findSearch
(
question
,
keyword
,
startTime
,
endTime
);
list
=
esClientDao
.
findSearch
(
question
,
keyword
,
startTime
,
endTime
);
}
else
{
// 未填辅助信息,则根据AI生成条件
}
else
{
// 未填辅助信息,则根据AI生成条件
Project
project
=
GlobalPojo
.
PROJECT_MAP
.
get
(
UserThreadLocal
.
getProjectId
());
Project
project
=
GlobalPojo
.
PROJECT_MAP
.
get
(
UserThreadLocal
.
getProjectId
());
StringBuilder
brandStr
=
new
StringBuilder
(
project
.
getProjectName
());
StringBuilder
brandStr
=
new
StringBuilder
(
project
.
get
Extra
ProjectName
());
if
(
CollectionUtils
.
isNotEmpty
(
project
.
getContendList
())){
if
(
CollectionUtils
.
isNotEmpty
(
project
.
getContendList
())){
project
.
getContendList
().
forEach
(
contend
->
brandStr
.
append
(
"、"
).
append
(
contend
.
getBrandName
()));
project
.
getContendList
().
forEach
(
contend
->
brandStr
.
append
(
"、"
).
append
(
contend
.
getBrandName
()));
}
}
...
@@ -4318,7 +4319,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -4318,7 +4319,7 @@ public class MarkDataServiceImpl implements MarkDataService {
Project
project
=
GlobalPojo
.
PROJECT_MAP
.
get
(
UserThreadLocal
.
getProjectId
());
Project
project
=
GlobalPojo
.
PROJECT_MAP
.
get
(
UserThreadLocal
.
getProjectId
());
fieldMappings
.
add
(
new
FieldMapping
(
FieldMapping
.
FieldMap
.
PROJECT
,
UserThreadLocal
.
getProjectId
()));
fieldMappings
.
add
(
new
FieldMapping
(
FieldMapping
.
FieldMap
.
PROJECT
,
UserThreadLocal
.
getProjectId
()));
List
<
String
>
projectBandNames
=
new
ArrayList
<>();
List
<
String
>
projectBandNames
=
new
ArrayList
<>();
projectBandNames
.
add
(
project
.
getProjectName
());
projectBandNames
.
add
(
project
.
get
Extra
ProjectName
());
projectBandNames
.
add
(
project
.
getBrandName
());
projectBandNames
.
add
(
project
.
getBrandName
());
if
(
CollectionUtils
.
isNotEmpty
(
project
.
getContendList
())){
if
(
CollectionUtils
.
isNotEmpty
(
project
.
getContendList
())){
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
View file @
2172f56e
...
@@ -109,7 +109,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -109,7 +109,7 @@ public class ProjectServiceImpl implements ProjectService {
//抛出非法参数异常
//抛出非法参数异常
ExceptionCast
.
cast
(
CommonCodeEnum
.
INVALID_PARAM
);
ExceptionCast
.
cast
(
CommonCodeEnum
.
INVALID_PARAM
);
}
}
if
(!
Tools
.
isEmpty
(
projectVO
.
getHitKeywords
())
&&
projectVO
.
getModuleShowList
().
contains
(
2
))
{
if
(!
Tools
.
isEmpty
(
projectVO
.
getHitKeywords
())
&&
projectVO
.
getModuleShowList
().
contains
(
"2"
))
{
return
ResponseResult
.
failure
(
"关键字和原始数据配置异常"
);
return
ResponseResult
.
failure
(
"关键字和原始数据配置异常"
);
}
}
Project
existsProject
=
projectDao
.
findOne
(
"projectName"
,
projectVO
.
getProjectName
());
Project
existsProject
=
projectDao
.
findOne
(
"projectName"
,
projectVO
.
getProjectName
());
...
@@ -145,7 +145,10 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -145,7 +145,10 @@ public class ProjectServiceImpl implements ProjectService {
public
PageVO
<
JSONObject
>
findProjectList
(
int
page
,
int
size
,
String
keyword
)
{
public
PageVO
<
JSONObject
>
findProjectList
(
int
page
,
int
size
,
String
keyword
)
{
Query
query
=
new
Query
();
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"isManual"
).
is
(
true
));
query
.
addCriteria
(
Criteria
.
where
(
"isManual"
).
is
(
true
));
projectDao
.
addKeywordFuzz
(
query
,
keyword
,
"projectName"
);
// projectDao.addKeywordFuzz(query, keyword, "extraProjectName", "projectName");
Criteria
extraProjectName
=
Criteria
.
where
(
"extraProjectName"
).
regex
(
keyword
,
"i"
);
Criteria
projectName
=
Criteria
.
where
(
"projectName"
).
regex
(
keyword
,
"i"
);
query
.
addCriteria
(
new
Criteria
().
orOperator
(
extraProjectName
,
projectName
));
long
count
=
projectDao
.
count
(
query
);
long
count
=
projectDao
.
count
(
query
);
projectDao
.
addSort
(
query
,
"{\"cTime\":\"descend\"}"
);
projectDao
.
addSort
(
query
,
"{\"cTime\":\"descend\"}"
);
mongoUtil
.
start
(
page
,
size
,
query
);
mongoUtil
.
start
(
page
,
size
,
query
);
...
@@ -156,6 +159,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -156,6 +159,7 @@ public class ProjectServiceImpl implements ProjectService {
result
.
put
(
"importTime"
,
project
.
getImportTime
());
result
.
put
(
"importTime"
,
project
.
getImportTime
());
result
.
put
(
"cTime"
,
project
.
getCTime
());
result
.
put
(
"cTime"
,
project
.
getCTime
());
result
.
put
(
"projectName"
,
project
.
getProjectName
());
result
.
put
(
"projectName"
,
project
.
getProjectName
());
result
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
result
.
put
(
"brandName"
,
project
.
getBrandName
());
result
.
put
(
"brandName"
,
project
.
getBrandName
());
result
.
put
(
"isStart"
,
project
.
isStart
());
result
.
put
(
"isStart"
,
project
.
isStart
());
result
.
put
(
"isShow"
,
project
.
isShow
());
result
.
put
(
"isShow"
,
project
.
isShow
());
...
@@ -335,13 +339,16 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -335,13 +339,16 @@ public class ProjectServiceImpl implements ProjectService {
return
projectDao
.
findList
(
null
).
stream
().
map
(
project
->
{
return
projectDao
.
findList
(
null
).
stream
().
map
(
project
->
{
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"name"
,
project
.
getProjectName
());
json
.
put
(
"name"
,
project
.
getProjectName
());
json
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
json
.
put
(
"id"
,
project
.
getId
());
json
.
put
(
"id"
,
project
.
getId
());
return
json
;
return
json
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
return
user
.
getRoles
().
stream
().
map
(
userRole
->
{
return
user
.
getRoles
().
stream
().
map
(
userRole
->
{
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"name"
,
projectDao
.
findOne
(
"_id"
,
userRole
.
getProjectId
()).
getProjectName
());
Project
project
=
projectDao
.
findOne
(
"_id"
,
userRole
.
getProjectId
());
json
.
put
(
"name"
,
project
.
getProjectName
());
json
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
json
.
put
(
"id"
,
userRole
.
getProjectId
());
json
.
put
(
"id"
,
userRole
.
getProjectId
());
return
json
;
return
json
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
@@ -572,7 +579,10 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -572,7 +579,10 @@ public class ProjectServiceImpl implements ProjectService {
public
PageVO
<
JSONObject
>
findNonManualProjectList
(
int
page
,
int
size
,
String
sorter
,
String
keyword
)
{
public
PageVO
<
JSONObject
>
findNonManualProjectList
(
int
page
,
int
size
,
String
sorter
,
String
keyword
)
{
Query
query
=
new
Query
();
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"isManual"
).
is
(
false
));
query
.
addCriteria
(
Criteria
.
where
(
"isManual"
).
is
(
false
));
projectDao
.
addKeywordFuzz
(
query
,
keyword
,
"projectName"
);
// projectDao.addKeywordFuzz(query, keyword, "extraProjectName", "projectName");
Criteria
extraProjectName
=
Criteria
.
where
(
"extraProjectName"
).
regex
(
keyword
,
"i"
);
Criteria
projectName
=
Criteria
.
where
(
"projectName"
).
regex
(
keyword
,
"i"
);
query
.
addCriteria
(
new
Criteria
().
orOperator
(
extraProjectName
,
projectName
));
long
count
=
projectDao
.
count
(
query
);
long
count
=
projectDao
.
count
(
query
);
if
(
Objects
.
isNull
(
sorter
)
||
Objects
.
isNull
(
JSONObject
.
parseObject
(
sorter
))
||
JSONObject
.
parseObject
(
sorter
).
isEmpty
()){
if
(
Objects
.
isNull
(
sorter
)
||
Objects
.
isNull
(
JSONObject
.
parseObject
(
sorter
))
||
JSONObject
.
parseObject
(
sorter
).
isEmpty
()){
projectDao
.
addSort
(
query
,
"{\"cTime\":\"descend\"}"
);
projectDao
.
addSort
(
query
,
"{\"cTime\":\"descend\"}"
);
...
@@ -587,6 +597,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -587,6 +597,7 @@ public class ProjectServiceImpl implements ProjectService {
result
.
put
(
"importTime"
,
project
.
getImportTime
());
result
.
put
(
"importTime"
,
project
.
getImportTime
());
result
.
put
(
"cTime"
,
project
.
getCTime
());
result
.
put
(
"cTime"
,
project
.
getCTime
());
result
.
put
(
"projectName"
,
project
.
getProjectName
());
result
.
put
(
"projectName"
,
project
.
getProjectName
());
result
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
result
.
put
(
"brandName"
,
project
.
getBrandName
());
result
.
put
(
"brandName"
,
project
.
getBrandName
());
result
.
put
(
"isStart"
,
project
.
isStart
());
result
.
put
(
"isStart"
,
project
.
isStart
());
result
.
put
(
"isShow"
,
project
.
isShow
());
result
.
put
(
"isShow"
,
project
.
isShow
());
...
@@ -648,6 +659,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -648,6 +659,7 @@ public class ProjectServiceImpl implements ProjectService {
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"id"
,
project
.
getId
());
jsonObject
.
put
(
"id"
,
project
.
getId
());
jsonObject
.
put
(
"name"
,
project
.
getProjectName
());
jsonObject
.
put
(
"name"
,
project
.
getProjectName
());
jsonObject
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
return
jsonObject
;
return
jsonObject
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
ResponseResult
.
success
(
res
);
return
ResponseResult
.
success
(
res
);
...
@@ -659,7 +671,10 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -659,7 +671,10 @@ public class ProjectServiceImpl implements ProjectService {
projectDao
.
addSort
(
query
,
"{\"_id\":\"asc\"}"
);
projectDao
.
addSort
(
query
,
"{\"_id\":\"asc\"}"
);
// 项目名关键词模糊
// 项目名关键词模糊
if
(
StringUtils
.
isNotBlank
(
keyword
)){
if
(
StringUtils
.
isNotBlank
(
keyword
)){
projectDao
.
addKeywordFuzz
(
query
,
keyword
,
"projectName"
);
// projectDao.addKeywordFuzz(query, keyword, "extraProjectName", "projectName");
Criteria
extraProjectName
=
Criteria
.
where
(
"extraProjectName"
).
regex
(
keyword
,
"i"
);
Criteria
projectName
=
Criteria
.
where
(
"projectName"
).
regex
(
keyword
,
"i"
);
query
.
addCriteria
(
new
Criteria
().
orOperator
(
extraProjectName
,
projectName
));
}
}
// 用户拥有权限的项目
// 用户拥有权限的项目
if
(
StringUtils
.
isNotBlank
(
userId
)
&&
!
userDao
.
findOneById
(
userId
).
isSuperAdmin
()){
if
(
StringUtils
.
isNotBlank
(
userId
)
&&
!
userDao
.
findOneById
(
userId
).
isSuperAdmin
()){
...
@@ -675,6 +690,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -675,6 +690,7 @@ public class ProjectServiceImpl implements ProjectService {
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"id"
,
project
.
getId
());
result
.
put
(
"id"
,
project
.
getId
());
result
.
put
(
"projectName"
,
project
.
getProjectName
());
result
.
put
(
"projectName"
,
project
.
getProjectName
());
result
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
return
result
;
return
result
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
ResponseResult
.
success
(
PageVO
.
createPageVo
(
total
,
page
,
pageSize
,
resList
));
return
ResponseResult
.
success
(
PageVO
.
createPageVo
(
total
,
page
,
pageSize
,
resList
));
...
@@ -765,6 +781,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -765,6 +781,7 @@ public class ProjectServiceImpl implements ProjectService {
json
.
put
(
"id"
,
project
.
getId
());
json
.
put
(
"id"
,
project
.
getId
());
json
.
put
(
"brands"
,
getBrands
(
project
.
getId
(),
true
));
json
.
put
(
"brands"
,
getBrands
(
project
.
getId
(),
true
));
json
.
put
(
"name"
,
project
.
getProjectName
());
json
.
put
(
"name"
,
project
.
getProjectName
());
json
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
json
.
put
(
"group"
,
project
.
getBrandLinkedGroup
());
json
.
put
(
"group"
,
project
.
getBrandLinkedGroup
());
json
.
put
(
"avatarUrl"
,
project
.
getAvatarUrl
());
json
.
put
(
"avatarUrl"
,
project
.
getAvatarUrl
());
json
.
put
(
"permission"
,
getPermissionList
(
project
));
json
.
put
(
"permission"
,
getPermissionList
(
project
));
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectWarnServiceImpl.java
View file @
2172f56e
...
@@ -220,13 +220,13 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -220,13 +220,13 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4Yuqing
(
BrandkbsYuQingConfigNew
config
,
List
<
BaseMap
>
datas
,
long
start
,
long
end
,
Abstract
Project
project
)
{
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4Yuqing
(
BrandkbsYuQingConfigNew
config
,
List
<
BaseMap
>
datas
,
long
start
,
long
end
,
Project
project
)
{
if
(
datas
.
isEmpty
())
{
if
(
datas
.
isEmpty
())
{
return
null
;
return
null
;
}
}
int
firstCount
=
datas
.
size
();
int
firstCount
=
datas
.
size
();
// key1
// key1
String
key1
=
"【品见】舆情动态-"
+
project
.
getProjectName
();
String
key1
=
"【品见】舆情动态-"
+
project
.
get
Extra
ProjectName
();
// key2
// key2
// String key2Header = "全部";
// String key2Header = "全部";
String
key2Header
=
""
;
String
key2Header
=
""
;
...
@@ -292,13 +292,13 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -292,13 +292,13 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsYuQingWarn
(
collect
));
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsYuQingWarn
(
collect
));
}
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4Channel
(
BrandkbsChannelConfig
config
,
List
<
BaseMap
>
datas
,
long
start
,
long
end
,
Abstract
Project
project
)
{
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4Channel
(
BrandkbsChannelConfig
config
,
List
<
BaseMap
>
datas
,
long
start
,
long
end
,
Project
project
)
{
if
(
datas
.
isEmpty
())
{
if
(
datas
.
isEmpty
())
{
return
null
;
return
null
;
}
}
int
firstCount
=
datas
.
size
();
int
firstCount
=
datas
.
size
();
// key1
// key1
String
key1
=
"【品见】渠道参与-"
+
project
.
getProjectName
();
String
key1
=
"【品见】渠道参与-"
+
project
.
get
Extra
ProjectName
();
// key2
// key2
String
key2
=
"自定义渠道"
;
String
key2
=
"自定义渠道"
;
if
(
Boolean
.
TRUE
.
equals
(
config
.
getFriendlyChannel
()))
{
if
(
Boolean
.
TRUE
.
equals
(
config
.
getFriendlyChannel
()))
{
...
@@ -333,12 +333,12 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -333,12 +333,12 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsYuQingWarn
(
collect
));
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsYuQingWarn
(
collect
));
}
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4HotEvent
(
BrandkbsHotEventConfig
config
,
Map
<
String
,
List
<
com
.
zhiwei
.
middleware
.
event
.
pojo
.
entity
.
Event
>>
eventMap
,
long
start
,
long
end
,
Abstract
Project
project
)
{
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4HotEvent
(
BrandkbsHotEventConfig
config
,
Map
<
String
,
List
<
com
.
zhiwei
.
middleware
.
event
.
pojo
.
entity
.
Event
>>
eventMap
,
long
start
,
long
end
,
Project
project
)
{
int
firstCount
=
eventMap
.
values
().
stream
().
mapToInt
(
List:
:
size
).
sum
();
int
firstCount
=
eventMap
.
values
().
stream
().
mapToInt
(
List:
:
size
).
sum
();
if
(
firstCount
==
0
)
{
if
(
firstCount
==
0
)
{
return
null
;
return
null
;
}
}
String
key1
=
"【品见】热点事件-"
+
project
.
getProjectName
();
String
key1
=
"【品见】热点事件-"
+
project
.
get
Extra
ProjectName
();
// key2
// key2
String
key2
=
null
;
String
key2
=
null
;
// key3
// key3
...
@@ -377,11 +377,11 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -377,11 +377,11 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
}
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4HotTop
(
BrandkbsHotTopConfig
config
,
List
<
BrandkbsHotTopWarn
.
HotTop
>
datas
,
long
start
,
long
end
,
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4HotTop
(
BrandkbsHotTopConfig
config
,
List
<
BrandkbsHotTopWarn
.
HotTop
>
datas
,
long
start
,
long
end
,
Abstract
Project
project
)
{
Project
project
)
{
if
(
CollectionUtils
.
isEmpty
(
datas
))
{
if
(
CollectionUtils
.
isEmpty
(
datas
))
{
return
null
;
return
null
;
}
}
String
key1
=
"【品见】上榜热搜-"
+
project
.
getProjectName
();
String
key1
=
"【品见】上榜热搜-"
+
project
.
get
Extra
ProjectName
();
// key2
// key2
String
key2
=
""
;
String
key2
=
""
;
List
<
String
>
key2Element
=
new
ArrayList
<>();
List
<
String
>
key2Element
=
new
ArrayList
<>();
...
@@ -437,7 +437,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -437,7 +437,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
return
null
;
return
null
;
}
}
int
firstCount
=
datas
.
size
();
int
firstCount
=
datas
.
size
();
String
key1
=
"【品见】案例上新-"
+
project
.
getProjectName
();
String
key1
=
"【品见】案例上新-"
+
project
.
get
Extra
ProjectName
();
String
key2
=
null
;
String
key2
=
null
;
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
time
);
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
time
);
// key4
// key4
...
@@ -677,11 +677,10 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -677,11 +677,10 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
@Override
@Override
public
ResponseResult
getChannelWaring
(
String
projectId
,
BrandkbsChannelConfig
config
)
{
public
ResponseResult
getChannelWaring
(
String
projectId
,
BrandkbsChannelConfig
config
)
{
Project
project
=
null
;
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
long
start
=
end
-
config
.
getPushInterval
();
long
start
=
end
-
config
.
getPushInterval
();
Project
project
=
projectService
.
getProjectById
(
projectId
);
try
{
try
{
project
=
projectService
.
getProjectById
(
projectId
);
log
.
info
(
"获取渠道参与预警开始,project:{}"
,
project
.
getProjectName
());
log
.
info
(
"获取渠道参与预警开始,project:{}"
,
project
.
getProjectName
());
EsClientDao
.
SearchHelper
helper
=
EsClientDao
.
createSearchHelper
();
EsClientDao
.
SearchHelper
helper
=
EsClientDao
.
createSearchHelper
();
BoolQueryBuilder
postFilter
=
EsQueryTools
.
assembleCacheMapsQuery
(
project
.
getId
(),
"0"
);
BoolQueryBuilder
postFilter
=
EsQueryTools
.
assembleCacheMapsQuery
(
project
.
getId
(),
"0"
);
...
@@ -760,7 +759,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -760,7 +759,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
long
start
=
end
-
Constant
.
ONE_DAY
*
7
;
long
start
=
end
-
Constant
.
ONE_DAY
*
7
;
try
{
try
{
log
.
info
(
"获取热点事件预警开始,project:{}"
,
project
.
getProjectName
());
log
.
info
(
"获取热点事件预警开始,project:{}"
,
project
.
get
Extra
ProjectName
());
Map
<
String
,
List
<
com
.
zhiwei
.
middleware
.
event
.
pojo
.
entity
.
Event
>>
eventMap
=
new
LinkedHashMap
<>();
Map
<
String
,
List
<
com
.
zhiwei
.
middleware
.
event
.
pojo
.
entity
.
Event
>>
eventMap
=
new
LinkedHashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getOwnEvent
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getOwnEvent
()))
{
// 调用事件中间件时,使用项目id作为主品牌id
// 调用事件中间件时,使用项目id作为主品牌id
...
@@ -801,10 +800,10 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -801,10 +800,10 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
}
}
eventMap
.
put
(
"行业动态"
,
externalEvents
);
eventMap
.
put
(
"行业动态"
,
externalEvents
);
}
}
log
.
info
(
"获取热点事件预警结束,project:{}"
,
project
.
getProjectName
());
log
.
info
(
"获取热点事件预警结束,project:{}"
,
project
.
get
Extra
ProjectName
());
return
ResponseResult
.
success
(
brandkbsWarnTemplate4HotEvent
(
config
,
eventMap
,
start
,
end
,
project
));
return
ResponseResult
.
success
(
brandkbsWarnTemplate4HotEvent
(
config
,
eventMap
,
start
,
end
,
project
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"获取热点事件预警失败,project:{}"
,
project
.
getProjectName
(),
e
);
log
.
info
(
"获取热点事件预警失败,project:{}"
,
project
.
get
Extra
ProjectName
(),
e
);
}
}
return
ResponseResult
.
failure
(
"获取热点事件预警失败"
);
return
ResponseResult
.
failure
(
"获取热点事件预警失败"
);
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
View file @
2172f56e
...
@@ -435,7 +435,7 @@ public class ReportServiceImpl implements ReportService {
...
@@ -435,7 +435,7 @@ public class ReportServiceImpl implements ReportService {
String
startTimeStr
=
Constant
.
HOUR_FORMAT
.
format
(
report
.
getStartTime
());
String
startTimeStr
=
Constant
.
HOUR_FORMAT
.
format
(
report
.
getStartTime
());
String
lastStartTimeStr
=
Constant
.
HOUR_FORMAT
.
format
(
lastStartTime
);
String
lastStartTimeStr
=
Constant
.
HOUR_FORMAT
.
format
(
lastStartTime
);
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"brand"
,
projectService
.
getProjectById
(
report
.
getProjectId
()).
getProjectName
());
result
.
put
(
"brand"
,
projectService
.
getProjectById
(
report
.
getProjectId
()).
get
Extra
ProjectName
());
result
.
put
(
"startTime"
,
report
.
getStartTime
());
result
.
put
(
"startTime"
,
report
.
getStartTime
());
result
.
put
(
"endTime"
,
report
.
getEndTime
());
result
.
put
(
"endTime"
,
report
.
getEndTime
());
result
.
put
(
"curMonth"
,
Integer
.
parseInt
(
startTimeStr
.
substring
(
5
,
7
)));
result
.
put
(
"curMonth"
,
Integer
.
parseInt
(
startTimeStr
.
substring
(
5
,
7
)));
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ToolsetServiceImpl.java
View file @
2172f56e
...
@@ -215,7 +215,7 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -215,7 +215,7 @@ public class ToolsetServiceImpl implements ToolsetService {
// 更新已用次数
// 更新已用次数
redisUtil
.
setExpire
(
redisKey
,
String
.
valueOf
(
ARTICLE_SUMMARY_LIMIT
-
remainingCount
),
Tools
.
getMillSecondNextDay
(),
TimeUnit
.
MILLISECONDS
);
redisUtil
.
setExpire
(
redisKey
,
String
.
valueOf
(
ARTICLE_SUMMARY_LIMIT
-
remainingCount
),
Tools
.
getMillSecondNextDay
(),
TimeUnit
.
MILLISECONDS
);
// excel输出到指定路径
// excel输出到指定路径
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
project
.
getProjectName
(),
UserThreadLocal
.
getNickname
(),
"摘要提取结果"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
project
.
get
Extra
ProjectName
(),
UserThreadLocal
.
getNickname
(),
"摘要提取结果"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportArticleSummaryDTO
.
class
,
datas
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportArticleSummaryDTO
.
class
,
datas
);
res
.
put
(
"filePath"
,
filePath
);
res
.
put
(
"filePath"
,
filePath
);
res
.
put
(
"remainingCount"
,
remainingCount
);
res
.
put
(
"remainingCount"
,
remainingCount
);
...
@@ -255,7 +255,7 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -255,7 +255,7 @@ public class ToolsetServiceImpl implements ToolsetService {
List
<
ExportInteractionUpdateDTO
>
exportList
=
List
<
ExportInteractionUpdateDTO
>
exportList
=
urls
.
stream
().
map
(
url
->
new
ExportInteractionUpdateDTO
(
String
.
valueOf
(
id
.
incrementAndGet
()),
urlMap
,
url
)).
collect
(
Collectors
.
toList
());
urls
.
stream
().
map
(
url
->
new
ExportInteractionUpdateDTO
(
String
.
valueOf
(
id
.
incrementAndGet
()),
urlMap
,
url
)).
collect
(
Collectors
.
toList
());
// excel输出到指定路径
// excel输出到指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"链接互动量更新结果"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"链接互动量更新结果"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportInteractionUpdateDTO
.
class
,
exportList
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportInteractionUpdateDTO
.
class
,
exportList
);
JSONObject
res
=
new
JSONObject
();
JSONObject
res
=
new
JSONObject
();
...
@@ -482,7 +482,7 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -482,7 +482,7 @@ public class ToolsetServiceImpl implements ToolsetService {
return
dto
;
return
dto
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"事件计算结果"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"事件计算结果"
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportBytedanceEventComputeResultDTO
.
class
,
list
);
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
ExportBytedanceEventComputeResultDTO
.
class
,
list
);
return
filePath
;
return
filePath
;
...
@@ -493,7 +493,7 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -493,7 +493,7 @@ public class ToolsetServiceImpl implements ToolsetService {
public
String
downloadPrimaryErrorData
(
String
taskId
)
{
public
String
downloadPrimaryErrorData
(
String
taskId
)
{
BytedanceCustomEventUpdateTask
task
=
bytedanceCustomEventUpdateTaskDao
.
findOneById
(
taskId
);
BytedanceCustomEventUpdateTask
task
=
bytedanceCustomEventUpdateTaskDao
.
findOneById
(
taskId
);
// excel写入至指定路径
// excel写入至指定路径
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
get
Extra
ProjectName
();
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"报错数据"
);
String
filePath
=
EasyExcelUtil
.
generateExcelFilePath
(
brandkbsFilePath
,
projectName
,
UserThreadLocal
.
getNickname
(),
"报错数据"
);
// List<UploadBytedanceEventDTO> collect = task.getErrorData().stream().map(errorData -> Tools.convertMap(errorData, UploadBytedanceEventDTO.class)).collect(Collectors.toList());
// List<UploadBytedanceEventDTO> collect = task.getErrorData().stream().map(errorData -> Tools.convertMap(errorData, UploadBytedanceEventDTO.class)).collect(Collectors.toList());
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
UploadBytedanceEventDTO
.
class
,
Collections
.
emptyList
());
EasyExcelUtil
.
write
(
filePath
,
"sheet1"
,
UploadBytedanceEventDTO
.
class
,
Collections
.
emptyList
());
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
View file @
2172f56e
...
@@ -444,6 +444,7 @@ public class UserServiceImpl implements UserService {
...
@@ -444,6 +444,7 @@ public class UserServiceImpl implements UserService {
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"projectId"
,
projectId
);
jsonObject
.
put
(
"projectId"
,
projectId
);
jsonObject
.
put
(
"projectName"
,
project
.
getProjectName
());
jsonObject
.
put
(
"projectName"
,
project
.
getProjectName
());
jsonObject
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
jsonObject
.
put
(
"id"
,
user
.
getId
());
jsonObject
.
put
(
"id"
,
user
.
getId
());
jsonObject
.
put
(
"nickname"
,
user
.
getNickname
());
jsonObject
.
put
(
"nickname"
,
user
.
getNickname
());
jsonObject
.
put
(
"username"
,
user
.
getUsername
());
jsonObject
.
put
(
"username"
,
user
.
getUsername
());
...
@@ -526,6 +527,7 @@ public class UserServiceImpl implements UserService {
...
@@ -526,6 +527,7 @@ public class UserServiceImpl implements UserService {
return
null
;
return
null
;
}
}
json
.
put
(
"projectName"
,
project
.
getProjectName
());
json
.
put
(
"projectName"
,
project
.
getProjectName
());
json
.
put
(
"extraProjectName"
,
project
.
getExtraProjectName
());
json
.
put
(
"key"
,
role
.
getKey
());
json
.
put
(
"key"
,
role
.
getKey
());
json
.
put
(
"projectId"
,
projectId
);
json
.
put
(
"projectId"
,
projectId
);
json
.
put
(
"roleId"
,
role
.
getRoleId
());
json
.
put
(
"roleId"
,
role
.
getRoleId
());
...
...
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