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
d961690e
Commit
d961690e
authored
Jul 13, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口命名规范调整
parent
7d0bd200
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
366 additions
and
268 deletions
+366
-268
src/main/java/com/zhiwei/brandkbs2/auth/AuthAspect.java
+3
-3
src/main/java/com/zhiwei/brandkbs2/common/GlobalPojo.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/config/Constant.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/controller/AppArticleController.java
+15
-7
src/main/java/com/zhiwei/brandkbs2/controller/CommonController.java
+18
-4
src/main/java/com/zhiwei/brandkbs2/controller/LoginController.java
+10
-10
src/main/java/com/zhiwei/brandkbs2/controller/admin/ArticleController.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/controller/admin/BaseModuleController.java
+6
-6
src/main/java/com/zhiwei/brandkbs2/controller/admin/BehaviorController.java
+5
-5
src/main/java/com/zhiwei/brandkbs2/controller/admin/ChannelController.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/controller/admin/CustomTagController.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/controller/admin/EventController.java
+25
-25
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
+15
-15
src/main/java/com/zhiwei/brandkbs2/controller/admin/ReportController.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/controller/admin/UserController.java
+11
-11
src/main/java/com/zhiwei/brandkbs2/easyexcel/listener/EventFileListener.java
+5
-5
src/main/java/com/zhiwei/brandkbs2/pojo/MarkFlowEntity.java
+21
-0
src/main/java/com/zhiwei/brandkbs2/pojo/dto/EventSearchDTO.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/BehaviorService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/BrandkbsTaskService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
+3
-3
src/main/java/com/zhiwei/brandkbs2/service/CommonService.java
+10
-3
src/main/java/com/zhiwei/brandkbs2/service/CustomTagService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/EventDataService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/EventService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/HighWordService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/ProjectService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/ReportService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/SystemInfoService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/TagFilterService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/TaskService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/UserService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/BehaviorServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/BrandkbsTaskServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/CommonServiceImpl.java
+24
-10
src/main/java/com/zhiwei/brandkbs2/service/impl/CustomTagServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/EventDataServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
+6
-6
src/main/java/com/zhiwei/brandkbs2/service/impl/HighWordServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+63
-71
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
+3
-3
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/service/impl/SystemInfoServiceImpl.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/service/impl/TagFilterServiceImpl.java
+6
-7
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
+5
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/task/ControlCenter.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
+28
-0
src/test/java/com/zhiwei/brandkbs2/TestRunWith.java
+20
-9
No files found.
src/main/java/com/zhiwei/brandkbs2/auth/AuthAspect.java
View file @
d961690e
...
@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.common.GenericAttribute;
...
@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.common.GenericAttribute;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
import
com.zhiwei.brandkbs2.service.
I
UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.middleware.auth.util.JwtUtil
;
import
com.zhiwei.middleware.auth.util.JwtUtil
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.Signature
;
...
@@ -40,7 +40,7 @@ public class AuthAspect {
...
@@ -40,7 +40,7 @@ public class AuthAspect {
private
String
jwtKey
;
private
String
jwtKey
;
@Resource
(
name
=
"userServiceImpl"
)
@Resource
(
name
=
"userServiceImpl"
)
private
IUserService
i
UserService
;
private
UserService
UserService
;
@Pointcut
(
"execution(com.zhiwei.brandkbs2.model.ResponseResult com.zhiwei.brandkbs2.controller..*.*(..))"
)
@Pointcut
(
"execution(com.zhiwei.brandkbs2.model.ResponseResult com.zhiwei.brandkbs2.controller..*.*(..))"
)
// @Pointcut("within(com.zhiwei.brandkbs2.controller..*)")
// @Pointcut("within(com.zhiwei.brandkbs2.controller..*)")
...
@@ -73,7 +73,7 @@ public class AuthAspect {
...
@@ -73,7 +73,7 @@ public class AuthAspect {
return
unAuthenticatedResponse
(
response
,
noAuth
,
joinPoint
);
return
unAuthenticatedResponse
(
response
,
noAuth
,
joinPoint
);
}
}
String
uid
=
tokenInfo
.
get
(
GenericAttribute
.
USER_ID
).
toString
();
String
uid
=
tokenInfo
.
get
(
GenericAttribute
.
USER_ID
).
toString
();
UserInfo
userInfo
=
i
UserService
.
queryUserInfo
(
uid
,
request
.
getHeader
(
"pid"
));
UserInfo
userInfo
=
UserService
.
queryUserInfo
(
uid
,
request
.
getHeader
(
"pid"
));
if
(!
noAuth
&&
null
==
userInfo
)
{
if
(!
noAuth
&&
null
==
userInfo
)
{
return
unAuthoriseResponse
(
response
);
return
unAuthoriseResponse
(
response
);
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/common/GlobalPojo.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
common
;
package
com
.
zhiwei
.
brandkbs2
.
common
;
import
com.zhiwei.brandkbs2.service.
I
SystemInfoService
;
import
com.zhiwei.brandkbs2.service.SystemInfoService
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
...
@@ -26,7 +26,7 @@ public class GlobalPojo {
...
@@ -26,7 +26,7 @@ public class GlobalPojo {
public
static
final
Logger
log
=
LogManager
.
getLogger
(
GlobalPojo
.
class
);
public
static
final
Logger
log
=
LogManager
.
getLogger
(
GlobalPojo
.
class
);
@Resource
(
name
=
"systemInfoServiceImpl"
)
@Resource
(
name
=
"systemInfoServiceImpl"
)
private
I
SystemInfoService
systemInfoService
;
private
SystemInfoService
systemInfoService
;
/**
/**
* 监测系统平台
* 监测系统平台
...
...
src/main/java/com/zhiwei/brandkbs2/config/Constant.java
View file @
d961690e
...
@@ -8,6 +8,7 @@ package com.zhiwei.brandkbs2.config;
...
@@ -8,6 +8,7 @@ package com.zhiwei.brandkbs2.config;
*/
*/
public
class
Constant
{
public
class
Constant
{
public
static
final
String
HOUR_PATTERN
=
"yyyy-MM-dd HH"
;
public
static
final
String
DAY_PATTERN
=
"yyyy-MM-dd"
;
public
static
final
String
DAY_PATTERN
=
"yyyy-MM-dd"
;
/**
/**
...
...
src/main/java/com/zhiwei/brandkbs2/controller/AppArticleController.java
View file @
d961690e
...
@@ -4,8 +4,9 @@ import com.zhiwei.brandkbs2.auth.Auth;
...
@@ -4,8 +4,9 @@ import com.zhiwei.brandkbs2.auth.Auth;
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.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.service.IMarkDataService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.IReportService
;
import
com.zhiwei.brandkbs2.service.MarkDataService
;
import
com.zhiwei.brandkbs2.service.ReportService
;
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
;
...
@@ -27,10 +28,13 @@ import javax.annotation.Resource;
...
@@ -27,10 +28,13 @@ import javax.annotation.Resource;
public
class
AppArticleController
extends
BaseController
{
public
class
AppArticleController
extends
BaseController
{
@Resource
(
name
=
"markDataServiceImpl"
)
@Resource
(
name
=
"markDataServiceImpl"
)
I
MarkDataService
markDataService
;
MarkDataService
markDataService
;
@Resource
(
name
=
"reportServiceImpl"
)
@Resource
(
name
=
"reportServiceImpl"
)
IReportService
reportService
;
ReportService
reportService
;
@Resource
(
name
=
"commonServiceImpl"
)
CommonService
commonService
;
@ApiOperation
(
"舆情列表"
)
@ApiOperation
(
"舆情列表"
)
@PostMapping
(
"/mark/list"
)
@PostMapping
(
"/mark/list"
)
...
@@ -62,7 +66,7 @@ public class AppArticleController extends BaseController {
...
@@ -62,7 +66,7 @@ public class AppArticleController extends BaseController {
return
ResponseResult
.
success
(
markDataService
.
getMarkSpread
(
startTime
,
endTime
,
true
));
return
ResponseResult
.
success
(
markDataService
.
getMarkSpread
(
startTime
,
endTime
,
true
));
}
}
@ApiOperation
(
"舆情分析-
平台
曝光对比"
)
@ApiOperation
(
"舆情分析-
品牌
曝光对比"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
paramType
=
"query"
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
paramType
=
"query"
,
dataType
=
"long"
)
...
@@ -102,12 +106,16 @@ public class AppArticleController extends BaseController {
...
@@ -102,12 +106,16 @@ public class AppArticleController extends BaseController {
return
ResponseResult
.
success
(
markDataService
.
getMarkHighWord
(
startTime
,
endTime
));
return
ResponseResult
.
success
(
markDataService
.
getMarkHighWord
(
startTime
,
endTime
));
}
}
@ApiOperation
(
"舆情分析-获取默认时间"
)
@GetMapping
(
"/default/time"
)
public
ResponseResult
getDefaultTime
()
{
return
ResponseResult
.
success
(
commonService
.
getTimeRangeMonth
());
}
@ApiOperation
(
"舆情简报-分类统计"
)
@ApiOperation
(
"舆情简报-分类统计"
)
@GetMapping
(
"/aggCount"
)
@GetMapping
(
"/aggCount"
)
public
ResponseResult
getReportsAggCount
()
{
public
ResponseResult
getReportsAggCount
()
{
return
ResponseResult
.
success
(
reportService
.
getReportsAggCount
());
return
ResponseResult
.
success
(
reportService
.
getReportsAggCount
());
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/controller/CommonController.java
View file @
d961690e
...
@@ -3,8 +3,8 @@ package com.zhiwei.brandkbs2.controller;
...
@@ -3,8 +3,8 @@ package com.zhiwei.brandkbs2.controller;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.Auth
;
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.service.
I
CommonService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -33,10 +33,10 @@ import java.util.stream.Collectors;
...
@@ -33,10 +33,10 @@ import java.util.stream.Collectors;
public
class
CommonController
extends
BaseController
{
public
class
CommonController
extends
BaseController
{
@Resource
(
name
=
"commonServiceImpl"
)
@Resource
(
name
=
"commonServiceImpl"
)
I
CommonService
commonService
;
CommonService
commonService
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
I
ProjectService
projectService
;
ProjectService
projectService
;
@ApiOperation
(
"获取情感倾向标签信息"
)
@ApiOperation
(
"获取情感倾向标签信息"
)
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
...
@@ -67,4 +67,18 @@ public class CommonController extends BaseController {
...
@@ -67,4 +67,18 @@ public class CommonController extends BaseController {
return
ResponseResult
.
success
(
projectService
.
getUserAllProjects
());
return
ResponseResult
.
success
(
projectService
.
getUserAllProjects
());
}
}
// @ApiOperation("获取默认月间隔时间节点")
// @GetMapping("/time/month")
// @Auth(role = RoleEnum.CUSTOMER)
// public ResponseResult getTimeRangeMonth() {
// return ResponseResult.success(commonService.getTimeRangeMonth());
// }
//
// @ApiOperation("获取默认周间隔时间节点")
// @GetMapping("/time/week")
// @Auth(role = RoleEnum.CUSTOMER)
// public ResponseResult getTimeRangeWeek() {
// return ResponseResult.success(commonService.getTimeRangeWeek());
// }
}
}
src/main/java/com/zhiwei/brandkbs2/controller/LoginController.java
View file @
d961690e
...
@@ -5,8 +5,8 @@ import com.zhiwei.brandkbs2.auth.Auth;
...
@@ -5,8 +5,8 @@ import com.zhiwei.brandkbs2.auth.Auth;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
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.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.
I
UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
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
;
...
@@ -36,15 +36,15 @@ public class LoginController extends BaseController {
...
@@ -36,15 +36,15 @@ public class LoginController extends BaseController {
private
int
jwtHour
;
private
int
jwtHour
;
@Resource
(
name
=
"userServiceImpl"
)
@Resource
(
name
=
"userServiceImpl"
)
private
IUserService
i
UserService
;
private
UserService
UserService
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
private
IProjectService
i
ProjectService
;
private
ProjectService
ProjectService
;
@ApiOperation
(
"用户登录"
)
@ApiOperation
(
"用户登录"
)
@PostMapping
(
"/user/login"
)
@PostMapping
(
"/user/login"
)
public
ResponseResult
login
()
{
public
ResponseResult
login
()
{
return
ResponseResult
.
success
(
i
UserService
.
login
().
toMap
());
return
ResponseResult
.
success
(
UserService
.
login
().
toMap
());
}
}
@ApiOperation
(
"用户信息获取"
)
@ApiOperation
(
"用户信息获取"
)
...
@@ -59,7 +59,7 @@ public class LoginController extends BaseController {
...
@@ -59,7 +59,7 @@ public class LoginController extends BaseController {
@ApiImplicitParam
(
name
=
"username"
,
value
=
"用户名"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"string"
))
@ApiImplicitParam
(
name
=
"username"
,
value
=
"用户名"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"string"
))
@PostMapping
(
"/user/bind/reset"
)
@PostMapping
(
"/user/bind/reset"
)
public
ResponseResult
resetBind
(
@RequestBody
JSONObject
json
)
{
public
ResponseResult
resetBind
(
@RequestBody
JSONObject
json
)
{
i
UserService
.
resetBind
(
json
.
getString
(
"username"
));
UserService
.
resetBind
(
json
.
getString
(
"username"
));
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -71,25 +71,25 @@ public class LoginController extends BaseController {
...
@@ -71,25 +71,25 @@ public class LoginController extends BaseController {
public
ResponseResult
bindUser
(
@RequestBody
JSONObject
json
)
{
public
ResponseResult
bindUser
(
@RequestBody
JSONObject
json
)
{
String
username
=
json
.
getString
(
"username"
);
String
username
=
json
.
getString
(
"username"
);
String
password
=
json
.
getString
(
"password"
);
String
password
=
json
.
getString
(
"password"
);
return
ResponseResult
.
success
(
i
UserService
.
bindUser
(
username
,
password
));
return
ResponseResult
.
success
(
UserService
.
bindUser
(
username
,
password
));
}
}
@ApiOperation
(
"跳过绑定(赋默认权限)"
)
@ApiOperation
(
"跳过绑定(赋默认权限)"
)
@PostMapping
(
"/user/bind/skip"
)
@PostMapping
(
"/user/bind/skip"
)
public
ResponseResult
skipBindUser
()
{
public
ResponseResult
skipBindUser
()
{
return
ResponseResult
.
success
(
i
UserService
.
skipBindUser
());
return
ResponseResult
.
success
(
UserService
.
skipBindUser
());
}
}
@ApiOperation
(
"校验用户是否已有绑定关系"
)
@ApiOperation
(
"校验用户是否已有绑定关系"
)
@GetMapping
(
"/user/login/checkBind"
)
@GetMapping
(
"/user/login/checkBind"
)
public
ResponseResult
checkBind
()
{
public
ResponseResult
checkBind
()
{
return
ResponseResult
.
success
(
i
UserService
.
checkUserRoles
());
return
ResponseResult
.
success
(
UserService
.
checkUserRoles
());
}
}
@ApiOperation
(
"获取当前用户拥有的所有项目(含过期)"
)
@ApiOperation
(
"获取当前用户拥有的所有项目(含过期)"
)
@GetMapping
(
"/user/login/getUserAllProjects"
)
@GetMapping
(
"/user/login/getUserAllProjects"
)
public
ResponseResult
getLoginUserAllProjects
()
{
public
ResponseResult
getLoginUserAllProjects
()
{
return
ResponseResult
.
success
(
i
ProjectService
.
getLoginUserAllProjects
());
return
ResponseResult
.
success
(
ProjectService
.
getLoginUserAllProjects
());
}
}
@ApiOperation
(
"测试接口"
)
@ApiOperation
(
"测试接口"
)
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/ArticleController.java
View file @
d961690e
...
@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.controller.BaseController;
...
@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.controller.BaseController;
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.Behavior
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -55,10 +55,10 @@ public class ArticleController extends BaseController {
...
@@ -55,10 +55,10 @@ public class ArticleController extends BaseController {
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@javax
.
annotation
.
Resource
(
name
=
"behaviorServiceImpl"
)
@javax
.
annotation
.
Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
@javax
.
annotation
.
Resource
(
name
=
"projectServiceImpl"
)
@javax
.
annotation
.
Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"稿件上传"
,
true
);
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"稿件上传"
,
true
);
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/BaseModuleController.java
View file @
d961690e
...
@@ -10,9 +10,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
...
@@ -10,9 +10,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.service.
I
HighWordService
;
import
com.zhiwei.brandkbs2.service.HighWordService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.
I
TagFilterService
;
import
com.zhiwei.brandkbs2.service.TagFilterService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -37,13 +37,13 @@ import java.util.List;
...
@@ -37,13 +37,13 @@ import java.util.List;
public
class
BaseModuleController
extends
BaseController
{
public
class
BaseModuleController
extends
BaseController
{
@Resource
(
name
=
"tagFilterServiceImpl"
)
@Resource
(
name
=
"tagFilterServiceImpl"
)
I
TagFilterService
tagFilterService
;
TagFilterService
tagFilterService
;
@Resource
(
name
=
"highWordServiceImpl"
)
@Resource
(
name
=
"highWordServiceImpl"
)
I
HighWordService
highWordService
;
HighWordService
highWordService
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
I
ProjectService
projectService
;
ProjectService
projectService
;
@ApiOperation
(
"获取在用筛选器列表"
)
@ApiOperation
(
"获取在用筛选器列表"
)
@GetMapping
(
"/tagFilter"
)
@GetMapping
(
"/tagFilter"
)
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/BehaviorController.java
View file @
d961690e
...
@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil;
...
@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportBehaviorDTO
;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportBehaviorDTO
;
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.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
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
;
...
@@ -34,10 +34,10 @@ import java.util.List;
...
@@ -34,10 +34,10 @@ import java.util.List;
public
class
BehaviorController
extends
BaseController
{
public
class
BehaviorController
extends
BaseController
{
@Resource
(
name
=
"behaviorServiceImpl"
)
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
private
IProjectService
i
ProjectService
;
private
ProjectService
ProjectService
;
@ApiOperation
(
"分页查询用户行为列表"
)
@ApiOperation
(
"分页查询用户行为列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
...
@@ -72,7 +72,7 @@ public class BehaviorController extends BaseController {
...
@@ -72,7 +72,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
=
i
ProjectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
()
+
"_"
+
behaviorName
;
String
sheetName
=
ProjectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
()
+
"_"
+
behaviorName
;
EasyExcelUtil
.
download
(
sheetName
+
"用户行为"
,
sheetName
,
ExportBehaviorDTO
.
class
,
downloadList
,
response
);
EasyExcelUtil
.
download
(
sheetName
+
"用户行为"
,
sheetName
,
ExportBehaviorDTO
.
class
,
downloadList
,
response
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/ChannelController.java
View file @
d961690e
...
@@ -12,8 +12,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
...
@@ -12,8 +12,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
ChannelService
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -41,10 +41,10 @@ import java.util.stream.Collectors;
...
@@ -41,10 +41,10 @@ import java.util.stream.Collectors;
public
class
ChannelController
extends
BaseController
{
public
class
ChannelController
extends
BaseController
{
@Resource
(
name
=
"channelServiceImpl"
)
@Resource
(
name
=
"channelServiceImpl"
)
I
ChannelService
channelService
;
ChannelService
channelService
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
I
ProjectService
projectService
;
ProjectService
projectService
;
@Value
(
"${brandkbs.img.url}"
)
@Value
(
"${brandkbs.img.url}"
)
private
String
brandkbsImgPath
;
private
String
brandkbsImgPath
;
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/CustomTagController.java
View file @
d961690e
...
@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.controller.BaseController;
...
@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.controller.BaseController;
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.Behavior
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
CustomTagService
;
import
com.zhiwei.brandkbs2.service.CustomTagService
;
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
;
...
@@ -33,10 +33,10 @@ import static com.alibaba.fastjson.JSON.parseArray;
...
@@ -33,10 +33,10 @@ import static com.alibaba.fastjson.JSON.parseArray;
public
class
CustomTagController
extends
BaseController
{
public
class
CustomTagController
extends
BaseController
{
@Resource
(
name
=
"customTagServiceImpl"
)
@Resource
(
name
=
"customTagServiceImpl"
)
private
I
CustomTagService
customTagService
;
private
CustomTagService
customTagService
;
@Resource
(
name
=
"behaviorServiceImpl"
)
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"自定义标签管理"
,
true
);
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"自定义标签管理"
,
true
);
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/EventController.java
View file @
d961690e
...
@@ -15,8 +15,8 @@ import com.zhiwei.brandkbs2.pojo.dto.YqEventDTO;
...
@@ -15,8 +15,8 @@ import com.zhiwei.brandkbs2.pojo.dto.YqEventDTO;
import
com.zhiwei.brandkbs2.pojo.vo.EventVO
;
import
com.zhiwei.brandkbs2.pojo.vo.EventVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.YqEventSearchVO
;
import
com.zhiwei.brandkbs2.pojo.vo.YqEventSearchVO
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
EventService
;
import
com.zhiwei.brandkbs2.service.EventService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -47,10 +47,10 @@ import java.util.Set;
...
@@ -47,10 +47,10 @@ import java.util.Set;
public
class
EventController
extends
BaseController
{
public
class
EventController
extends
BaseController
{
@Resource
(
name
=
"eventServiceImpl"
)
@Resource
(
name
=
"eventServiceImpl"
)
private
IEventService
i
EventService
;
private
EventService
EventService
;
@Resource
(
name
=
"behaviorServiceImpl"
)
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"事件管理"
,
true
);
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"事件管理"
,
true
);
...
@@ -64,13 +64,13 @@ public class EventController extends BaseController {
...
@@ -64,13 +64,13 @@ public class EventController extends BaseController {
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联项目组id"
,
paramType
=
"query"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联项目组id"
,
paramType
=
"query"
,
dataType
=
"string"
)
@GetMapping
(
"/yq/tag"
)
@GetMapping
(
"/yq/tag"
)
public
ResponseResult
searchCriteria
(
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
)
{
public
ResponseResult
searchCriteria
(
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
)
{
return
ResponseResult
.
success
(
i
EventService
.
findEventTagListAll
(
linkedGroupId
));
return
ResponseResult
.
success
(
EventService
.
findEventTagListAll
(
linkedGroupId
));
}
}
@ApiOperation
(
"分页查询舆情事件列表"
)
@ApiOperation
(
"分页查询舆情事件列表"
)
@PostMapping
(
"/yq/list"
)
@PostMapping
(
"/yq/list"
)
public
ResponseResult
findYqEventList
(
@RequestBody
YqEventSearchVO
yqEventSearchVO
)
{
public
ResponseResult
findYqEventList
(
@RequestBody
YqEventSearchVO
yqEventSearchVO
)
{
PageVO
<
JSONObject
>
yqEventList
=
i
EventService
.
findYqEventList
(
yqEventSearchVO
);
PageVO
<
JSONObject
>
yqEventList
=
EventService
.
findYqEventList
(
yqEventSearchVO
);
return
ResponseResult
.
success
(
yqEventList
);
return
ResponseResult
.
success
(
yqEventList
);
}
}
...
@@ -87,27 +87,27 @@ public class EventController extends BaseController {
...
@@ -87,27 +87,27 @@ public class EventController extends BaseController {
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
,
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
,
@RequestParam
(
value
=
"sorter"
,
defaultValue
=
"{\"startTime\":\"descend\"}"
)
String
sorter
)
{
@RequestParam
(
value
=
"sorter"
,
defaultValue
=
"{\"startTime\":\"descend\"}"
)
String
sorter
)
{
return
ResponseResult
.
success
(
i
EventService
.
findEventList
(
page
,
size
,
linkedGroupId
,
keyword
,
sorter
));
return
ResponseResult
.
success
(
EventService
.
findEventList
(
page
,
size
,
linkedGroupId
,
keyword
,
sorter
));
}
}
@ApiOperation
(
"获取单个事件信息"
)
@ApiOperation
(
"获取单个事件信息"
)
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@GetMapping
(
"/get/{eventId}"
)
@GetMapping
(
"/get/{eventId}"
)
public
ResponseResult
getEvent
(
@PathVariable
(
"eventId"
)
String
eventId
)
{
public
ResponseResult
getEvent
(
@PathVariable
(
"eventId"
)
String
eventId
)
{
return
ResponseResult
.
success
(
i
EventService
.
getEventJSONByEventId
(
eventId
));
return
ResponseResult
.
success
(
EventService
.
getEventJSONByEventId
(
eventId
));
}
}
@ApiOperation
(
"获取事件数据列表"
)
@ApiOperation
(
"获取事件数据列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
required
=
false
,
defaultValue
=
"1"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"10"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
required
=
false
,
defaultValue
=
"1"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"10"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)})
@GetMapping
(
"/data/get"
)
@GetMapping
(
"/data/get"
)
public
ResponseResult
getEventDatas
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"eventId"
)
String
eventId
)
{
public
ResponseResult
getEventDatas
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"eventId"
)
String
eventId
)
{
return
ResponseResult
.
success
(
i
EventService
.
getEventDatas
(
page
,
size
,
eventId
));
return
ResponseResult
.
success
(
EventService
.
getEventDatas
(
page
,
size
,
eventId
));
}
}
@ApiOperation
(
"修改事件信息"
)
@ApiOperation
(
"修改事件信息"
)
@PutMapping
(
"/update"
)
@PutMapping
(
"/update"
)
public
ResponseResult
updateEvent
(
@RequestBody
EventVO
eventVO
)
{
public
ResponseResult
updateEvent
(
@RequestBody
EventVO
eventVO
)
{
i
EventService
.
updateEvent
(
eventVO
);
EventService
.
updateEvent
(
eventVO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"修改事件信息:"
+
eventVO
.
getId
(),
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"修改事件信息:"
+
eventVO
.
getId
(),
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -115,7 +115,7 @@ public class EventController extends BaseController {
...
@@ -115,7 +115,7 @@ public class EventController extends BaseController {
@ApiOperation
(
"修改事件首发信息"
)
@ApiOperation
(
"修改事件首发信息"
)
@PutMapping
(
"/updateFirst"
)
@PutMapping
(
"/updateFirst"
)
public
ResponseResult
updateEventFirst
(
@RequestBody
EventDataDTO
eventDataDTO
)
{
public
ResponseResult
updateEventFirst
(
@RequestBody
EventDataDTO
eventDataDTO
)
{
i
EventService
.
updateEventFirst
(
eventDataDTO
);
EventService
.
updateEventFirst
(
eventDataDTO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"修改事件首发信息:"
+
eventDataDTO
.
getEventId
(),
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"修改事件首发信息:"
+
eventDataDTO
.
getEventId
(),
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -124,7 +124,7 @@ public class EventController extends BaseController {
...
@@ -124,7 +124,7 @@ public class EventController extends BaseController {
@ApiImplicitParam
(
name
=
"eventIds"
,
value
=
"事件ID集合"
,
paramType
=
"body"
,
dataType
=
"list"
)
@ApiImplicitParam
(
name
=
"eventIds"
,
value
=
"事件ID集合"
,
paramType
=
"body"
,
dataType
=
"list"
)
@PostMapping
(
"/analyze"
)
@PostMapping
(
"/analyze"
)
public
ResponseResult
analysisEvents
(
@RequestBody
JSONObject
info
)
{
public
ResponseResult
analysisEvents
(
@RequestBody
JSONObject
info
)
{
i
EventService
.
analysisEvents
(
info
.
getJSONArray
(
"eventIds"
).
toJavaList
(
String
.
class
));
EventService
.
analysisEvents
(
info
.
getJSONArray
(
"eventIds"
).
toJavaList
(
String
.
class
));
behaviorService
.
pushBehavior
(
OPERATION
,
"批量更新事件"
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"批量更新事件"
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -133,7 +133,7 @@ public class EventController extends BaseController {
...
@@ -133,7 +133,7 @@ public class EventController extends BaseController {
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@PutMapping
(
"/end/{eventId}"
)
@PutMapping
(
"/end/{eventId}"
)
public
ResponseResult
endEvent
(
@PathVariable
(
"eventId"
)
String
eventId
)
{
public
ResponseResult
endEvent
(
@PathVariable
(
"eventId"
)
String
eventId
)
{
i
EventService
.
endEvent
(
eventId
);
EventService
.
endEvent
(
eventId
);
behaviorService
.
pushBehavior
(
OPERATION
,
"结束事件:"
+
eventId
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"结束事件:"
+
eventId
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -142,7 +142,7 @@ public class EventController extends BaseController {
...
@@ -142,7 +142,7 @@ public class EventController extends BaseController {
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@DeleteMapping
(
"/delete/{eventId}"
)
@DeleteMapping
(
"/delete/{eventId}"
)
public
ResponseResult
deleteEvent
(
@PathVariable
(
"eventId"
)
String
eventId
)
{
public
ResponseResult
deleteEvent
(
@PathVariable
(
"eventId"
)
String
eventId
)
{
String
title
=
i
EventService
.
deleteEvent
(
eventId
);
String
title
=
EventService
.
deleteEvent
(
eventId
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除事件:"
+
title
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除事件:"
+
title
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -153,7 +153,7 @@ public class EventController extends BaseController {
...
@@ -153,7 +153,7 @@ public class EventController extends BaseController {
public
ResponseResult
deleteEventData
(
@RequestBody
JSONObject
info
)
{
public
ResponseResult
deleteEventData
(
@RequestBody
JSONObject
info
)
{
String
id
=
info
.
getString
(
"id"
);
String
id
=
info
.
getString
(
"id"
);
String
eventId
=
info
.
getString
(
"eventId"
);
String
eventId
=
info
.
getString
(
"eventId"
);
String
title
=
i
EventService
.
deleteEventData
(
id
,
eventId
);
String
title
=
EventService
.
deleteEventData
(
id
,
eventId
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除事件单条数据,eventId:"
+
eventId
+
",数据id:"
+
id
+
",事件标题:"
+
title
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除事件单条数据,eventId:"
+
eventId
+
",数据id:"
+
id
+
",事件标题:"
+
title
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -172,14 +172,14 @@ public class EventController extends BaseController {
...
@@ -172,14 +172,14 @@ public class EventController extends BaseController {
@ApiOperation
(
"事件上传进度获取"
)
@ApiOperation
(
"事件上传进度获取"
)
@GetMapping
(
"data/upload/progress/{ticket}"
)
@GetMapping
(
"data/upload/progress/{ticket}"
)
public
ResponseResult
getEventDataUploadProgress
(
@PathVariable
String
ticket
)
{
public
ResponseResult
getEventDataUploadProgress
(
@PathVariable
String
ticket
)
{
return
ResponseResult
.
success
(
i
EventService
.
getEventDataUploadProgress
(
ticket
));
return
ResponseResult
.
success
(
EventService
.
getEventDataUploadProgress
(
ticket
));
}
}
@ApiOperation
(
"事件数据上传进度获取"
)
@ApiOperation
(
"事件数据上传进度获取"
)
@ApiImplicitParams
(
@ApiImplicitParam
(
name
=
"eventIds"
,
value
=
"事件id列表"
,
paramType
=
"body"
,
dataType
=
"list"
))
@ApiImplicitParams
(
@ApiImplicitParam
(
name
=
"eventIds"
,
value
=
"事件id列表"
,
paramType
=
"body"
,
dataType
=
"list"
))
@PostMapping
(
"analyze/progress"
)
@PostMapping
(
"analyze/progress"
)
public
ResponseResult
getEventAnalyzeProgress
(
@RequestBody
JSONObject
info
)
{
public
ResponseResult
getEventAnalyzeProgress
(
@RequestBody
JSONObject
info
)
{
return
ResponseResult
.
success
(
i
EventService
.
getEventAnalyzeProgress
(
info
.
getJSONArray
(
"eventIds"
).
toJavaList
(
String
.
class
)));
return
ResponseResult
.
success
(
EventService
.
getEventAnalyzeProgress
(
info
.
getJSONArray
(
"eventIds"
).
toJavaList
(
String
.
class
)));
}
}
@ApiOperation
(
"事件上传模板下载"
)
@ApiOperation
(
"事件上传模板下载"
)
...
@@ -202,7 +202,7 @@ public class EventController extends BaseController {
...
@@ -202,7 +202,7 @@ public class EventController extends BaseController {
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联项目组id"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联项目组id"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)
@GetMapping
(
"/download"
)
@GetMapping
(
"/download"
)
public
ResponseResult
downloadEvents
(
@RequestParam
(
"linkedGroupId"
)
String
linkedGroupId
)
{
public
ResponseResult
downloadEvents
(
@RequestParam
(
"linkedGroupId"
)
String
linkedGroupId
)
{
Pair
<
String
,
List
<
ExportEventDTO
>>
result
=
i
EventService
.
downloadEvents
(
linkedGroupId
);
Pair
<
String
,
List
<
ExportEventDTO
>>
result
=
EventService
.
downloadEvents
(
linkedGroupId
);
String
fileName
=
result
.
getLeft
();
String
fileName
=
result
.
getLeft
();
EasyExcelUtil
.
download
(
fileName
+
"_事件列表数据"
,
fileName
,
ExportEventDTO
.
class
,
result
.
getRight
(),
response
);
EasyExcelUtil
.
download
(
fileName
+
"_事件列表数据"
,
fileName
,
ExportEventDTO
.
class
,
result
.
getRight
(),
response
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
...
@@ -212,7 +212,7 @@ public class EventController extends BaseController {
...
@@ -212,7 +212,7 @@ public class EventController extends BaseController {
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"eventId"
,
value
=
"事件ID"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)
@GetMapping
(
"/data/download"
)
@GetMapping
(
"/data/download"
)
public
ResponseResult
downloadEventDatas
(
@RequestParam
(
"eventId"
)
String
eventId
)
{
public
ResponseResult
downloadEventDatas
(
@RequestParam
(
"eventId"
)
String
eventId
)
{
Pair
<
String
,
List
<
ExportEventDataDTO
>>
result
=
i
EventService
.
downloadEventDatas
(
eventId
);
Pair
<
String
,
List
<
ExportEventDataDTO
>>
result
=
EventService
.
downloadEventDatas
(
eventId
);
String
title
=
result
.
getLeft
();
String
title
=
result
.
getLeft
();
EasyExcelUtil
.
download
(
title
,
title
,
ExportEventDataDTO
.
class
,
result
.
getRight
(),
response
);
EasyExcelUtil
.
download
(
title
,
title
,
ExportEventDataDTO
.
class
,
result
.
getRight
(),
response
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
...
@@ -224,7 +224,7 @@ public class EventController extends BaseController {
...
@@ -224,7 +224,7 @@ public class EventController extends BaseController {
public
ResponseResult
addEventsByYq
(
@RequestBody
JSONObject
info
)
{
public
ResponseResult
addEventsByYq
(
@RequestBody
JSONObject
info
)
{
String
linkedGroupId
=
info
.
getString
(
"linkedGroupId"
);
String
linkedGroupId
=
info
.
getString
(
"linkedGroupId"
);
List
<
YqEventDTO
>
yqEventList
=
info
.
getJSONArray
(
"list"
).
toJavaList
(
YqEventDTO
.
class
);
List
<
YqEventDTO
>
yqEventList
=
info
.
getJSONArray
(
"list"
).
toJavaList
(
YqEventDTO
.
class
);
i
EventService
.
addYqEvents
(
linkedGroupId
,
yqEventList
);
EventService
.
addYqEvents
(
linkedGroupId
,
yqEventList
);
behaviorService
.
pushBehavior
(
OPERATION
,
"批量导入舆情事件数据"
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"批量导入舆情事件数据"
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -232,7 +232,7 @@ public class EventController extends BaseController {
...
@@ -232,7 +232,7 @@ public class EventController extends BaseController {
@ApiOperation
(
"按搜索条件全部导入舆情事件数据"
)
@ApiOperation
(
"按搜索条件全部导入舆情事件数据"
)
@PutMapping
(
"/upload/yqAll"
)
@PutMapping
(
"/upload/yqAll"
)
public
ResponseResult
addEventAllByYq
(
@RequestBody
YqEventSearchVO
yqEventSearchVO
)
{
public
ResponseResult
addEventAllByYq
(
@RequestBody
YqEventSearchVO
yqEventSearchVO
)
{
i
EventService
.
addYqEventAll
(
yqEventSearchVO
);
EventService
.
addYqEventAll
(
yqEventSearchVO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"全部导入舆情事件数据"
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"全部导入舆情事件数据"
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -242,7 +242,7 @@ public class EventController extends BaseController {
...
@@ -242,7 +242,7 @@ public class EventController extends BaseController {
@PostMapping
(
value
=
"/upload/file"
,
headers
=
"content-type=multipart/form-data"
)
@PostMapping
(
value
=
"/upload/file"
,
headers
=
"content-type=multipart/form-data"
)
@Auth
(
role
=
RoleEnum
.
SUPER_ADMIN
)
@Auth
(
role
=
RoleEnum
.
SUPER_ADMIN
)
public
ResponseResult
addEventsByFile
(
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
,
@RequestParam
(
"fileUrl"
)
String
fileUrl
)
{
public
ResponseResult
addEventsByFile
(
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
,
@RequestParam
(
"fileUrl"
)
String
fileUrl
)
{
i
EventService
.
addFileEvents
(
linkedGroupId
,
fileUrl
);
EventService
.
addFileEvents
(
linkedGroupId
,
fileUrl
);
behaviorService
.
pushBehavior
(
OPERATION
,
"文件上传事件"
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"文件上传事件"
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -252,7 +252,7 @@ public class EventController extends BaseController {
...
@@ -252,7 +252,7 @@ public class EventController extends BaseController {
"linkedGroupId"
,
value
=
"关联项目id"
,
paramType
=
"form"
,
dataType
=
"string"
)})
"linkedGroupId"
,
value
=
"关联项目id"
,
paramType
=
"form"
,
dataType
=
"string"
)})
@PostMapping
(
value
=
"/data/upload"
,
headers
=
"content-type=multipart/form-data"
)
@PostMapping
(
value
=
"/data/upload"
,
headers
=
"content-type=multipart/form-data"
)
public
ResponseResult
uploadEventDatas
(
@RequestParam
(
"linkedGroupId"
)
String
linkedGroupId
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
ResponseResult
uploadEventDatas
(
@RequestParam
(
"linkedGroupId"
)
String
linkedGroupId
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
i
EventService
.
uploadEventDatas
(
linkedGroupId
,
file
);
EventService
.
uploadEventDatas
(
linkedGroupId
,
file
);
behaviorService
.
pushBehavior
(
OPERATION
,
"事件数据上传"
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"事件数据上传"
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -261,13 +261,13 @@ public class EventController extends BaseController {
...
@@ -261,13 +261,13 @@ public class EventController extends BaseController {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
required
=
false
,
defaultValue
=
"1"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"10"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联性项目组id"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"tagGroupName"
,
value
=
"标签组名"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
required
=
false
,
defaultValue
=
"1"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"10"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联性项目组id"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"tagGroupName"
,
value
=
"标签组名"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)})
@GetMapping
(
"/tag/list"
)
@GetMapping
(
"/tag/list"
)
public
ResponseResult
findEventTagList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
,
@RequestParam
(
value
=
"tagGroupName"
)
String
tagGroupName
)
{
public
ResponseResult
findEventTagList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
,
@RequestParam
(
value
=
"tagGroupName"
)
String
tagGroupName
)
{
return
ResponseResult
.
success
(
i
EventService
.
findEventTagList
(
page
,
size
,
linkedGroupId
,
tagGroupName
));
return
ResponseResult
.
success
(
EventService
.
findEventTagList
(
page
,
size
,
linkedGroupId
,
tagGroupName
));
}
}
@ApiOperation
(
"查询所有事件标签组名"
)
@ApiOperation
(
"查询所有事件标签组名"
)
@GetMapping
(
"/tag/groupName"
)
@GetMapping
(
"/tag/groupName"
)
public
ResponseResult
findEventTagGroupName
(
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
)
{
public
ResponseResult
findEventTagGroupName
(
@RequestParam
(
value
=
"linkedGroupId"
)
String
linkedGroupId
)
{
return
ResponseResult
.
success
(
i
EventService
.
findEventTagGroupName
(
linkedGroupId
));
return
ResponseResult
.
success
(
EventService
.
findEventTagGroupName
(
linkedGroupId
));
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
View file @
d961690e
...
@@ -11,9 +11,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
...
@@ -11,9 +11,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
CommonService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -50,13 +50,13 @@ public class ProjectController extends BaseController {
...
@@ -50,13 +50,13 @@ public class ProjectController extends BaseController {
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
private
IProjectService
i
ProjectService
;
private
ProjectService
ProjectService
;
@Resource
(
name
=
"behaviorServiceImpl"
)
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
@Resource
(
name
=
"commonServiceImpl"
)
@Resource
(
name
=
"commonServiceImpl"
)
private
I
CommonService
commonService
;
private
CommonService
commonService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"项目管理"
,
true
);
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"项目管理"
,
true
);
...
@@ -75,7 +75,7 @@ public class ProjectController extends BaseController {
...
@@ -75,7 +75,7 @@ public class ProjectController extends BaseController {
@ApiOperation
(
"添加项目配置"
)
@ApiOperation
(
"添加项目配置"
)
@PostMapping
(
"/add"
)
@PostMapping
(
"/add"
)
public
ResponseResult
addProject
(
@RequestBody
ProjectVO
projectVO
)
{
public
ResponseResult
addProject
(
@RequestBody
ProjectVO
projectVO
)
{
i
ProjectService
.
addProject
(
projectVO
);
ProjectService
.
addProject
(
projectVO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加项目配置:"
+
projectVO
.
getId
(),
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加项目配置:"
+
projectVO
.
getId
(),
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -85,14 +85,14 @@ public class ProjectController extends BaseController {
...
@@ -85,14 +85,14 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"10"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"keyword"
,
value
=
"搜索关键字"
,
required
=
false
,
defaultValue
=
""
,
paramType
=
"query"
,
dataType
=
"string"
)})
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"10"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"keyword"
,
value
=
"搜索关键字"
,
required
=
false
,
defaultValue
=
""
,
paramType
=
"query"
,
dataType
=
"string"
)})
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
ResponseResult
findProjectList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
public
ResponseResult
findProjectList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
return
ResponseResult
.
success
(
i
ProjectService
.
findProjectList
(
page
,
size
,
keyword
));
return
ResponseResult
.
success
(
ProjectService
.
findProjectList
(
page
,
size
,
keyword
));
}
}
@ApiOperation
(
"修改项目"
)
@ApiOperation
(
"修改项目"
)
@PutMapping
(
"/update"
)
@PutMapping
(
"/update"
)
public
ResponseResult
updateProject
(
@RequestBody
ProjectVO
projectVO
)
{
public
ResponseResult
updateProject
(
@RequestBody
ProjectVO
projectVO
)
{
i
ProjectService
.
updateProject
(
projectVO
);
ProjectService
.
updateProject
(
projectVO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"修改项目:"
+
projectVO
.
getId
(),
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"修改项目:"
+
projectVO
.
getId
(),
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -101,7 +101,7 @@ public class ProjectController extends BaseController {
...
@@ -101,7 +101,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@DeleteMapping
(
"/delete/{pid}"
)
@DeleteMapping
(
"/delete/{pid}"
)
public
ResponseResult
deleteProject
(
@PathVariable
(
"pid"
)
String
pid
)
{
public
ResponseResult
deleteProject
(
@PathVariable
(
"pid"
)
String
pid
)
{
i
ProjectService
.
deleteProject
(
pid
,
UserThreadLocal
.
getProjectId
());
ProjectService
.
deleteProject
(
pid
,
UserThreadLocal
.
getProjectId
());
behaviorService
.
pushBehavior
(
OPERATION
,
"删除项目:"
+
pid
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除项目:"
+
pid
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -110,7 +110,7 @@ public class ProjectController extends BaseController {
...
@@ -110,7 +110,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@PutMapping
(
"/switch/projectShow/{pid}"
)
@PutMapping
(
"/switch/projectShow/{pid}"
)
public
ResponseResult
switchProjectShow
(
@PathVariable
String
pid
)
{
public
ResponseResult
switchProjectShow
(
@PathVariable
String
pid
)
{
boolean
result
=
i
ProjectService
.
switchProjectShow
(
pid
);
boolean
result
=
ProjectService
.
switchProjectShow
(
pid
);
if
(
result
)
{
if
(
result
)
{
behaviorService
.
pushBehavior
(
OPERATION
,
"切换项目展示状态:"
+
pid
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"切换项目展示状态:"
+
pid
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
...
@@ -123,7 +123,7 @@ public class ProjectController extends BaseController {
...
@@ -123,7 +123,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@PutMapping
(
"/switch/projectStart/{pid}"
)
@PutMapping
(
"/switch/projectStart/{pid}"
)
public
ResponseResult
switchProjectStart
(
@PathVariable
String
pid
)
{
public
ResponseResult
switchProjectStart
(
@PathVariable
String
pid
)
{
i
ProjectService
.
switchProjectStart
(
pid
);
ProjectService
.
switchProjectStart
(
pid
);
behaviorService
.
pushBehavior
(
OPERATION
,
"切换项目状态:"
+
pid
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"切换项目状态:"
+
pid
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -132,7 +132,7 @@ public class ProjectController extends BaseController {
...
@@ -132,7 +132,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@GetMapping
(
"/get/{pid}"
)
@GetMapping
(
"/get/{pid}"
)
public
ResponseResult
getProjectVOById
(
@PathVariable
(
"pid"
)
String
pid
)
{
public
ResponseResult
getProjectVOById
(
@PathVariable
(
"pid"
)
String
pid
)
{
return
ResponseResult
.
success
(
i
ProjectService
.
getProjectVOById
(
pid
));
return
ResponseResult
.
success
(
ProjectService
.
getProjectVOById
(
pid
));
}
}
@ApiOperation
(
"图片上传"
)
@ApiOperation
(
"图片上传"
)
...
@@ -153,7 +153,7 @@ public class ProjectController extends BaseController {
...
@@ -153,7 +153,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@GetMapping
(
"/download/keyword/{pid}"
)
@GetMapping
(
"/download/keyword/{pid}"
)
public
ResponseResult
downloadArticles
(
@PathVariable
(
"pid"
)
String
pid
)
{
public
ResponseResult
downloadArticles
(
@PathVariable
(
"pid"
)
String
pid
)
{
ProjectVO
project
=
i
ProjectService
.
getProjectVOById
(
pid
);
ProjectVO
project
=
ProjectService
.
getProjectVOById
(
pid
);
EasyExcelUtil
.
download
(
project
.
getBrandName
()
+
"_命中关键词"
,
"sheet1"
,
UploadKeywordDTO
.
class
,
UploadKeywordDTO
.
change2This
(
project
.
getHitKeywords
()),
response
);
EasyExcelUtil
.
download
(
project
.
getBrandName
()
+
"_命中关键词"
,
"sheet1"
,
UploadKeywordDTO
.
class
,
UploadKeywordDTO
.
change2This
(
project
.
getHitKeywords
()),
response
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -202,7 +202,7 @@ public class ProjectController extends BaseController {
...
@@ -202,7 +202,7 @@ public class ProjectController extends BaseController {
@GetMapping
(
"/user/getUserAllProjects"
)
@GetMapping
(
"/user/getUserAllProjects"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
ResponseResult
getUserAllProjects
()
{
public
ResponseResult
getUserAllProjects
()
{
return
ResponseResult
.
success
(
i
ProjectService
.
getUserAllProjects
());
return
ResponseResult
.
success
(
ProjectService
.
getUserAllProjects
());
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/controller/admin/ReportController.java
View file @
d961690e
...
@@ -4,7 +4,7 @@ import com.zhiwei.brandkbs2.auth.Auth;
...
@@ -4,7 +4,7 @@ import com.zhiwei.brandkbs2.auth.Auth;
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.ReportSettingsDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO
;
import
com.zhiwei.brandkbs2.service.
I
ReportService
;
import
com.zhiwei.brandkbs2.service.ReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -24,7 +24,7 @@ import javax.annotation.Resource;
...
@@ -24,7 +24,7 @@ import javax.annotation.Resource;
public
class
ReportController
{
public
class
ReportController
{
@Resource
(
name
=
"reportServiceImpl"
)
@Resource
(
name
=
"reportServiceImpl"
)
private
I
ReportService
reportService
;
private
ReportService
reportService
;
@ApiOperation
(
"获取简报设置"
)
@ApiOperation
(
"获取简报设置"
)
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/UserController.java
View file @
d961690e
...
@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
...
@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.middleware.auth.pojo.CenterUser
;
import
com.zhiwei.middleware.auth.pojo.CenterUser
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -31,10 +31,10 @@ import javax.annotation.Resource;
...
@@ -31,10 +31,10 @@ import javax.annotation.Resource;
public
class
UserController
extends
BaseController
{
public
class
UserController
extends
BaseController
{
@Resource
(
name
=
"userServiceImpl"
)
@Resource
(
name
=
"userServiceImpl"
)
private
IUserService
i
UserService
;
private
UserService
UserService
;
@Resource
(
name
=
"behaviorServiceImpl"
)
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"用户管理"
,
true
);
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"用户管理"
,
true
);
...
@@ -55,7 +55,7 @@ public class UserController extends BaseController {
...
@@ -55,7 +55,7 @@ public class UserController extends BaseController {
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
,
@RequestParam
(
value
=
"pid"
)
String
pid
,
@RequestParam
(
value
=
"pid"
)
String
pid
,
@RequestParam
(
value
=
"role"
,
defaultValue
=
"-1"
)
int
role
)
{
@RequestParam
(
value
=
"role"
,
defaultValue
=
"-1"
)
int
role
)
{
return
ResponseResult
.
success
(
i
UserService
.
findUserList
(
page
,
size
,
keyword
,
pid
,
role
));
return
ResponseResult
.
success
(
UserService
.
findUserList
(
page
,
size
,
keyword
,
pid
,
role
));
}
}
@ApiOperation
(
"根据手机号搜索用户信息"
)
@ApiOperation
(
"根据手机号搜索用户信息"
)
...
@@ -77,7 +77,7 @@ public class UserController extends BaseController {
...
@@ -77,7 +77,7 @@ public class UserController extends BaseController {
@ApiOperation
(
"添加用户"
)
@ApiOperation
(
"添加用户"
)
@PostMapping
(
"/add"
)
@PostMapping
(
"/add"
)
public
ResponseResult
addUser
(
@RequestBody
UserDTO
userDTO
)
{
public
ResponseResult
addUser
(
@RequestBody
UserDTO
userDTO
)
{
i
UserService
.
addUser
(
userDTO
);
UserService
.
addUser
(
userDTO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加用户:"
+
userDTO
.
getId
(),
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加用户:"
+
userDTO
.
getId
(),
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -89,7 +89,7 @@ public class UserController extends BaseController {
...
@@ -89,7 +89,7 @@ public class UserController extends BaseController {
@DeleteMapping
(
"/delete"
)
@DeleteMapping
(
"/delete"
)
@Auth
(
role
=
RoleEnum
.
ADMIN
)
@Auth
(
role
=
RoleEnum
.
ADMIN
)
public
ResponseResult
deleteUser
(
@RequestParam
(
value
=
"uid"
)
String
userId
,
@RequestParam
(
value
=
"pid"
)
String
pid
)
{
public
ResponseResult
deleteUser
(
@RequestParam
(
value
=
"uid"
)
String
userId
,
@RequestParam
(
value
=
"pid"
)
String
pid
)
{
i
UserService
.
deleteUser
(
userId
,
pid
);
UserService
.
deleteUser
(
userId
,
pid
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除用户:"
+
userId
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除用户:"
+
userId
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -97,7 +97,7 @@ public class UserController extends BaseController {
...
@@ -97,7 +97,7 @@ public class UserController extends BaseController {
@ApiOperation
(
"编辑用户"
)
@ApiOperation
(
"编辑用户"
)
@PutMapping
(
"/update"
)
@PutMapping
(
"/update"
)
public
ResponseResult
updateUser
(
@RequestBody
UserDTO
userDTO
)
{
public
ResponseResult
updateUser
(
@RequestBody
UserDTO
userDTO
)
{
i
UserService
.
updateUser
(
userDTO
);
UserService
.
updateUser
(
userDTO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"编辑用户:"
+
userDTO
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"编辑用户:"
+
userDTO
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -113,14 +113,14 @@ public class UserController extends BaseController {
...
@@ -113,14 +113,14 @@ public class UserController extends BaseController {
public
ResponseResult
findSuperAdminList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
public
ResponseResult
findSuperAdminList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
return
ResponseResult
.
success
(
i
UserService
.
findSuperAdminList
(
page
,
size
,
keyword
));
return
ResponseResult
.
success
(
UserService
.
findSuperAdminList
(
page
,
size
,
keyword
));
}
}
@ApiOperation
(
"添加超级管理员"
)
@ApiOperation
(
"添加超级管理员"
)
@PostMapping
(
"/add/superAdmin"
)
@PostMapping
(
"/add/superAdmin"
)
@Auth
(
role
=
RoleEnum
.
SUPER_ADMIN
)
@Auth
(
role
=
RoleEnum
.
SUPER_ADMIN
)
public
ResponseResult
addSuperAdmin
(
@RequestBody
UserDTO
userDTO
)
{
public
ResponseResult
addSuperAdmin
(
@RequestBody
UserDTO
userDTO
)
{
i
UserService
.
addSuperAdmin
(
userDTO
);
UserService
.
addSuperAdmin
(
userDTO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加超级管理员:"
+
userDTO
.
getId
(),
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加超级管理员:"
+
userDTO
.
getId
(),
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -131,7 +131,7 @@ public class UserController extends BaseController {
...
@@ -131,7 +131,7 @@ public class UserController extends BaseController {
@DeleteMapping
(
"/delete/superAdmin"
)
@DeleteMapping
(
"/delete/superAdmin"
)
@Auth
(
role
=
RoleEnum
.
SUPER_ADMIN
)
@Auth
(
role
=
RoleEnum
.
SUPER_ADMIN
)
public
ResponseResult
deleteSuperAdmin
(
@RequestParam
(
value
=
"uid"
)
String
userId
)
{
public
ResponseResult
deleteSuperAdmin
(
@RequestParam
(
value
=
"uid"
)
String
userId
)
{
i
UserService
.
deleteSuperAdmin
(
userId
);
UserService
.
deleteSuperAdmin
(
userId
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除超级管理员:"
+
userId
,
request
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除超级管理员:"
+
userId
,
request
);
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/easyexcel/listener/EventFileListener.java
View file @
d961690e
...
@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.easyexcel.listener;
...
@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.easyexcel.listener;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.zhiwei.brandkbs2.easyexcel.dto.UploadEventDTO
;
import
com.zhiwei.brandkbs2.easyexcel.dto.UploadEventDTO
;
import
com.zhiwei.brandkbs2.service.
I
EventService
;
import
com.zhiwei.brandkbs2.service.EventService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -25,12 +25,12 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> {
...
@@ -25,12 +25,12 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> {
* 储存解析数据集合
* 储存解析数据集合
*/
*/
private
final
List
<
UploadEventDTO
>
datas
=
new
ArrayList
<>(
BATCH_COUNT
);
private
final
List
<
UploadEventDTO
>
datas
=
new
ArrayList
<>(
BATCH_COUNT
);
private
final
IEventService
i
EventService
;
private
final
EventService
EventService
;
private
final
String
projectId
;
private
final
String
projectId
;
private
final
String
linkedGroupId
;
private
final
String
linkedGroupId
;
public
EventFileListener
(
IEventService
i
EventService
,
String
projectId
,
String
linkedGroupId
)
{
public
EventFileListener
(
EventService
EventService
,
String
projectId
,
String
linkedGroupId
)
{
this
.
iEventService
=
i
EventService
;
this
.
EventService
=
EventService
;
this
.
projectId
=
projectId
;
this
.
projectId
=
projectId
;
this
.
linkedGroupId
=
linkedGroupId
;
this
.
linkedGroupId
=
linkedGroupId
;
}
}
...
@@ -65,6 +65,6 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> {
...
@@ -65,6 +65,6 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> {
* 保存更新事件信息逻辑
* 保存更新事件信息逻辑
*/
*/
private
void
addFileEvent
()
{
private
void
addFileEvent
()
{
datas
.
forEach
(
eventDTO
->
i
EventService
.
addFileEvent
(
projectId
,
linkedGroupId
,
eventDTO
));
datas
.
forEach
(
eventDTO
->
EventService
.
addFileEvent
(
projectId
,
linkedGroupId
,
eventDTO
));
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/pojo/MarkFlowEntity.java
View file @
d961690e
...
@@ -37,6 +37,11 @@ public class MarkFlowEntity {
...
@@ -37,6 +37,11 @@ public class MarkFlowEntity {
private
JSONObject
type
;
private
JSONObject
type
;
/**
/**
* 信息字段
*/
private
JSONObject
info
;
/**
* 消息内容
* 消息内容
*/
*/
private
Object
data
;
private
Object
data
;
...
@@ -82,6 +87,7 @@ public class MarkFlowEntity {
...
@@ -82,6 +87,7 @@ public class MarkFlowEntity {
CompleteText
completeText
=
CompleteText
.
restoreFromEs
(
tJson
);
CompleteText
completeText
=
CompleteText
.
restoreFromEs
(
tJson
);
this
.
type
=
FlowEntityUtil
.
getCompleteTextType
(
completeText
);
this
.
type
=
FlowEntityUtil
.
getCompleteTextType
(
completeText
);
this
.
data
=
completeText
;
this
.
data
=
completeText
;
this
.
info
=
createInfoWithEmotion
(
tJson
);
break
;
break
;
case
INCOMPLETE:
case
INCOMPLETE:
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
...
@@ -90,6 +96,7 @@ public class MarkFlowEntity {
...
@@ -90,6 +96,7 @@ public class MarkFlowEntity {
IncompleteText
incompleteText
=
IncompleteText
.
restoreFromEs
(
tJson
);
IncompleteText
incompleteText
=
IncompleteText
.
restoreFromEs
(
tJson
);
this
.
type
=
FlowEntityUtil
.
getIncompleteTextType
(
incompleteText
);
this
.
type
=
FlowEntityUtil
.
getIncompleteTextType
(
incompleteText
);
this
.
data
=
incompleteText
;
this
.
data
=
incompleteText
;
this
.
info
=
createInfoWithEmotion
(
tJson
);
break
;
break
;
case
QA:
case
QA:
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
...
@@ -104,6 +111,7 @@ public class MarkFlowEntity {
...
@@ -104,6 +111,7 @@ public class MarkFlowEntity {
QAText
qaText
=
QAText
.
restoreFromEs
(
tJson
);
QAText
qaText
=
QAText
.
restoreFromEs
(
tJson
);
this
.
type
=
FlowEntityUtil
.
getQaTextType
(
qaText
);
this
.
type
=
FlowEntityUtil
.
getQaTextType
(
qaText
);
this
.
data
=
qaText
;
this
.
data
=
qaText
;
this
.
info
=
createInfoWithEmotion
(
tJson
);
break
;
break
;
case
VIDEO:
case
VIDEO:
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
...
@@ -115,10 +123,23 @@ public class MarkFlowEntity {
...
@@ -115,10 +123,23 @@ public class MarkFlowEntity {
Video
video
=
Video
.
restoreFromEs
(
tJson
);
Video
video
=
Video
.
restoreFromEs
(
tJson
);
this
.
type
=
FlowEntityUtil
.
getVideoType
(
video
);
this
.
type
=
FlowEntityUtil
.
getVideoType
(
video
);
this
.
data
=
video
;
this
.
data
=
video
;
this
.
info
=
createInfoWithEmotion
(
tJson
);
break
;
break
;
default
:
default
:
break
;
break
;
}
}
}
}
private
JSONObject
createInfoWithEmotion
(
JSONObject
tJson
)
{
JSONObject
info
=
new
JSONObject
();
String
emotion
=
Tools
.
getEmotion
(
tJson
);
if
(
null
==
emotion
)
{
info
.
put
(
"hasTag"
,
false
);
return
info
;
}
info
.
put
(
"hasTag"
,
true
);
info
.
put
(
"showEmotion"
,
emotion
);
return
info
;
}
}
}
src/main/java/com/zhiwei/brandkbs2/pojo/dto/EventSearchDTO.java
View file @
d961690e
...
@@ -10,7 +10,7 @@ import java.util.Map;
...
@@ -10,7 +10,7 @@ import java.util.Map;
/**
/**
* @ClassName: EventSearchDto
* @ClassName: EventSearchDto
* @Description
TODO
* @Description
EventSearchDto
* @author: sjj
* @author: sjj
* @date: 2022-05-20 14:07
* @date: 2022-05-20 14:07
*/
*/
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
BehaviorService.java
→
src/main/java/com/zhiwei/brandkbs2/service/BehaviorService.java
View file @
d961690e
...
@@ -9,12 +9,12 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -9,12 +9,12 @@ import javax.servlet.http.HttpServletRequest;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @ClassName:
I
BehaviorService
* @ClassName: BehaviorService
* @Description 用户行为业务接口
* @Description 用户行为业务接口
* @author: sjj
* @author: sjj
* @date: 2022-05-27 11:05
* @date: 2022-05-27 11:05
*/
*/
public
interface
I
BehaviorService
{
public
interface
BehaviorService
{
/**
/**
* 添加用户行为
* 添加用户行为
*
*
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
BrandkbsTaskService.java
→
src/main/java/com/zhiwei/brandkbs2/service/BrandkbsTaskService.java
View file @
d961690e
...
@@ -9,7 +9,7 @@ import com.zhiwei.brandkbs2.pojo.BrandkbsTask;
...
@@ -9,7 +9,7 @@ import com.zhiwei.brandkbs2.pojo.BrandkbsTask;
* @description 定时任务业务接口
* @description 定时任务业务接口
* @date 2019/12/12 13:58
* @date 2019/12/12 13:58
*/
*/
public
interface
I
BrandkbsTaskService
{
public
interface
BrandkbsTaskService
{
/**
/**
* 根据任务名称获取任务
* 根据任务名称获取任务
*
*
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
ChannelService.java
→
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
View file @
d961690e
...
@@ -10,12 +10,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
...
@@ -10,12 +10,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @ClassName:
I
ChannelService
* @ClassName: ChannelService
* @Description
I
ChannelService
* @Description ChannelService
* @author: sjj
* @author: sjj
* @date: 2022-06-16 16:00
* @date: 2022-06-16 16:00
*/
*/
public
interface
I
ChannelService
{
public
interface
ChannelService
{
/**
/**
* 根据搜索条件查询渠道列表
* 根据搜索条件查询渠道列表
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
CommonService.java
→
src/main/java/com/zhiwei/brandkbs2/service/CommonService.java
View file @
d961690e
...
@@ -12,13 +12,13 @@ import java.util.List;
...
@@ -12,13 +12,13 @@ import java.util.List;
* @author: sjj
* @author: sjj
* @date: 2022-06-02 11:22
* @date: 2022-06-02 11:22
*/
*/
public
interface
I
CommonService
{
public
interface
CommonService
{
/**
/**
* 获取qbjcTags
* 获取qbjcTags
*
*
* @param linkedGroupId 项目组id
* @param linkedGroupId 项目组id
* @param tagSearches 搜索条件
* @param tagSearches
搜索条件
* @return markTags
* @return markTags
*/
*/
List
<
MarkerTag
>
getQbjcTags
(
String
linkedGroupId
,
TagSearch
...
tagSearches
);
List
<
MarkerTag
>
getQbjcTags
(
String
linkedGroupId
,
TagSearch
...
tagSearches
);
...
@@ -26,7 +26,7 @@ public interface ICommonService {
...
@@ -26,7 +26,7 @@ public interface ICommonService {
/**
/**
* 获取qbjcTags
* 获取qbjcTags
*
*
* @param groupName 项目组名
* @param groupName
项目组名
* @param tagSearches 搜索条件
* @param tagSearches 搜索条件
* @return markTags
* @return markTags
*/
*/
...
@@ -34,13 +34,20 @@ public interface ICommonService {
...
@@ -34,13 +34,20 @@ public interface ICommonService {
/**
/**
* 获取qbjcPlatform名称
* 获取qbjcPlatform名称
*
* @return 平台名称
* @return 平台名称
*/
*/
List
<
String
>
getQbjcPlatformNames
();
List
<
String
>
getQbjcPlatformNames
();
/**
/**
* 获取qbjcPlatform
* 获取qbjcPlatform
*
* @return 平台
* @return 平台
*/
*/
List
<
JSONObject
>
getQbjcPlatform
(
String
...
includeFields
);
List
<
JSONObject
>
getQbjcPlatform
(
String
...
includeFields
);
Long
[]
getTimeRangeMonth
();
Long
[]
getTimeRangeWeek
();
}
}
src/main/java/com/zhiwei/brandkbs2/service/
I
CustomTagService.java
→
src/main/java/com/zhiwei/brandkbs2/service/CustomTagService.java
View file @
d961690e
...
@@ -12,7 +12,7 @@ import java.util.List;
...
@@ -12,7 +12,7 @@ import java.util.List;
* @description 自定义标签业务接口
* @description 自定义标签业务接口
* @date 2022年3月24日15:20:16
* @date 2022年3月24日15:20:16
*/
*/
public
interface
I
CustomTagService
{
public
interface
CustomTagService
{
/**
/**
* 分页查询该项目所有自定义标签数据
* 分页查询该项目所有自定义标签数据
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
EventDataService.java
→
src/main/java/com/zhiwei/brandkbs2/service/EventDataService.java
View file @
d961690e
...
@@ -3,12 +3,12 @@ package com.zhiwei.brandkbs2.service;
...
@@ -3,12 +3,12 @@ package com.zhiwei.brandkbs2.service;
import
com.zhiwei.brandkbs2.pojo.Event
;
import
com.zhiwei.brandkbs2.pojo.Event
;
/**
/**
* @ClassName:
I
EventDataService
* @ClassName: EventDataService
* @Description 事件数据业务接口抽象类
* @Description 事件数据业务接口抽象类
* @author: sjj
* @author: sjj
* @date: 2022-05-23 17:48
* @date: 2022-05-23 17:48
*/
*/
public
interface
I
EventDataService
{
public
interface
EventDataService
{
/**
/**
* 更新事件数据
* 更新事件数据
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
EventService.java
→
src/main/java/com/zhiwei/brandkbs2/service/EventService.java
View file @
d961690e
...
@@ -16,12 +16,12 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -16,12 +16,12 @@ import org.springframework.web.multipart.MultipartFile;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @ClassName:
I
EventService
* @ClassName: EventService
* @Description 事件管理业务接口
* @Description 事件管理业务接口
* @author: sjj
* @author: sjj
* @date: 2022-05-17 16:32
* @date: 2022-05-17 16:32
*/
*/
public
interface
I
EventService
{
public
interface
EventService
{
/**
/**
* 根据事件id查询事件
* 根据事件id查询事件
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
HighWordService.java
→
src/main/java/com/zhiwei/brandkbs2/service/HighWordService.java
View file @
d961690e
...
@@ -7,12 +7,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
...
@@ -7,12 +7,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @ClassName:
I
HighWordService
* @ClassName: HighWordService
* @Description 高频词服务接口
* @Description 高频词服务接口
* @author: sjj
* @author: sjj
* @date: 2022-06-06 09:59
* @date: 2022-06-06 09:59
*/
*/
public
interface
I
HighWordService
{
public
interface
HighWordService
{
/**
/**
* 分页查询高频词列表
* 分页查询高频词列表
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
MarkDataService.java
→
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
View file @
d961690e
...
@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
...
@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @ClassName:
I
MarkDataService
* @ClassName: MarkDataService
* @Description: 标注数据服务抽象类
* @Description: 标注数据服务抽象类
* @author: sjj
* @author: sjj
* @date: 2022-06-28 14:04
* @date: 2022-06-28 14:04
*/
*/
public
interface
I
MarkDataService
{
public
interface
MarkDataService
{
/**
/**
* @param markSearchDTO 标注数据搜索传输类
* @param markSearchDTO 标注数据搜索传输类
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
ProjectService.java
→
src/main/java/com/zhiwei/brandkbs2/service/ProjectService.java
View file @
d961690e
...
@@ -13,7 +13,7 @@ import java.util.List;
...
@@ -13,7 +13,7 @@ import java.util.List;
* @description 项目业务接口
* @description 项目业务接口
* @date 2022年4月18日16:49:10
* @date 2022年4月18日16:49:10
*/
*/
public
interface
I
ProjectService
{
public
interface
ProjectService
{
/**
/**
* 添加项目
* 添加项目
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
ReportService.java
→
src/main/java/com/zhiwei/brandkbs2/service/ReportService.java
View file @
d961690e
...
@@ -6,12 +6,12 @@ import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO;
...
@@ -6,12 +6,12 @@ import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* @ClassName:
I
ReportService
* @ClassName: ReportService
* @Description 报告业务接口
* @Description 报告业务接口
* @author: sjj
* @author: sjj
* @date: 2022-05-31 18:00
* @date: 2022-05-31 18:00
*/
*/
public
interface
I
ReportService
{
public
interface
ReportService
{
/**
/**
* 获取项目报告配置信息
* 获取项目报告配置信息
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
SystemInfoService.java
→
src/main/java/com/zhiwei/brandkbs2/service/SystemInfoService.java
View file @
d961690e
...
@@ -6,12 +6,12 @@ import com.zhiwei.qbjc.bean.pojo.common.Tag;
...
@@ -6,12 +6,12 @@ import com.zhiwei.qbjc.bean.pojo.common.Tag;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @ClassName:
I
SystemInfoService
* @ClassName: SystemInfoService
* @Description 监测系统相关infoService
* @Description 监测系统相关infoService
* @author: sjj
* @author: sjj
* @date: 2022-06-16 14:19
* @date: 2022-06-16 14:19
*/
*/
public
interface
I
SystemInfoService
{
public
interface
SystemInfoService
{
/**
/**
* 获取监测系统Platforms
* 获取监测系统Platforms
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
TagFilterService.java
→
src/main/java/com/zhiwei/brandkbs2/service/TagFilterService.java
View file @
d961690e
...
@@ -10,7 +10,7 @@ import java.util.List;
...
@@ -10,7 +10,7 @@ import java.util.List;
* @author: sjj
* @author: sjj
* @date: 2022-06-01 13:40
* @date: 2022-06-01 13:40
*/
*/
public
interface
I
TagFilterService
{
public
interface
TagFilterService
{
/**
/**
* 获取在用筛选器列表
* 获取在用筛选器列表
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
TaskService.java
→
src/main/java/com/zhiwei/brandkbs2/service/TaskService.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
service
;
package
com
.
zhiwei
.
brandkbs2
.
service
;
/**
/**
* @ClassName:
I
TaskService
* @ClassName: TaskService
* @Description 定时服务抽象类
* @Description 定时服务抽象类
* @author: sjj
* @author: sjj
* @date: 2022-06-16 15:27
* @date: 2022-06-16 15:27
*/
*/
public
interface
I
TaskService
{
public
interface
TaskService
{
/**
/**
* 渠道记录
* 渠道记录
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
UserService.java
→
src/main/java/com/zhiwei/brandkbs2/service/UserService.java
View file @
d961690e
...
@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
...
@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @ClassName:
I
UserService
* @ClassName: UserService
* @Description 用户管理服务接口
* @Description 用户管理服务接口
* @author: sjj
* @author: sjj
* @date: 2022-04-28 14:58
* @date: 2022-04-28 14:58
*/
*/
public
interface
I
UserService
{
public
interface
UserService
{
/**
/**
* 用户登录
* 用户登录
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/BehaviorServiceImpl.java
View file @
d961690e
...
@@ -11,7 +11,7 @@ import com.zhiwei.brandkbs2.pojo.User;
...
@@ -11,7 +11,7 @@ import com.zhiwei.brandkbs2.pojo.User;
import
com.zhiwei.brandkbs2.pojo.UserRole
;
import
com.zhiwei.brandkbs2.pojo.UserRole
;
import
com.zhiwei.brandkbs2.pojo.vo.BehaviorVO
;
import
com.zhiwei.brandkbs2.pojo.vo.BehaviorVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
...
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-27 13:41
* @date: 2022-05-27 13:41
*/
*/
@Service
(
"behaviorServiceImpl"
)
@Service
(
"behaviorServiceImpl"
)
public
class
BehaviorServiceImpl
implements
I
BehaviorService
{
public
class
BehaviorServiceImpl
implements
BehaviorService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
BehaviorServiceImpl
.
class
);
public
static
final
Logger
log
=
LogManager
.
getLogger
(
BehaviorServiceImpl
.
class
);
@Resource
(
name
=
"behaviorDao"
)
@Resource
(
name
=
"behaviorDao"
)
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/BrandkbsTaskServiceImpl.java
View file @
d961690e
...
@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.service.impl;
...
@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.service.impl;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.dao.IBrandkbsTaskDao
;
import
com.zhiwei.brandkbs2.dao.IBrandkbsTaskDao
;
import
com.zhiwei.brandkbs2.pojo.BrandkbsTask
;
import
com.zhiwei.brandkbs2.pojo.BrandkbsTask
;
import
com.zhiwei.brandkbs2.service.
I
BrandkbsTaskService
;
import
com.zhiwei.brandkbs2.service.BrandkbsTaskService
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -17,7 +17,7 @@ import java.util.Objects;
...
@@ -17,7 +17,7 @@ import java.util.Objects;
* @date: 2022-07-12 17:38
* @date: 2022-07-12 17:38
*/
*/
@Service
@Service
public
class
BrandkbsTaskServiceImpl
implements
I
BrandkbsTaskService
{
public
class
BrandkbsTaskServiceImpl
implements
BrandkbsTaskService
{
@Resource
(
name
=
"brandkbsTaskDao"
)
@Resource
(
name
=
"brandkbsTaskDao"
)
private
IBrandkbsTaskDao
brandkbsTaskDao
;
private
IBrandkbsTaskDao
brandkbsTaskDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
d961690e
...
@@ -16,7 +16,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum;
...
@@ -16,7 +16,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import
com.zhiwei.brandkbs2.pojo.*
;
import
com.zhiwei.brandkbs2.pojo.*
;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
ChannelService
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
...
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
* @date: 2022-06-16 16:07
* @date: 2022-06-16 16:07
*/
*/
@Service
(
"channelServiceImpl"
)
@Service
(
"channelServiceImpl"
)
public
class
ChannelServiceImpl
implements
I
ChannelService
{
public
class
ChannelServiceImpl
implements
ChannelService
{
@Resource
(
name
=
"eventDataDao"
)
@Resource
(
name
=
"eventDataDao"
)
IEventDataDao
eventDataDao
;
IEventDataDao
eventDataDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/CommonServiceImpl.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.service.ICommonService
;
import
com.zhiwei.brandkbs2.common.GenericAttribute
;
import
com.zhiwei.brandkbs2.service.IProjectService
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.service.MarkerClient
;
import
com.zhiwei.middleware.mark.service.MarkerClient
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
com.zhiwei.middleware.mark.vo.TagSearch
;
import
com.zhiwei.middleware.mark.vo.TagSearch
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
...
@@ -14,10 +18,7 @@ import org.springframework.stereotype.Service;
...
@@ -14,10 +18,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -27,13 +28,13 @@ import java.util.stream.Collectors;
...
@@ -27,13 +28,13 @@ import java.util.stream.Collectors;
* @date: 2022-06-02 11:23
* @date: 2022-06-02 11:23
*/
*/
@Service
(
"commonServiceImpl"
)
@Service
(
"commonServiceImpl"
)
public
class
CommonServiceImpl
implements
I
CommonService
{
public
class
CommonServiceImpl
implements
CommonService
{
@Value
(
"${qbjc.platform.url}"
)
@Value
(
"${qbjc.platform.url}"
)
private
String
qbjcPlatformUrl
;
private
String
qbjcPlatformUrl
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
@Autowired
@Autowired
private
MarkerClient
markClient
;
private
MarkerClient
markClient
;
...
@@ -71,8 +72,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -71,8 +72,7 @@ public class CommonServiceImpl implements ICommonService {
@Override
@Override
public
List
<
String
>
getQbjcPlatformNames
()
{
public
List
<
String
>
getQbjcPlatformNames
()
{
HttpEntity
<
JSONObject
>
entity
=
restTemplate
.
getForEntity
(
qbjcPlatformUrl
,
JSONObject
.
class
);
HttpEntity
<
JSONObject
>
entity
=
restTemplate
.
getForEntity
(
qbjcPlatformUrl
,
JSONObject
.
class
);
return
Objects
.
requireNonNull
(
entity
.
getBody
()).
getJSONArray
(
"data"
).
toJavaList
(
JSONObject
.
class
).
stream
().
map
(
json
->
json
.
getString
(
"name"
))
return
Objects
.
requireNonNull
(
entity
.
getBody
()).
getJSONArray
(
"data"
).
toJavaList
(
JSONObject
.
class
).
stream
().
map
(
json
->
json
.
getString
(
"name"
)).
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
@Override
@Override
...
@@ -90,4 +90,18 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -90,4 +90,18 @@ public class CommonServiceImpl implements ICommonService {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
@Override
public
Long
[]
getTimeRangeMonth
()
{
long
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
long
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
return
new
Long
[]{
startTime
,
endTime
};
}
@Override
public
Long
[]
getTimeRangeWeek
()
{
long
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
long
startTime
=
DateUtils
.
addWeeks
(
new
Date
(
endTime
),
-
1
).
getTime
();
return
new
Long
[]{
startTime
,
endTime
};
}
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/CustomTagServiceImpl.java
View file @
d961690e
...
@@ -10,7 +10,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum;
...
@@ -10,7 +10,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import
com.zhiwei.brandkbs2.pojo.CustomTag
;
import
com.zhiwei.brandkbs2.pojo.CustomTag
;
import
com.zhiwei.brandkbs2.pojo.vo.CustomTagVo
;
import
com.zhiwei.brandkbs2.pojo.vo.CustomTagVo
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
CustomTagService
;
import
com.zhiwei.brandkbs2.service.CustomTagService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.elasticsearch.action.DocWriteResponse
;
import
org.elasticsearch.action.DocWriteResponse
;
import
org.elasticsearch.action.update.UpdateRequest
;
import
org.elasticsearch.action.update.UpdateRequest
;
...
@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
...
@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
* @date 2022年3月24日18:22:53
* @date 2022年3月24日18:22:53
*/
*/
@Service
@Service
public
class
CustomTagServiceImpl
implements
I
CustomTagService
{
public
class
CustomTagServiceImpl
implements
CustomTagService
{
@Resource
(
name
=
"customTagDao"
)
@Resource
(
name
=
"customTagDao"
)
private
ICustomTagDao
customTagDao
;
private
ICustomTagDao
customTagDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/EventDataServiceImpl.java
View file @
d961690e
...
@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.dao.IEventDataDao;
...
@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.dao.IEventDataDao;
import
com.zhiwei.brandkbs2.es.EsClientDao
;
import
com.zhiwei.brandkbs2.es.EsClientDao
;
import
com.zhiwei.brandkbs2.pojo.Event
;
import
com.zhiwei.brandkbs2.pojo.Event
;
import
com.zhiwei.brandkbs2.pojo.EventData
;
import
com.zhiwei.brandkbs2.pojo.EventData
;
import
com.zhiwei.brandkbs2.service.
I
EventDataService
;
import
com.zhiwei.brandkbs2.service.EventDataService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
...
@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-23 17:49
* @date: 2022-05-23 17:49
*/
*/
@Service
(
"eventDataServiceImpl"
)
@Service
(
"eventDataServiceImpl"
)
public
class
EventDataServiceImpl
implements
I
EventDataService
{
public
class
EventDataServiceImpl
implements
EventDataService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
EventDataServiceImpl
.
class
);
public
static
final
Logger
log
=
LogManager
.
getLogger
(
EventDataServiceImpl
.
class
);
@Resource
(
name
=
"eventDao"
)
@Resource
(
name
=
"eventDao"
)
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
View file @
d961690e
...
@@ -26,9 +26,9 @@ import com.zhiwei.brandkbs2.pojo.dto.YqEventDTO;
...
@@ -26,9 +26,9 @@ import com.zhiwei.brandkbs2.pojo.dto.YqEventDTO;
import
com.zhiwei.brandkbs2.pojo.vo.EventVO
;
import
com.zhiwei.brandkbs2.pojo.vo.EventVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.YqEventSearchVO
;
import
com.zhiwei.brandkbs2.pojo.vo.YqEventSearchVO
;
import
com.zhiwei.brandkbs2.service.
I
EventDataService
;
import
com.zhiwei.brandkbs2.service.EventDataService
;
import
com.zhiwei.brandkbs2.service.
I
EventService
;
import
com.zhiwei.brandkbs2.service.EventService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -62,7 +62,7 @@ import java.util.stream.Collectors;
...
@@ -62,7 +62,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-17 16:36
* @date: 2022-05-17 16:36
*/
*/
@Service
(
"eventServiceImpl"
)
@Service
(
"eventServiceImpl"
)
public
class
EventServiceImpl
implements
I
EventService
{
public
class
EventServiceImpl
implements
EventService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
EventServiceImpl
.
class
);
private
static
final
Logger
log
=
LogManager
.
getLogger
(
EventServiceImpl
.
class
);
@Value
(
"${qbjc.event.tag.url}"
)
@Value
(
"${qbjc.event.tag.url}"
)
...
@@ -81,10 +81,10 @@ public class EventServiceImpl implements IEventService {
...
@@ -81,10 +81,10 @@ public class EventServiceImpl implements IEventService {
private
IEventDataDao
eventDataDao
;
private
IEventDataDao
eventDataDao
;
@Resource
(
name
=
"eventDataServiceImpl"
)
@Resource
(
name
=
"eventDataServiceImpl"
)
private
I
EventDataService
eventDataService
;
private
EventDataService
eventDataService
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
@Resource
(
name
=
"mongoUtil"
)
@Resource
(
name
=
"mongoUtil"
)
private
com
.
zhiwei
.
brandkbs2
.
util
.
MongoUtil
mongoUtil
;
private
com
.
zhiwei
.
brandkbs2
.
util
.
MongoUtil
mongoUtil
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/HighWordServiceImpl.java
View file @
d961690e
...
@@ -6,7 +6,7 @@ import com.zhiwei.brandkbs2.dao.IHighWordDao;
...
@@ -6,7 +6,7 @@ import com.zhiwei.brandkbs2.dao.IHighWordDao;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO
;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO
;
import
com.zhiwei.brandkbs2.pojo.HighWord
;
import
com.zhiwei.brandkbs2.pojo.HighWord
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
HighWordService
;
import
com.zhiwei.brandkbs2.service.HighWordService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
...
@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
...
@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
* @date: 2022-06-06 10:02
* @date: 2022-06-06 10:02
*/
*/
@Service
(
"highWordServiceImpl"
)
@Service
(
"highWordServiceImpl"
)
public
class
HighWordServiceImpl
implements
I
HighWordService
{
public
class
HighWordServiceImpl
implements
HighWordService
{
@Resource
(
name
=
"highWordDao"
)
@Resource
(
name
=
"highWordDao"
)
IHighWordDao
highWordDao
;
IHighWordDao
highWordDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
d961690e
...
@@ -8,7 +8,6 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal;
...
@@ -8,7 +8,6 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import
com.zhiwei.brandkbs2.common.GenericAttribute
;
import
com.zhiwei.brandkbs2.common.GenericAttribute
;
import
com.zhiwei.brandkbs2.common.GlobalPojo
;
import
com.zhiwei.brandkbs2.common.GlobalPojo
;
import
com.zhiwei.brandkbs2.common.RedisKeyPrefix
;
import
com.zhiwei.brandkbs2.common.RedisKeyPrefix
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.ImportantChannelEnum
;
import
com.zhiwei.brandkbs2.enmus.ImportantChannelEnum
;
import
com.zhiwei.brandkbs2.es.EsClientDao
;
import
com.zhiwei.brandkbs2.es.EsClientDao
;
...
@@ -57,13 +56,10 @@ import org.springframework.stereotype.Service;
...
@@ -57,13 +56,10 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
zhiwei
.
brandkbs2
.
config
.
Constant
.
DAY_PATTERN
;
/**
/**
* @ClassName: MarkDataServiceImpl
* @ClassName: MarkDataServiceImpl
* @Description
* @Description
...
@@ -71,23 +67,23 @@ import static com.zhiwei.brandkbs2.config.Constant.DAY_PATTERN;
...
@@ -71,23 +67,23 @@ import static com.zhiwei.brandkbs2.config.Constant.DAY_PATTERN;
* @date: 2022-06-28 14:07
* @date: 2022-06-28 14:07
*/
*/
@Service
(
"markDataServiceImpl"
)
@Service
(
"markDataServiceImpl"
)
public
class
MarkDataServiceImpl
implements
I
MarkDataService
{
public
class
MarkDataServiceImpl
implements
MarkDataService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
MarkDataServiceImpl
.
class
);
private
static
final
Logger
log
=
LogManager
.
getLogger
(
MarkDataServiceImpl
.
class
);
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
@Resource
(
name
=
"esClientDao"
)
@Resource
(
name
=
"esClientDao"
)
private
EsClientDao
esClientDao
;
private
EsClientDao
esClientDao
;
@Resource
(
name
=
"commonServiceImpl"
)
@Resource
(
name
=
"commonServiceImpl"
)
private
I
CommonService
commonService
;
private
CommonService
commonService
;
@Resource
(
name
=
"customTagServiceImpl"
)
@Resource
(
name
=
"customTagServiceImpl"
)
private
I
CustomTagService
customTagService
;
private
CustomTagService
customTagService
;
@Resource
(
name
=
"tagFilterServiceImpl"
)
@Resource
(
name
=
"tagFilterServiceImpl"
)
I
TagFilterService
tagFilterService
;
TagFilterService
tagFilterService
;
@Autowired
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
private
StringRedisTemplate
stringRedisTemplate
;
...
@@ -124,7 +120,6 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -124,7 +120,6 @@ public class MarkDataServiceImpl implements IMarkDataService {
linkedGroupId
=
projectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getBrandLinkedGroupId
();
linkedGroupId
=
projectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getBrandLinkedGroupId
();
}
}
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
Date
endDate
=
new
Date
();
// 搜索时间
// 搜索时间
result
.
put
(
"times"
,
Arrays
.
asList
(
"今天"
,
"24小时"
,
"三天"
,
"七天"
,
"近30天"
));
result
.
put
(
"times"
,
Arrays
.
asList
(
"今天"
,
"24小时"
,
"三天"
,
"七天"
,
"近30天"
));
// 平台
// 平台
...
@@ -151,10 +146,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -151,10 +146,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
@Override
@Override
public
JSONObject
getAnalyzeSummary
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
public
JSONObject
getAnalyzeSummary
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
try
{
try
{
if
(
Objects
.
isNull
(
startTime
)
||
Objects
.
isNull
(
endTime
))
{
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
DAY_PATTERN
),
1
).
getTime
();
startTime
=
timeRange
[
0
];
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
endTime
=
timeRange
[
1
];
}
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
redisKey
=
RedisKeyPrefix
.
MARK_ANALYZE_SUMMARY
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
String
redisKey
=
RedisKeyPrefix
.
MARK_ANALYZE_SUMMARY
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
...
@@ -178,13 +172,21 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -178,13 +172,21 @@ public class MarkDataServiceImpl implements IMarkDataService {
// 负面舆情峰值平台
// 负面舆情峰值平台
platformsCount
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
EmotionEnum
.
NEGATIVE
.
getName
()))).
ifPresent
(
e
->
result
.
put
(
"negTopPlatform"
,
e
.
getString
(
"platform_id"
)));
platformsCount
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
EmotionEnum
.
NEGATIVE
.
getName
()))).
ifPresent
(
e
->
result
.
put
(
"negTopPlatform"
,
e
.
getString
(
"platform_id"
)));
// 获取时间段正面情感数据最多的标题
// 获取时间段正面情感数据最多的标题
String
posTopTitle
=
getMarkTopTitle
(
startTime
,
endTime
,
EmotionEnum
.
POSITIVE
.
getName
(),
projectId
,
linkedGroupId
,
1
).
get
(
0
).
getKey
();
String
topTitle
=
""
;
result
.
put
(
"posTopTitle"
,
posTopTitle
);
List
<
Map
.
Entry
<
String
,
Integer
>>
markTopTitle
=
getMarkTopTitle
(
startTime
,
endTime
,
EmotionEnum
.
POSITIVE
.
getName
(),
projectId
,
linkedGroupId
,
1
);
if
(!
markTopTitle
.
isEmpty
())
{
topTitle
=
markTopTitle
.
get
(
0
).
getKey
();
}
result
.
put
(
"posTopTitle"
,
topTitle
);
// 正面舆情峰值时间
// 正面舆情峰值时间
markSpread
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
"negNormalCount"
))).
ifPresent
(
e
->
result
.
put
(
"negMaxTime"
,
e
.
getLong
(
"time"
)));
markSpread
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
"negNormalCount"
))).
ifPresent
(
e
->
result
.
put
(
"negMaxTime"
,
e
.
getLong
(
"time"
)));
// 获取时间段负面情感数据最多的标题
// 获取时间段负面情感数据最多的标题
String
negTopTitle
=
getMarkTopTitle
(
startTime
,
endTime
,
EmotionEnum
.
NEGATIVE
.
getName
(),
projectId
,
linkedGroupId
,
1
).
get
(
0
).
getKey
();
topTitle
=
""
;
result
.
put
(
"negTopTitle"
,
negTopTitle
);
List
<
Map
.
Entry
<
String
,
Integer
>>
negTopTitle
=
getMarkTopTitle
(
startTime
,
endTime
,
EmotionEnum
.
NEGATIVE
.
getName
(),
projectId
,
linkedGroupId
,
1
);
if
(!
negTopTitle
.
isEmpty
())
{
topTitle
=
negTopTitle
.
get
(
0
).
getKey
();
}
result
.
put
(
"negTopTitle"
,
topTitle
);
List
<
JSONObject
>
articlePlatformProportion
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
true
);
List
<
JSONObject
>
articlePlatformProportion
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
true
);
result
.
put
(
"platformRank"
,
articlePlatformProportion
.
stream
().
filter
(
articlePlatform
->
articlePlatform
.
getLongValue
(
"count"
)
>
0
).
sorted
((
o1
,
o2
)
->
o2
.
getLong
(
"count"
).
compareTo
(
o1
.
getLong
(
"count"
))).
collect
(
Collectors
.
toList
()));
result
.
put
(
"platformRank"
,
articlePlatformProportion
.
stream
().
filter
(
articlePlatform
->
articlePlatform
.
getLongValue
(
"count"
)
>
0
).
sorted
((
o1
,
o2
)
->
o2
.
getLong
(
"count"
).
compareTo
(
o1
.
getLong
(
"count"
))).
collect
(
Collectors
.
toList
()));
stringRedisTemplate
.
opsForValue
().
set
(
redisKey
,
JSON
.
toJSONString
(
result
),
1
,
TimeUnit
.
HOURS
);
stringRedisTemplate
.
opsForValue
().
set
(
redisKey
,
JSON
.
toJSONString
(
result
),
1
,
TimeUnit
.
HOURS
);
...
@@ -209,10 +211,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -209,10 +211,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
@Override
@Override
public
JSONObject
getMarkEmotionProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
public
JSONObject
getMarkEmotionProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
try
{
try
{
if
(
Objects
.
isNull
(
startTime
)
||
Objects
.
isNull
(
endTime
))
{
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
startTime
=
timeRange
[
0
];
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
endTime
=
timeRange
[
1
];
}
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
redisKey
=
RedisKeyPrefix
.
MARK_EMOTION_PROPORTION
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
String
redisKey
=
RedisKeyPrefix
.
MARK_EMOTION_PROPORTION
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
...
@@ -244,10 +245,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -244,10 +245,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
@Override
@Override
public
List
<
JSONObject
>
getMarkChannelProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
public
List
<
JSONObject
>
getMarkChannelProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
if
(
Objects
.
isNull
(
startTime
)
||
Objects
.
isNull
(
endTime
))
{
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
startTime
=
timeRange
[
0
];
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
endTime
=
timeRange
[
1
];
}
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
redisKey
=
RedisKeyPrefix
.
MARK_CHANNEL_PROPORTION
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
String
redisKey
=
RedisKeyPrefix
.
MARK_CHANNEL_PROPORTION
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
...
@@ -293,10 +293,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -293,10 +293,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
public
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
public
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
List
<
JSONObject
>
res
=
null
;
List
<
JSONObject
>
res
=
null
;
try
{
try
{
if
(
Objects
.
isNull
(
startTime
)
||
Objects
.
isNull
(
endTime
))
{
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
startTime
=
timeRange
[
0
];
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
endTime
=
timeRange
[
1
];
}
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
res
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
cache
);
res
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
cache
);
...
@@ -309,10 +308,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -309,10 +308,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
@Override
@Override
public
List
<
JSONObject
>
getMarkHighWord
(
Long
startTime
,
Long
endTime
)
{
public
List
<
JSONObject
>
getMarkHighWord
(
Long
startTime
,
Long
endTime
)
{
try
{
try
{
if
(
Objects
.
isNull
(
startTime
)
||
Objects
.
isNull
(
endTime
))
{
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
startTime
=
timeRange
[
0
];
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
endTime
=
timeRange
[
1
];
}
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
redisKey
=
RedisKeyPrefix
.
MARK_HIGH_WORD
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
String
redisKey
=
RedisKeyPrefix
.
MARK_HIGH_WORD
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
...
@@ -482,8 +480,6 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -482,8 +480,6 @@ public class MarkDataServiceImpl implements IMarkDataService {
int
lastNeuCount
=
lastArticleEmotions
.
get
(
2
).
getIntValue
(
"count"
);
int
lastNeuCount
=
lastArticleEmotions
.
get
(
2
).
getIntValue
(
"count"
);
int
curArticleTotal
=
curPosCount
+
curNegCount
+
curNeuCount
;
int
curArticleTotal
=
curPosCount
+
curNegCount
+
curNeuCount
;
int
oldArticleTotal
=
lastPosCount
+
lastNegCount
+
lastNeuCount
;
int
oldArticleTotal
=
lastPosCount
+
lastNegCount
+
lastNeuCount
;
result
.
put
(
"startTime"
,
startTime
);
result
.
put
(
"endTime"
,
endTime
);
result
.
put
(
"articlesCount"
,
curArticleTotal
);
result
.
put
(
"articlesCount"
,
curArticleTotal
);
result
.
put
(
"compare"
,
oldArticleTotal
==
0
?
0
d
:
curArticleTotal
/
(
double
)
oldArticleTotal
);
result
.
put
(
"compare"
,
oldArticleTotal
==
0
?
0
d
:
curArticleTotal
/
(
double
)
oldArticleTotal
);
result
.
put
(
"posProportion"
,
curPosCount
*
1.0
/
curArticleTotal
);
result
.
put
(
"posProportion"
,
curPosCount
*
1.0
/
curArticleTotal
);
...
@@ -515,15 +511,13 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -515,15 +511,13 @@ public class MarkDataServiceImpl implements IMarkDataService {
String
[]
fieldSearch
=
"标题"
.
equals
(
searchField
)
?
new
String
[]{
GenericAttribute
.
ES_IND_TITLE
}
:
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
};
String
[]
fieldSearch
=
"标题"
.
equals
(
searchField
)
?
new
String
[]{
GenericAttribute
.
ES_IND_TITLE
}
:
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
};
query
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
keyword
,
fieldSearch
));
query
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
keyword
,
fieldSearch
));
}
}
// postFilter
query
.
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.linkedGroupId.keyword"
,
linkedGroupId
)).
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.projectId.keyword"
,
projectId
));
BoolQueryBuilder
postFilter
=
QueryBuilders
.
boolQuery
();
postFilter
.
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.linkedGroupId.keyword"
,
linkedGroupId
)).
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.projectId.keyword"
,
projectId
));
// time range
// time range
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
query
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
List
<
JSONObject
>
resultList
=
new
ArrayList
<>(
emotionList
.
size
());
List
<
JSONObject
>
resultList
=
new
ArrayList
<>(
emotionList
.
size
());
Map
<
String
,
Aggregation
>
aggMap
=
Map
<
String
,
Aggregation
>
aggMap
=
esClientDao
.
searchResponse
(
indexes
,
postFilter
,
query
,
aggregationBuilder
,
null
,
null
,
0
,
0
,
null
).
getAggregations
().
asMap
();
esClientDao
.
searchResponse
(
indexes
,
null
,
query
,
aggregationBuilder
,
null
,
null
,
0
,
0
,
null
).
getAggregations
().
asMap
();
ParsedStringTerms
teamAgg
=
(
ParsedStringTerms
)
aggMap
.
get
(
"count"
);
ParsedStringTerms
teamAgg
=
(
ParsedStringTerms
)
aggMap
.
get
(
"count"
);
List
<?
extends
Terms
.
Bucket
>
buckets
=
teamAgg
.
getBuckets
();
List
<?
extends
Terms
.
Bucket
>
buckets
=
teamAgg
.
getBuckets
();
for
(
String
emotion
:
emotionList
)
{
for
(
String
emotion
:
emotionList
)
{
...
@@ -539,17 +533,15 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -539,17 +533,15 @@ public class MarkDataServiceImpl implements IMarkDataService {
public
List
<
JSONObject
>
getMarkSpread
(
Long
startTime
,
Long
endTime
,
String
projectId
,
boolean
cache
)
throws
IOException
{
public
List
<
JSONObject
>
getMarkSpread
(
Long
startTime
,
Long
endTime
,
String
projectId
,
boolean
cache
)
throws
IOException
{
ProjectVO
project
=
projectService
.
getProjectVOById
(
projectId
);
ProjectVO
project
=
projectService
.
getProjectVOById
(
projectId
);
String
linkedGroupId
=
project
.
getBrandLinkedGroupId
();
String
linkedGroupId
=
project
.
getBrandLinkedGroupId
();
if
(
Objects
.
isNull
(
startTime
)
||
Objects
.
isNull
(
endTime
))
{
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
startTime
=
timeRange
[
0
];
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
endTime
=
timeRange
[
1
];
}
String
redisKey
=
RedisKeyPrefix
.
MARK_SPREAD
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
String
redisKey
=
RedisKeyPrefix
.
MARK_SPREAD
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
String
resultStr
;
String
resultStr
;
if
(
cache
&&
StringUtils
.
isNotEmpty
(
resultStr
=
stringRedisTemplate
.
opsForValue
().
get
(
redisKey
)))
{
if
(
cache
&&
StringUtils
.
isNotEmpty
(
resultStr
=
stringRedisTemplate
.
opsForValue
().
get
(
redisKey
)))
{
return
JSON
.
parseArray
(
resultStr
,
JSONObject
.
class
);
return
JSON
.
parseArray
(
resultStr
,
JSONObject
.
class
);
}
}
List
<
JSONObject
>
lineList
=
new
ArrayList
<>();
List
<
JSONObject
>
lineList
=
new
ArrayList
<>();
List
<
JSONObject
>
result
=
getDayMarkEmotionCount
(
startTime
,
endTime
,
projectId
,
linkedGroupId
);
List
<
JSONObject
>
result
=
getDayMarkEmotionCount
(
startTime
,
endTime
,
projectId
,
linkedGroupId
);
result
.
forEach
(
day
->
{
result
.
forEach
(
day
->
{
JSONObject
line
=
new
JSONObject
();
JSONObject
line
=
new
JSONObject
();
...
@@ -581,17 +573,17 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -581,17 +573,17 @@ public class MarkDataServiceImpl implements IMarkDataService {
// TODO script使用
// TODO script使用
Script
script
=
new
Script
(
"params._source.ind_title"
);
Script
script
=
new
Script
(
"params._source.ind_title"
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"titles"
).
script
(
script
).
order
(
BucketOrder
.
count
(
false
)).
size
(
60000
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"titles"
).
script
(
script
).
order
(
BucketOrder
.
count
(
false
)).
size
(
60000
);
//
postFilter
//
query
BoolQueryBuilder
postFilter
=
projectLinkedGroupQuery
(
projectId
,
linkedGroupId
);
BoolQueryBuilder
query
=
projectLinkedGroupQuery
(
projectId
,
linkedGroupId
);
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
))
query
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
))
// 过滤微博
// 过滤微博
.
mustNot
(
QueryBuilders
.
termQuery
(
"platform_id.keyword"
,
"5d02236e6395002a7c380b79"
));
.
mustNot
(
QueryBuilders
.
termQuery
(
"platform_id.keyword"
,
"5d02236e6395002a7c380b79"
));
if
(
null
!=
emotion
)
{
if
(
null
!=
emotion
)
{
postFilter
.
must
(
QueryBuilders
.
termQuery
(
"mark_cache_maps.name.keyword"
,
emotion
));
query
.
must
(
QueryBuilders
.
termQuery
(
"mark_cache_maps.name.keyword"
,
emotion
));
}
}
Map
<
String
,
Integer
>
result
=
new
HashMap
<>();
Map
<
String
,
Integer
>
result
=
new
HashMap
<>();
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
postFilter
,
null
,
aggregationBuilder
,
null
,
null
,
0
,
0
,
null
);
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
null
,
query
,
aggregationBuilder
,
null
,
null
,
0
,
0
,
null
);
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
ParsedStringTerms
teamAgg
=
(
ParsedStringTerms
)
aggMap
.
get
(
"titles"
);
ParsedStringTerms
teamAgg
=
(
ParsedStringTerms
)
aggMap
.
get
(
"titles"
);
List
<?
extends
Terms
.
Bucket
>
buckets
=
teamAgg
.
getBuckets
();
List
<?
extends
Terms
.
Bucket
>
buckets
=
teamAgg
.
getBuckets
();
...
@@ -615,19 +607,21 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -615,19 +607,21 @@ public class MarkDataServiceImpl implements IMarkDataService {
* @return 所有稿件倾向稿件数量信息
* @return 所有稿件倾向稿件数量信息
*/
*/
private
List
<
JSONObject
>
getDayMarkEmotionCount
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
linkedGroupId
)
throws
IOException
{
private
List
<
JSONObject
>
getDayMarkEmotionCount
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
linkedGroupId
)
throws
IOException
{
List
<
JSONObject
>
R
esultList
=
new
ArrayList
<>();
List
<
JSONObject
>
r
esultList
=
new
ArrayList
<>();
// 索引
// 索引
String
[]
indexes
=
esClientDao
.
getIndexes
();
String
[]
indexes
=
esClientDao
.
getIndexes
();
// ??? TODO 为什么是16h offset
// ??? TODO 为什么是16h offset
DateHistogramAggregationBuilder
daysAggregationBuilder
=
AggregationBuilders
.
dateHistogram
(
"dayAgg"
).
field
(
"time"
).
calendarInterval
(
DateHistogramInterval
.
DAY
);
DateHistogramAggregationBuilder
daysAggregationBuilder
=
AggregationBuilders
.
dateHistogram
(
"dayAgg"
).
field
(
"time"
).
calendarInterval
(
DateHistogramInterval
.
DAY
);
TermsAggregationBuilder
emotionAggregationBuilder
=
AggregationBuilders
.
terms
(
"count"
).
field
(
"mark_cache_maps.name.keyword"
);
TermsAggregationBuilder
emotionAggregationBuilder
=
AggregationBuilders
.
terms
(
"count"
).
field
(
"mark_cache_maps.name.keyword"
);
// postFilter
// query
BoolQueryBuilder
postFilter
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
)).
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.projectId.keyword"
,
projectId
)).
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.linkedGroupId.keyword"
,
linkedGroupId
));
query
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
)).
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.projectId.keyword"
,
projectId
)).
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.linkedGroupId.keyword"
,
linkedGroupId
));
// 情感倾向限制
// 情感倾向限制
postFilter
.
must
(
QueryBuilders
.
termQuery
(
"mark_cache_maps.group_name.keyword"
,
"情感倾向"
));
query
.
must
(
QueryBuilders
.
termQuery
(
"mark_cache_maps.group_name.keyword"
,
"情感倾向"
));
// response
// response
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
postFilter
,
null
,
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
null
,
query
,
daysAggregationBuilder
.
subAggregation
(
emotionAggregationBuilder
),
null
,
null
,
0
,
0
,
null
);
daysAggregationBuilder
.
subAggregation
(
emotionAggregationBuilder
),
null
,
null
,
0
,
0
,
null
);
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
ParsedDateHistogram
dayAggTeam
=
(
ParsedDateHistogram
)
aggMap
.
get
(
"dayAgg"
);
ParsedDateHistogram
dayAggTeam
=
(
ParsedDateHistogram
)
aggMap
.
get
(
"dayAgg"
);
...
@@ -639,9 +633,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -639,9 +633,9 @@ public class MarkDataServiceImpl implements IMarkDataService {
List
<?
extends
Terms
.
Bucket
>
list
=
countTeam
.
getBuckets
();
List
<?
extends
Terms
.
Bucket
>
list
=
countTeam
.
getBuckets
();
result
.
put
(
"date"
,
bucket
.
getKeyAsString
());
result
.
put
(
"date"
,
bucket
.
getKeyAsString
());
emotionCount
(
result
,
bucket
.
getDocCount
(),
list
);
emotionCount
(
result
,
bucket
.
getDocCount
(),
list
);
R
esultList
.
add
(
result
);
r
esultList
.
add
(
result
);
});
});
return
R
esultList
;
return
r
esultList
;
}
}
/**
/**
...
@@ -661,12 +655,12 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -661,12 +655,12 @@ public class MarkDataServiceImpl implements IMarkDataService {
TermsAggregationBuilder
platformAggregationBuilder
=
AggregationBuilders
.
terms
(
"platform_count"
).
field
(
"platform_id.keyword"
).
order
(
BucketOrder
.
count
(
false
));
TermsAggregationBuilder
platformAggregationBuilder
=
AggregationBuilders
.
terms
(
"platform_count"
).
field
(
"platform_id.keyword"
).
order
(
BucketOrder
.
count
(
false
));
TermsAggregationBuilder
emotionAggregationBuilder
=
AggregationBuilders
.
terms
(
"emotion_count"
).
field
(
"mark_cache_maps.name.keyword"
);
TermsAggregationBuilder
emotionAggregationBuilder
=
AggregationBuilders
.
terms
(
"emotion_count"
).
field
(
"mark_cache_maps.name.keyword"
);
// postFilter
// postFilter
BoolQueryBuilder
postFilter
=
projectLinkedGroupQuery
(
projectId
,
linkedGroupId
);
BoolQueryBuilder
query
=
projectLinkedGroupQuery
(
projectId
,
linkedGroupId
);
// time
// time
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
query
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
// 情感倾向限制
// 情感倾向限制
postFilter
.
must
(
QueryBuilders
.
termQuery
(
"mark_cache_maps.group_name.keyword"
,
"情感倾向"
));
query
.
must
(
QueryBuilders
.
termQuery
(
"mark_cache_maps.group_name.keyword"
,
"情感倾向"
));
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
postFilter
,
null
,
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
null
,
query
,
platformAggregationBuilder
.
subAggregation
(
emotionAggregationBuilder
),
null
,
null
,
0
,
0
,
null
);
platformAggregationBuilder
.
subAggregation
(
emotionAggregationBuilder
),
null
,
null
,
0
,
0
,
null
);
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
ParsedStringTerms
teamAgg
=
(
ParsedStringTerms
)
aggMap
.
get
(
"platform_count"
);
ParsedStringTerms
teamAgg
=
(
ParsedStringTerms
)
aggMap
.
get
(
"platform_count"
);
...
@@ -684,6 +678,7 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -684,6 +678,7 @@ public class MarkDataServiceImpl implements IMarkDataService {
}
}
private
void
emotionCount
(
JSONObject
result
,
long
total
,
List
<?
extends
Terms
.
Bucket
>
list
)
{
private
void
emotionCount
(
JSONObject
result
,
long
total
,
List
<?
extends
Terms
.
Bucket
>
list
)
{
result
.
put
(
"total"
,
total
);
result
.
put
(
EmotionEnum
.
POSITIVE
.
getName
(),
0
);
result
.
put
(
EmotionEnum
.
POSITIVE
.
getName
(),
0
);
result
.
put
(
EmotionEnum
.
NEUTRAL
.
getName
(),
0
);
result
.
put
(
EmotionEnum
.
NEUTRAL
.
getName
(),
0
);
result
.
put
(
EmotionEnum
.
NEGATIVE
.
getName
(),
0
);
result
.
put
(
EmotionEnum
.
NEGATIVE
.
getName
(),
0
);
...
@@ -708,7 +703,8 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -708,7 +703,8 @@ public class MarkDataServiceImpl implements IMarkDataService {
List
<
JSONObject
>
platformList
=
commonService
.
getQbjcPlatform
(
"id"
,
"name"
);
List
<
JSONObject
>
platformList
=
commonService
.
getQbjcPlatform
(
"id"
,
"name"
);
List
<
JSONObject
>
platformsCount
=
getPlatformsCount
(
startTime
,
endTime
,
null
,
null
,
projectId
,
linkedGroupId
,
platformList
);
List
<
JSONObject
>
platformsCount
=
getPlatformsCount
(
startTime
,
endTime
,
null
,
null
,
projectId
,
linkedGroupId
,
platformList
);
long
articlesCount
=
platformsCount
.
stream
().
mapToLong
(
platform
->
platform
.
getLongValue
(
"count"
)).
sum
();
long
articlesCount
=
platformsCount
.
stream
().
mapToLong
(
platform
->
platform
.
getLongValue
(
"count"
)).
sum
();
List
<
JSONObject
>
resultList
=
platformsCount
.
stream
().
peek
(
platform
->
platform
.
put
(
"proportion"
,
platform
.
getLongValue
(
"count"
)
*
1.0
/
articlesCount
)).
collect
(
Collectors
.
toList
());
List
<
JSONObject
>
resultList
=
platformsCount
.
stream
().
peek
(
platform
->
platform
.
put
(
"proportion"
,
0
==
articlesCount
?
0
:
platform
.
getLongValue
(
"count"
)
*
1.0
/
articlesCount
)).
collect
(
Collectors
.
toList
());
stringRedisTemplate
.
opsForValue
().
set
(
redisKey
,
JSON
.
toJSONString
(
resultList
),
1
,
TimeUnit
.
HOURS
);
stringRedisTemplate
.
opsForValue
().
set
(
redisKey
,
JSON
.
toJSONString
(
resultList
),
1
,
TimeUnit
.
HOURS
);
return
resultList
;
return
resultList
;
}
}
...
@@ -730,19 +726,16 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -730,19 +726,16 @@ public class MarkDataServiceImpl implements IMarkDataService {
// 聚合请求
// 聚合请求
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"count"
).
field
(
"platform_id.keyword"
).
order
(
BucketOrder
.
count
(
false
)).
size
(
100
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"count"
).
field
(
"platform_id.keyword"
).
order
(
BucketOrder
.
count
(
false
)).
size
(
100
);
// query
// query
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
(
);
BoolQueryBuilder
query
=
projectLinkedGroupQuery
(
projectId
,
linedGroupId
);
// keyword
// keyword
if
(
StringUtils
.
isNotEmpty
(
keyword
))
{
if
(
StringUtils
.
isNotEmpty
(
keyword
))
{
String
[]
fieldSearch
=
"标题"
.
equals
(
searchField
)
?
new
String
[]{
GenericAttribute
.
ES_IND_TITLE
}
:
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
};
String
[]
fieldSearch
=
"标题"
.
equals
(
searchField
)
?
new
String
[]{
GenericAttribute
.
ES_IND_TITLE
}
:
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
};
query
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
keyword
,
fieldSearch
));
query
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
keyword
,
fieldSearch
));
}
}
// postFilter
query
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
BoolQueryBuilder
postFilter
=
projectLinkedGroupQuery
(
projectId
,
linedGroupId
);
// time
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
List
<
JSONObject
>
platformResultList
=
new
ArrayList
<>(
platformList
.
size
());
List
<
JSONObject
>
platformResultList
=
new
ArrayList
<>(
platformList
.
size
());
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
postFilter
,
query
,
aggregationBuilder
,
null
,
null
,
0
,
0
,
null
);
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
null
,
query
,
aggregationBuilder
,
null
,
null
,
0
,
0
,
null
);
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
Map
<
String
,
Aggregation
>
aggMap
=
searchResponse
.
getAggregations
().
asMap
();
ParsedStringTerms
teamAgg
=
(
ParsedStringTerms
)
aggMap
.
get
(
"count"
);
ParsedStringTerms
teamAgg
=
(
ParsedStringTerms
)
aggMap
.
get
(
"count"
);
List
<?
extends
Terms
.
Bucket
>
buckets
=
teamAgg
.
getBuckets
();
List
<?
extends
Terms
.
Bucket
>
buckets
=
teamAgg
.
getBuckets
();
...
@@ -779,7 +772,6 @@ public class MarkDataServiceImpl implements IMarkDataService {
...
@@ -779,7 +772,6 @@ public class MarkDataServiceImpl implements IMarkDataService {
BoolQueryBuilder
postFilter
=
projectLinkedGroupQuery
(
projectId
,
linkedGroupId
);
BoolQueryBuilder
postFilter
=
projectLinkedGroupQuery
(
projectId
,
linkedGroupId
);
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
searchHelper
.
setPostFilter
(
postFilter
);
searchHelper
.
setPostFilter
(
postFilter
);
// TODO 临时添加
searchHelper
.
setSize
(
10000
);
searchHelper
.
setSize
(
10000
);
List
<
String
>
textList
=
new
ArrayList
<>();
List
<
String
>
textList
=
new
ArrayList
<>();
List
<
SearchResponse
>
searchResponses
=
Collections
.
singletonList
(
esClientDao
.
searchResponse
(
searchHelper
));
List
<
SearchResponse
>
searchResponses
=
Collections
.
singletonList
(
esClientDao
.
searchResponse
(
searchHelper
));
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
View file @
d961690e
...
@@ -13,7 +13,7 @@ import com.zhiwei.brandkbs2.pojo.Project;
...
@@ -13,7 +13,7 @@ import com.zhiwei.brandkbs2.pojo.Project;
import
com.zhiwei.brandkbs2.pojo.User
;
import
com.zhiwei.brandkbs2.pojo.User
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
...
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
* @date 2022年4月18日16:49:10
* @date 2022年4月18日16:49:10
*/
*/
@Service
(
"projectServiceImpl"
)
@Service
(
"projectServiceImpl"
)
public
class
ProjectServiceImpl
implements
I
ProjectService
{
public
class
ProjectServiceImpl
implements
ProjectService
{
@Resource
(
name
=
"userDao"
)
@Resource
(
name
=
"userDao"
)
private
IUserDao
userDao
;
private
IUserDao
userDao
;
...
@@ -62,7 +62,7 @@ public class ProjectServiceImpl implements IProjectService {
...
@@ -62,7 +62,7 @@ public class ProjectServiceImpl implements IProjectService {
}
}
//给超管添加该项目权限,并且初始化预警推送 TODO
//给超管添加该项目权限,并且初始化预警推送 TODO
// for (Integer SUPER_ADMINUid : userMapper.getAllSUPER_ADMINUids()) {
// for (Integer SUPER_ADMINUid : userMapper.getAllSUPER_ADMINUids()) {
//
i
UserService.insertAdminRoleAndWarn(SUPER_ADMINUid, project.getId());
// UserService.insertAdminRoleAndWarn(SUPER_ADMINUid, project.getId());
// }
// }
projectDao
.
insertOneWithoutId
(
projectVO
.
creatProject
(
new
Date
()));
projectDao
.
insertOneWithoutId
(
projectVO
.
creatProject
(
new
Date
()));
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
View file @
d961690e
...
@@ -9,8 +9,8 @@ import com.zhiwei.brandkbs2.exception.ExceptionCast;
...
@@ -9,8 +9,8 @@ import com.zhiwei.brandkbs2.exception.ExceptionCast;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.pojo.ReportSettings
;
import
com.zhiwei.brandkbs2.pojo.ReportSettings
;
import
com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.
I
ReportService
;
import
com.zhiwei.brandkbs2.service.ReportService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
...
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-31 18:01
* @date: 2022-05-31 18:01
*/
*/
@Service
(
"reportServiceImpl"
)
@Service
(
"reportServiceImpl"
)
public
class
ReportServiceImpl
implements
I
ReportService
{
public
class
ReportServiceImpl
implements
ReportService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
ReportServiceImpl
.
class
);
public
static
final
Logger
log
=
LogManager
.
getLogger
(
ReportServiceImpl
.
class
);
@Resource
(
name
=
"reportDao"
)
@Resource
(
name
=
"reportDao"
)
...
@@ -41,7 +41,7 @@ public class ReportServiceImpl implements IReportService {
...
@@ -41,7 +41,7 @@ public class ReportServiceImpl implements IReportService {
IReportSettingsDao
reportSettingsDao
;
IReportSettingsDao
reportSettingsDao
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
I
ProjectService
projectService
;
ProjectService
projectService
;
@Override
@Override
public
Map
<
String
,
ReportSettingsDTO
>
getReportSettings
()
{
public
Map
<
String
,
ReportSettingsDTO
>
getReportSettings
()
{
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/SystemInfoServiceImpl.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
import
com.zhiwei.brandkbs2.dao.IQbjcPojoDao
;
import
com.zhiwei.brandkbs2.dao.IQbjcPojoDao
;
import
com.zhiwei.brandkbs2.service.
I
SystemInfoService
;
import
com.zhiwei.brandkbs2.service.SystemInfoService
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -10,13 +10,13 @@ import javax.annotation.Resource;
...
@@ -10,13 +10,13 @@ import javax.annotation.Resource;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @ClassName:
I
SystemInfoServiceImpl
* @ClassName: SystemInfoServiceImpl
* @Description
I
SystemInfoServiceImpl
* @Description SystemInfoServiceImpl
* @author: sjj
* @author: sjj
* @date: 2022-06-16 14:21
* @date: 2022-06-16 14:21
*/
*/
@Service
(
"systemInfoServiceImpl"
)
@Service
(
"systemInfoServiceImpl"
)
public
class
SystemInfoServiceImpl
implements
I
SystemInfoService
{
public
class
SystemInfoServiceImpl
implements
SystemInfoService
{
@Resource
(
name
=
"qbjcPojoDao"
)
@Resource
(
name
=
"qbjcPojoDao"
)
private
IQbjcPojoDao
qbjcPojoDao
;
private
IQbjcPojoDao
qbjcPojoDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/TagFilterServiceImpl.java
View file @
d961690e
...
@@ -4,12 +4,11 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal;
...
@@ -4,12 +4,11 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import
com.zhiwei.brandkbs2.dao.ITagFilterDao
;
import
com.zhiwei.brandkbs2.dao.ITagFilterDao
;
import
com.zhiwei.brandkbs2.pojo.TagFilter
;
import
com.zhiwei.brandkbs2.pojo.TagFilter
;
import
com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO
;
import
com.zhiwei.brandkbs2.service.
I
CommonService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.
IProject
Service
;
import
com.zhiwei.brandkbs2.service.
TagFilter
Service
;
import
com.zhiwei.brandkbs2.service.
ITagFilter
Service
;
import
com.zhiwei.brandkbs2.service.
Project
Service
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -24,16 +23,16 @@ import java.util.stream.Collectors;
...
@@ -24,16 +23,16 @@ import java.util.stream.Collectors;
* @date: 2022-06-01 13:40
* @date: 2022-06-01 13:40
*/
*/
@Service
(
"tagFilterServiceImpl"
)
@Service
(
"tagFilterServiceImpl"
)
public
class
TagFilterServiceImpl
implements
I
TagFilterService
{
public
class
TagFilterServiceImpl
implements
TagFilterService
{
@Resource
(
name
=
"tagFilterDao"
)
@Resource
(
name
=
"tagFilterDao"
)
private
ITagFilterDao
tagFilterDao
;
private
ITagFilterDao
tagFilterDao
;
@Resource
(
name
=
"commonServiceImpl"
)
@Resource
(
name
=
"commonServiceImpl"
)
private
I
CommonService
commonService
;
private
CommonService
commonService
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
@Override
@Override
public
List
<
TagFilterDTO
>
getTagFilter
()
{
public
List
<
TagFilterDTO
>
getTagFilter
()
{
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
View file @
d961690e
...
@@ -8,7 +8,7 @@ import com.zhiwei.brandkbs2.es.EsClientDao;
...
@@ -8,7 +8,7 @@ import com.zhiwei.brandkbs2.es.EsClientDao;
import
com.zhiwei.brandkbs2.pojo.BrandkbsTask
;
import
com.zhiwei.brandkbs2.pojo.BrandkbsTask
;
import
com.zhiwei.brandkbs2.pojo.Channel
;
import
com.zhiwei.brandkbs2.pojo.Channel
;
import
com.zhiwei.brandkbs2.pojo.ChannelIndex
;
import
com.zhiwei.brandkbs2.pojo.ChannelIndex
;
import
com.zhiwei.brandkbs2.service.
I
TaskService
;
import
com.zhiwei.brandkbs2.service.TaskService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -25,7 +25,7 @@ import java.util.Map;
...
@@ -25,7 +25,7 @@ import java.util.Map;
* @date: 2022-06-16 15:28
* @date: 2022-06-16 15:28
*/
*/
@Service
(
"taskServiceImpl"
)
@Service
(
"taskServiceImpl"
)
public
class
TaskServiceImpl
implements
I
TaskService
{
public
class
TaskServiceImpl
implements
TaskService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
TaskServiceImpl
.
class
);
public
static
final
Logger
log
=
LogManager
.
getLogger
(
TaskServiceImpl
.
class
);
@Resource
(
name
=
"esClientDao"
)
@Resource
(
name
=
"esClientDao"
)
...
@@ -66,5 +66,8 @@ public class TaskServiceImpl implements ITaskService {
...
@@ -66,5 +66,8 @@ public class TaskServiceImpl implements ITaskService {
public
void
reportSend
()
{
public
void
reportSend
()
{
Date
now
=
new
Date
();
Date
now
=
new
Date
();
BrandkbsTask
task
=
brandkbsTaskDao
.
findTaskByTaskNameAndVersion
(
Constant
.
TASK_REPORT_JOB
,
Constant
.
INIT_VERSION
);
BrandkbsTask
task
=
brandkbsTaskDao
.
findTaskByTaskNameAndVersion
(
Constant
.
TASK_REPORT_JOB
,
Constant
.
INIT_VERSION
);
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
View file @
d961690e
...
@@ -14,7 +14,7 @@ import com.zhiwei.brandkbs2.pojo.UserInfo;
...
@@ -14,7 +14,7 @@ import com.zhiwei.brandkbs2.pojo.UserInfo;
import
com.zhiwei.brandkbs2.pojo.UserRole
;
import
com.zhiwei.brandkbs2.pojo.UserRole
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.middleware.auth.pojo.CenterUser
;
import
com.zhiwei.middleware.auth.pojo.CenterUser
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -36,7 +36,7 @@ import java.util.stream.Collectors;
...
@@ -36,7 +36,7 @@ import java.util.stream.Collectors;
* @date: 2022-04-28 17:34
* @date: 2022-04-28 17:34
*/
*/
@Service
(
"userServiceImpl"
)
@Service
(
"userServiceImpl"
)
public
class
UserServiceImpl
implements
I
UserService
{
public
class
UserServiceImpl
implements
UserService
{
@Resource
(
name
=
"userDao"
)
@Resource
(
name
=
"userDao"
)
private
IUserDao
userDao
;
private
IUserDao
userDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/task/ControlCenter.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
task
;
package
com
.
zhiwei
.
brandkbs2
.
task
;
import
com.zhiwei.brandkbs2.service.
I
TaskService
;
import
com.zhiwei.brandkbs2.service.TaskService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.context.annotation.Profile
;
...
@@ -22,7 +22,7 @@ public class ControlCenter {
...
@@ -22,7 +22,7 @@ public class ControlCenter {
public
static
final
Logger
log
=
LogManager
.
getLogger
(
ControlCenter
.
class
);
public
static
final
Logger
log
=
LogManager
.
getLogger
(
ControlCenter
.
class
);
@Resource
(
name
=
"taskServiceImpl"
)
@Resource
(
name
=
"taskServiceImpl"
)
private
I
TaskService
taskService
;
private
TaskService
taskService
;
@Async
(
"scheduledExecutor"
)
@Async
(
"scheduledExecutor"
)
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
...
...
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
View file @
d961690e
...
@@ -20,6 +20,7 @@ import com.zhiwei.qbjc.bean.tools.BeanTools;
...
@@ -20,6 +20,7 @@ import com.zhiwei.qbjc.bean.tools.BeanTools;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.MapUtils
;
import
org.apache.commons.collections4.MapUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.commons.lang3.time.FastDateFormat
;
import
org.apache.commons.lang3.time.FastDateFormat
;
import
org.dozer.DozerBeanMapper
;
import
org.dozer.DozerBeanMapper
;
import
org.springframework.data.mapping.MappingException
;
import
org.springframework.data.mapping.MappingException
;
...
@@ -39,6 +40,8 @@ import java.util.stream.Collectors;
...
@@ -39,6 +40,8 @@ import java.util.stream.Collectors;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
static
com
.
zhiwei
.
brandkbs2
.
common
.
GenericAttribute
.
ES_MARK_CACHE_MAPS
;
import
static
com
.
zhiwei
.
brandkbs2
.
common
.
GenericAttribute
.
ES_MARK_CACHE_MAPS
;
import
static
com
.
zhiwei
.
brandkbs2
.
config
.
Constant
.
DAY_PATTERN
;
import
static
com
.
zhiwei
.
brandkbs2
.
config
.
Constant
.
HOUR_PATTERN
;
import
static
java
.
util
.
Objects
.
nonNull
;
import
static
java
.
util
.
Objects
.
nonNull
;
/**
/**
...
@@ -516,4 +519,28 @@ public class Tools {
...
@@ -516,4 +519,28 @@ public class Tools {
return
result
;
return
result
;
}
}
public
static
Long
[]
formatTimeRange
(
Long
startTime
,
Long
endTime
)
{
if
(
Objects
.
isNull
(
startTime
)
||
Objects
.
isNull
(
endTime
))
{
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
DAY_PATTERN
),
1
).
getTime
();
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
}
else
{
startTime
=
Tools
.
truncDate
(
new
Date
(
startTime
),
HOUR_PATTERN
).
getTime
();
endTime
=
Tools
.
truncDate
(
new
Date
(
endTime
),
HOUR_PATTERN
).
getTime
();
}
return
new
Long
[]{
startTime
,
endTime
};
}
public
String
getEmotionByEsMarkMap
(
Map
<
String
,
Object
>
map
)
{
List
<
JSONObject
>
cacheMaps
=
(
List
<
JSONObject
>)
map
.
get
(
GenericAttribute
.
ES_MARK_CACHE_MAPS
);
if
(
null
==
cacheMaps
)
{
return
null
;
}
for
(
JSONObject
json
:
cacheMaps
)
{
if
(
Constant
.
EMOTION_LABEL_KEY
.
equals
(
json
.
getString
(
"group_name"
)))
{
return
json
.
getString
(
"name"
);
}
}
return
null
;
}
}
}
\ No newline at end of file
src/test/java/com/zhiwei/brandkbs2/TestRunWith.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
;
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.controller.AppArticleController
;
import
com.zhiwei.brandkbs2.dao.IChannelLabelDao
;
import
com.zhiwei.brandkbs2.dao.IChannelLabelDao
;
import
com.zhiwei.brandkbs2.dao.IEventDataDao
;
import
com.zhiwei.brandkbs2.dao.IEventDataDao
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.ChannelIndex
;
import
com.zhiwei.brandkbs2.pojo.ChannelIndex
;
import
com.zhiwei.brandkbs2.service.ITaskService
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
import
com.zhiwei.brandkbs2.service.TaskService
;
import
com.zhiwei.brandkbs2.util.TextUtil
;
import
com.zhiwei.brandkbs2.util.TextUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -18,7 +22,7 @@ import java.util.List;
...
@@ -18,7 +22,7 @@ import java.util.List;
/**
/**
* @ClassName: TestRunWith
* @ClassName: TestRunWith
* @Description T
ODO
* @Description T
estRunWith
* @author: sjj
* @author: sjj
* @date: 2022-06-16 16:27
* @date: 2022-06-16 16:27
*/
*/
...
@@ -28,7 +32,7 @@ import java.util.List;
...
@@ -28,7 +32,7 @@ import java.util.List;
public
class
TestRunWith
{
public
class
TestRunWith
{
@Autowired
@Autowired
ITaskService
i
TaskService
;
TaskService
TaskService
;
@Autowired
@Autowired
IEventDataDao
eventDataDao
;
IEventDataDao
eventDataDao
;
...
@@ -39,13 +43,20 @@ public class TestRunWith {
...
@@ -39,13 +43,20 @@ public class TestRunWith {
@Autowired
@Autowired
TextUtil
textUtil
;
TextUtil
textUtil
;
@Autowired
AppArticleController
appArticleController
;
@Test
@Test
public
void
test1
(){
public
void
test1
()
{
iTaskService
.
messageFlowCount
(
1
);
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setProjectId
(
"62beadd1bbf8eb20f96d2f2f"
);
UserThreadLocal
.
set
(
userInfo
);
ResponseResult
result
=
appArticleController
.
getMarkSpread
(
1657468800000L
,
1657555200000L
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
result
));
}
}
@Test
@Test
public
void
test2
(){
public
void
test2
()
{
ChannelIndex
channelIndex
=
new
ChannelIndex
();
ChannelIndex
channelIndex
=
new
ChannelIndex
();
channelIndex
.
setPlatform
(
"微信"
);
channelIndex
.
setPlatform
(
"微信"
);
channelIndex
.
setRealSource
(
"微信公众号"
);
channelIndex
.
setRealSource
(
"微信公众号"
);
...
@@ -55,16 +66,16 @@ public class TestRunWith {
...
@@ -55,16 +66,16 @@ public class TestRunWith {
}
}
@Test
@Test
public
void
test3
(){
public
void
test3
()
{
channelLabelDao
.
getChannelLabelType
();
channelLabelDao
.
getChannelLabelType
();
}
}
@Test
@Test
public
void
test4
(){
public
void
test4
()
{
List
<
String
>
list
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
"分析高频词耗时"
);
list
.
add
(
"分析高频词耗时"
);
list
.
add
(
"分析高频词"
);
list
.
add
(
"分析高频词"
);
List
<
JSONObject
>
highWordsJson
=
TextUtil
.
getHighWordsJson
(
list
,
1
);
List
<
JSONObject
>
highWordsJson
=
TextUtil
.
getHighWordsJson
(
list
,
1
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
highWordsJson
));
System
.
out
.
println
(
JSONObject
.
toJSONString
(
highWordsJson
));
}
}
...
...
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