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
6419ab60
Commit
6419ab60
authored
Mar 20, 2023
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移动端调整改动上线
parent
763f198a
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
1269 additions
and
58 deletions
+1269
-58
src/main/java/com/zhiwei/brandkbs2/common/RedisKeyPrefix.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/config/Constant.java
+3
-1
src/main/java/com/zhiwei/brandkbs2/controller/LoginController.java
+14
-7
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileChannelController.java
+88
-0
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileEventController.java
+80
-0
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileIndexController.java
+111
-0
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileReportController.java
+67
-0
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileSearchController.java
+120
-0
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileUserController.java
+61
-0
src/main/java/com/zhiwei/brandkbs2/es/EsQueryTools.java
+18
-16
src/main/java/com/zhiwei/brandkbs2/pojo/UserRole.java
+2
-1
src/main/java/com/zhiwei/brandkbs2/pojo/dto/MarkSearchDTO.java
+6
-0
src/main/java/com/zhiwei/brandkbs2/pojo/dto/UnionDTO.java
+29
-0
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ChannelVO.java
+10
-0
src/main/java/com/zhiwei/brandkbs2/pojo/vo/MobileLoginVO.java
+34
-0
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
+2
-0
src/main/java/com/zhiwei/brandkbs2/service/IndexService.java
+9
-0
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
+15
-0
src/main/java/com/zhiwei/brandkbs2/service/ReportService.java
+2
-0
src/main/java/com/zhiwei/brandkbs2/service/UserCenterService.java
+14
-0
src/main/java/com/zhiwei/brandkbs2/service/UserService.java
+16
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+60
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/IndexServiceImpl.java
+28
-3
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+52
-14
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkFlowServiceImpl.java
+3
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
+2
-9
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
+290
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/UserCenterServiceImpl.java
+25
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
+91
-0
src/main/resources/application-dev.properties
+5
-2
src/main/resources/application-local.properties
+5
-2
src/main/resources/application-prod.properties
+5
-2
No files found.
src/main/java/com/zhiwei/brandkbs2/common/RedisKeyPrefix.java
View file @
6419ab60
...
@@ -67,6 +67,7 @@ public class RedisKeyPrefix {
...
@@ -67,6 +67,7 @@ public class RedisKeyPrefix {
* 项目简报报相关缓存KEY
* 项目简报报相关缓存KEY
*/
*/
public
static
final
String
REPORT_PC
=
"BRANDKBS:REPORT:PC:"
;
public
static
final
String
REPORT_PC
=
"BRANDKBS:REPORT:PC:"
;
public
static
final
String
REPORT_MOBILE
=
"BRANDKBS:REPORT:MOBILE:"
;
/**
/**
* 稿件数据上传缓存key
* 稿件数据上传缓存key
...
...
src/main/java/com/zhiwei/brandkbs2/config/Constant.java
View file @
6419ab60
...
@@ -27,7 +27,7 @@ public class Constant {
...
@@ -27,7 +27,7 @@ public class Constant {
public
static
final
FastDateFormat
HOUR_FORMAT
=
FastDateFormat
.
getInstance
(
HOUR_PATTERN
);
public
static
final
FastDateFormat
HOUR_FORMAT
=
FastDateFormat
.
getInstance
(
HOUR_PATTERN
);
public
static
final
FastDateFormat
DAY_FORMAT
=
FastDateFormat
.
getInstance
(
DAY_PATTERN
);
public
static
final
FastDateFormat
DAY_FORMAT
=
FastDateFormat
.
getInstance
(
DAY_PATTERN
);
public
static
final
FastDateFormat
SPEC_DAY_FORMAT
=
FastDateFormat
.
getInstance
(
"yyyy/MM/dd"
);
public
static
final
FastDateFormat
SPEC_DAY_FORMAT
=
FastDateFormat
.
getInstance
(
"yyyy/MM/dd"
);
public
static
final
FastDateFormat
MONTH_FORMAT
=
FastDateFormat
.
getInstance
(
MONTH_PATTERN
);
public
static
final
FastDateFormat
ONLY_MONTH_FORMAT
=
FastDateFormat
.
getInstance
(
"M月"
);
/**
/**
* 自定义fid分隔符号
* 自定义fid分隔符号
...
@@ -62,4 +62,6 @@ public class Constant {
...
@@ -62,4 +62,6 @@ public class Constant {
* 主品牌默认竞品ID
* 主品牌默认竞品ID
*/
*/
public
static
final
String
PRIMARY_CONTEND_ID
=
"0"
;
public
static
final
String
PRIMARY_CONTEND_ID
=
"0"
;
public
final
static
String
DEFAULT_PROJECT_ID
=
"62beadd1bbf8eb20f96d2f1c"
;
}
}
src/main/java/com/zhiwei/brandkbs2/controller/LoginController.java
View file @
6419ab60
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
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.pojo.vo.MobileLoginVO
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.UserCenterService
;
import
com.zhiwei.brandkbs2.service.UserCenterService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
...
@@ -33,7 +34,7 @@ public class LoginController extends BaseController {
...
@@ -33,7 +34,7 @@ public class LoginController extends BaseController {
private
int
jwtHour
;
private
int
jwtHour
;
@Resource
(
name
=
"userServiceImpl"
)
@Resource
(
name
=
"userServiceImpl"
)
private
UserService
U
serService
;
private
UserService
u
serService
;
@Resource
(
name
=
"projectServiceImpl"
)
@Resource
(
name
=
"projectServiceImpl"
)
private
ProjectService
ProjectService
;
private
ProjectService
ProjectService
;
...
@@ -44,14 +45,14 @@ public class LoginController extends BaseController {
...
@@ -44,14 +45,14 @@ public class LoginController extends BaseController {
@ApiOperation
(
"用户登录"
)
@ApiOperation
(
"用户登录"
)
@PostMapping
(
"/user/login"
)
@PostMapping
(
"/user/login"
)
public
ResponseResult
login
()
{
public
ResponseResult
login
()
{
return
ResponseResult
.
success
(
U
serService
.
login
().
toMap
());
return
ResponseResult
.
success
(
u
serService
.
login
().
toMap
());
}
}
@ApiOperation
(
"用户信息获取"
)
@ApiOperation
(
"用户信息获取"
)
@GetMapping
(
"/user/getLoginInfo"
)
@GetMapping
(
"/user/getLoginInfo"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
ResponseResult
getLoginInfo
()
{
public
ResponseResult
getLoginInfo
()
{
return
ResponseResult
.
success
(
U
serService
.
getLoginInfo
());
return
ResponseResult
.
success
(
u
serService
.
getLoginInfo
());
}
}
@ApiOperation
(
"重置绑定关系(本地测试)"
)
@ApiOperation
(
"重置绑定关系(本地测试)"
)
...
@@ -59,7 +60,7 @@ public class LoginController extends BaseController {
...
@@ -59,7 +60,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
)
{
U
serService
.
resetBind
(
json
.
getString
(
"username"
));
u
serService
.
resetBind
(
json
.
getString
(
"username"
));
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -71,19 +72,19 @@ public class LoginController extends BaseController {
...
@@ -71,19 +72,19 @@ 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
(
U
serService
.
bindUser
(
username
,
password
));
return
ResponseResult
.
success
(
u
serService
.
bindUser
(
username
,
password
));
}
}
@ApiOperation
(
"跳过绑定(赋默认权限)"
)
@ApiOperation
(
"跳过绑定(赋默认权限)"
)
@PostMapping
(
"/user/bind/skip"
)
@PostMapping
(
"/user/bind/skip"
)
public
ResponseResult
skipBindUser
()
{
public
ResponseResult
skipBindUser
()
{
return
ResponseResult
.
success
(
U
serService
.
skipBindUser
());
return
ResponseResult
.
success
(
u
serService
.
skipBindUser
());
}
}
@ApiOperation
(
"校验用户是否已有绑定关系"
)
@ApiOperation
(
"校验用户是否已有绑定关系"
)
@GetMapping
(
"/user/login/checkBind"
)
@GetMapping
(
"/user/login/checkBind"
)
public
ResponseResult
checkBind
()
{
public
ResponseResult
checkBind
()
{
return
ResponseResult
.
success
(
U
serService
.
checkUserRoles
());
return
ResponseResult
.
success
(
u
serService
.
checkUserRoles
());
}
}
@ApiOperation
(
"获取当前用户拥有的所有项目(含过期)"
)
@ApiOperation
(
"获取当前用户拥有的所有项目(含过期)"
)
...
@@ -104,6 +105,12 @@ public class LoginController extends BaseController {
...
@@ -104,6 +105,12 @@ public class LoginController extends BaseController {
return
userCenterService
.
verifyTicket
(
ticket
);
return
userCenterService
.
verifyTicket
(
ticket
);
}
}
@ApiOperation
(
"移动端用户登录"
)
@PostMapping
(
"/mobile/login"
)
public
ResponseResult
mobileLogin
(
@RequestBody
MobileLoginVO
loginVO
)
{
return
userService
.
mobileLogin
(
loginVO
);
}
@ApiOperation
(
"测试接口"
)
@ApiOperation
(
"测试接口"
)
@GetMapping
(
"/test"
)
@GetMapping
(
"/test"
)
public
ResponseResult
test
()
{
public
ResponseResult
test
()
{
...
...
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileChannelController.java
0 → 100644
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
controller
.
mobile
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelListVO
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author sjj
* @version 1.0
* @description 移动端渠道展示
* @date 2023年3月14日11:32:52
*/
@RestController
@RequestMapping
(
"/mobile/channel"
)
@Api
(
tags
=
"移动端渠道展示接口"
,
description
=
"提供移动端渠道相关信息展示"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
class
MobileChannelController
extends
BaseController
{
@Resource
(
name
=
"channelServiceImpl"
)
private
ChannelService
channelService
;
@ApiOperation
(
"渠道基本信息"
)
@ApiImplicitParam
(
name
=
"channelId"
,
value
=
"渠道ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@GetMapping
(
"/details/{channelId}"
)
public
ResponseResult
getDetailsByChannelId
(
@PathVariable
(
"channelId"
)
String
channelId
)
{
return
ResponseResult
.
success
(
channelService
.
getBaseInfoByChannelId
(
channelId
));
}
@ApiOperation
(
"收藏或取消收藏渠道"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"channelId"
,
value
=
"渠道ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"collect"
,
value
=
"收藏或取消收藏"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"boolean"
)
})
@PostMapping
(
"/collect/{channelId}/{collect}"
)
public
ResponseResult
collectChannel
(
@PathVariable
String
channelId
,
@PathVariable
boolean
collect
)
{
if
(
collect
)
{
return
ResponseResult
.
success
(
channelService
.
collectChannel
(
channelId
));
}
return
ResponseResult
.
success
(
channelService
.
removeCollectChannel
(
channelId
));
}
@ApiOperation
(
"趋势对比和提要"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"channelId"
,
value
=
"渠道ID"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"趋势类型"
,
required
=
false
,
defaultValue
=
"稿件"
,
paramType
=
"query"
,
dataType
=
"string"
)
})
@GetMapping
(
"/spreadingTend"
)
public
ResponseResult
getMobileSpreadingTendByChannelId
(
@RequestParam
(
"channelId"
)
String
channelId
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"稿件"
)
String
type
)
{
return
ResponseResult
.
success
(
channelService
.
getMobileSpreadingTend
(
channelId
,
type
));
}
@ApiOperation
(
"移动端渠道榜单展示"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"contendId"
,
value
=
"品牌ID"
,
required
=
false
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"emotion"
,
value
=
"情感倾向"
,
required
=
false
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"int"
)
})
@GetMapping
(
"/rankList"
)
public
ResponseResult
getMobileChannelRankList
(
@RequestParam
(
"startTime"
)
long
startTime
,
@RequestParam
(
"endTime"
)
long
endTime
,
@RequestParam
(
value
=
"contendId"
,
defaultValue
=
"0"
)
String
contendId
,
@RequestParam
(
value
=
"emotion"
,
defaultValue
=
"0"
)
int
emotion
)
{
List
<
ChannelListVO
>
res
;
String
sorter
=
"{\"index\":\"descend\"}"
;
if
(
0
==
emotion
)
{
res
=
channelService
.
getActiveChannelList
(
contendId
,
null
,
null
,
startTime
,
endTime
,
50
,
true
);
}
else
if
(
EmotionEnum
.
POSITIVE
.
getState
()
==
emotion
)
{
res
=
channelService
.
getPositiveList
(
contendId
,
null
,
null
,
sorter
,
startTime
,
endTime
,
50
,
true
);
}
else
{
res
=
channelService
.
getNegativeList
(
contendId
,
null
,
null
,
sorter
,
startTime
,
endTime
,
50
,
true
);
}
return
ResponseResult
.
success
(
res
);
}
}
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileEventController.java
0 → 100644
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
controller
.
mobile
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.EventService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.middleware.event.pojo.dto.BrandkbsEventSearchDTO
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.Collections
;
import
java.util.List
;
/**
* @author sjj
* @version 1.0
* @description 移动端事件接口
* @date 2023年3月15日14:44:44
*/
@RestController
@RequestMapping
(
"/mobile/event"
)
@Api
(
tags
=
"移动端事件展示接口"
,
description
=
"提供移动端事件相关信息展示"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
class
MobileEventController
extends
BaseController
{
@Resource
(
name
=
"eventServiceImpl"
)
private
EventService
eventService
;
@Resource
(
name
=
"commonServiceImpl"
)
private
CommonService
commonService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
ProjectService
projectService
;
@ApiOperation
(
"移动端事件榜单"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"brandId"
,
value
=
"品牌ID"
,
required
=
false
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"emotion"
,
value
=
"情感倾向"
,
required
=
false
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"int"
)
})
@GetMapping
(
"/rankList"
)
public
ResponseResult
getMobileEventRankList
(
@RequestParam
(
"startTime"
)
long
startTime
,
@RequestParam
(
"endTime"
)
long
endTime
,
@RequestParam
(
value
=
"brandId"
,
defaultValue
=
"0"
)
String
brandId
,
@RequestParam
(
value
=
"emotion"
,
defaultValue
=
"0"
)
int
emotion
)
{
BrandkbsEventSearchDTO
dto
=
new
BrandkbsEventSearchDTO
();
dto
.
setStartTime
(
startTime
);
dto
.
setEndTime
(
endTime
);
dto
.
setBrandId
(
brandId
);
if
(
0
!=
emotion
)
{
String
emotionName
=
EmotionEnum
.
state2Name
(
emotion
);
String
linkedGroupId
=
projectService
.
getProjectByContendId
(
UserThreadLocal
.
getProjectId
(),
Constant
.
PRIMARY_CONTEND_ID
).
getBrandLinkedGroupId
();
List
<
MarkerTag
>
tags
=
commonService
.
getQbjcTags
(
linkedGroupId
,
TagField
.
GROUP_NAME
.
is
(
"情感倾向"
));
tags
.
forEach
(
tag
->
{
if
(
tag
.
getName
().
equals
(
emotionName
))
{
dto
.
setEmotions
(
Collections
.
singletonList
(
tag
.
getUniqueId
()));
}
});
}
return
ResponseResult
.
success
(
eventService
.
getEventListMiddleware
(
dto
));
}
}
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileIndexController.java
0 → 100644
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
controller
.
mobile
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.IndexService
;
import
com.zhiwei.brandkbs2.service.MarkDataService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
/**
* @author sjj
* @version 1.0
* @description 移动端首页接口
* @date 2023年3月14日11:34:18
*/
@RestController
@RequestMapping
(
"/mobile/index"
)
@Api
(
tags
=
"移动端首页展示接口"
,
description
=
"提供移动端首页相关信息展示"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
class
MobileIndexController
{
@Resource
(
name
=
"indexServiceImpl"
)
private
IndexService
indexService
;
@Resource
(
name
=
"markDataServiceImpl"
)
private
MarkDataService
markDataService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
ProjectService
projectService
;
@Resource
(
name
=
"commonServiceImpl"
)
private
CommonService
commonService
;
@ApiOperation
(
"主品牌整体指标"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"long"
)
})
@GetMapping
(
"/wholeCriteria"
)
public
ResponseResult
getWholeCriteria
(
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
Long
endTime
)
{
return
ResponseResult
.
success
(
indexService
.
getMobileWholeCriteria
(
startTime
,
endTime
));
}
@ApiOperation
(
"传播趋势"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"long"
)
})
@GetMapping
(
"/spreadingTend"
)
public
ResponseResult
getSpreadingTend
(
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
Long
endTime
)
{
return
ResponseResult
.
success
(
indexService
.
getSpreadingTend
(
startTime
,
endTime
,
true
));
}
@ApiOperation
(
"移动端舆情总结页面"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"brandId"
,
value
=
"竞品品牌ID"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)
})
@GetMapping
(
"/summary"
)
public
ResponseResult
getMobileSummary
(
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
Long
endTime
,
@RequestParam
(
"brandId"
)
String
brandId
)
throws
IOException
{
MarkSearchDTO
dto
=
new
MarkSearchDTO
();
dto
.
setStartTime
(
startTime
);
dto
.
setEndTime
(
endTime
);
dto
.
setContendId
(
brandId
);
return
ResponseResult
.
success
(
markDataService
.
getContendSummary
(
dto
,
true
));
}
@ApiOperation
(
"移动端传播分析页面"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"brandId"
,
value
=
"竞品品牌ID"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"string"
)
})
@GetMapping
(
"/spread/analyze"
)
public
ResponseResult
getMobileSpreadAnalyze
(
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
Long
endTime
,
@RequestParam
(
value
=
"brandId"
)
String
brandId
)
throws
IOException
{
if
(
null
==
startTime
||
null
==
endTime
)
{
Long
[]
timeRangeMonth
=
commonService
.
getTimeRangeMonth
();
startTime
=
timeRangeMonth
[
0
];
endTime
=
timeRangeMonth
[
1
];
}
return
ResponseResult
.
success
(
markDataService
.
getContendSpreadAnalyze
(
startTime
,
endTime
,
UserThreadLocal
.
getProjectId
(),
brandId
,
3
,
true
));
}
@ApiOperation
(
"移动端首页竞品列表"
)
@GetMapping
(
"/contends"
)
public
ResponseResult
getContends
()
{
return
ResponseResult
.
success
(
projectService
.
getBrands
(
UserThreadLocal
.
getProjectId
(),
false
));
}
}
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileReportController.java
0 → 100644
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
controller
.
mobile
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.ReportSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
/**
* @author sjj
* @version 1.0
* @description 移动端月报界面接口
* @date 2023年3月14日17:27:18
*/
@RestController
@RequestMapping
(
"/mobile/report"
)
@Api
(
tags
=
"移动端项目月报相关信息展示接口"
,
description
=
"实现移动端项目月报相关信息展示功能"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
class
MobileReportController
{
@Resource
(
name
=
"reportServiceImpl"
)
private
ReportService
reportService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
ProjectService
projectService
;
@ApiOperation
(
"月报列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
required
=
false
,
defaultValue
=
"1"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"5"
,
paramType
=
"query"
,
dataType
=
"int"
)
})
@GetMapping
(
"/list"
)
public
ResponseResult
getReportList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"5"
)
int
size
)
{
ReportSearchDTO
dto
=
new
ReportSearchDTO
();
dto
.
setPage
(
page
);
dto
.
setPageSize
(
size
);
dto
.
setType
(
"月报"
);
String
projectName
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
();
PageVO
<
JSONObject
>
reportList
=
reportService
.
findReportList
(
dto
);
reportList
.
getList
().
forEach
(
json
->
{
Long
startTime
=
json
.
getLong
(
"endTime"
);
json
.
put
(
"mobileTitle"
,
projectName
+
Constant
.
ONLY_MONTH_FORMAT
.
format
(
startTime
)
+
"简报"
);
});
return
ResponseResult
.
success
(
reportList
);
}
@ApiOperation
(
"舆情简报-获取月报结果"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"报告ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@GetMapping
(
"/analyze/{id}"
)
public
ResponseResult
getReportAnalyze
(
@PathVariable
String
id
)
{
return
ResponseResult
.
success
(
reportService
.
getMobileReportAnalyze
(
id
,
true
));
}
}
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileSearchController.java
0 → 100644
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
controller
.
mobile
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.service.*
;
import
com.zhiwei.middleware.event.pojo.dto.BrandkbsEventSearchDTO
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.Collections
;
import
java.util.List
;
/**
* @author sjj
* @version 1.0
* @description 移动端搜索展示接口
* @date 2023年3月14日17:30:10
*/
@RestController
@RequestMapping
(
"/mobile/search"
)
@Api
(
tags
=
"移动端搜索展示接口"
,
description
=
"提供移动端搜索相关信息展示"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
class
MobileSearchController
{
@Resource
(
name
=
"channelServiceImpl"
)
private
ChannelService
channelService
;
@Resource
(
name
=
"eventServiceImpl"
)
private
EventService
eventService
;
@Resource
(
name
=
"commonServiceImpl"
)
private
CommonService
commonService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
ProjectService
projectService
;
@Resource
(
name
=
"markDataServiceImpl"
)
private
MarkDataService
markDataService
;
@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
=
"keyword"
,
value
=
"关键字"
,
required
=
false
,
defaultValue
=
""
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"platform"
,
value
=
"平台筛选"
,
required
=
false
,
defaultValue
=
"全部"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"emotion"
,
value
=
"情感倾向"
,
required
=
false
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"int"
)
})
@GetMapping
(
"/channel"
)
public
ResponseResult
searchChannelList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
,
@RequestParam
(
value
=
"platform"
,
defaultValue
=
"全部"
)
String
platform
,
@RequestParam
(
value
=
"emotion"
,
defaultValue
=
"0"
)
int
emotion
)
{
JSONObject
sorter
=
new
JSONObject
();
sorter
.
put
(
"last_time"
,
"descend"
);
return
ResponseResult
.
success
(
channelService
.
getChannelListNew
(
page
,
size
,
keyword
,
Collections
.
singletonList
(
platform
),
Collections
.
singletonList
(
emotion
),
null
,
null
,
sorter
));
}
@ApiOperation
(
"移动端渠道搜索条件"
)
@GetMapping
(
"/channel/criteria"
)
public
ResponseResult
getChannelSearchCriteria
()
{
return
ResponseResult
.
success
(
channelService
.
getChannelSearchCriteria
());
}
@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
=
"emotion"
,
value
=
"情感倾向"
,
required
=
false
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"keyword"
,
value
=
"关键字"
,
required
=
false
,
defaultValue
=
""
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/event"
)
public
ResponseResult
searchEventList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"emotion"
,
defaultValue
=
"0"
)
int
emotion
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
BrandkbsEventSearchDTO
dto
=
new
BrandkbsEventSearchDTO
();
dto
.
setPage
(
page
);
dto
.
setPageSize
(
size
);
if
(
0
!=
emotion
)
{
String
emotionName
=
EmotionEnum
.
state2Name
(
emotion
);
String
linkedGroupId
=
projectService
.
getProjectByContendId
(
UserThreadLocal
.
getProjectId
(),
Constant
.
PRIMARY_CONTEND_ID
).
getBrandLinkedGroupId
();
List
<
MarkerTag
>
tags
=
commonService
.
getQbjcTags
(
linkedGroupId
,
TagField
.
GROUP_NAME
.
is
(
"情感倾向"
));
tags
.
forEach
(
tag
->
{
if
(
tag
.
getName
().
equals
(
emotionName
))
{
dto
.
setEmotions
(
Collections
.
singletonList
(
tag
.
getUniqueId
()));
}
});
}
dto
.
setKeyword
(
keyword
);
return
ResponseResult
.
success
(
eventService
.
getEventListMiddleware
(
dto
));
}
@ApiOperation
(
"移动端关键字搜索稿件列表"
)
@PostMapping
(
"/article"
)
public
ResponseResult
searchArticleList
(
@RequestBody
MarkSearchDTO
markSearchDTO
)
{
return
ResponseResult
.
success
(
markDataService
.
getYuqingMarkList
(
markSearchDTO
));
}
@ApiOperation
(
"移动端稿件搜索条件"
)
@GetMapping
(
"/article/criteria"
)
public
ResponseResult
getArticleCriteria
()
{
return
ResponseResult
.
success
(
markDataService
.
getMobileYuqingMarkCriteria
());
}
}
src/main/java/com/zhiwei/brandkbs2/controller/mobile/MobileUserController.java
0 → 100644
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
controller
.
mobile
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
/**
* @author lxj
* @version 1.0
* @description 移动端用户个人中心接口
* @date 2020/1/13 14:33
*/
@RestController
@RequestMapping
(
"/mobile/user"
)
@Api
(
tags
=
"移动端用户信息接口"
,
description
=
"提供移动端用户信息展示功能"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
class
MobileUserController
extends
BaseController
{
@Resource
(
name
=
"userServiceImpl"
)
private
UserService
userService
;
@Resource
(
name
=
"channelServiceImpl"
)
private
ChannelService
channelService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
ProjectService
projectService
;
@ApiOperation
(
"移动端切换登陆"
)
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@PostMapping
(
"/cutLogin/{projectId}"
)
public
ResponseResult
cutLogin
(
@PathVariable
String
projectId
)
{
String
userId
=
UserThreadLocal
.
getUserId
();
return
ResponseResult
.
success
(
userService
.
mobileCutLogin
(
userId
,
projectId
));
}
@ApiOperation
(
"收藏列表"
)
@GetMapping
(
"/collects"
)
public
ResponseResult
collectList
()
{
// 暂时只返回渠道收藏列表
return
ResponseResult
.
success
(
channelService
.
getCollectList
(
Constant
.
PRIMARY_CONTEND_ID
));
}
@ApiOperation
(
"项目列表"
)
@GetMapping
(
"/projects"
)
public
ResponseResult
projectList
()
{
return
ResponseResult
.
success
(
projectService
.
getUserAllProjects
());
}
}
src/main/java/com/zhiwei/brandkbs2/es/EsQueryTools.java
View file @
6419ab60
...
@@ -94,20 +94,23 @@ public class EsQueryTools {
...
@@ -94,20 +94,23 @@ public class EsQueryTools {
}
}
public
static
BoolQueryBuilder
assembleCacheMapsQuery
(
String
projectId
,
String
linkedGroupId
,
String
contendId
,
List
<
String
>
mediaTypes
)
{
public
static
BoolQueryBuilder
assembleCacheMapsQuery
(
String
projectId
,
String
linkedGroupId
,
String
contendId
,
List
<
String
>
mediaTypes
)
{
BoolQueryBuilder
nestedBoolQueryBuilder
=
QueryBuilders
.
boolQuery
();
return
assembleCacheMapsQuery
(
projectId
,
linkedGroupId
,
contendId
,
mediaTypes
,
null
);
}
public
static
BoolQueryBuilder
assembleCacheMapsQuery
(
String
projectId
,
String
linkedGroupId
,
String
contendId
,
List
<
String
>
mediaTypes
,
Integer
channelEmotion
)
{
BoolQueryBuilder
boolQueryBuilder
=
QueryBuilders
.
boolQuery
();
String
key
=
concat
(
projectId
,
contendId
);
String
key
=
concat
(
projectId
,
contendId
);
TermQueryBuilder
mustQuery
=
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.key.keyword"
,
key
);
BoolQueryBuilder
nestedBoolBuilder
=
QueryBuilders
.
boolQuery
();
if
(
CollectionUtils
.
isEmpty
(
mediaTypes
))
{
// 必要条件
// 不组装mediaTypes的情况
nestedBoolBuilder
.
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.key.keyword"
,
key
));
nestedBoolQueryBuilder
.
must
(
cacheMapsNestedQuery
(
mustQuery
));
// nested字段
}
else
{
if
(
null
!=
channelEmotion
)
{
// BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
nestedBoolBuilder
.
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.channel_emotion"
,
channelEmotion
));
// mediaTypes.forEach(e -> {
}
// BoolQueryBuilder mediaTypeQueryBuilder = QueryBuilders.boolQuery();
boolQueryBuilder
.
must
(
cacheMapsNestedQuery
(
nestedBoolBuilder
));
// mediaTypeQueryBuilder.must(QueryBuilders.termQuery("brandkbs_cache_maps.channel_type.keyword", e));
// 其他字段
// mediaTypeQueryBuilder.must(mustQuery);
if
(
CollectionUtils
.
isNotEmpty
(
mediaTypes
))
{
// boolQueryBuilder.should(cacheMapsNestedQuery(mediaTypeQueryBuilder));
// });
BoolQueryBuilder
mediaTypesBoolQueryBuilder
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
mediaTypesBoolQueryBuilder
=
QueryBuilders
.
boolQuery
();
for
(
String
mediaType
:
mediaTypes
)
{
for
(
String
mediaType
:
mediaTypes
)
{
BoolQueryBuilder
mediaTypeBoolQueryBuilder
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
mediaTypeBoolQueryBuilder
=
QueryBuilders
.
boolQuery
();
...
@@ -121,10 +124,9 @@ public class EsQueryTools {
...
@@ -121,10 +124,9 @@ public class EsQueryTools {
}
}
mediaTypesBoolQueryBuilder
.
should
(
mediaTypeBoolQueryBuilder
);
mediaTypesBoolQueryBuilder
.
should
(
mediaTypeBoolQueryBuilder
);
}
}
nestedBoolQueryBuilder
.
must
(
cacheMapsNestedQuery
(
mustQuery
));
boolQueryBuilder
.
must
(
mediaTypesBoolQueryBuilder
);
nestedBoolQueryBuilder
.
must
(
mediaTypesBoolQueryBuilder
);
}
}
return
nestedB
oolQueryBuilder
;
return
b
oolQueryBuilder
;
}
}
public
static
BoolQueryBuilder
assembleCacheMapsQueryWithProject
(
String
projectId
,
List
<
String
>
mediaTypes
)
{
public
static
BoolQueryBuilder
assembleCacheMapsQueryWithProject
(
String
projectId
,
List
<
String
>
mediaTypes
)
{
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/UserRole.java
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
pojo
;
package
com
.
zhiwei
.
brandkbs2
.
pojo
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
...
@@ -23,7 +24,7 @@ import java.util.Date;
...
@@ -23,7 +24,7 @@ import java.util.Date;
public
class
UserRole
{
public
class
UserRole
{
// 默认绑定阿里项目
// 默认绑定阿里项目
private
final
static
String
DEFAULT_PROJECT_ID
=
"62beadd1bbf8eb20f96d2f1c"
;
private
final
static
String
DEFAULT_PROJECT_ID
=
Constant
.
DEFAULT_PROJECT_ID
;
// 默认导出1000
// 默认导出1000
private
final
static
int
DEFAULT_EXPORT_LIMIT
=
1000
;
private
final
static
int
DEFAULT_EXPORT_LIMIT
=
1000
;
// 默认角色ID
// 默认角色ID
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/dto/MarkSearchDTO.java
View file @
6419ab60
...
@@ -82,6 +82,12 @@ public class MarkSearchDTO {
...
@@ -82,6 +82,12 @@ public class MarkSearchDTO {
private
List
<
String
>
tags
;
private
List
<
String
>
tags
;
/**
/**
* 渠道倾向
*/
@ApiModelProperty
(
value
=
"渠道倾向"
)
private
Integer
channelEmotion
;
/**
* 自定义标签筛选
* 自定义标签筛选
*/
*/
@ApiModelProperty
(
value
=
"自定义标签筛选"
)
@ApiModelProperty
(
value
=
"自定义标签筛选"
)
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/dto/UnionDTO.java
0 → 100644
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.ToString
;
/**
* @author sjj
* @version 1.0
* @description 微信关联解密参数
* @date 2023年3月15日09:20:54
*/
@Data
@ToString
@ApiModel
(
"微信关联解密参数"
)
public
class
UnionDTO
{
/**
* 完整用户信息的加密数据
*/
@ApiModelProperty
(
"完整用户信息的加密数据"
)
private
String
encryptedData
;
/**
* 加密算法的初始向量
*/
@ApiModelProperty
(
"加密算法的初始向量"
)
private
String
iv
;
}
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ChannelVO.java
View file @
6419ab60
...
@@ -19,6 +19,9 @@ public class ChannelVO {
...
@@ -19,6 +19,9 @@ public class ChannelVO {
@ApiModelProperty
(
value
=
"id"
)
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
private
String
id
;
@ApiModelProperty
(
value
=
"平台"
)
private
String
platform
;
@ApiModelProperty
(
value
=
"渠道"
)
@ApiModelProperty
(
value
=
"渠道"
)
private
String
source
;
private
String
source
;
...
@@ -49,12 +52,17 @@ public class ChannelVO {
...
@@ -49,12 +52,17 @@ public class ChannelVO {
@ApiModelProperty
(
value
=
"最近发文链接"
)
@ApiModelProperty
(
value
=
"最近发文链接"
)
private
JSONObject
lastArticle
;
private
JSONObject
lastArticle
;
@ApiModelProperty
(
value
=
"渠道标签"
)
private
String
channelTag
;
@Deprecated
public
static
ChannelVO
createFromChannelInfo
(
JSONObject
channelInfo
,
String
projectId
)
{
public
static
ChannelVO
createFromChannelInfo
(
JSONObject
channelInfo
,
String
projectId
)
{
Channel
channel
=
(
Channel
)
channelInfo
.
get
(
"channel"
);
Channel
channel
=
(
Channel
)
channelInfo
.
get
(
"channel"
);
JSONObject
lastArticle
=
channelInfo
.
getJSONObject
(
"lastArticle"
);
JSONObject
lastArticle
=
channelInfo
.
getJSONObject
(
"lastArticle"
);
return
createFromChannelVO
(
channel
,
projectId
,
lastArticle
);
return
createFromChannelVO
(
channel
,
projectId
,
lastArticle
);
}
}
@Deprecated
public
static
ChannelVO
createFromChannelVO
(
Channel
channel
,
String
projectId
,
JSONObject
lastArticle
)
{
public
static
ChannelVO
createFromChannelVO
(
Channel
channel
,
String
projectId
,
JSONObject
lastArticle
)
{
ChannelVO
channelVO
=
new
ChannelVO
();
ChannelVO
channelVO
=
new
ChannelVO
();
channelVO
.
setId
(
channel
.
getId
());
channelVO
.
setId
(
channel
.
getId
());
...
@@ -78,6 +86,7 @@ public class ChannelVO {
...
@@ -78,6 +86,7 @@ public class ChannelVO {
JSONObject
json
=
new
JSONObject
(
map
);
JSONObject
json
=
new
JSONObject
(
map
);
ChannelVO
channelVO
=
new
ChannelVO
();
ChannelVO
channelVO
=
new
ChannelVO
();
channelVO
.
setId
(
json
.
getString
(
"id"
));
channelVO
.
setId
(
json
.
getString
(
"id"
));
channelVO
.
setPlatform
(
json
.
getString
(
"platform"
));
channelVO
.
setSource
(
json
.
getString
(
"source"
));
channelVO
.
setSource
(
json
.
getString
(
"source"
));
channelVO
.
setRealSource
(
json
.
getString
(
"real_source"
));
channelVO
.
setRealSource
(
json
.
getString
(
"real_source"
));
channelVO
.
setEmotion
(
ChannelEmotion
.
getNameFromState
(
json
.
getInteger
(
"emotion"
)));
channelVO
.
setEmotion
(
ChannelEmotion
.
getNameFromState
(
json
.
getInteger
(
"emotion"
)));
...
@@ -96,6 +105,7 @@ public class ChannelVO {
...
@@ -96,6 +105,7 @@ public class ChannelVO {
if
(
null
!=
influence
&&
influence
!=
-
1
)
{
if
(
null
!=
influence
&&
influence
!=
-
1
)
{
channelVO
.
setInfluence
(
new
BigDecimal
(
influence
).
setScale
(
2
,
RoundingMode
.
UP
).
doubleValue
());
channelVO
.
setInfluence
(
new
BigDecimal
(
influence
).
setScale
(
2
,
RoundingMode
.
UP
).
doubleValue
());
}
}
channelVO
.
setChannelTag
(
GlobalPojo
.
CHANNEL_TAGS
.
get
(
channelVO
.
getSource
()));
return
channelVO
;
return
channelVO
;
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/vo/MobileLoginVO.java
0 → 100644
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
vo
;
import
com.zhiwei.brandkbs2.pojo.dto.UnionDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.ToString
;
/**
* @author sjj
* @version V1.0
* @description 移动端登陆用户实体
* @date 2023年3月15日09:21:02
**/
@Data
@ToString
@ApiModel
(
"移动端登陆用户实体"
)
public
class
MobileLoginVO
{
/**
* 账号
*/
@ApiModelProperty
(
"手机号"
)
private
Long
phoneNumber
;
/**
* 项目名
*/
@ApiModelProperty
(
"小程序临时code"
)
private
String
code
;
/**
* 微信关联解密参数
*/
@ApiModelProperty
(
"微信关联解密参数"
)
private
UnionDTO
union
;
}
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
View file @
6419ab60
...
@@ -268,4 +268,6 @@ public interface ChannelService {
...
@@ -268,4 +268,6 @@ public interface ChannelService {
PageVO
<
ChannelVO
>
getChannelListNew
(
int
page
,
int
pageSize
,
String
keyword
,
List
<
String
>
platforms
,
List
<
Integer
>
emotions
,
List
<
String
>
mediaTypes
,
PageVO
<
ChannelVO
>
getChannelListNew
(
int
page
,
int
pageSize
,
String
keyword
,
List
<
String
>
platforms
,
List
<
Integer
>
emotions
,
List
<
String
>
mediaTypes
,
Integer
[]
articlesCount
,
JSONObject
sorter
);
Integer
[]
articlesCount
,
JSONObject
sorter
);
JSONObject
getMobileSpreadingTend
(
String
channelId
,
String
type
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/IndexService.java
View file @
6419ab60
...
@@ -72,4 +72,13 @@ public interface IndexService {
...
@@ -72,4 +72,13 @@ public interface IndexService {
*/
*/
JSONObject
getSpreadingTend
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
contendId
,
boolean
cache
);
JSONObject
getSpreadingTend
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
contendId
,
boolean
cache
);
/**
* 获取主品牌整体指标
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return 主品牌整体指标
*/
JSONObject
getMobileWholeCriteria
(
Long
startTime
,
Long
endTime
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
View file @
6419ab60
...
@@ -65,6 +65,11 @@ public interface MarkDataService {
...
@@ -65,6 +65,11 @@ public interface MarkDataService {
JSONObject
getYuqingMarkCriteria
(
String
linkedGroup
);
JSONObject
getYuqingMarkCriteria
(
String
linkedGroup
);
/**
/**
* 舆情标注数据搜索条件
*/
JSONObject
getMobileYuqingMarkCriteria
();
/**
* 舆情标注数据提要信息
* 舆情标注数据提要信息
*
*
* @param startTime 开始时间
* @param startTime 开始时间
...
@@ -112,6 +117,16 @@ public interface MarkDataService {
...
@@ -112,6 +117,16 @@ public interface MarkDataService {
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
);
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
);
/**
/**
* 获取舆情标注数据舆情平台分布
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param emotion 情感倾向筛选
* @return 获取舆情标注数据舆情平台分布
*/
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
String
emotion
,
boolean
cache
);
/**
* 获取舆情标注数据舆情高频词分布
* 获取舆情标注数据舆情高频词分布
*
*
* @param startTime 开始时间
* @param startTime 开始时间
...
...
src/main/java/com/zhiwei/brandkbs2/service/ReportService.java
View file @
6419ab60
...
@@ -90,6 +90,8 @@ public interface ReportService {
...
@@ -90,6 +90,8 @@ public interface ReportService {
*/
*/
JSONObject
getPcReportAnalyze
(
Report
report
,
boolean
cache
);
JSONObject
getPcReportAnalyze
(
Report
report
,
boolean
cache
);
JSONObject
getMobileReportAnalyze
(
String
id
,
boolean
cache
);
/**
/**
* 分页查询报告列表
* 分页查询报告列表
*
*
...
...
src/main/java/com/zhiwei/brandkbs2/service/UserCenterService.java
View file @
6419ab60
...
@@ -32,4 +32,18 @@ public interface UserCenterService {
...
@@ -32,4 +32,18 @@ public interface UserCenterService {
*/
*/
CenterUser
registerUser
(
long
phone
,
String
password
,
String
nickName
);
CenterUser
registerUser
(
long
phone
,
String
password
,
String
nickName
);
/**
* ticket绑定用户信息
* @param ticket
* @param userId
* @return
*/
boolean
bindUser
(
String
ticket
,
String
userId
);
/**
* 添加产品开通权限
* @return
*/
boolean
addProduct
(
String
userId
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/UserService.java
View file @
6419ab60
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
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.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.MobileLoginVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -118,4 +119,19 @@ public interface UserService {
...
@@ -118,4 +119,19 @@ public interface UserService {
void
resetBind
(
String
username
);
void
resetBind
(
String
username
);
/**
* 移动端用户登录
* @param loginVO
* @return
*/
ResponseResult
mobileLogin
(
MobileLoginVO
loginVO
);
/**
* 移动端切换用户
* @param userId
* @param projectId
* @return
*/
ResponseResult
mobileCutLogin
(
String
userId
,
String
projectId
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
6419ab60
...
@@ -578,6 +578,11 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -578,6 +578,11 @@ public class ChannelServiceImpl implements ChannelService {
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
channel
.
getId
());
json
.
put
(
"id"
,
channel
.
getId
());
json
.
put
(
"source"
,
channel
.
getSource
());
json
.
put
(
"source"
,
channel
.
getSource
());
json
.
put
(
"platform"
,
channel
.
getPlatform
());
json
.
put
(
"emotion"
,
channel
.
getEmotion
());
json
.
put
(
"avatarUrl"
,
channel
.
getAvatarUrl
());
json
.
put
(
"emotionRank"
,
getChannelEmotionRank
(
channel
.
getEmotionIndex
(),
channel
.
getEmotion
()));
json
.
put
(
"channelTag"
,
channelTagDao
.
getTagByChannelName
(
channel
.
getSource
()));
return
json
;
return
json
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
...
@@ -603,6 +608,7 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -603,6 +608,7 @@ public class ChannelServiceImpl implements ChannelService {
if
(
Boolean
.
TRUE
.
equals
(
channel
.
getIsCollect
()))
{
if
(
Boolean
.
TRUE
.
equals
(
channel
.
getIsCollect
()))
{
jsonObject
.
put
(
"collectTime"
,
channel
.
getCollectTime
());
jsonObject
.
put
(
"collectTime"
,
channel
.
getCollectTime
());
}
}
jsonObject
.
put
(
"lastTime"
,
channel
.
getLastTime
());
// 渠道倾向变化 TODO
// 渠道倾向变化 TODO
return
jsonObject
;
return
jsonObject
;
}
}
...
@@ -1028,6 +1034,60 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -1028,6 +1034,60 @@ public class ChannelServiceImpl implements ChannelService {
return
null
;
return
null
;
}
}
@Override
public
JSONObject
getMobileSpreadingTend
(
String
channelId
,
String
type
)
{
Long
[]
timeRangeWeek
=
commonService
.
getTimeRangeMonth
();
Long
startTime
=
timeRangeWeek
[
0
];
Long
endTime
=
timeRangeWeek
[
1
];
String
contendId
=
Constant
.
PRIMARY_CONTEND_ID
;
JSONObject
result
=
getSpreadingTend
(
channelId
,
type
,
contendId
,
startTime
,
endTime
);
if
(
"稿件"
.
equals
(
type
))
{
List
<
ChannelIndex
.
Article
>
dataList
=
getSourceContendMap
(
channelId
,
Collections
.
singletonList
(
contendId
),
startTime
,
endTime
).
get
(
contendId
);
int
dataSize
=
dataList
.
size
();
long
positiveArticle
=
dataList
.
stream
().
filter
(
data
->
EmotionEnum
.
POSITIVE
.
getState
()
==
data
.
getEmotion
()).
count
();
long
negativeArticle
=
dataList
.
stream
().
filter
(
data
->
EmotionEnum
.
NEGATIVE
.
getState
()
==
data
.
getEmotion
()).
count
();
result
.
put
(
"positiveArticle"
,
positiveArticle
);
result
.
put
(
"positiveArticleProportion"
,
dataSize
==
0
?
0
:
positiveArticle
*
1.0
/
dataSize
);
result
.
put
(
"negativeArticle"
,
negativeArticle
);
result
.
put
(
"negativeArticleProportion"
,
dataSize
==
0
?
0
:
negativeArticle
*
1.0
/
dataSize
);
List
<
CompletableFuture
<
JSONObject
>>
futureList
=
dataList
.
stream
().
limit
(
5
).
map
(
normalData
->
CompletableFuture
.
supplyAsync
(()
->
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"emotion"
,
normalData
.
getEmotion
());
json
.
put
(
"time"
,
normalData
.
getTime
());
String
[]
titleUrl
=
getTitleAndUrlById
(
normalData
.
getId
());
json
.
put
(
"title"
,
titleUrl
[
0
]);
json
.
put
(
"url"
,
titleUrl
[
1
]);
return
json
;
},
esSearchExecutor
)).
collect
(
Collectors
.
toList
());
CompletableFuture
.
allOf
(
futureList
.
toArray
(
new
CompletableFuture
[
0
])).
join
();
result
.
put
(
"recentlyArticles"
,
futureList
.
stream
().
map
(
CompletableFuture:
:
join
).
collect
(
Collectors
.
toList
()));
}
else
if
(
"事件"
.
equals
(
type
))
{
Map
<
Long
,
List
<
Event
>>
eventMap
=
eventMiddlewareDao
.
getEventDay
(
new
ChannelIndex
(
channelDao
.
findOneById
(
channelId
),
contendId
).
getFid
(),
startTime
,
endTime
);
List
<
Event
>
events
=
new
ArrayList
<>();
eventMap
.
entrySet
().
stream
().
sorted
(
Comparator
.
comparingLong
(
Map
.
Entry
::
getKey
)).
forEach
(
entry
->{
events
.
addAll
(
entry
.
getValue
());
});
int
eventSize
=
events
.
size
();
result
.
put
(
"recentlyEvent"
,
events
.
stream
().
limit
(
5
).
map
(
event
->
{
JSONObject
eventJson
=
new
JSONObject
();
eventJson
.
put
(
"id"
,
event
.
getId
());
eventJson
.
put
(
"title"
,
event
.
getName
());
eventJson
.
put
(
"emotion"
,
event
.
getEmotionEventTag
().
getName
());
eventJson
.
put
(
"influence"
,
event
.
getInfluence
());
return
eventJson
;
}).
collect
(
Collectors
.
toList
()));
long
positiveEvent
=
events
.
stream
().
filter
(
event
->
EmotionEnum
.
POSITIVE
.
getName
().
equals
(
event
.
getEmotionEventTag
().
getName
())).
count
();
long
negativeEvent
=
events
.
stream
().
filter
(
event
->
EmotionEnum
.
NEGATIVE
.
getName
().
equals
(
event
.
getEmotionEventTag
().
getName
())).
count
();
result
.
put
(
"positiveEvent"
,
positiveEvent
);
result
.
put
(
"positiveEventProportion"
,
eventSize
==
0
?
0
:
positiveEvent
*
1.0
/
eventSize
);
result
.
put
(
"negativeEvent"
,
negativeEvent
);
result
.
put
(
"negativeEventProportion"
,
eventSize
==
0
?
0
:
negativeEvent
*
1.0
/
eventSize
);
}
return
result
;
}
private
BoolQueryBuilder
getChannelListQuery
(
String
projectId
,
String
contendId
,
String
keyword
,
private
BoolQueryBuilder
getChannelListQuery
(
String
projectId
,
String
contendId
,
String
keyword
,
List
<
String
>
platforms
,
List
<
Integer
>
emotions
,
List
<
String
>
mediaTypes
,
Integer
[]
articlesCount
)
{
List
<
String
>
platforms
,
List
<
Integer
>
emotions
,
List
<
String
>
mediaTypes
,
Integer
[]
articlesCount
)
{
BoolQueryBuilder
postFilter
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
postFilter
=
QueryBuilders
.
boolQuery
();
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/IndexServiceImpl.java
View file @
6419ab60
...
@@ -13,21 +13,18 @@ import com.zhiwei.brandkbs2.exception.ExceptionCast;
...
@@ -13,21 +13,18 @@ import com.zhiwei.brandkbs2.exception.ExceptionCast;
import
com.zhiwei.brandkbs2.listener.ApplicationProjectListener
;
import
com.zhiwei.brandkbs2.listener.ApplicationProjectListener
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.pojo.BaseMap
;
import
com.zhiwei.brandkbs2.pojo.BaseMap
;
import
com.zhiwei.brandkbs2.pojo.Event
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.IndexService
;
import
com.zhiwei.brandkbs2.service.IndexService
;
import
com.zhiwei.brandkbs2.service.MarkDataService
;
import
com.zhiwei.brandkbs2.service.MarkDataService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.RedisUtil
;
import
com.zhiwei.brandkbs2.util.RedisUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.event.core.EventClient
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.joda.time.Period
;
import
org.joda.time.Period
;
import
org.joda.time.PeriodType
;
import
org.joda.time.PeriodType
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -302,6 +299,34 @@ public class IndexServiceImpl implements IndexService {
...
@@ -302,6 +299,34 @@ public class IndexServiceImpl implements IndexService {
return
resJson
;
return
resJson
;
}
}
@Override
public
JSONObject
getMobileWholeCriteria
(
Long
startTime
,
Long
endTime
)
{
JSONObject
result
=
new
JSONObject
();
JSONObject
yuQingResult
=
getYuqingAmount
(
startTime
,
endTime
,
true
);
JSONObject
reputationResult
=
getReputation
(
startTime
,
endTime
,
true
);
JSONObject
eventResult
=
getEventAmount
(
startTime
,
endTime
,
true
);
List
<
JSONObject
>
platformResult
=
getPlatformInfo
(
startTime
,
endTime
,
true
);
result
.
put
(
"startTime"
,
yuQingResult
.
getLongValue
(
"startTime"
));
result
.
put
(
"endTime"
,
yuQingResult
.
getLongValue
(
"endTime"
));
JSONObject
yuQing
=
new
JSONObject
();
yuQing
.
put
(
"avgTotal"
,
yuQingResult
.
getIntValue
(
"avgTotal"
));
yuQing
.
put
(
"compare"
,
yuQingResult
.
getDoubleValue
(
"compare"
));
yuQing
.
put
(
"yuqingTotal"
,
yuQingResult
.
getIntValue
(
"yuqingTotal"
));
result
.
put
(
"yuqing"
,
yuQing
);
JSONObject
reputation
=
new
JSONObject
();
reputation
.
put
(
"avgReputation"
,
reputationResult
.
getDoubleValue
(
"avgPosPro"
));
reputation
.
put
(
"compare"
,
reputationResult
.
getDoubleValue
(
"compare"
));
reputation
.
put
(
"reputation"
,
reputationResult
.
getDoubleValue
(
"posPro"
));
result
.
put
(
"reputation"
,
reputation
);
JSONObject
event
=
new
JSONObject
();
event
.
put
(
"avgEventTotal"
,
eventResult
.
getIntValue
(
"avgEventTotal"
));
event
.
put
(
"compare"
,
eventResult
.
getDoubleValue
(
"compare"
));
event
.
put
(
"eventTotal"
,
eventResult
.
getIntValue
(
"eventTotal"
));
result
.
put
(
"event"
,
event
);
result
.
put
(
"platform"
,
platformResult
.
stream
().
max
(
Comparator
.
comparing
(
json
->
json
.
getIntValue
(
"num"
))).
get
());
return
result
;
}
public
List
<
JSONObject
>
getPlatformProportionWithPlatform
(
Long
startTime
,
Long
endTime
,
String
emotion
,
String
projectId
,
String
contendId
,
long
normalCount
)
{
public
List
<
JSONObject
>
getPlatformProportionWithPlatform
(
Long
startTime
,
Long
endTime
,
String
emotion
,
String
projectId
,
String
contendId
,
long
normalCount
)
{
List
<
String
>
platformIds
=
GlobalPojo
.
PLATFORMS
.
stream
().
map
(
MessagePlatform:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
platformIds
=
GlobalPojo
.
PLATFORMS
.
stream
().
map
(
MessagePlatform:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
JSONObject
>
resultList
=
new
ArrayList
<>(
platformIds
.
size
());
List
<
JSONObject
>
resultList
=
new
ArrayList
<>(
platformIds
.
size
());
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
6419ab60
...
@@ -351,6 +351,39 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -351,6 +351,39 @@ public class MarkDataServiceImpl implements MarkDataService {
}
}
@Override
@Override
public
JSONObject
getMobileYuqingMarkCriteria
()
{
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
JSONObject
result
=
new
JSONObject
();
JSONObject
allFiled
=
new
JSONObject
();
allFiled
.
put
(
"id"
,
null
);
allFiled
.
put
(
"name"
,
"全部"
);
List
<
JSONObject
>
platformList
=
commonService
.
getQbjcPlatform
(
"id"
,
"name"
);
platformList
.
add
(
0
,
allFiled
);
// 平台
result
.
put
(
"platformList"
,
platformList
);
// 情感标签
List
<
JSONObject
>
emotionList
=
commonService
.
getEmotionTagsWithSort
(
projectId
,
linkedGroupId
).
stream
().
map
(
markerTag
->
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
markerTag
.
getUniqueId
());
json
.
put
(
"name"
,
markerTag
.
getName
());
return
json
;
}).
collect
(
Collectors
.
toList
());
emotionList
.
add
(
0
,
allFiled
);
result
.
put
(
"emotionList"
,
emotionList
);
// 渠道情感倾向
List
<
JSONObject
>
channelEmotionList
=
Arrays
.
stream
(
ChannelEmotion
.
values
()).
filter
(
emotion
->
emotion
!=
ChannelEmotion
.
UNDEFINED
).
map
(
emotion
->
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
emotion
.
getState
());
json
.
put
(
"name"
,
emotion
.
getName
());
return
json
;
}).
collect
(
Collectors
.
toList
());
channelEmotionList
.
add
(
0
,
allFiled
);
result
.
put
(
"channelEmotionList"
,
channelEmotionList
);
return
result
;
}
@Override
public
JSONObject
getAnalyzeSummary
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
public
JSONObject
getAnalyzeSummary
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
try
{
try
{
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
...
@@ -477,15 +510,19 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -477,15 +510,19 @@ public class MarkDataServiceImpl implements MarkDataService {
@Override
@Override
public
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
public
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
boolean
cache
)
{
return
getMarkPlatformProportion
(
startTime
,
endTime
,
null
,
cache
);
}
@Override
public
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
String
emotion
,
boolean
cache
)
{
List
<
JSONObject
>
res
=
null
;
List
<
JSONObject
>
res
=
null
;
try
{
try
{
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
Long
[]
timeRange
=
Tools
.
formatTimeRange
(
startTime
,
endTime
);
startTime
=
timeRange
[
0
];
startTime
=
timeRange
[
0
];
endTime
=
timeRange
[
1
];
endTime
=
timeRange
[
1
];
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
// 舆情库默认contendId为0
// 舆情库默认contendId为0
res
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
Constant
.
PRIMARY_CONTEND_ID
,
cache
);
res
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
Constant
.
PRIMARY_CONTEND_ID
,
emotion
,
cache
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
ExceptionCast
.
cast
(
CommonCodeEnum
.
FAIL
,
"es查询异常"
,
e
);
ExceptionCast
.
cast
(
CommonCodeEnum
.
FAIL
,
"es查询异常"
,
e
);
}
}
...
@@ -551,10 +588,10 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -551,10 +588,10 @@ public class MarkDataServiceImpl implements MarkDataService {
markSearchDTO
.
setStartTime
(
DateUtils
.
addDays
(
now
,
-
29
).
getTime
());
markSearchDTO
.
setStartTime
(
DateUtils
.
addDays
(
now
,
-
29
).
getTime
());
}
}
// 页码默认
// 页码默认
if
(
markSearchDTO
.
getPage
()
<
1
)
{
if
(
null
==
markSearchDTO
.
getPage
()
||
markSearchDTO
.
getPage
()
<
1
)
{
markSearchDTO
.
setPage
(
1
);
markSearchDTO
.
setPage
(
1
);
}
}
if
(
markSearchDTO
.
getPageSize
()
<=
0
||
markSearchDTO
.
getPageSize
()
>
10000
)
{
if
(
null
==
markSearchDTO
.
getPageSize
()
||
markSearchDTO
.
getPageSize
()
<=
0
||
markSearchDTO
.
getPageSize
()
>
10000
)
{
markSearchDTO
.
setPageSize
(
20
);
markSearchDTO
.
setPageSize
(
20
);
}
}
// 排序默认
// 排序默认
...
@@ -580,7 +617,8 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -580,7 +617,8 @@ public class MarkDataServiceImpl implements MarkDataService {
String
contendId
=
dto
.
getContendId
();
String
contendId
=
dto
.
getContendId
();
// PostFilter 后置过滤器
// PostFilter 后置过滤器
// BoolQueryBuilder postFilter = projectLinkedGroupQuery(projectId, linkedGroupId);
// BoolQueryBuilder postFilter = projectLinkedGroupQuery(projectId, linkedGroupId);
BoolQueryBuilder
postFilter
=
EsQueryTools
.
assembleCacheMapsQuery
(
projectId
,
linkedGroupId
,
contendId
,
dto
.
getMediaTypes
());
// 新增channelEmotion
BoolQueryBuilder
postFilter
=
EsQueryTools
.
assembleCacheMapsQuery
(
projectId
,
linkedGroupId
,
contendId
,
dto
.
getMediaTypes
(),
dto
.
getChannelEmotion
());
// time
// time
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
dto
.
getTimeType
()).
gte
(
dto
.
getStartTime
()).
lt
(
dto
.
getEndTime
()));
postFilter
.
must
(
QueryBuilders
.
rangeQuery
(
dto
.
getTimeType
()).
gte
(
dto
.
getStartTime
()).
lt
(
dto
.
getEndTime
()));
// platform
// platform
...
@@ -1754,14 +1792,14 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -1754,14 +1792,14 @@ public class MarkDataServiceImpl implements MarkDataService {
});
});
}
}
private
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
linkedGroupId
,
String
contendId
,
boolean
cache
)
throws
IOException
{
private
List
<
JSONObject
>
getMarkPlatformProportion
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
contendId
,
String
emotion
,
boolean
cache
)
throws
IOException
{
String
redisKey
=
RedisKeyPrefix
.
MARK_PLATFORM_PROPORTION
+
Tools
.
concat
(
projectId
,
contendId
,
startTime
,
endTime
);
String
redisKey
=
RedisKeyPrefix
.
MARK_PLATFORM_PROPORTION
+
Tools
.
concat
(
projectId
,
contendId
,
startTime
,
endTime
);
String
resultStr
;
String
resultStr
;
if
(
cache
&&
StringUtils
.
isNotEmpty
(
resultStr
=
redisUtil
.
get
(
redisKey
)))
{
if
(
cache
&&
StringUtils
.
isNotEmpty
(
resultStr
=
redisUtil
.
get
(
redisKey
)))
{
return
JSON
.
parseArray
(
resultStr
,
JSONObject
.
class
);
return
JSON
.
parseArray
(
resultStr
,
JSONObject
.
class
);
}
}
List
<
JSONObject
>
platformList
=
commonService
.
getQbjcPlatform
(
"id"
,
"name"
);
List
<
JSONObject
>
platformList
=
commonService
.
getQbjcPlatform
(
"id"
,
"name"
);
List
<
JSONObject
>
platformsCount
=
getPlatformsCount
(
startTime
,
endTime
,
null
,
null
,
projectId
,
linkedGroupId
,
contendId
,
platformList
);
List
<
JSONObject
>
platformsCount
=
getPlatformsCount
(
startTime
,
endTime
,
null
,
null
,
projectId
,
emotion
,
contendId
,
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"
,
0
==
articlesCount
?
0
:
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
());
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
resultList
));
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
resultList
));
...
@@ -1779,20 +1817,23 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -1779,20 +1817,23 @@ public class MarkDataServiceImpl implements MarkDataService {
* @param platformList 平台集合
* @param platformList 平台集合
* @return 所有平台稿件数量信息
* @return 所有平台稿件数量信息
*/
*/
private
List
<
JSONObject
>
getPlatformsCount
(
Long
startTime
,
Long
endTime
,
String
keyword
,
String
searchField
,
String
projectId
,
String
linkedGroupId
,
String
contendId
,
List
<
JSONObject
>
platformList
)
throws
IOException
{
private
List
<
JSONObject
>
getPlatformsCount
(
Long
startTime
,
Long
endTime
,
String
keyword
,
String
searchField
,
String
projectId
,
String
emotion
,
String
contendId
,
List
<
JSONObject
>
platformList
)
throws
IOException
{
// 获取索引
// 获取索引
String
[]
indexes
=
esClientDao
.
getIndexes
();
String
[]
indexes
=
esClientDao
.
getIndexes
();
// 聚合请求
// 聚合请求
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"count"
).
field
(
"platform_id"
).
order
(
BucketOrder
.
count
(
false
)).
size
(
100
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"count"
).
field
(
"platform_id"
).
order
(
BucketOrder
.
count
(
false
)).
size
(
100
);
// query
// query
BoolQueryBuilder
query
=
projectLinkedGroupContendIdQuery
(
projectId
,
linkedGroupId
,
contendId
);
BoolQueryBuilder
query
=
projectLinkedGroupContendIdQuery
(
projectId
,
null
,
contendId
);
// 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
));
}
}
query
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
query
.
must
(
QueryBuilders
.
rangeQuery
(
"time"
).
gte
(
startTime
).
lt
(
endTime
));
if
(
null
!=
emotion
&&
!
Objects
.
equals
(
emotion
,
EmotionEnum
.
ALL
.
getName
()))
{
query
.
must
(
QueryBuilders
.
termQuery
(
"brandkbs_mark_cache_maps.name.keyword"
,
emotion
));
}
List
<
JSONObject
>
platformResultList
=
new
ArrayList
<>(
platformList
.
size
());
List
<
JSONObject
>
platformResultList
=
new
ArrayList
<>(
platformList
.
size
());
SearchResponse
searchResponse
=
esClientDao
.
searchResponse
(
indexes
,
null
,
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
();
...
@@ -1838,7 +1879,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -1838,7 +1879,7 @@ public class MarkDataServiceImpl implements MarkDataService {
}
}
}
}
}
}
long
total
=
emotionMap
.
values
().
stream
().
mapToInt
(
AtomicInteger:
:
get
AndIncrement
).
sum
();
long
total
=
emotionMap
.
values
().
stream
().
mapToInt
(
AtomicInteger:
:
get
).
sum
();
channelEmotionResult
.
put
(
"positivePercent"
,
total
==
0
?
0
:
(
double
)
emotionMap
.
get
(
ChannelEmotion
.
POSITIVE
.
getState
()).
get
()
/
total
);
channelEmotionResult
.
put
(
"positivePercent"
,
total
==
0
?
0
:
(
double
)
emotionMap
.
get
(
ChannelEmotion
.
POSITIVE
.
getState
()).
get
()
/
total
);
channelEmotionResult
.
put
(
"negativePercent"
,
total
==
0
?
0
:
(
double
)
emotionMap
.
get
(
ChannelEmotion
.
NEGATIVE
.
getState
()).
get
()
/
total
);
channelEmotionResult
.
put
(
"negativePercent"
,
total
==
0
?
0
:
(
double
)
emotionMap
.
get
(
ChannelEmotion
.
NEGATIVE
.
getState
()).
get
()
/
total
);
channelEmotionResult
.
put
(
"neutralPercent"
,
total
==
0
?
0
:
(
double
)
emotionMap
.
get
(
ChannelEmotion
.
NEUTRAL
.
getState
()).
get
()
/
total
);
channelEmotionResult
.
put
(
"neutralPercent"
,
total
==
0
?
0
:
(
double
)
emotionMap
.
get
(
ChannelEmotion
.
NEUTRAL
.
getState
()).
get
()
/
total
);
...
@@ -1888,9 +1929,6 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -1888,9 +1929,6 @@ public class MarkDataServiceImpl implements MarkDataService {
}
}
public
BoolQueryBuilder
projectLinkedGroupContendIdQuery
(
String
projectId
,
String
linkedGroupId
,
String
contendId
)
{
public
BoolQueryBuilder
projectLinkedGroupContendIdQuery
(
String
projectId
,
String
linkedGroupId
,
String
contendId
)
{
if
(
null
==
linkedGroupId
)
{
linkedGroupId
=
projectService
.
getProjectByContendId
(
projectId
,
contendId
).
getBrandLinkedGroupId
();
}
return
EsQueryTools
.
assembleCacheMapsQuery
(
projectId
,
linkedGroupId
,
contendId
);
return
EsQueryTools
.
assembleCacheMapsQuery
(
projectId
,
linkedGroupId
,
contendId
);
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkFlowServiceImpl.java
View file @
6419ab60
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.zhiwei.base.category.ClassD
;
import
com.zhiwei.base.category.ClassD
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
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.config.Constant
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.dao.ChannelDao
;
import
com.zhiwei.brandkbs2.dao.ChannelDao
;
import
com.zhiwei.brandkbs2.dao.ChannelTagDao
;
import
com.zhiwei.brandkbs2.dao.ChannelTagDao
;
...
@@ -110,6 +111,8 @@ public class MarkFlowServiceImpl implements MarkFlowService {
...
@@ -110,6 +111,8 @@ public class MarkFlowServiceImpl implements MarkFlowService {
}
}
// C4,realSource提取展示
// C4,realSource提取展示
sourceDetails
.
put
(
"clientFrom"
,
getClientFrom
(
tJson
.
getIntValue
(
GenericAttribute
.
ES_C4
),
tJson
.
getString
(
GenericAttribute
.
ES_REAL_SOURCE
)));
sourceDetails
.
put
(
"clientFrom"
,
getClientFrom
(
tJson
.
getIntValue
(
GenericAttribute
.
ES_C4
),
tJson
.
getString
(
GenericAttribute
.
ES_REAL_SOURCE
)));
// platform
sourceDetails
.
put
(
"platform"
,
GlobalPojo
.
getPlatformNameById
(
tJson
.
getString
(
"platform_id"
)));
// source
// source
sourceDetails
.
put
(
"source"
,
source
);
sourceDetails
.
put
(
"source"
,
source
);
// 粉丝量提取
// 粉丝量提取
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
View file @
6419ab60
...
@@ -19,25 +19,17 @@ import com.zhiwei.brandkbs2.pojo.Project;
...
@@ -19,25 +19,17 @@ 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.CommonService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.SystemInfoService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
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
com.zhiwei.middleware.auth.util.JwtUtil
;
import
com.zhiwei.middleware.auth.util.JwtUtil
;
import
com.zhiwei.middleware.event.core.EventTagClient
;
import
com.zhiwei.middleware.event.pojo.dto.EventTagRelatedDTO
;
import
com.zhiwei.middleware.event.pojo.dto.EventTagRelatedDTO
;
import
com.zhiwei.middleware.event.pojo.entity.BrandkbsBasicInfo
;
import
com.zhiwei.middleware.event.pojo.entity.BrandkbsBasicInfo
;
import
com.zhiwei.middleware.event.pojo.entity.Event
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.ListUtils
;
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.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
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
;
...
@@ -48,7 +40,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
...
@@ -48,7 +40,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Array
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -314,6 +305,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -314,6 +305,7 @@ public class ProjectServiceImpl implements ProjectService {
json
.
put
(
"contendId"
,
"0"
);
json
.
put
(
"contendId"
,
"0"
);
json
.
put
(
"brandName"
,
project
.
getBrandName
());
json
.
put
(
"brandName"
,
project
.
getBrandName
());
json
.
put
(
"linkedGroupId"
,
project
.
getBrandLinkedGroupId
());
json
.
put
(
"linkedGroupId"
,
project
.
getBrandLinkedGroupId
());
json
.
put
(
"avatarUrl"
,
project
.
getAvatarUrl
());
resultList
.
add
(
json
);
resultList
.
add
(
json
);
}
}
List
<
Contend
>
contendList
=
project
.
getContendList
();
List
<
Contend
>
contendList
=
project
.
getContendList
();
...
@@ -323,6 +315,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -323,6 +315,7 @@ public class ProjectServiceImpl implements ProjectService {
json
.
put
(
"contendId"
,
contend
.
getId
());
json
.
put
(
"contendId"
,
contend
.
getId
());
json
.
put
(
"brandName"
,
contend
.
getBrandName
());
json
.
put
(
"brandName"
,
contend
.
getBrandName
());
json
.
put
(
"linkedGroupId"
,
contend
.
getBrandLinkedGroupId
());
json
.
put
(
"linkedGroupId"
,
contend
.
getBrandLinkedGroupId
());
json
.
put
(
"avatarUrl"
,
contend
.
getAvatarUrl
());
resultList
.
add
(
json
);
resultList
.
add
(
json
);
}
}
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
View file @
6419ab60
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.common.RedisKeyPrefix
;
import
com.zhiwei.brandkbs2.common.RedisKeyPrefix
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.dao.*
;
import
com.zhiwei.brandkbs2.dao.*
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.ReportTypeEnum
;
import
com.zhiwei.brandkbs2.enmus.ReportTypeEnum
;
...
@@ -29,12 +30,15 @@ import com.zhiwei.brandkbs2.util.MongoUtil;
...
@@ -29,12 +30,15 @@ import com.zhiwei.brandkbs2.util.MongoUtil;
import
com.zhiwei.brandkbs2.util.RedisUtil
;
import
com.zhiwei.brandkbs2.util.RedisUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.event.pojo.entity.BrandkbsBasicInfo
;
import
com.zhiwei.middleware.event.pojo.entity.BrandkbsBasicInfo
;
import
com.zhiwei.middleware.event.pojo.entity.Event
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
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.DateUtils
;
import
org.apache.commons.lang3.tuple.Pair
;
import
org.apache.commons.lang3.tuple.Pair
;
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.joda.time.Period
;
import
org.joda.time.PeriodType
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
;
...
@@ -255,6 +259,41 @@ public class ReportServiceImpl implements ReportService {
...
@@ -255,6 +259,41 @@ public class ReportServiceImpl implements ReportService {
}
}
@Override
@Override
public
JSONObject
getMobileReportAnalyze
(
String
id
,
boolean
cache
)
{
Report
report
=
reportDao
.
findOneById
(
id
);
if
(
Objects
.
isNull
(
report
))
{
ExceptionCast
.
cast
(
CommonCodeEnum
.
FAIL
,
"获取移动端报告数据异常"
);
}
String
redisKey
=
RedisKeyPrefix
.
REPORT_MOBILE
+
report
.
getId
();
String
resultStr
;
// 需要缓存且有缓存
if
(
cache
&&
StringUtils
.
isNotEmpty
(
resultStr
=
stringRedisTemplate
.
opsForValue
().
get
(
redisKey
)))
{
return
JSON
.
parseObject
(
resultStr
);
}
// 结果立刻返回,后台任务缓存
// if (cache) {
// ApplicationProjectListener.getThreadPool().execute(() -> {getMobileReportAnalyze(id,false);});
// JSONObject result = new JSONObject();
// result.put("title", report.getTitle());
// result.put("startTime", report.getStartTime());
// result.put("endTime", report.getEndTime());
// result.put("status", false);
// return result;
// }
JSONObject
result
=
null
;
try
{
result
=
getMobileReportResult
(
report
);
}
catch
(
Exception
e
)
{
log
.
error
(
"生成报告数据异常,id:{}"
,
report
.
getId
(),
e
);
ExceptionCast
.
cast
(
CommonCodeEnum
.
FAIL
,
"生成报告数据异常"
);
}
redisUtil
.
set
(
redisKey
,
JSON
.
toJSONString
(
result
));
return
result
;
}
@Override
public
PageVO
<
JSONObject
>
findReportList
(
ReportSearchDTO
reportSearch
)
{
public
PageVO
<
JSONObject
>
findReportList
(
ReportSearchDTO
reportSearch
)
{
Criteria
criteria
=
new
Criteria
();
Criteria
criteria
=
new
Criteria
();
// 项目限制
// 项目限制
...
@@ -383,6 +422,257 @@ public class ReportServiceImpl implements ReportService {
...
@@ -383,6 +422,257 @@ public class ReportServiceImpl implements ReportService {
}
}
/**
/**
* 获取MOBILE端月报结果
*
* @param report 报告对象
* @return 月报结果
*/
private
JSONObject
getMobileReportResult
(
Report
report
)
throws
Exception
{
log
.
info
(
"getMobileReportResult-生成报告开始,id:{}"
,
report
.
getId
());
Long
startTime
=
report
.
getStartTime
();
Long
endTime
=
report
.
getEndTime
();
Long
lastStartTime
=
DateUtils
.
addMonths
(
new
Date
(
startTime
),
-
1
).
getTime
();
String
startTimeStr
=
Constant
.
HOUR_FORMAT
.
format
(
report
.
getStartTime
());
String
lastStartTimeStr
=
Constant
.
HOUR_FORMAT
.
format
(
lastStartTime
);
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"brand"
,
projectService
.
getProjectById
(
report
.
getProjectId
()).
getProjectName
());
result
.
put
(
"startTime"
,
report
.
getStartTime
());
result
.
put
(
"endTime"
,
report
.
getEndTime
());
result
.
put
(
"curMonth"
,
Integer
.
parseInt
(
startTimeStr
.
substring
(
5
,
7
)));
result
.
put
(
"lastMonth"
,
Integer
.
parseInt
(
lastStartTimeStr
.
substring
(
5
,
7
)));
result
.
put
(
"brandSummary"
,
getMobileBrandSummary
(
startTime
,
endTime
,
lastStartTime
,
report
.
getProjectId
()));
List
<
Map
<
String
,
Long
>>
dayList
=
Tools
.
parseToDays
(
startTime
,
DateUtils
.
addDays
(
new
Date
(
endTime
),
-
1
).
getTime
());
result
.
put
(
"brandSpread"
,
getMobileBrandSpread
(
startTime
,
endTime
,
dayList
,
report
.
getProjectId
()));
result
.
put
(
"brandEvent"
,
getMobileBrandEvent
(
startTime
,
endTime
,
report
.
getProjectId
()));
// TODO 暂不实现
// result.put("brandChannel", this.getMobileBrandChannel(startTimeStr, endTimeStr, pid));
log
.
info
(
"getMobileReportResult-生成报告结束,id:{}"
,
report
.
getId
());
return
result
;
}
/**
* 获取品牌总览页面数据
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param lastStartTime 上个月开始时间
* @param projectId 项目ID
* @return 总览页面数据
*/
private
JSONObject
getMobileBrandSummary
(
Long
startTime
,
Long
endTime
,
Long
lastStartTime
,
String
projectId
)
throws
IOException
{
JSONObject
result
=
new
JSONObject
();
//本月舆情总量数据
long
curMonthTotal
=
markDataService
.
getYuqingMarkCount
(
startTime
,
endTime
,
EmotionEnum
.
ALL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
result
.
put
(
"curMonthTotal"
,
curMonthTotal
);
//上月舆情总量数据
long
lastMonthTotal
=
markDataService
.
getYuqingMarkCount
(
lastStartTime
,
startTime
,
EmotionEnum
.
ALL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
result
.
put
(
"lastMonthTotal"
,
lastMonthTotal
);
result
.
put
(
"totalCompare"
,
lastMonthTotal
==
0
?
0
:
curMonthTotal
*
1.0
/
lastMonthTotal
);
//获取时间范围内总正面稿件数
long
curPositiveTotal
=
markDataService
.
getYuqingMarkCount
(
startTime
,
endTime
,
EmotionEnum
.
POSITIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//获取时间范围内总中性稿件数
long
curNeutralTotal
=
markDataService
.
getYuqingMarkCount
(
startTime
,
endTime
,
EmotionEnum
.
NEUTRAL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//获取时间范围内总负面稿件数
long
curNegativeTotal
=
markDataService
.
getYuqingMarkCount
(
startTime
,
endTime
,
EmotionEnum
.
NEGATIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//获取上个周期时间范围内总正面稿件数
long
lastPositiveTotal
=
markDataService
.
getYuqingMarkCount
(
lastStartTime
,
startTime
,
EmotionEnum
.
POSITIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//获取上个周期时间范围内总中性稿件数
long
lastNeutralTotal
=
markDataService
.
getYuqingMarkCount
(
lastStartTime
,
startTime
,
EmotionEnum
.
NEUTRAL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//获取上个周期时间范围内总负面稿件数
long
lastNegativeTotal
=
markDataService
.
getYuqingMarkCount
(
lastStartTime
,
startTime
,
EmotionEnum
.
NEGATIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
result
.
put
(
"curPosTotal"
,
curPositiveTotal
);
result
.
put
(
"curNeuTotal"
,
curNeutralTotal
);
result
.
put
(
"curNegTotal"
,
curNegativeTotal
);
result
.
put
(
"lastPosTotal"
,
lastPositiveTotal
);
result
.
put
(
"lastNeuTotal"
,
lastNeutralTotal
);
result
.
put
(
"lastNegTotal"
,
lastNegativeTotal
);
result
.
put
(
"curPosPro"
,
curMonthTotal
==
0
?
0
:
curPositiveTotal
*
1.0
/
curMonthTotal
);
result
.
put
(
"curNeuPro"
,
curMonthTotal
==
0
?
0
:
curNeutralTotal
*
1.0
/
curMonthTotal
);
result
.
put
(
"curNegPro"
,
curMonthTotal
==
0
?
0
:
curNegativeTotal
*
1.0
/
curMonthTotal
);
result
.
put
(
"posCompare"
,
lastPositiveTotal
==
0
?
0
:
(
curPositiveTotal
-
lastPositiveTotal
)
*
1.0
/
lastPositiveTotal
);
List
<
JSONObject
>
platforms
=
markDataService
.
getMarkPlatformProportion
(
startTime
,
endTime
,
true
);
result
.
put
(
"maxPlatform"
,
platforms
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getLong
(
"count"
))).
get
().
getString
(
"platform"
));
result
.
put
(
"minPlatform"
,
platforms
.
stream
().
min
(
Comparator
.
comparing
(
o
->
o
.
getLong
(
"count"
))).
get
().
getString
(
"platform"
));
List
<
JSONObject
>
posPlatforms
=
markDataService
.
getMarkPlatformProportion
(
startTime
,
endTime
,
EmotionEnum
.
POSITIVE
.
getName
(),
true
);
result
.
put
(
"maxPosPlatform"
,
posPlatforms
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getLong
(
"count"
))).
get
().
getString
(
"platform"
));
List
<
JSONObject
>
neuPlatforms
=
markDataService
.
getMarkPlatformProportion
(
startTime
,
endTime
,
EmotionEnum
.
NEUTRAL
.
getName
(),
true
);
List
<
JSONObject
>
negPlatforms
=
markDataService
.
getMarkPlatformProportion
(
startTime
,
endTime
,
EmotionEnum
.
NEGATIVE
.
getName
(),
true
);
result
.
put
(
"maxNegPlatform"
,
negPlatforms
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getLong
(
"count"
))).
get
().
getString
(
"platform"
));
platforms
.
forEach
(
platform
->
{
String
platformStr
=
platform
.
getString
(
"platform"
);
int
num
=
platform
.
getIntValue
(
"count"
);
long
posNum
=
posPlatforms
.
stream
()
.
filter
(
posPlatform
->
platformStr
.
equals
(
posPlatform
.
getString
(
"platform"
)))
.
collect
(
Collectors
.
toList
()).
get
(
0
).
getLongValue
(
"count"
);
long
neuNum
=
neuPlatforms
.
stream
()
.
filter
(
neuPlatform
->
platformStr
.
equals
(
neuPlatform
.
getString
(
"platform"
)))
.
collect
(
Collectors
.
toList
()).
get
(
0
).
getLongValue
(
"count"
);
long
negNum
=
negPlatforms
.
stream
()
.
filter
(
negPlatform
->
platformStr
.
equals
(
negPlatform
.
getString
(
"platform"
)))
.
collect
(
Collectors
.
toList
()).
get
(
0
).
getLongValue
(
"count"
);
platform
.
put
(
"posNum"
,
posNum
);
platform
.
put
(
"neuNum"
,
neuNum
);
platform
.
put
(
"negNum"
,
negNum
);
platform
.
put
(
"posProportion"
,
num
==
0
?
0
:
posNum
*
1.0
/
num
);
platform
.
put
(
"neuProportion"
,
num
==
0
?
0
:
neuNum
*
1.0
/
num
);
platform
.
put
(
"negProportion"
,
num
==
0
?
0
:
negNum
*
1.0
/
num
);
});
result
.
put
(
"platforms"
,
platforms
);
return
result
;
}
/**
* 获取品牌传播分析页面数据
*
* @param dayList 分段时间集合
* @param projectId 项目ID
* @return 传播分析页面数据
*/
private
JSONObject
getMobileBrandSpread
(
Long
start
,
Long
end
,
List
<
Map
<
String
,
Long
>>
dayList
,
String
projectId
)
throws
IOException
{
JSONObject
result
=
new
JSONObject
();
List
<
JSONObject
>
lineList
=
new
ArrayList
<>(
dayList
.
size
());
//获取传播趋势
for
(
Map
<
String
,
Long
>
map
:
dayList
)
{
Long
startTime
=
map
.
get
(
"startTime"
);
Long
endTime
=
map
.
get
(
"endTime"
);
//统计时间段总稿件个数
long
normalCount
=
markDataService
.
getYuqingMarkCount
(
startTime
,
endTime
,
EmotionEnum
.
ALL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//统计时间段正面稿件个数
long
posNormalCount
=
markDataService
.
getYuqingMarkCount
(
startTime
,
endTime
,
EmotionEnum
.
POSITIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//统计时间段中性稿件个数
long
neuNormalCount
=
markDataService
.
getYuqingMarkCount
(
startTime
,
endTime
,
EmotionEnum
.
NEUTRAL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//统计时间段负面稿件个数
long
negNormalCount
=
markDataService
.
getYuqingMarkCount
(
startTime
,
endTime
,
EmotionEnum
.
NEGATIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
//统计时间段总事件数
long
eventCount
=
eventMiddlewareDao
.
getEventCountByProjectIdAndContendId
(
startTime
,
endTime
,
EmotionEnum
.
ALL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
JSONObject
line
=
new
JSONObject
();
line
.
put
(
"normalCount"
,
normalCount
);
line
.
put
(
"posNormalCount"
,
posNormalCount
);
line
.
put
(
"neuNormalCount"
,
neuNormalCount
);
line
.
put
(
"negNormalCount"
,
negNormalCount
);
line
.
put
(
"eventCount"
,
eventCount
);
line
.
put
(
"time"
,
startTime
);
lineList
.
add
(
line
);
}
result
.
put
(
"spread"
,
lineList
);
//获取事件和稿件的传播峰值
result
.
put
(
"normalMaxTime"
,
lineList
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
"normalCount"
))).
get
().
getDate
(
"time"
));
result
.
put
(
"eventMaxTime"
,
lineList
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
"eventCount"
))).
get
().
getDate
(
"time"
));
result
.
put
(
"posNormalMaxTime"
,
lineList
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
"posNormalCount"
))).
get
().
getDate
(
"time"
));
result
.
put
(
"neuNormalMaxTime"
,
lineList
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
"neuNormalCount"
))).
get
().
getDate
(
"time"
));
result
.
put
(
"negNormalMaxTime"
,
lineList
.
stream
().
max
(
Comparator
.
comparing
(
o
->
o
.
getInteger
(
"negNormalCount"
))).
get
().
getDate
(
"time"
));
long
eventTotal
=
eventMiddlewareDao
.
getEventCountByProjectIdAndContendId
(
start
,
end
,
EmotionEnum
.
ALL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
long
posEventTotal
=
eventMiddlewareDao
.
getEventCountByProjectIdAndContendId
(
start
,
end
,
EmotionEnum
.
POSITIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
);
result
.
put
(
"eventTotal"
,
eventTotal
);
result
.
put
(
"posEventPro"
,
eventTotal
==
0
?
0
:
posEventTotal
*
1.0
/
eventTotal
);
//获取最热稿件相关信息
List
<
Map
.
Entry
<
String
,
Integer
>>
resList
=
markDataService
.
getMarkTopTitle
(
start
,
end
,
EmotionEnum
.
ALL
.
getName
(),
projectId
,
null
,
Constant
.
PRIMARY_CONTEND_ID
,
1
);
if
(
CollectionUtils
.
isNotEmpty
(
resList
))
{
Map
.
Entry
<
String
,
Integer
>
resMap
=
resList
.
get
(
0
);
BaseMap
firstArticle
=
markDataService
.
getFirstArticle
(
start
,
end
,
resMap
.
getKey
(),
projectId
,
null
,
Constant
.
PRIMARY_CONTEND_ID
);
result
.
put
(
"topArticle"
,
firstArticle
.
getTitle
());
result
.
put
(
"similarArticleCount"
,
resMap
.
getValue
());
}
//获取最热事件相关信息
List
<
Event
>
eventList
=
eventMiddlewareDao
.
getEventsByProjectIdAndContendId
(
start
,
end
,
EmotionEnum
.
ALL
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
,
1
);
if
(
CollectionUtils
.
isNotEmpty
(
eventList
))
{
Event
event
=
eventList
.
get
(
0
);
result
.
put
(
"title"
,
event
.
getName
());
result
.
put
(
"influence"
,
event
.
getInfluence
());
}
// TODO eventMiddlewareDao 需要添加获取首发稿件接口
// List<Event> posTopArticleList = eventMiddlewareDao.getEventsByProjectIdAndContendId(start, end, EmotionEnum.POSITIVE.getName(), projectId,
// Constant.PRIMARY_CONTEND_ID, 1);
// if (!Tools.isEmpty(posTopArticleList)) {
// result.put("posTopArtTitle", null);
// }
// List<Event> neuTopArticleTitleList = eventMiddlewareDao.getEventsByProjectIdAndContendId(start, end, EmotionEnum.NEUTRAL.getName(), projectId,
// Constant.PRIMARY_CONTEND_ID, 1);
// if (!Tools.isEmpty(neuTopArticleTitleList)) {
// result.put("neuTopArtTitle", neuTopArtTitle.length() <= 30 ? neuTopArtTitle : neuTopArtTitle.substring(0, 30) + "...");
// }
// List<Event> negTopArticleTitleList = eventMiddlewareDao.getEventsByProjectIdAndContendId(start, end, EmotionEnum.NEUTRAL.getName(), projectId,
// Constant.PRIMARY_CONTEND_ID, 1);
// if (!Tools.isEmpty(negTopArticleTitleList)) {
// result.put("negTopArtTitle", neuTopArtTitle.length() <= 30 ? neuTopArtTitle : neuTopArtTitle.substring(0, 30) + "...");
// }
return
result
;
}
/**
* 获取品牌事件数据
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param projectId 项目ID
* @return 品牌事件数据
*/
private
JSONObject
getMobileBrandEvent
(
Long
startTime
,
Long
endTime
,
String
projectId
)
{
JSONObject
result
=
new
JSONObject
();
// TODO eventMiddlewareDao需要提供 获取参与某情感事件最多的平台列表
// List<Map<String, Object>> topPlatforms = iEventService.selectTopPlatformByTimeAndEmotionAndProjectIdAndContendId
// (startTimeStr, endTimeStr, EmotionEnum.NEGATIVE.getState(), pid, Constant.PRIMARY_CONTENDID);
// //负面事件舆情平台top
// result.put("topPlatforms", topPlatforms.stream()
// .sorted((o1, o2) -> Integer.valueOf(o2.get("num").toString()).compareTo(Integer.valueOf(o1.get("num").toString())))
// .limit(3)
// .map(map -> map.get("platform"))
// .collect(Collectors.toList()));
//负面事件传播周期
List
<
Event
>
negEvents
=
eventMiddlewareDao
.
getEventsByProjectIdAndContendId
(
startTime
,
endTime
,
EmotionEnum
.
NEGATIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
,
50
);
List
<
Integer
>
spreadDayList
=
negEvents
.
stream
().
map
(
event
->
{
Long
start
=
event
.
getStartTime
();
Long
end
=
Boolean
.
TRUE
.
equals
(
event
.
getEndStatus
())
&&
event
.
getEndTime
()
<
endTime
?
event
.
getEndTime
()
:
endTime
;
Period
periodDays
=
new
Period
(
start
,
end
-
1
,
PeriodType
.
days
());
return
periodDays
.
getDays
()
+
1
;
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
spreadDayList
))
{
int
maxSpreadDay
=
spreadDayList
.
stream
().
mapToInt
(
o
->
o
).
max
().
getAsInt
();
int
minSpreadDay
=
spreadDayList
.
stream
().
mapToInt
(
o
->
o
).
min
().
getAsInt
();
StringBuilder
sb
=
new
StringBuilder
();
result
.
put
(
"spreadDay"
,
maxSpreadDay
==
minSpreadDay
?
sb
.
append
(
minSpreadDay
).
append
(
"天"
).
toString
()
:
sb
.
append
(
minSpreadDay
).
append
(
"至"
).
append
(
maxSpreadDay
).
append
(
"天"
).
toString
());
}
//负面事件影响力top
result
.
put
(
"topNegEvents"
,
negEvents
.
stream
().
limit
(
5
)
.
map
(
event
->
{
JSONObject
jsonObject
=
new
JSONObject
();
String
title
=
event
.
getName
();
Long
start
=
event
.
getStartTime
();
Long
end
=
Boolean
.
TRUE
.
equals
(
event
.
getEndStatus
())
&&
event
.
getEndTime
()<
endTime
?
event
.
getEndTime
()
:
endTime
;
Period
periodDays
=
new
Period
(
start
,
end
-
1
,
PeriodType
.
days
());
jsonObject
.
put
(
"title"
,
title
.
length
()
<=
30
?
title
:
title
.
substring
(
0
,
30
)
+
"..."
);
jsonObject
.
put
(
"influence"
,
event
.
getInfluence
());
jsonObject
.
put
(
"periodDays"
,
periodDays
.
getDays
()
+
1
);
return
jsonObject
;
}).
collect
(
Collectors
.
toList
()));
//正面事件传播量top
List
<
Event
>
topPosEvents
=
eventMiddlewareDao
.
getEventsByTotalChannelVolumeTop
(
startTime
,
endTime
,
EmotionEnum
.
POSITIVE
.
getName
(),
projectId
,
Constant
.
PRIMARY_CONTEND_ID
,
5
);
result
.
put
(
"topPosEvents"
,
topPosEvents
.
stream
()
.
map
(
event
->
{
JSONObject
jsonObject
=
new
JSONObject
();
String
title
=
event
.
getName
();
jsonObject
.
put
(
"title"
,
title
.
length
()
<=
30
?
title
:
title
.
substring
(
0
,
30
)
+
"..."
);
jsonObject
.
put
(
"num"
,
event
.
getTotalDisseminationVolume
());
return
jsonObject
;
}).
collect
(
Collectors
.
toList
()));
return
result
;
}
/**
* 获取品牌总览页面数据
* 获取品牌总览页面数据
*
*
* @param startTime 开始时间
* @param startTime 开始时间
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
View file @
6419ab60
...
@@ -335,6 +335,7 @@ public class TaskServiceImpl implements TaskService {
...
@@ -335,6 +335,7 @@ public class TaskServiceImpl implements TaskService {
// 用作生成缓存
// 用作生成缓存
reportService
.
getPcReportAnalyze
(
report
.
getId
(),
false
);
reportService
.
getPcReportAnalyze
(
report
.
getId
(),
false
);
reportService
.
switchReportStatus
(
report
.
getId
(),
true
);
reportService
.
switchReportStatus
(
report
.
getId
(),
true
);
reportService
.
getMobileReportAnalyze
(
report
.
getId
(),
false
);
}
}
return
flag
;
return
flag
;
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/UserCenterServiceImpl.java
View file @
6419ab60
...
@@ -45,7 +45,7 @@ public class UserCenterServiceImpl implements UserCenterService {
...
@@ -45,7 +45,7 @@ public class UserCenterServiceImpl implements UserCenterService {
HttpEntity
<
String
>
requestEntity
=
new
HttpEntity
<>(
httpHeaders
);
HttpEntity
<
String
>
requestEntity
=
new
HttpEntity
<>(
httpHeaders
);
HttpEntity
<
JSONObject
>
entity
=
restTemplate
.
exchange
(
yuqingInterface
+
"/thirdPart/external/verify/token"
,
HttpMethod
.
GET
,
HttpEntity
<
JSONObject
>
entity
=
restTemplate
.
exchange
(
yuqingInterface
+
"/thirdPart/external/verify/token"
,
HttpMethod
.
GET
,
requestEntity
,
JSONObject
.
class
);
requestEntity
,
JSONObject
.
class
);
if
(
null
!=
entity
.
getBody
()
||
!
entity
.
getBody
().
getBoolean
(
"status"
))
{
if
(
null
!=
entity
.
getBody
()
&&
entity
.
getBody
().
getBoolean
(
"status"
))
{
String
ticket
=
entity
.
getBody
().
getJSONObject
(
"data"
).
getString
(
"ticket"
);
String
ticket
=
entity
.
getBody
().
getJSONObject
(
"data"
).
getString
(
"ticket"
);
return
ResponseResult
.
success
(
ticket
);
return
ResponseResult
.
success
(
ticket
);
}
}
...
@@ -85,4 +85,28 @@ public class UserCenterServiceImpl implements UserCenterService {
...
@@ -85,4 +85,28 @@ public class UserCenterServiceImpl implements UserCenterService {
}
}
return
entity
.
getBody
().
getObject
(
"data"
,
CenterUser
.
class
);
return
entity
.
getBody
().
getObject
(
"data"
,
CenterUser
.
class
);
}
}
@Override
public
boolean
bindUser
(
String
ticket
,
String
userId
)
{
String
url
=
yuqingInterface
+
"/thirdPart/external/ticket/bindUser?ticket="
+
ticket
+
"&userId="
+
userId
+
"&service"
+
SERVICE_NAME
;
HttpEntity
<
JSONObject
>
entity
=
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
null
,
JSONObject
.
class
);
if
(
null
==
entity
.
getBody
()
||
!
entity
.
getBody
().
getBoolean
(
"status"
))
{
return
false
;
}
return
entity
.
getBody
().
getObject
(
"status"
,
Boolean
.
class
);
}
@Override
public
boolean
addProduct
(
String
userId
)
{
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
httpHeaders
.
set
(
EXTERNAL_ORIGIN
,
SERVICE_NAME
);
httpHeaders
.
set
(
EXTERNAL_SERVICE
,
SERVICE_NAME
);
httpHeaders
.
set
(
EXTERNAL_TOKEN
,
token
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"userId"
,
userId
);
HttpEntity
<
JSONObject
>
requestEntity
=
new
HttpEntity
<>(
json
,
httpHeaders
);
HttpEntity
<
JSONObject
>
entity
=
restTemplate
.
exchange
(
yuqingInterface
+
"/thirdPart/external/user/product"
,
HttpMethod
.
POST
,
requestEntity
,
JSONObject
.
class
);
return
null
!=
entity
.
getBody
()
&&
entity
.
getBody
().
getBoolean
(
"status"
);
}
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
View file @
6419ab60
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.dao.ProjectDao
;
import
com.zhiwei.brandkbs2.dao.ProjectDao
;
import
com.zhiwei.brandkbs2.dao.UserDao
;
import
com.zhiwei.brandkbs2.dao.UserDao
;
import
com.zhiwei.brandkbs2.dao.impl.UserOldDaoImpl
;
import
com.zhiwei.brandkbs2.dao.impl.UserOldDaoImpl
;
...
@@ -15,6 +17,7 @@ import com.zhiwei.brandkbs2.pojo.User;
...
@@ -15,6 +17,7 @@ import com.zhiwei.brandkbs2.pojo.User;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
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.MobileLoginVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.UserCenterService
;
import
com.zhiwei.brandkbs2.service.UserCenterService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
...
@@ -23,10 +26,14 @@ import com.zhiwei.brandkbs2.util.Tools;
...
@@ -23,10 +26,14 @@ import com.zhiwei.brandkbs2.util.Tools;
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
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
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.data.mongodb.core.query.Update
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
...
@@ -66,6 +73,15 @@ public class UserServiceImpl implements UserService {
...
@@ -66,6 +73,15 @@ public class UserServiceImpl implements UserService {
@Resource
(
name
=
"userCenterServiceImpl"
)
@Resource
(
name
=
"userCenterServiceImpl"
)
private
UserCenterService
userCenterService
;
private
UserCenterService
userCenterService
;
@Value
(
"${wx.accesstoken.url}"
)
private
String
wechatAccessTokenUrl
;
@Value
(
"${wx.getuserphonenumber}"
)
private
String
wxGetUserPhoneNumberUrl
;
@Autowired
private
RestTemplate
restTemplate
;
@Override
@Override
public
UserInfo
login
()
{
public
UserInfo
login
()
{
String
uid
=
UserThreadLocal
.
getUserId
();
String
uid
=
UserThreadLocal
.
getUserId
();
...
@@ -155,6 +171,7 @@ public class UserServiceImpl implements UserService {
...
@@ -155,6 +171,7 @@ public class UserServiceImpl implements UserService {
newUser
=
createNewUser
(
userDTO
);
newUser
=
createNewUser
(
userDTO
);
}
}
userDao
.
insertOne
(
newUser
);
userDao
.
insertOne
(
newUser
);
userCenterService
.
addProduct
(
newUser
.
getId
());
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
List
<
UserRole
>
roles
=
user
.
getRoles
();
List
<
UserRole
>
roles
=
user
.
getRoles
();
...
@@ -244,6 +261,7 @@ public class UserServiceImpl implements UserService {
...
@@ -244,6 +261,7 @@ public class UserServiceImpl implements UserService {
newUser
=
createNewUser
(
userDTO
);
newUser
=
createNewUser
(
userDTO
);
}
}
userDao
.
insertOne
(
newUser
);
userDao
.
insertOne
(
newUser
);
userCenterService
.
addProduct
(
newUser
.
getId
());
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
...
@@ -332,6 +350,56 @@ public class UserServiceImpl implements UserService {
...
@@ -332,6 +350,56 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
public
ResponseResult
mobileLogin
(
MobileLoginVO
loginVO
)
{
Long
phoneNumber
;
if
(
null
==
(
phoneNumber
=
loginVO
.
getPhoneNumber
()))
{
// 解析code获取手机号
ResponseEntity
<
String
>
entity
=
restTemplate
.
getForEntity
(
wechatAccessTokenUrl
,
String
.
class
);
if
(
null
==
entity
.
getBody
())
{
return
ResponseResult
.
failure
(
"手机号获取失败"
);
}
String
accessToken
=
JSON
.
parseObject
(
entity
.
getBody
()).
getJSONObject
(
"data"
).
getString
(
"accessToken"
);
JSONObject
info
=
new
JSONObject
();
info
.
put
(
"code"
,
loginVO
.
getCode
());
HttpEntity
<
JSONObject
>
phoneNumberEntity
=
restTemplate
.
postForEntity
(
wxGetUserPhoneNumberUrl
+
accessToken
,
info
,
JSONObject
.
class
);
if
(
null
==
phoneNumberEntity
.
getBody
())
{
return
ResponseResult
.
failure
(
"手机号获取失败"
);
}
phoneNumber
=
Long
.
valueOf
(
phoneNumberEntity
.
getBody
().
getJSONObject
(
"phone_info"
).
getString
(
"purePhoneNumber"
));
}
User
user
=
userDao
.
findOne
(
"phoneNumber"
,
phoneNumber
);
if
(
null
==
user
)
{
return
ResponseResult
.
failure
(
"手机号未注册"
);
}
String
userCenterToken
=
getUserCenterToken
(
user
.
getId
());
if
(
null
==
userCenterToken
)
{
return
ResponseResult
.
failure
(
"用户中心校验失败"
);
}
setThreadLocalUserInfoByUser
(
user
);
// 登录状态
Map
<
String
,
Object
>
map
=
login
().
toMap
();
map
.
put
(
"token"
,
userCenterToken
);
return
ResponseResult
.
success
(
map
);
}
@Override
public
ResponseResult
mobileCutLogin
(
String
userId
,
String
projectId
)
{
UserInfo
userInfo
=
queryUserInfo
(
userId
,
projectId
);
if
(
null
==
userInfo
)
{
return
ResponseResult
.
failure
(
"未有该项目权限"
);
}
String
userCenterToken
=
getUserCenterToken
(
userInfo
.
getUserId
());
if
(
null
==
userCenterToken
)
{
return
ResponseResult
.
failure
(
"用户中心校验失败"
);
}
UserThreadLocal
.
set
(
userInfo
);
// 登录状态
Map
<
String
,
Object
>
map
=
login
().
toMap
();
map
.
put
(
"token"
,
userCenterToken
);
return
ResponseResult
.
success
(
map
);
}
@Override
public
Map
<
String
,
Object
>
getLoginInfo
()
{
public
Map
<
String
,
Object
>
getLoginInfo
()
{
// String userId = UserThreadLocal.getUserId();
// String userId = UserThreadLocal.getUserId();
// String projectId = UserThreadLocal.getProjectId();
// String projectId = UserThreadLocal.getProjectId();
...
@@ -386,4 +454,27 @@ public class UserServiceImpl implements UserService {
...
@@ -386,4 +454,27 @@ public class UserServiceImpl implements UserService {
return
PageVO
.
createPageVo
(
pageHelper
,
resList
);
return
PageVO
.
createPageVo
(
pageHelper
,
resList
);
}
}
private
String
getUserCenterToken
(
String
userId
)
{
// 1.获取ticket
String
ticket
=
userCenterService
.
verifyToken
().
getData
().
toString
();
// 2.绑定用户
if
(
userCenterService
.
bindUser
(
ticket
,
userId
))
{
ResponseResult
responseResult
=
userCenterService
.
verifyTicket
(
ticket
);
return
((
JSONObject
)
responseResult
.
getData
()).
getString
(
"token"
);
}
return
null
;
}
private
void
setThreadLocalUserInfoByUser
(
User
user
)
{
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setUserId
(
user
.
getId
());
// 默认登录项目id
if
(
user
.
isSuperAdmin
())
{
userInfo
.
setProjectId
(
Constant
.
DEFAULT_PROJECT_ID
);
}
else
{
userInfo
.
setProjectId
(
user
.
getRoles
().
get
(
0
).
getProjectId
());
}
UserThreadLocal
.
set
(
userInfo
);
}
}
}
src/main/resources/application-dev.properties
View file @
6419ab60
...
@@ -103,4 +103,7 @@ warn.yuQing.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/bra
...
@@ -103,4 +103,7 @@ warn.yuQing.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/bra
warn.taskSwitch.url
=
https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/brandkbs/enable/used
warn.taskSwitch.url
=
https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/brandkbs/enable/used
#\u9884\u8B66\u5916\u90E8\u63A5\u53E3
#\u9884\u8B66\u5916\u90E8\u63A5\u53E3
ef.external.filterNew.url
=
https://ef.zhiweidata.com/external/filterNew.do?firstTypes={1}&start={2}&end={3}
ef.external.filterNew.url
=
https://ef.zhiweidata.com/external/filterNew.do?firstTypes={1}&start={2}&end={3}
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
\ No newline at end of file
#\u5FAE\u4FE1\u76F8\u5173\u63A5\u53E3
wx.accesstoken.url
=
https://ef.zhiweidata.com/smallprogram/api/codeToken/getToken?appId=7FFBB9B377D0D28FBCF9FA481D6FF77546718A121E4BD0EA1AAB28011C53E7EE
wx.getuserphonenumber
=
https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=
\ No newline at end of file
src/main/resources/application-local.properties
View file @
6419ab60
...
@@ -106,4 +106,7 @@ warn.yuQing.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/brandkbs/
...
@@ -106,4 +106,7 @@ warn.yuQing.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/brandkbs/
warn.taskSwitch.url
=
http://192.168.0.225:11003/qbjc/brandkbsPush/interface/brandkbs/enable/used
warn.taskSwitch.url
=
http://192.168.0.225:11003/qbjc/brandkbsPush/interface/brandkbs/enable/used
#\u9884\u8B66\u5916\u90E8\u63A5\u53E3
#\u9884\u8B66\u5916\u90E8\u63A5\u53E3
ef.external.filterNew.url
=
https://ef.zhiweidata.com/external/filterNew.do?firstTypes={1}&start={2}&end={3}
ef.external.filterNew.url
=
https://ef.zhiweidata.com/external/filterNew.do?firstTypes={1}&start={2}&end={3}
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
\ No newline at end of file
#\u5FAE\u4FE1\u76F8\u5173\u63A5\u53E3
wx.accesstoken.url
=
https://ef.zhiweidata.com/smallprogram/api/codeToken/getToken?appId=7FFBB9B377D0D28FBCF9FA481D6FF77546718A121E4BD0EA1AAB28011C53E7EE
wx.getuserphonenumber
=
https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=
\ No newline at end of file
src/main/resources/application-prod.properties
View file @
6419ab60
...
@@ -103,4 +103,7 @@ warn.yuQing.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/bra
...
@@ -103,4 +103,7 @@ warn.yuQing.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/bra
warn.taskSwitch.url
=
https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/brandkbs/enable/used
warn.taskSwitch.url
=
https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/brandkbs/enable/used
#\u9884\u8B66\u5916\u90E8\u63A5\u53E3
#\u9884\u8B66\u5916\u90E8\u63A5\u53E3
ef.external.filterNew.url
=
https://ef.zhiweidata.com/external/filterNew.do?firstTypes={1}&start={2}&end={3}
ef.external.filterNew.url
=
https://ef.zhiweidata.com/external/filterNew.do?firstTypes={1}&start={2}&end={3}
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
\ No newline at end of file
#\u5FAE\u4FE1\u76F8\u5173\u63A5\u53E3
wx.accesstoken.url
=
https://ef.zhiweidata.com/smallprogram/api/codeToken/getToken?appId=7FFBB9B377D0D28FBCF9FA481D6FF77546718A121E4BD0EA1AAB28011C53E7EE
wx.getuserphonenumber
=
https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment