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
07df721f
Commit
07df721f
authored
Nov 16, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!86
parents
0b70c359
d1a5afc1
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
752 additions
and
315 deletions
+752
-315
src/main/java/com/zhiwei/brandkbs2/common/RedisKeyPrefix.java
+23
-1
src/main/java/com/zhiwei/brandkbs2/controller/InterfaceController.java
+9
-2
src/main/java/com/zhiwei/brandkbs2/controller/app/AppWarnController.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/es/EsQueryTools.java
+10
-3
src/main/java/com/zhiwei/brandkbs2/pojo/external/BaseMapCompound.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/pojo/external/BrandkbsHotTopWarn.java
+14
-0
src/main/java/com/zhiwei/brandkbs2/pojo/external/BrandkbsNewCaseWarn.java
+22
-0
src/main/java/com/zhiwei/brandkbs2/pojo/vo/CrisisCaseWarnVO.java
+51
-0
src/main/java/com/zhiwei/brandkbs2/service/ProjectWarnService.java
+41
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkFlowServiceImpl.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectWarnServiceImpl.java
+473
-270
src/main/java/com/zhiwei/brandkbs2/util/RedisUtil.java
+29
-0
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
+34
-0
src/main/resources/application-dev.properties
+13
-11
src/main/resources/application-local.properties
+13
-11
src/main/resources/application-prod.properties
+13
-11
No files found.
src/main/java/com/zhiwei/brandkbs2/common/RedisKeyPrefix.java
View file @
07df721f
package
com
.
zhiwei
.
brandkbs2
.
common
;
package
com
.
zhiwei
.
brandkbs2
.
common
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -82,6 +83,22 @@ public class RedisKeyPrefix {
...
@@ -82,6 +83,22 @@ public class RedisKeyPrefix {
*/
*/
private
static
final
String
EVENT_ANALYZE_PROGRESS
=
"BRANDKBS:EVENT:ANALYZE:PROGRESS:"
;
private
static
final
String
EVENT_ANALYZE_PROGRESS
=
"BRANDKBS:EVENT:ANALYZE:PROGRESS:"
;
/**
* 项目预警相关缓存
*/
public
static
final
String
PROJECT_WARN_HOT_TOP
=
"BRANDKBS:HOT_TOP:"
;
public
static
final
String
PROJECT_WARN_NEW_CASE_LIST
=
"BRANDKBS:NEW_CASE:LIST_"
;
public
static
final
String
PROJECT_WARN_NEW_CASE_CURSOR
=
"BRANDKBS:NEW_CASE:CURSOR:"
;
public
static
String
projectWarnHotTopKeyAll
(
String
projectId
,
String
type
)
{
return
RedisKeyPrefix
.
generateRedisKey
(
RedisKeyPrefix
.
PROJECT_WARN_HOT_TOP
,
projectId
,
Tools
.
concat
(
type
,
"*"
));
}
public
static
String
projectWarnHotTopKey
(
String
projectId
,
String
type
,
String
name
)
{
return
RedisKeyPrefix
.
generateRedisKey
(
RedisKeyPrefix
.
PROJECT_WARN_HOT_TOP
,
projectId
,
Tools
.
concat
(
type
,
name
));
}
public
static
String
eventAnalysisProgress
(
String
eventId
,
String
projectId
)
{
public
static
String
eventAnalysisProgress
(
String
eventId
,
String
projectId
)
{
return
RedisKeyPrefix
.
generateRedisKey
(
RedisKeyPrefix
.
EVENT_ANALYZE_PROGRESS
,
projectId
,
eventId
);
return
RedisKeyPrefix
.
generateRedisKey
(
RedisKeyPrefix
.
EVENT_ANALYZE_PROGRESS
,
projectId
,
eventId
);
}
}
...
@@ -104,9 +121,14 @@ public class RedisKeyPrefix {
...
@@ -104,9 +121,14 @@ public class RedisKeyPrefix {
private
static
String
generateRedisKey
(
String
...
keys
)
{
private
static
String
generateRedisKey
(
String
...
keys
)
{
Objects
.
requireNonNull
(
keys
);
Objects
.
requireNonNull
(
keys
);
boolean
contains
=
keys
[
0
].
endsWith
(
":"
);
StringBuilder
sb
=
new
StringBuilder
(
keys
[
0
]);
StringBuilder
sb
=
new
StringBuilder
(
keys
[
0
]);
for
(
int
i
=
1
;
i
<
keys
.
length
;
i
++)
{
for
(
int
i
=
1
;
i
<
keys
.
length
;
i
++)
{
sb
.
append
(
SEPARATOR
).
append
(
keys
[
i
]);
if
(
1
==
i
&&
contains
)
{
sb
.
append
(
keys
[
i
]);
}
else
{
sb
.
append
(
SEPARATOR
).
append
(
keys
[
i
]);
}
}
}
return
sb
.
toString
();
return
sb
.
toString
();
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/controller/InterfaceController.java
View file @
07df721f
...
@@ -6,6 +6,7 @@ import com.zhiwei.brandkbs2.pojo.external.BrandkbsChannelConfig;
...
@@ -6,6 +6,7 @@ import com.zhiwei.brandkbs2.pojo.external.BrandkbsChannelConfig;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsHotEventConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsHotEventConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsHotTopConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsHotTopConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsYuQingConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsYuQingConfig
;
import
com.zhiwei.brandkbs2.pojo.vo.CrisisCaseWarnVO
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectWarnService
;
import
com.zhiwei.brandkbs2.service.ProjectWarnService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -73,7 +74,7 @@ public class InterfaceController {
...
@@ -73,7 +74,7 @@ public class InterfaceController {
return
projectWarnService
.
getHotEventWaring
(
projectId
,
config
);
return
projectWarnService
.
getHotEventWaring
(
projectId
,
config
);
}
}
@ApiOperation
(
"获取
热点事件
-预警结果"
)
@ApiOperation
(
"获取
上榜热搜
-预警结果"
)
@PostMapping
(
"/warn/hotTop"
)
@PostMapping
(
"/warn/hotTop"
)
public
ResponseResult
getHotTopWaring
(
@RequestBody
JSONObject
json
)
{
public
ResponseResult
getHotTopWaring
(
@RequestBody
JSONObject
json
)
{
String
projectId
=
json
.
getString
(
"projectId"
);
String
projectId
=
json
.
getString
(
"projectId"
);
...
@@ -81,11 +82,17 @@ public class InterfaceController {
...
@@ -81,11 +82,17 @@ public class InterfaceController {
return
projectWarnService
.
getHotTopWaring
(
projectId
,
config
);
return
projectWarnService
.
getHotTopWaring
(
projectId
,
config
);
}
}
@ApiOperation
(
"获取
热点事件
-预警结果"
)
@ApiOperation
(
"获取
案例上新
-预警结果"
)
@PostMapping
(
"/warn/newCase"
)
@PostMapping
(
"/warn/newCase"
)
public
ResponseResult
getNewCaseWaring
(
@RequestBody
JSONObject
json
)
{
public
ResponseResult
getNewCaseWaring
(
@RequestBody
JSONObject
json
)
{
String
projectId
=
json
.
getString
(
"projectId"
);
String
projectId
=
json
.
getString
(
"projectId"
);
return
projectWarnService
.
getNewCaseWaring
(
projectId
);
return
projectWarnService
.
getNewCaseWaring
(
projectId
);
}
}
@ApiOperation
(
"案例上新预警(案例库项目调用)"
)
@PostMapping
(
"/newCrisisCaseWarn"
)
public
void
newCrisisCaseWarn
(
@RequestBody
CrisisCaseWarnVO
caseWarnVO
)
{
projectWarnService
.
newCrisisCaseWarn
(
caseWarnVO
);
}
}
}
src/main/java/com/zhiwei/brandkbs2/controller/app/AppWarnController.java
View file @
07df721f
...
@@ -42,7 +42,7 @@ import java.util.Map;
...
@@ -42,7 +42,7 @@ import java.util.Map;
public
class
AppWarnController
extends
BaseController
{
public
class
AppWarnController
extends
BaseController
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
AppWarnController
.
class
);
private
static
final
Logger
log
=
LogManager
.
getLogger
(
AppWarnController
.
class
);
private
static
final
String
taskType
=
"brandkbs"
;
private
static
final
String
TASK_TYPE
=
"brandkbs"
;
@Value
(
"${jwt.key}"
)
@Value
(
"${jwt.key}"
)
private
String
jwtKey
;
private
String
jwtKey
;
...
@@ -127,7 +127,7 @@ public class AppWarnController extends BaseController {
...
@@ -127,7 +127,7 @@ public class AppWarnController extends BaseController {
headers
.
add
(
"token"
,
token
);
headers
.
add
(
"token"
,
token
);
HttpEntity
<
Object
>
request
=
new
HttpEntity
<>(
headers
);
HttpEntity
<
Object
>
request
=
new
HttpEntity
<>(
headers
);
JSONObject
data
=
restTemplate
.
exchange
(
warnTicketUrl
,
HttpMethod
.
GET
,
request
,
JSONObject
.
class
,
pushTaskId
,
taskType
).
getBody
().
getJSONObject
(
"data"
);
JSONObject
data
=
restTemplate
.
exchange
(
warnTicketUrl
,
HttpMethod
.
GET
,
request
,
JSONObject
.
class
,
pushTaskId
,
TASK_TYPE
).
getBody
().
getJSONObject
(
"data"
);
return
ResponseResult
.
success
(
data
);
return
ResponseResult
.
success
(
data
);
}
}
...
@@ -139,7 +139,7 @@ public class AppWarnController extends BaseController {
...
@@ -139,7 +139,7 @@ public class AppWarnController extends BaseController {
headers
.
add
(
"token"
,
token
);
headers
.
add
(
"token"
,
token
);
HttpEntity
<
Object
>
request
=
new
HttpEntity
<>(
headers
);
HttpEntity
<
Object
>
request
=
new
HttpEntity
<>(
headers
);
JSONArray
data
=
restTemplate
.
exchange
(
warnPushRecipientsUrl
,
HttpMethod
.
GET
,
request
,
JSONObject
.
class
,
pushTaskId
,
taskType
).
getBody
().
getJSONArray
(
"data"
);
JSONArray
data
=
restTemplate
.
exchange
(
warnPushRecipientsUrl
,
HttpMethod
.
GET
,
request
,
JSONObject
.
class
,
pushTaskId
,
TASK_TYPE
).
getBody
().
getJSONArray
(
"data"
);
return
ResponseResult
.
success
(
data
);
return
ResponseResult
.
success
(
data
);
}
}
...
@@ -152,7 +152,7 @@ public class AppWarnController extends BaseController {
...
@@ -152,7 +152,7 @@ public class AppWarnController extends BaseController {
headers
.
add
(
"token"
,
token
);
headers
.
add
(
"token"
,
token
);
HttpEntity
<
Object
>
request
=
new
HttpEntity
<>(
headers
);
HttpEntity
<
Object
>
request
=
new
HttpEntity
<>(
headers
);
JSONObject
data
=
restTemplate
.
exchange
(
deletePushRecipientsUrl
,
HttpMethod
.
GET
,
request
,
JSONObject
.
class
,
pushTaskId
,
recipientsId
,
taskType
).
getBody
().
getJSONObject
(
"data"
);
JSONObject
data
=
restTemplate
.
exchange
(
deletePushRecipientsUrl
,
HttpMethod
.
GET
,
request
,
JSONObject
.
class
,
pushTaskId
,
recipientsId
,
TASK_TYPE
).
getBody
().
getJSONObject
(
"data"
);
return
ResponseResult
.
success
(
data
);
return
ResponseResult
.
success
(
data
);
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/es/EsQueryTools.java
View file @
07df721f
...
@@ -98,7 +98,7 @@ public class EsQueryTools {
...
@@ -98,7 +98,7 @@ 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
();
BoolQueryBuilder
nestedBoolQueryBuilder
=
QueryBuilders
.
boolQuery
();
// must key
// must key
nestedBoolQueryBuilder
.
must
(
cacheMapsNestedQuery
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.key.keyword"
,
concat
(
projectId
,
linkedGroupId
,
contendId
))));
nestedBoolQueryBuilder
.
must
(
cacheMapsNestedQuery
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.key.keyword"
,
concat
(
projectId
,
contendId
))));
// mediaType
// mediaType
if
(
CollectionUtils
.
isNotEmpty
(
mediaTypes
))
{
if
(
CollectionUtils
.
isNotEmpty
(
mediaTypes
))
{
BoolQueryBuilder
mediaTypeQueryBuilder
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
mediaTypeQueryBuilder
=
QueryBuilders
.
boolQuery
();
...
@@ -188,9 +188,16 @@ public class EsQueryTools {
...
@@ -188,9 +188,16 @@ public class EsQueryTools {
}
}
public
static
void
assembleContendsQuery
(
BoolQueryBuilder
query
,
Collection
<
String
>
contends
)
{
public
static
void
assembleContendsQuery
(
BoolQueryBuilder
query
,
Collection
<
String
>
contends
)
{
if
(
CollectionUtils
.
isEmpty
(
contends
))
{
return
;
}
for
(
String
contendId
:
contends
)
{
query
.
should
(
cacheMapsNestedQuery
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.contend_id.keyword"
,
contendId
)));
}
}
public
static
void
assembleContendsQuery4Channel
(
BoolQueryBuilder
query
,
Collection
<
String
>
contends
)
{
BoolQueryBuilder
contendQuery
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
contendQuery
=
QueryBuilders
.
boolQuery
();
// 主品牌一定参与
// contendQuery.should(QueryBuilders.termQuery("contend_id.keyword", "0"));
if
(
CollectionUtils
.
isEmpty
(
contends
))
{
if
(
CollectionUtils
.
isEmpty
(
contends
))
{
return
;
return
;
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/external/BaseMapCompound.java
View file @
07df721f
...
@@ -31,7 +31,7 @@ public class BaseMapCompound {
...
@@ -31,7 +31,7 @@ public class BaseMapCompound {
public
static
BaseMapCompound
createFromBaseMap
(
BaseMap
baseMap
,
String
projectId
)
{
public
static
BaseMapCompound
createFromBaseMap
(
BaseMap
baseMap
,
String
projectId
)
{
List
<
String
>
tagList
=
new
ArrayList
<>();
List
<
String
>
tagList
=
new
ArrayList
<>();
// 情感倾向
// 情感倾向
tagList
.
add
(
baseMap
.
getEmotion
());
//
tagList.add(baseMap.getEmotion());
// 媒体类型
// 媒体类型
String
mediaType
=
GlobalPojo
.
getMediaType
(
projectId
,
baseMap
.
getPlatform
(),
baseMap
.
getSource
());
String
mediaType
=
GlobalPojo
.
getMediaType
(
projectId
,
baseMap
.
getPlatform
(),
baseMap
.
getSource
());
if
(
null
!=
mediaType
)
{
if
(
null
!=
mediaType
)
{
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/external/BrandkbsHotTopWarn.java
View file @
07df721f
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
external
;
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
external
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -51,6 +54,17 @@ public class BrandkbsHotTopWarn {
...
@@ -51,6 +54,17 @@ public class BrandkbsHotTopWarn {
* 上榜时间
* 上榜时间
*/
*/
private
Long
time
;
private
Long
time
;
public
static
HotTop
createFromJSON
(
JSONObject
json
,
String
topReason
,
String
topName
)
{
HotTop
hotTop
=
new
HotTop
();
hotTop
.
setTitle
(
json
.
getString
(
"name"
));
hotTop
.
setTopReason
(
topReason
);
hotTop
.
setRank
(
json
.
getString
(
"lastRank"
)
+
"名"
);
hotTop
.
setHot
(
BigDecimal
.
valueOf
(
json
.
getLongValue
(
"lastCount"
)
/
10000.00
).
setScale
(
2
,
RoundingMode
.
UP
)
+
"w"
);
hotTop
.
setTopName
(
topName
);
hotTop
.
setTime
(
json
.
getLong
(
"endTime"
));
return
hotTop
;
}
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/pojo/external/BrandkbsNewCaseWarn.java
View file @
07df721f
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
external
;
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
external
;
import
com.zhiwei.brandkbs2.pojo.vo.CrisisCaseWarnVO
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -39,6 +41,26 @@ public class BrandkbsNewCaseWarn {
...
@@ -39,6 +41,26 @@ public class BrandkbsNewCaseWarn {
* 案例类别
* 案例类别
*/
*/
private
String
caseType
;
private
String
caseType
;
/**
* 分享链接
*/
private
String
url
;
public
static
NewCase
createFromCrisisCaseWarnVO
(
CrisisCaseWarnVO
vo
,
String
url
)
{
NewCase
newCase
=
new
NewCase
();
newCase
.
setTitle
(
vo
.
getEventName
());
List
<
String
>
tagList
=
new
ArrayList
<>();
tagList
.
add
(
vo
.
getPriBrand
());
tagList
.
addAll
(
vo
.
getPriCrisisTags
());
newCase
.
setTagList
(
tagList
);
newCase
.
setContent
(
vo
.
getIntroduction
());
newCase
.
setSpreadIndex
(
vo
.
getInterveneScore
());
newCase
.
setCaseType
(
vo
.
getCategory
());
newCase
.
setUrl
(
url
);
return
newCase
;
}
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/pojo/vo/CrisisCaseWarnVO.java
0 → 100644
View file @
07df721f
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.ToString
;
import
java.util.List
;
@Data
@ToString
@ApiModel
(
"危机案例预警展示"
)
public
class
CrisisCaseWarnVO
{
/**
* id
*/
private
int
id
;
/**
* 事件名
*/
private
String
eventName
;
/**
* 简介
*/
private
String
introduction
;
/**
* 主品牌名
*/
private
String
priBrand
;
/**
* 主品牌危机标签
*/
private
List
<
String
>
priCrisisTags
;
/**
* 公关传播效果指数
*/
private
Double
interveneScore
;
/**
* 案例类别
*/
private
String
category
;
}
src/main/java/com/zhiwei/brandkbs2/service/ProjectWarnService.java
View file @
07df721f
...
@@ -5,6 +5,7 @@ import com.zhiwei.brandkbs2.pojo.external.BrandkbsChannelConfig;
...
@@ -5,6 +5,7 @@ import com.zhiwei.brandkbs2.pojo.external.BrandkbsChannelConfig;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsHotEventConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsHotEventConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsHotTopConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsHotTopConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsYuQingConfig
;
import
com.zhiwei.brandkbs2.pojo.external.BrandkbsYuQingConfig
;
import
com.zhiwei.brandkbs2.pojo.vo.CrisisCaseWarnVO
;
public
interface
ProjectWarnService
{
public
interface
ProjectWarnService
{
...
@@ -16,16 +17,56 @@ public interface ProjectWarnService {
...
@@ -16,16 +17,56 @@ public interface ProjectWarnService {
*/
*/
ResponseResult
getProjectWarnCriteria
(
String
projectId
,
String
type
);
ResponseResult
getProjectWarnCriteria
(
String
projectId
,
String
type
);
/**
* 获取项目预警条件默认值
* @param projectId
* @param type
* @return
*/
ResponseResult
getProjectWarnCriteriaDefault
(
String
projectId
,
String
type
);
ResponseResult
getProjectWarnCriteriaDefault
(
String
projectId
,
String
type
);
/**
* 获取舆情动态预警
* @param projectId
* @param brandkbsYuQingConfig
* @return
*/
ResponseResult
getYuqingWaring
(
String
projectId
,
BrandkbsYuQingConfig
brandkbsYuQingConfig
);
ResponseResult
getYuqingWaring
(
String
projectId
,
BrandkbsYuQingConfig
brandkbsYuQingConfig
);
/**
* 获取渠道参与预警
* @param projectId
* @param brandkbsChannelConfig
* @return
*/
ResponseResult
getChannelWaring
(
String
projectId
,
BrandkbsChannelConfig
brandkbsChannelConfig
);
ResponseResult
getChannelWaring
(
String
projectId
,
BrandkbsChannelConfig
brandkbsChannelConfig
);
/**
* 获取热点事件预警
* @param projectId
* @param brandkbsHotEventConfig
* @return
*/
ResponseResult
getHotEventWaring
(
String
projectId
,
BrandkbsHotEventConfig
brandkbsHotEventConfig
);
ResponseResult
getHotEventWaring
(
String
projectId
,
BrandkbsHotEventConfig
brandkbsHotEventConfig
);
/**
* 获取上榜热搜预警
* @param projectId
* @param config
* @return
*/
ResponseResult
getHotTopWaring
(
String
projectId
,
BrandkbsHotTopConfig
config
);
ResponseResult
getHotTopWaring
(
String
projectId
,
BrandkbsHotTopConfig
config
);
/**
* 获取案例上新预警
* @param projectId
* @return
*/
ResponseResult
getNewCaseWaring
(
String
projectId
);
ResponseResult
getNewCaseWaring
(
String
projectId
);
/**
* 案例上新主动调用
* @param caseWarnVO
*/
void
newCrisisCaseWarn
(
CrisisCaseWarnVO
caseWarnVO
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
07df721f
...
@@ -1407,7 +1407,7 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -1407,7 +1407,7 @@ public class ChannelServiceImpl implements ChannelService {
query
.
must
(
QueryBuilders
.
termQuery
(
"project_id.keyword"
,
projectId
));
query
.
must
(
QueryBuilders
.
termQuery
(
"project_id.keyword"
,
projectId
));
// 添加contends集合 查询
// 添加contends集合 查询
if
(
null
!=
contendIds
)
{
if
(
null
!=
contendIds
)
{
EsQueryTools
.
assembleContendsQuery
(
query
,
contendIds
);
EsQueryTools
.
assembleContendsQuery
4Channel
(
query
,
contendIds
);
}
}
// 添加渠道限制
// 添加渠道限制
if
(
null
!=
channelId
)
{
if
(
null
!=
channelId
)
{
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkFlowServiceImpl.java
View file @
07df721f
...
@@ -142,6 +142,7 @@ public class MarkFlowServiceImpl implements MarkFlowService {
...
@@ -142,6 +142,7 @@ public class MarkFlowServiceImpl implements MarkFlowService {
}
}
double
channelValue
=
tJson
.
getDoubleValue
(
GenericAttribute
.
ES_CHANNEL_INFLUENCE
);
double
channelValue
=
tJson
.
getDoubleValue
(
GenericAttribute
.
ES_CHANNEL_INFLUENCE
);
if
(
channelValue
>
0
)
{
if
(
channelValue
>
0
)
{
// 保留两位小数
sourceDetails
.
put
(
"channelInfluence"
,
new
BigDecimal
(
channelValue
).
setScale
(
2
,
RoundingMode
.
UP
));
sourceDetails
.
put
(
"channelInfluence"
,
new
BigDecimal
(
channelValue
).
setScale
(
2
,
RoundingMode
.
UP
));
}
}
return
sourceDetails
;
return
sourceDetails
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectWarnServiceImpl.java
View file @
07df721f
...
@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.service.impl;
...
@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.common.
GenericAttribute
;
import
com.zhiwei.brandkbs2.common.
RedisKeyPrefix
;
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.EventDao
;
import
com.zhiwei.brandkbs2.dao.EventDao
;
...
@@ -13,10 +13,13 @@ import com.zhiwei.brandkbs2.es.EsQueryTools;
...
@@ -13,10 +13,13 @@ import com.zhiwei.brandkbs2.es.EsQueryTools;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.*
;
import
com.zhiwei.brandkbs2.pojo.*
;
import
com.zhiwei.brandkbs2.pojo.external.*
;
import
com.zhiwei.brandkbs2.pojo.external.*
;
import
com.zhiwei.brandkbs2.pojo.vo.CrisisCaseWarnVO
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectWarnService
;
import
com.zhiwei.brandkbs2.service.ProjectWarnService
;
import
com.zhiwei.brandkbs2.util.RedisUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
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.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
...
@@ -29,8 +32,8 @@ import org.springframework.stereotype.Service;
...
@@ -29,8 +32,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -48,6 +51,15 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -48,6 +51,15 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
@Value
(
"${ef.external.filterNew.url}"
)
@Value
(
"${ef.external.filterNew.url}"
)
private
String
getExternalFilterNewUrl
;
private
String
getExternalFilterNewUrl
;
@Value
(
"${hot.search.url}"
)
private
String
hotSearchUrl
;
@Value
(
"${crisis.share.url}"
)
private
String
crisisEventShareUrl
;
@Value
(
"${crisis.event.url}"
)
private
String
crisisEventUrl
;
@Autowired
@Autowired
private
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
...
@@ -63,6 +75,22 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -63,6 +75,22 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
@Resource
(
name
=
"eventDao"
)
@Resource
(
name
=
"eventDao"
)
EventDao
eventDao
;
EventDao
eventDao
;
@Resource
(
name
=
"redisUtil"
)
RedisUtil
redisUtil
;
private
static
final
Map
<
String
,
String
>
TYPE_SEARCH
=
new
HashMap
<>();
static
{
TYPE_SEARCH
.
put
(
"微博热搜"
,
"weibo"
);
TYPE_SEARCH
.
put
(
"微博话题"
,
"weibo-topic"
);
TYPE_SEARCH
.
put
(
"微博预热"
,
"weibo-rise"
);
TYPE_SEARCH
.
put
(
"头条热搜"
,
"toutiao"
);
TYPE_SEARCH
.
put
(
"抖音热搜"
,
"douyin"
);
TYPE_SEARCH
.
put
(
"知乎热搜"
,
"zhihu"
);
TYPE_SEARCH
.
put
(
"B站热搜"
,
"bilibili-ranking"
);
TYPE_SEARCH
.
put
(
"快手热搜"
,
"kuaishou"
);
}
@Override
@Override
public
ResponseResult
getProjectWarnCriteria
(
String
projectId
,
String
type
)
{
public
ResponseResult
getProjectWarnCriteria
(
String
projectId
,
String
type
)
{
Map
<
String
,
Object
>
res
=
new
HashMap
<>();
Map
<
String
,
Object
>
res
=
new
HashMap
<>();
...
@@ -77,12 +105,10 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -77,12 +105,10 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"contends"
,
nameList
,
idList
);
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"contends"
,
nameList
,
idList
);
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"keyword"
,
null
);
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"keyword"
,
null
);
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"duplicate"
,
Arrays
.
asList
(
"去重"
,
"不去重"
),
Arrays
.
asList
(
true
,
false
),
Collections
.
singletonList
(
"不去重"
));
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"duplicate"
,
Arrays
.
asList
(
"去重"
,
"不去重"
),
Arrays
.
asList
(
true
,
false
),
Collections
.
singletonList
(
"不去重"
));
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"pushInterval"
,
Arrays
.
asList
(
"10min"
,
"30min"
,
"60min"
),
Arrays
.
asList
(
10
*
ONE_MINUTE
,
30
*
ONE_MINUTE
,
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"pushInterval"
,
Arrays
.
asList
(
"10min"
,
"30min"
,
"60min"
),
Arrays
.
asList
(
10
*
ONE_MINUTE
,
30
*
ONE_MINUTE
,
60
*
ONE_MINUTE
),
Collections
.
singletonList
(
"10min"
));
60
*
ONE_MINUTE
),
Collections
.
singletonList
(
"10min"
));
break
;
break
;
case
"渠道参与"
:
case
"渠道参与"
:
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"friendlyChannel"
,
Arrays
.
asList
(
"友好渠道"
,
"敏感渠道"
,
"自定义渠道"
),
Arrays
.
asList
(
true
,
false
,
null
),
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"friendlyChannel"
,
Arrays
.
asList
(
"友好渠道"
,
"敏感渠道"
,
"自定义渠道"
),
Arrays
.
asList
(
true
,
false
,
null
),
Collections
.
singletonList
(
"自定义渠道"
));
Collections
.
singletonList
(
"自定义渠道"
));
List
<
Map
<
String
,
Object
>>
thresholdValue
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
thresholdValue
=
new
ArrayList
<>();
for
(
String
name
:
Arrays
.
asList
(
"友好渠道 友好指数"
,
"敏感渠道 敏感指数"
))
{
for
(
String
name
:
Arrays
.
asList
(
"友好渠道 友好指数"
,
"敏感渠道 敏感指数"
))
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
@@ -95,8 +121,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -95,8 +121,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"primary"
,
Arrays
.
asList
(
"原创"
,
"转发"
),
Arrays
.
asList
(
false
,
true
),
Collections
.
singletonList
(
"原创"
));
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"primary"
,
Arrays
.
asList
(
"原创"
,
"转发"
),
Arrays
.
asList
(
false
,
true
),
Collections
.
singletonList
(
"原创"
));
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"markerTags"
,
Arrays
.
asList
(
"正面"
,
"中性"
,
"负面"
),
Collections
.
singletonList
(
"负面"
));
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"markerTags"
,
Arrays
.
asList
(
"正面"
,
"中性"
,
"负面"
),
Collections
.
singletonList
(
"负面"
));
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"duplicate"
,
Arrays
.
asList
(
"去重"
,
"不去重"
),
Arrays
.
asList
(
true
,
false
),
Collections
.
singletonList
(
"去重"
));
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"duplicate"
,
Arrays
.
asList
(
"去重"
,
"不去重"
),
Arrays
.
asList
(
true
,
false
),
Collections
.
singletonList
(
"去重"
));
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"pushInterval"
,
Arrays
.
asList
(
"10min"
,
"30min"
,
"60min"
),
Arrays
.
asList
(
10
*
ONE_MINUTE
,
30
*
ONE_MINUTE
,
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"pushInterval"
,
Arrays
.
asList
(
"10min"
,
"30min"
,
"60min"
),
Arrays
.
asList
(
10
*
ONE_MINUTE
,
30
*
ONE_MINUTE
,
60
*
ONE_MINUTE
),
Collections
.
singletonList
(
"10min"
));
60
*
ONE_MINUTE
),
Collections
.
singletonList
(
"10min"
));
break
;
break
;
case
"热点事件"
:
case
"热点事件"
:
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"ownEvent"
,
Arrays
.
asList
(
"正面"
,
"中性"
,
"负面"
),
Arrays
.
asList
(
"正面"
,
"中性"
,
"负面"
));
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"ownEvent"
,
Arrays
.
asList
(
"正面"
,
"中性"
,
"负面"
),
Arrays
.
asList
(
"正面"
,
"中性"
,
"负面"
));
...
@@ -107,14 +132,12 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -107,14 +132,12 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
List
<
String
>
zhiWeiEventList
=
Arrays
.
asList
(
"社会"
,
"互联网"
,
"政务"
,
"财经"
,
"企业"
,
"娱乐"
,
"灾难"
,
"违法犯罪"
,
"国际"
,
"体育"
,
"谣言"
);
List
<
String
>
zhiWeiEventList
=
Arrays
.
asList
(
"社会"
,
"互联网"
,
"政务"
,
"财经"
,
"企业"
,
"娱乐"
,
"灾难"
,
"违法犯罪"
,
"国际"
,
"体育"
,
"谣言"
);
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"zhiWeiEvent"
,
zhiWeiEventList
,
zhiWeiEventList
);
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"zhiWeiEvent"
,
zhiWeiEventList
,
zhiWeiEventList
);
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"eventTop"
,
Arrays
.
asList
(
"TOP5"
,
"TOP10"
),
Arrays
.
asList
(
5
,
10
),
Collections
.
singletonList
(
"TOP10"
));
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"eventTop"
,
Arrays
.
asList
(
"TOP5"
,
"TOP10"
),
Arrays
.
asList
(
5
,
10
),
Collections
.
singletonList
(
"TOP10"
));
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"timeCycles"
,
Arrays
.
asList
(
"周一"
,
"周二"
,
"周三"
,
"周四"
,
"周五"
,
"周六"
,
"周日"
),
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"timeCycles"
,
Arrays
.
asList
(
"周一"
,
"周二"
,
"周三"
,
"周四"
,
"周五"
,
"周六"
,
"周日"
),
Arrays
.
asList
(
2
,
3
,
4
,
5
,
6
,
7
,
1
),
Collections
.
singletonList
(
"周一"
));
Arrays
.
asList
(
2
,
3
,
4
,
5
,
6
,
7
,
1
),
Collections
.
singletonList
(
"周一"
));
break
;
break
;
case
"上榜热搜"
:
case
"上榜热搜"
:
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"warnKeyword"
,
null
);
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"warnKeyword"
,
null
);
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"filterKeyword"
,
null
);
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"filterKeyword"
,
null
);
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"listType"
,
Arrays
.
asList
(
"微博热搜"
,
"微博话题"
,
"微博预热"
,
"头条热搜"
,
"抖音热搜"
,
"知乎热搜"
,
"B站热搜"
,
"快手热榜"
),
CriteriaHelper
.
warnCriteriaAddSimple
(
res
,
"listType"
,
Arrays
.
asList
(
"微博热搜"
,
"微博话题"
,
"微博预热"
,
"头条热搜"
,
"抖音热搜"
,
"知乎热搜"
,
"B站热搜"
,
"快手热榜"
),
Collections
.
singletonList
(
"微博热搜"
));
Collections
.
singletonList
(
"微博热搜"
));
List
<
Map
<
String
,
Object
>>
topNewHeight
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
topNewHeight
=
new
ArrayList
<>();
for
(
int
i
:
Arrays
.
asList
(
3
,
5
,
10
,
20
,
50
))
{
for
(
int
i
:
Arrays
.
asList
(
3
,
5
,
10
,
20
,
50
))
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
@@ -125,8 +148,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -125,8 +148,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
res
.
put
(
"topNewHeight"
,
topNewHeight
);
res
.
put
(
"topNewHeight"
,
topNewHeight
);
List
<
String
>
warnTypeList
=
Arrays
.
asList
(
"首次上榜"
,
"排名新高"
,
"掉榜和再次上榜"
,
"导语(仅支持微博平台)"
);
List
<
String
>
warnTypeList
=
Arrays
.
asList
(
"首次上榜"
,
"排名新高"
,
"掉榜和再次上榜"
,
"导语(仅支持微博平台)"
);
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"warnType"
,
warnTypeList
,
Arrays
.
asList
(
"firstTop"
,
"newHeight"
,
"topOnceAgain"
,
"introduction"
),
warnTypeList
);
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"warnType"
,
warnTypeList
,
Arrays
.
asList
(
"firstTop"
,
"newHeight"
,
"topOnceAgain"
,
"introduction"
),
warnTypeList
);
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"pushInterval"
,
Collections
.
singletonList
(
"5min"
),
Collections
.
singletonList
(
5
*
ONE_MINUTE
),
CriteriaHelper
.
warnCriteriaAdd
(
res
,
"pushInterval"
,
Collections
.
singletonList
(
"5min"
),
Collections
.
singletonList
(
5
*
ONE_MINUTE
),
Collections
.
singletonList
(
"5min"
));
Collections
.
singletonList
(
"5min"
));
break
;
break
;
case
"案例上新"
:
case
"案例上新"
:
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
...
@@ -182,7 +204,373 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -182,7 +204,373 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
return
ResponseResult
.
success
();
return
ResponseResult
.
success
();
}
}
private
ResponseResult
yuqingWaringReal
(
String
projectId
,
BrandkbsYuQingConfig
config
)
{
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4Yuqing
(
BrandkbsYuQingConfig
config
,
List
<
BaseMap
>
datas
,
long
start
,
long
end
,
AbstractProject
project
)
{
if
(
datas
.
isEmpty
())
{
return
null
;
}
int
firstCount
=
datas
.
size
();
// key1
String
key1
=
"【品见】舆情动态-"
+
project
.
getProjectName
();
// key2
String
key2Header
=
"全部"
;
StringBuilder
mediaChannel
=
new
StringBuilder
();
config
.
getChannelTypes
().
forEach
(
channelType
->
mediaChannel
.
append
(
channelType
).
append
(
"、"
));
if
(
0
!=
mediaChannel
.
length
())
{
key2Header
=
mediaChannel
.
deleteCharAt
(
mediaChannel
.
length
()
-
1
).
toString
();
}
key2Header
+=
"媒体,"
;
StringBuilder
dataType
=
new
StringBuilder
();
config
.
getMarkerTags
().
forEach
(
emotion
->
dataType
.
append
(
emotion
).
append
(
" "
));
dataType
.
append
(
"(本品)"
);
// 如果有竞品
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getContends
()))
{
dataType
.
append
(
","
);
config
.
getContends
().
forEach
(
contend
->
dataType
.
append
(
projectService
.
getProjectByContendId
(
project
.
getId
(),
contend
).
getBrandName
()).
append
(
" "
));
dataType
.
append
(
"(竞品)"
);
}
String
key2
=
key2Header
+
dataType
;
// key3
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
start
)
+
" ~ "
+
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
end
);
// key4
String
key4
;
StringBuilder
keyBuilder4
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
Math
.
min
(
datas
.
size
(),
2
);
i
++)
{
BaseMap
baseMap
=
datas
.
get
(
i
);
String
platform
=
baseMap
.
getPlatform
();
String
source
=
baseMap
.
getSource
();
String
title
=
baseMap
.
getTitle
();
keyBuilder4
.
append
(
platform
).
append
(
"-"
).
append
(
source
).
append
(
"\r\n"
);
// 最后一条
if
(
datas
.
size
()
==
i
+
1
)
{
keyBuilder4
.
append
(
i
+
1
).
append
(
"、"
).
append
(
title
);
}
else
{
keyBuilder4
.
append
(
i
+
1
).
append
(
"、"
).
append
(
title
).
append
(
"\r\n"
);
}
}
if
(
datas
.
size
()
>
2
)
{
key4
=
keyBuilder4
.
append
(
"..."
).
toString
();
}
else
{
key4
=
keyBuilder4
.
toString
();
}
List
<
BaseMapCompound
>
collect
=
datas
.
stream
().
map
(
baseMap
->
BaseMapCompound
.
createFromBaseMap
(
baseMap
,
project
.
getId
())).
collect
(
Collectors
.
toList
());
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsYuQingWarn
(
collect
));
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4Channel
(
BrandkbsChannelConfig
config
,
List
<
BaseMap
>
datas
,
long
start
,
long
end
,
AbstractProject
project
)
{
if
(
datas
.
isEmpty
())
{
return
null
;
}
int
firstCount
=
datas
.
size
();
// key1
String
key1
=
"【品见】渠道参与-"
+
project
.
getProjectName
();
// key2
String
key2
=
"自定义渠道"
;
if
(
Boolean
.
TRUE
.
equals
(
config
.
getFriendlyChannel
()))
{
key2
=
"友好渠道"
;
}
else
if
(
Boolean
.
FALSE
.
equals
(
config
.
getFriendlyChannel
()))
{
key2
=
"敏感渠道"
;
}
// key3
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
start
)
+
" ~ "
+
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
end
);
// key4
String
key4
;
StringBuilder
keyBuilder4
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
Math
.
min
(
datas
.
size
(),
2
);
i
++)
{
BaseMap
baseMap
=
datas
.
get
(
i
);
String
platform
=
baseMap
.
getPlatform
();
String
source
=
baseMap
.
getSource
();
String
title
=
baseMap
.
getTitle
();
keyBuilder4
.
append
(
platform
).
append
(
"-"
).
append
(
source
).
append
(
"\r\n"
);
// 最后一条
if
(
datas
.
size
()
==
i
+
1
)
{
keyBuilder4
.
append
(
i
+
1
).
append
(
"、"
).
append
(
title
);
}
else
{
keyBuilder4
.
append
(
i
+
1
).
append
(
"、"
).
append
(
title
).
append
(
"\r\n"
);
}
}
if
(
datas
.
size
()
>
2
)
{
key4
=
keyBuilder4
.
append
(
"..."
).
toString
();
}
else
{
key4
=
keyBuilder4
.
toString
();
}
List
<
BaseMapCompound
>
collect
=
datas
.
stream
().
map
(
baseMap
->
BaseMapCompound
.
createFromBaseMap
(
baseMap
,
project
.
getId
())).
collect
(
Collectors
.
toList
());
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsYuQingWarn
(
collect
));
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4HotEvent
(
BrandkbsHotEventConfig
config
,
Map
<
String
,
List
<
Event
>>
eventMap
,
long
start
,
long
end
,
AbstractProject
project
)
{
int
firstCount
=
eventMap
.
values
().
stream
().
mapToInt
(
List:
:
size
).
sum
();
if
(
firstCount
==
0
)
{
return
null
;
}
String
key1
=
"【品见】热点事件-"
+
project
.
getProjectName
();
// key2
String
key2
=
null
;
// key3
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
start
)
+
" ~ "
+
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
end
);
// key4
String
key4
;
StringBuilder
keyBuilder4
=
new
StringBuilder
();
final
int
limit
=
2
;
int
count
=
limit
;
out:
for
(
List
<
Event
>
value
:
eventMap
.
values
())
{
for
(
Event
event
:
value
)
{
if
(--
count
==
0
)
{
if
(
firstCount
<=
limit
)
{
keyBuilder4
.
append
(
event
.
getTitle
());
}
else
{
keyBuilder4
.
append
(
event
.
getTitle
()).
append
(
"\r\n"
);
}
break
out
;
}
else
{
keyBuilder4
.
append
(
event
.
getTitle
()).
append
(
"\r\n"
);
}
}
}
if
(
firstCount
>
limit
)
{
key4
=
keyBuilder4
.
append
(
"..."
).
toString
();
}
else
{
key4
=
keyBuilder4
.
toString
();
}
List
<
BrandkbsHotEventWarn
.
HotEvent
>
collect
=
eventMap
.
entrySet
().
stream
().
map
(
entry
->
entry
.
getValue
().
stream
().
map
(
event
->
BrandkbsHotEventWarn
.
HotEvent
.
createFromEvent
(
entry
.
getKey
(),
event
)).
collect
(
Collectors
.
toList
())).
collect
(
Collectors
.
toList
()).
stream
().
flatMap
(
List:
:
stream
).
collect
(
Collectors
.
toList
());
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsHotEventWarn
(
collect
));
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4HotTop
(
BrandkbsHotTopConfig
config
,
List
<
BrandkbsHotTopWarn
.
HotTop
>
datas
,
long
start
,
long
end
,
AbstractProject
project
)
{
if
(
CollectionUtils
.
isEmpty
(
datas
))
{
return
null
;
}
String
key1
=
"【品见】上榜热搜-"
+
project
.
getProjectName
();
// key2
String
key2
=
""
;
List
<
String
>
key2Element
=
new
ArrayList
<>();
config
.
getListType
().
forEach
(
type
->
{
if
(
config
.
getFirstTop
())
{
key2Element
.
add
(
type
+
"榜-首次上榜"
);
}
if
(
config
.
getNewHeight
())
{
key2Element
.
add
(
type
+
"榜-排名新高"
);
}
if
(
config
.
getTopOnceAgain
())
{
key2Element
.
add
(
type
+
"榜-掉榜和再次上榜"
);
}
if
((
type
.
equals
(
"微博话题"
)
||
type
.
equals
(
"微博热搜"
))
&&
config
.
getIntroduction
())
{
key2Element
.
add
(
type
+
"榜-导语"
);
}
});
if
(
key2Element
.
size
()
>
2
)
{
key2
=
key2Element
.
get
(
0
)
+
"、"
+
key2Element
.
get
(
1
)
+
"..."
;
}
else
if
(
1
==
key2Element
.
size
())
{
key2
=
key2Element
.
get
(
0
);
}
else
if
(
2
==
key2Element
.
size
())
{
key2
=
key2Element
.
get
(
0
)
+
"、"
+
key2Element
.
get
(
1
);
}
// key3
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
start
)
+
" ~ "
+
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
end
);
// key4
String
key4
;
StringBuilder
keyBuilder4
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
Math
.
min
(
datas
.
size
(),
2
);
i
++)
{
BrandkbsHotTopWarn
.
HotTop
hotTop
=
datas
.
get
(
i
);
String
topName
=
hotTop
.
getTopName
()
+
"榜"
;
String
title
=
hotTop
.
getTitle
();
keyBuilder4
.
append
(
topName
).
append
(
"\r\n"
);
// 最后一条
if
(
datas
.
size
()
==
i
+
1
)
{
keyBuilder4
.
append
(
i
+
1
).
append
(
"、"
).
append
(
title
);
}
else
{
keyBuilder4
.
append
(
i
+
1
).
append
(
"、"
).
append
(
title
).
append
(
"\r\n"
);
}
}
if
(
datas
.
size
()
>
2
)
{
key4
=
keyBuilder4
.
append
(
"..."
).
toString
();
}
else
{
key4
=
keyBuilder4
.
toString
();
}
return
new
BrandkbsWarnTemplate
(
datas
.
size
(),
key1
,
key2
,
key3
,
key4
,
new
BrandkbsHotTopWarn
(
config
.
getWarnKeyword
(),
config
.
getFilterKeyword
(),
datas
));
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4NewCase
(
List
<
BrandkbsNewCaseWarn
.
NewCase
>
datas
,
Long
time
,
Project
project
)
{
if
(
CollectionUtils
.
isEmpty
(
datas
))
{
return
null
;
}
int
firstCount
=
datas
.
size
();
String
key1
=
"【品见】案例上新-"
+
project
.
getProjectName
();
String
key2
=
null
;
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
time
);
// key4
String
key4
;
StringBuilder
keyBuilder4
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
Math
.
min
(
datas
.
size
(),
2
);
i
++)
{
BrandkbsNewCaseWarn
.
NewCase
newCase
=
datas
.
get
(
i
);
String
title
=
newCase
.
getTitle
();
// 最后一条
if
(
datas
.
size
()
==
i
+
1
)
{
keyBuilder4
.
append
(
title
);
}
else
{
keyBuilder4
.
append
(
title
).
append
(
"\r\n"
);
}
}
if
(
datas
.
size
()
>
2
)
{
key4
=
keyBuilder4
.
append
(
"..."
).
toString
();
}
else
{
key4
=
keyBuilder4
.
toString
();
}
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsNewCaseWarn
(
datas
));
}
private
List
<
JSONObject
>
getRankListByType
(
String
type
)
{
String
search
=
TYPE_SEARCH
.
get
(
type
);
if
(
null
==
search
)
{
log
.
error
(
"getRankListByType,search-null,type:{}"
,
type
);
return
Collections
.
emptyList
();
}
try
{
ResponseEntity
<
String
>
response
=
restTemplate
.
getForEntity
(
hotSearchUrl
,
String
.
class
,
search
);
return
JSON
.
parseObject
(
response
.
getBody
()).
getJSONArray
(
"data"
).
toJavaList
(
JSONObject
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"{} 热搜获取失败:"
,
search
,
e
);
}
return
Collections
.
emptyList
();
}
/**
* 处理热搜预警
*
* @param rankList 匹配的热搜结果集
* @param type 类型
*/
private
List
<
BrandkbsHotTopWarn
.
HotTop
>
getHotTopList
(
BrandkbsHotTopConfig
config
,
String
projectId
,
List
<
JSONObject
>
rankList
,
String
type
)
{
if
(
CollectionUtils
.
isEmpty
(
rankList
))
{
return
Collections
.
emptyList
();
}
// 关键词和过滤词筛选
List
<
JSONObject
>
resList
=
rankList
.
stream
().
filter
(
wbRank
->
{
String
hotSearchName
=
wbRank
.
getString
(
"name"
).
toLowerCase
();
return
Tools
.
isContains
(
config
.
getWarnKeyword
(),
hotSearchName
)
&&
Tools
.
isExclusive
(
config
.
getFilterKeyword
(),
hotSearchName
);
}).
collect
(
Collectors
.
toList
());
//首次进榜
List
<
JSONObject
>
firstList
=
new
ArrayList
<>();
//排名新高
List
<
JSONObject
>
newTopList
=
new
ArrayList
<>();
//掉榜
List
<
JSONObject
>
dropList
=
new
ArrayList
<>();
//再次上榜
List
<
JSONObject
>
reappearList
=
new
ArrayList
<>();
//当前上榜的名称
List
<
String
>
lastNameList
=
resList
.
stream
().
map
(
json
->
json
.
getString
(
"name"
)).
collect
(
Collectors
.
toList
());
//之前掉榜的热搜名称列表
List
<
String
>
preDropNameList
=
new
ArrayList
<>();
//之前上榜的数据
String
projectWarnRedisKey
=
RedisKeyPrefix
.
projectWarnHotTopKeyAll
(
projectId
,
type
+
"_*"
);
Set
<
String
>
keys
=
redisUtil
.
keys
(
projectWarnRedisKey
);
if
(
CollectionUtils
.
isNotEmpty
(
keys
))
{
//查询之前未掉榜的数据
List
<
JSONObject
>
preNotDropList
=
keys
.
stream
().
map
(
key
->
JSON
.
parseObject
(
redisUtil
.
get
(
key
))).
filter
(
jsonObject
->
Integer
.
parseInt
(
jsonObject
.
getString
(
"lastRank"
))
>
0
).
collect
(
Collectors
.
toList
());
preNotDropList
.
forEach
(
pre
->
{
String
preName
=
pre
.
getString
(
"name"
);
//之前上榜数据本次未出现
if
(!
lastNameList
.
contains
(
preName
))
{
//修改状态
String
redisKey
=
RedisKeyPrefix
.
projectWarnHotTopKey
(
projectId
,
type
,
preName
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"name"
,
pre
.
getString
(
"name"
));
jsonObject
.
put
(
"lastRank"
,
-
1
);
jsonObject
.
put
(
"lastCount"
,
-
1
);
jsonObject
.
put
(
"url"
,
pre
.
getString
(
"url"
));
jsonObject
.
put
(
"endTime"
,
pre
.
getLong
(
"endTime"
));
redisUtil
.
setExpire
(
redisKey
,
jsonObject
.
toJSONString
(),
7
,
TimeUnit
.
DAYS
);
//加入掉榜列表
dropList
.
add
(
jsonObject
);
}
});
//查询之前掉榜的热搜名称列表
preDropNameList
=
keys
.
stream
().
map
(
key
->
JSON
.
parseObject
(
redisUtil
.
get
(
key
))).
filter
(
jsonObject
->
Integer
.
parseInt
(
jsonObject
.
getString
(
"lastRank"
))
==
1
).
map
(
jsonObject
->
jsonObject
.
getString
(
"name"
)).
collect
(
Collectors
.
toList
());
}
List
<
String
>
finalPreDropNameList
=
preDropNameList
;
resList
.
forEach
(
json
->
{
//热搜名称
String
name
=
json
.
getString
(
"name"
);
//当前排名
int
lastRank
=
json
.
getIntValue
(
"lastRank"
);
//热度值
long
lastCount
=
json
.
getLongValue
(
"lastCount"
);
//链接
String
url
=
json
.
getString
(
"url"
);
//时间
Long
endTime
=
json
.
getLong
(
"endTime"
);
//获取之前的排名
String
hotSearchRedis
=
RedisKeyPrefix
.
projectWarnHotTopKey
(
projectId
,
type
,
name
);
String
result
=
redisUtil
.
get
(
hotSearchRedis
);
String
oldRank
=
""
;
if
(
StringUtils
.
isNotEmpty
(
result
))
{
oldRank
=
JSON
.
parseObject
(
result
).
getString
(
"lastRank"
);
}
//更新数据
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"name"
,
name
);
jsonObject
.
put
(
"lastRank"
,
lastRank
);
jsonObject
.
put
(
"lastCount"
,
lastCount
);
jsonObject
.
put
(
"url"
,
url
);
jsonObject
.
put
(
"endTime"
,
endTime
);
redisUtil
.
setExpire
(
hotSearchRedis
,
jsonObject
.
toJSONString
(),
7
,
TimeUnit
.
DAYS
);
if
(
finalPreDropNameList
.
contains
(
name
))
{
//加入再次上榜列表
reappearList
.
add
(
jsonObject
);
}
//首次上榜
if
(
StringUtils
.
isEmpty
(
oldRank
))
{
firstList
.
add
(
json
);
}
else
if
(
Integer
.
parseInt
(
oldRank
)
>
0
&&
lastRank
<=
config
.
getTopNewHeight
()
&&
lastRank
<
Integer
.
parseInt
(
oldRank
))
{
//排名新高
newTopList
.
add
(
json
);
}
});
List
<
BrandkbsHotTopWarn
.
HotTop
>
hotTops
=
new
ArrayList
<>();
if
(
Boolean
.
TRUE
.
equals
(
config
.
getFirstTop
()))
{
hotTops
.
addAll
(
firstList
.
stream
().
map
(
json
->
BrandkbsHotTopWarn
.
HotTop
.
createFromJSON
(
json
,
"首次上榜"
,
type
)).
collect
(
Collectors
.
toList
()));
}
if
(
Boolean
.
TRUE
.
equals
(
config
.
getNewHeight
()))
{
hotTops
.
addAll
(
newTopList
.
stream
().
map
(
json
->
BrandkbsHotTopWarn
.
HotTop
.
createFromJSON
(
json
,
"排名新高"
,
type
)).
collect
(
Collectors
.
toList
()));
}
if
(
Boolean
.
TRUE
.
equals
(
config
.
getTopOnceAgain
()))
{
hotTops
.
addAll
(
dropList
.
stream
().
map
(
json
->
BrandkbsHotTopWarn
.
HotTop
.
createFromJSON
(
json
,
"掉榜"
,
type
)).
collect
(
Collectors
.
toList
()));
hotTops
.
addAll
(
reappearList
.
stream
().
map
(
json
->
BrandkbsHotTopWarn
.
HotTop
.
createFromJSON
(
json
,
"再次上榜"
,
type
)).
collect
(
Collectors
.
toList
()));
}
if
(((
type
.
equals
(
"微博话题"
)
||
type
.
equals
(
"微博热搜"
))
&&
Boolean
.
TRUE
.
equals
(
config
.
getIntroduction
())))
{
List
<
JSONObject
>
topLeads
=
rankList
.
stream
().
filter
(
wbRank
->
{
if
(
wbRank
.
getString
(
"topicLead"
)
==
null
)
{
return
false
;
}
String
topicLead
=
wbRank
.
getString
(
"topicLead"
).
toLowerCase
();
return
Tools
.
isContains
(
config
.
getWarnKeyword
(),
topicLead
)
&&
Tools
.
isExclusive
(
config
.
getFilterKeyword
(),
topicLead
);
}).
collect
(
Collectors
.
toList
());
hotTops
.
addAll
(
topLeads
.
stream
().
map
(
json
->
BrandkbsHotTopWarn
.
HotTop
.
createFromJSON
(
json
,
"导语"
,
type
)).
collect
(
Collectors
.
toList
()));
}
return
hotTops
;
}
private
List
<
BaseMap
>
duplicateBaseMapList
(
List
<
BaseMap
>
datas
)
{
Map
<
String
,
BaseMap
>
duplicateMap
=
new
LinkedHashMap
<>();
for
(
BaseMap
data
:
datas
)
{
String
key
=
Tools
.
filterSpecialCharacter
(
data
.
getTitleNullOptionalContent
());
BaseMap
newValue
;
if
(
duplicateMap
.
containsKey
(
key
))
{
BaseMap
oldValue
=
duplicateMap
.
get
(
key
);
// 取最早时间的数据
newValue
=
data
.
getTime
()
<
oldValue
.
getTime
()
?
data
:
oldValue
;
}
else
{
newValue
=
data
;
}
duplicateMap
.
put
(
key
,
newValue
);
}
return
new
ArrayList
<>(
duplicateMap
.
values
());
}
@Override
public
ResponseResult
getYuqingWaring
(
String
projectId
,
BrandkbsYuQingConfig
config
)
{
Project
project
=
null
;
Project
project
=
null
;
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
long
start
=
end
-
config
.
getPushInterval
();
long
start
=
end
-
config
.
getPushInterval
();
...
@@ -202,24 +590,29 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -202,24 +590,29 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
// 本品舆情+竞品舆情
// 本品舆情+竞品舆情
BoolQueryBuilder
sourceBuilder
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
sourceBuilder
=
QueryBuilders
.
boolQuery
();
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getMarkerTags
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getMarkerTags
()))
{
sourceBuilder
.
should
(
QueryBuilders
.
termQuery
(
"brandkbs_mark_cache_maps.name.keyword"
,
config
.
getMarkerTags
(
)));
config
.
getMarkerTags
().
forEach
(
tagName
->
sourceBuilder
.
should
(
QueryBuilders
.
termQuery
(
"brandkbs_mark_cache_maps.name.keyword"
,
tagName
)));
}
}
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getContends
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getContends
()))
{
EsQueryTools
.
assembleContendsQuery
(
sourceBuilder
,
config
.
getContends
());
EsQueryTools
.
assembleContendsQuery
(
sourceBuilder
,
config
.
getContends
());
}
}
postFilter
.
must
(
sourceBuilder
);
postFilter
.
must
(
sourceBuilder
);
// 关键词命中
// postFilter.must(EsQueryTools.assembleNormalKeywordQuery(config.getKeyword(), new String[]{GenericAttribute.ES_IND_FULL_TEXT}));
postFilter
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
config
.
getKeyword
(),
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
})
);
helper
.
setPostFilter
(
postFilter
);
SearchHits
searchHits
=
esClientDao
.
searchHits
(
helper
);
SearchHits
searchHits
=
esClientDao
.
searchHits
(
helper
);
log
.
info
(
"获取舆情动态预警-es搜索到数据:{}条,剩余关键词筛选未进行,project:{}"
,
searchHits
.
getHits
().
length
,
project
.
getProjectName
());
List
<
BaseMap
>
datas
=
Arrays
.
stream
(
searchHits
.
getHits
()).
map
(
hit
->
{
List
<
BaseMap
>
datas
=
Arrays
.
stream
(
searchHits
.
getHits
()).
map
(
hit
->
{
Map
<
String
,
Object
>
sourceMap
=
hit
.
getSourceAsMap
();
Map
<
String
,
Object
>
sourceMap
=
hit
.
getSourceAsMap
();
BaseMap
baseMap
=
Tools
.
getBaseFromEsMap
(
sourceMap
);
BaseMap
baseMap
=
Tools
.
getBaseFromEsMap
(
sourceMap
);
// 关键词命中
if
(!
Tools
.
isContains
(
config
.
getKeyword
(),
baseMap
.
getTitle
()
+
baseMap
.
getContent
()))
{
return
null
;
}
JSONObject
hitMap
=
Tools
.
getBrandkbsHitMapWithProjectId
(
sourceMap
,
projectId
);
JSONObject
hitMap
=
Tools
.
getBrandkbsHitMapWithProjectId
(
sourceMap
,
projectId
);
if
(!
hitMap
.
isEmpty
()
&&
!
Constant
.
PRIMARY_CONTEND_ID
.
equals
(
hitMap
.
getString
(
"contend_id"
)))
{
if
(!
hitMap
.
isEmpty
()
&&
!
Constant
.
PRIMARY_CONTEND_ID
.
equals
(
hitMap
.
getString
(
"contend_id"
)))
{
baseMap
.
setBrandName
(
projectService
.
getProjectByContendId
(
projectId
,
hitMap
.
getString
(
"contend_id"
)).
getBrandName
());
baseMap
.
setBrandName
(
projectService
.
getProjectByContendId
(
projectId
,
hitMap
.
getString
(
"contend_id"
)).
getBrandName
());
}
}
return
baseMap
;
return
baseMap
;
}).
collect
(
Collectors
.
toList
());
}).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
// 开启去重
// 开启去重
if
(
Boolean
.
TRUE
.
equals
(
config
.
getDuplicate
()))
{
if
(
Boolean
.
TRUE
.
equals
(
config
.
getDuplicate
()))
{
datas
=
duplicateBaseMapList
(
datas
);
datas
=
duplicateBaseMapList
(
datas
);
...
@@ -233,54 +626,8 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -233,54 +626,8 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
return
ResponseResult
.
failure
(
"获取舆情动态预警失败"
);
return
ResponseResult
.
failure
(
"获取舆情动态预警失败"
);
}
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4Yuqing
(
BrandkbsYuQingConfig
config
,
List
<
BaseMap
>
datas
,
long
start
,
long
end
,
AbstractProject
project
)
{
@Override
if
(
datas
.
isEmpty
())
{
public
ResponseResult
getChannelWaring
(
String
projectId
,
BrandkbsChannelConfig
config
)
{
return
null
;
}
int
firstCount
=
datas
.
size
();
// key1
String
key1
=
"【品见】舆情动态"
+
project
.
getProjectName
();
// key2
String
key2Header
=
"全部"
;
StringBuilder
mediaChannel
=
new
StringBuilder
();
config
.
getChannelTypes
().
forEach
(
channelType
->
mediaChannel
.
append
(
channelType
).
append
(
"、"
));
if
(
0
!=
mediaChannel
.
length
())
{
key2Header
=
mediaChannel
.
deleteCharAt
(
mediaChannel
.
length
()
-
1
).
toString
();
}
key2Header
+=
"媒体,"
;
StringBuilder
dataType
=
new
StringBuilder
();
config
.
getMarkerTags
().
forEach
(
emotion
->
dataType
.
append
(
emotion
).
append
(
" "
));
dataType
.
append
(
"(本品)"
);
// 如果有竞品
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getContends
()))
{
dataType
.
append
(
","
);
config
.
getContends
().
forEach
(
contend
->
dataType
.
append
(
contend
).
append
(
" "
));
dataType
.
append
(
"(竞品)"
);
}
String
key2
=
key2Header
+
dataType
;
// key3
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
start
)
+
" ~ "
+
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
end
);
// key4
String
key4
;
StringBuilder
keyBuilder4
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
BaseMap
baseMap
=
datas
.
get
(
i
);
String
platform
=
baseMap
.
getPlatform
();
String
source
=
baseMap
.
getSource
();
String
title
=
baseMap
.
getTitle
();
keyBuilder4
.
append
(
platform
).
append
(
"-"
).
append
(
source
).
append
(
"/r/n"
);
keyBuilder4
.
append
(
i
+
1
).
append
(
"、"
).
append
(
title
).
append
(
"/r/n"
);
}
if
(
datas
.
size
()
>
2
)
{
key4
=
keyBuilder4
.
append
(
"..."
).
toString
();
}
else
{
key4
=
keyBuilder4
.
substring
(
0
,
keyBuilder4
.
length
()
-
4
);
}
List
<
BaseMapCompound
>
collect
=
datas
.
stream
().
map
(
baseMap
->
BaseMapCompound
.
createFromBaseMap
(
baseMap
,
project
.
getId
())).
collect
(
Collectors
.
toList
());
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsYuQingWarn
(
collect
));
}
private
ResponseResult
channelWarnReal
(
String
projectId
,
BrandkbsChannelConfig
config
)
{
Project
project
=
null
;
Project
project
=
null
;
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
long
start
=
end
-
config
.
getPushInterval
();
long
start
=
end
-
config
.
getPushInterval
();
...
@@ -302,11 +649,13 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -302,11 +649,13 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
// 本品舆情
// 本品舆情
BoolQueryBuilder
sourceBuilder
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
sourceBuilder
=
QueryBuilders
.
boolQuery
();
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getMarkerTags
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
config
.
getMarkerTags
()))
{
sourceBuilder
.
should
(
QueryBuilders
.
termQuery
(
"brandkbs_mark_cache_maps.name.keyword"
,
config
.
getMarkerTags
(
)));
config
.
getMarkerTags
().
forEach
(
tagName
->
sourceBuilder
.
should
(
QueryBuilders
.
termQuery
(
"brandkbs_mark_cache_maps.name.keyword"
,
tagName
)));
}
}
postFilter
.
must
(
sourceBuilder
);
postFilter
.
must
(
sourceBuilder
);
helper
.
setPostFilter
(
postFilter
);
// 搜索结果
// 搜索结果
SearchHits
searchHits
=
esClientDao
.
searchHits
(
helper
);
SearchHits
searchHits
=
esClientDao
.
searchHits
(
helper
);
log
.
info
(
"获取渠道参与预警-es搜索到数据:{}条,剩余渠道指数筛选未进行,project:{}"
,
searchHits
.
getHits
().
length
,
project
.
getProjectName
());
List
<
BaseMap
>
datas
=
Arrays
.
stream
(
searchHits
.
getHits
()).
map
(
hit
->
Tools
.
getBaseFromEsMap
(
hit
.
getSourceAsMap
())).
collect
(
Collectors
.
toList
());
List
<
BaseMap
>
datas
=
Arrays
.
stream
(
searchHits
.
getHits
()).
map
(
hit
->
Tools
.
getBaseFromEsMap
(
hit
.
getSourceAsMap
())).
collect
(
Collectors
.
toList
());
// 开启去重
// 开启去重
if
(
Boolean
.
TRUE
.
equals
(
config
.
getDuplicate
()))
{
if
(
Boolean
.
TRUE
.
equals
(
config
.
getDuplicate
()))
{
...
@@ -314,8 +663,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -314,8 +663,7 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
}
}
// 渠道指数筛选
// 渠道指数筛选
if
(
null
!=
config
.
getFriendlyChannel
())
{
if
(
null
!=
config
.
getFriendlyChannel
())
{
Map
<
String
,
BaseMap
>
collect
=
datas
.
stream
().
collect
(
Collectors
.
toMap
(
baseMap
->
Map
<
String
,
BaseMap
>
collect
=
datas
.
stream
().
collect
(
Collectors
.
toMap
(
baseMap
->
Tools
.
getFid
(
projectId
,
"0"
,
baseMap
.
getPlatform
(),
baseMap
.
getRealSource
(),
baseMap
.
getSource
()),
map
->
map
));
Tools
.
getFid
(
projectId
,
"0"
,
baseMap
.
getPlatform
(),
baseMap
.
getRealSource
(),
baseMap
.
getSource
()),
map
->
map
));
// 通过筛选的fid列表
// 通过筛选的fid列表
Map
<
String
,
Channel
>
fidChannel
=
channelDao
.
queryUniqueAsync
(
collect
.
keySet
()).
entrySet
().
stream
().
map
(
entry
->
{
Map
<
String
,
Channel
>
fidChannel
=
channelDao
.
queryUniqueAsync
(
collect
.
keySet
()).
entrySet
().
stream
().
map
(
entry
->
{
Channel
channel
=
entry
.
getValue
();
Channel
channel
=
entry
.
getValue
();
...
@@ -352,43 +700,8 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -352,43 +700,8 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
return
ResponseResult
.
failure
(
"获取渠道参与预警失败"
);
return
ResponseResult
.
failure
(
"获取渠道参与预警失败"
);
}
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4Channel
(
BrandkbsChannelConfig
config
,
List
<
BaseMap
>
datas
,
long
start
,
long
end
,
AbstractProject
project
)
{
@Override
if
(
datas
.
isEmpty
())
{
public
ResponseResult
getHotEventWaring
(
String
projectId
,
BrandkbsHotEventConfig
config
)
{
return
null
;
}
int
firstCount
=
datas
.
size
();
// key1
String
key1
=
"【品见】渠道参与"
+
project
.
getProjectName
();
// key2
String
key2
=
"自定义渠道"
;
if
(
Boolean
.
TRUE
.
equals
(
config
.
getFriendlyChannel
()))
{
key2
=
"友好渠道"
;
}
else
if
(
Boolean
.
FALSE
.
equals
(
config
.
getFriendlyChannel
()))
{
key2
=
"敏感渠道"
;
}
// key3
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
start
)
+
" ~ "
+
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
end
);
// key4
String
key4
;
StringBuilder
keyBuilder4
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
BaseMap
baseMap
=
datas
.
get
(
i
);
String
platform
=
baseMap
.
getPlatform
();
String
source
=
baseMap
.
getSource
();
String
title
=
baseMap
.
getTitle
();
keyBuilder4
.
append
(
platform
).
append
(
"-"
).
append
(
source
).
append
(
"/r/n"
);
keyBuilder4
.
append
(
i
+
1
).
append
(
"、"
).
append
(
title
).
append
(
"/r/n"
);
}
if
(
datas
.
size
()
>
2
)
{
key4
=
keyBuilder4
.
append
(
"..."
).
toString
();
}
else
{
key4
=
keyBuilder4
.
substring
(
0
,
keyBuilder4
.
length
()
-
4
);
}
List
<
BaseMapCompound
>
collect
=
datas
.
stream
().
map
(
baseMap
->
BaseMapCompound
.
createFromBaseMap
(
baseMap
,
project
.
getId
())).
collect
(
Collectors
.
toList
());
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsYuQingWarn
(
collect
));
}
private
ResponseResult
hotEventWaring
(
String
projectId
,
BrandkbsHotEventConfig
config
)
{
Project
project
=
projectService
.
getProjectById
(
projectId
);
Project
project
=
projectService
.
getProjectById
(
projectId
);
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
long
start
=
end
-
Constant
.
ONE_DAY
*
7
;
long
start
=
end
-
Constant
.
ONE_DAY
*
7
;
...
@@ -416,10 +729,9 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -416,10 +729,9 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
Event
event
=
new
Event
();
Event
event
=
new
Event
();
event
.
setTitle
(
zhiweiEvent
.
getString
(
"eventname"
));
event
.
setTitle
(
zhiweiEvent
.
getString
(
"eventname"
));
JSONObject
eventTag
=
new
JSONObject
();
JSONObject
eventTag
=
new
JSONObject
();
// TODO 存疑
eventTag
.
put
(
"事件类型"
,
zhiweiEvent
.
getString
(
"type"
));
eventTag
.
put
(
"事件类型"
,
zhiweiEvent
.
getString
(
"type"
));
event
.
setEventTag
(
eventTag
);
event
.
setEventTag
(
eventTag
);
event
.
setTotalDisseminationVolume
(
zhiweiEvent
.
getLong
(
"
total
"
));
event
.
setTotalDisseminationVolume
(
zhiweiEvent
.
getLong
(
"
allCount
"
));
event
.
setStartTime
(
zhiweiEvent
.
getLong
(
"startTime"
));
event
.
setStartTime
(
zhiweiEvent
.
getLong
(
"startTime"
));
event
.
setInfluence
(
zhiweiEvent
.
getDouble
(
"index"
));
event
.
setInfluence
(
zhiweiEvent
.
getDouble
(
"index"
));
externalEvents
.
add
(
event
);
externalEvents
.
add
(
event
);
...
@@ -434,178 +746,69 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
...
@@ -434,178 +746,69 @@ public class ProjectWarnServiceImpl implements ProjectWarnService {
return
ResponseResult
.
failure
(
"获取热点事件预警失败"
);
return
ResponseResult
.
failure
(
"获取热点事件预警失败"
);
}
}
private
BrandkbsWarnTemplate
brandkbsWarnTemplate4HotEvent
(
BrandkbsHotEventConfig
config
,
Map
<
String
,
List
<
Event
>>
eventMap
,
long
start
,
long
end
,
@Override
AbstractProject
project
)
{
public
ResponseResult
getHotTopWaring
(
String
projectId
,
BrandkbsHotTopConfig
config
)
{
int
firstCount
=
eventMap
.
values
().
stream
().
mapToInt
(
List:
:
size
).
sum
();
Project
project
=
projectService
.
getProjectById
(
projectId
);
if
(
firstCount
==
0
)
{
long
end
=
System
.
currentTimeMillis
();
return
null
;
long
start
=
end
-
config
.
getPushInterval
();
}
try
{
String
key1
=
"【品见】热点事件"
+
project
.
getProjectName
();
log
.
info
(
"获取上榜热搜预警开始,project:{}"
,
project
.
getProjectName
());
// key2
if
(
null
==
config
.
getListType
())
{
String
key2
=
null
;
return
ResponseResult
.
success
(
null
);
// key3
String
key3
=
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
start
)
+
" ~ "
+
Constant
.
SPEC_MINUTE_FORMAT
.
format
(
end
);
// key4
String
key4
;
StringBuilder
keyBuilder4
=
new
StringBuilder
();
int
limit
=
2
;
out:
for
(
List
<
Event
>
value
:
eventMap
.
values
())
{
for
(
Event
event
:
value
)
{
keyBuilder4
.
append
(
event
.
getTitle
()).
append
(
"/r/n"
);
if
(--
limit
==
0
)
{
break
out
;
}
}
}
// 根据配置榜单类型
List
<
BrandkbsHotTopWarn
.
HotTop
>
resList
=
new
ArrayList
<>();
config
.
getListType
().
forEach
(
type
->
resList
.
addAll
(
getHotTopList
(
config
,
projectId
,
getRankListByType
(
type
),
type
)));
log
.
info
(
"获取上榜热搜预警结束,project:{}"
,
project
.
getProjectName
());
return
ResponseResult
.
success
(
brandkbsWarnTemplate4HotTop
(
config
,
resList
,
start
,
end
,
project
));
}
catch
(
Exception
e
)
{
log
.
info
(
"获取上榜热搜预警失败,project:{}"
,
project
.
getProjectName
(),
e
);
}
}
if
(
firstCount
>
2
)
{
return
ResponseResult
.
failure
(
"获取上榜热搜预警失败"
);
key4
=
keyBuilder4
.
append
(
"..."
).
toString
();
}
else
{
key4
=
keyBuilder4
.
substring
(
0
,
keyBuilder4
.
length
()
-
4
);
}
List
<
BrandkbsHotEventWarn
.
HotEvent
>
collect
=
eventMap
.
entrySet
().
stream
().
map
(
entry
->
entry
.
getValue
().
stream
().
map
(
event
->
BrandkbsHotEventWarn
.
HotEvent
.
createFromEvent
(
entry
.
getKey
(),
event
)).
collect
(
Collectors
.
toList
())).
collect
(
Collectors
.
toList
()).
stream
().
flatMap
(
List:
:
stream
).
collect
(
Collectors
.
toList
());
return
new
BrandkbsWarnTemplate
(
firstCount
,
key1
,
key2
,
key3
,
key4
,
new
BrandkbsHotEventWarn
(
collect
));
}
}
private
List
<
BaseMap
>
duplicateBaseMapList
(
List
<
BaseMap
>
datas
)
{
@Override
Map
<
String
,
BaseMap
>
duplicateMap
=
new
LinkedHashMap
<>();
public
ResponseResult
getNewCaseWaring
(
String
projectId
)
{
for
(
BaseMap
data
:
datas
)
{
Project
project
=
projectService
.
getProjectById
(
projectId
);
String
key
=
data
.
getTitleNullOptionalContent
();
try
{
BaseMap
newValue
;
long
time
=
System
.
currentTimeMillis
();
if
(
duplicateMap
.
containsKey
(
key
))
{
log
.
info
(
"获取案例上新预警开始,project:{}"
,
project
.
getProjectName
());
BaseMap
oldValue
=
duplicateMap
.
get
(
key
);
String
cursorKey
=
RedisUtil
.
getNewCrisisCaseCursor
(
projectId
);
// 取最早时间的数据
String
cursor
=
redisUtil
.
get
(
cursorKey
);
newValue
=
data
.
getTime
()
<
oldValue
.
getTime
()
?
data
:
oldValue
;
Set
<
String
>
keys
=
redisUtil
.
keys
(
RedisUtil
.
getNewCrisisCaseListAllKey
());
}
else
{
int
recordCursor
=
null
==
cursor
?
0
:
Integer
.
parseInt
(
cursor
);
newValue
=
data
;
List
<
BrandkbsNewCaseWarn
.
NewCase
>
resList
=
new
ArrayList
<>();
for
(
String
key
:
keys
)
{
CrisisCaseWarnVO
crisisCaseWarnVO
=
JSON
.
parseObject
(
redisUtil
.
get
(
key
),
CrisisCaseWarnVO
.
class
);
// 符合条件并记录游标
if
(
recordCursor
<
crisisCaseWarnVO
.
getId
())
{
recordCursor
=
crisisCaseWarnVO
.
getId
();
resList
.
add
(
BrandkbsNewCaseWarn
.
NewCase
.
createFromCrisisCaseWarnVO
(
crisisCaseWarnVO
,
getCrisisEventUrlByCrisisEventId
(
crisisCaseWarnVO
.
getId
())));
}
}
}
duplicateMap
.
put
(
key
,
newValue
);
BrandkbsWarnTemplate
brandkbsWarnTemplate
=
brandkbsWarnTemplate4NewCase
(
resList
,
time
,
project
);
redisUtil
.
set
(
cursorKey
,
String
.
valueOf
(
recordCursor
));
log
.
info
(
"获取案例上新预警结束,project:{}"
,
project
.
getProjectName
());
return
ResponseResult
.
success
(
brandkbsWarnTemplate
);
}
catch
(
Exception
e
)
{
log
.
info
(
"获取案例上新预警异常,project:{}"
,
project
.
getProjectName
());
}
}
return
new
ArrayList
<>(
duplicateMap
.
values
());
return
ResponseResult
.
failure
(
"获取案例上新预警失败"
);
}
private
BrandkbsWarnTemplate
getWarnTemplate
(
BrandkbsYuQingWarn
warn1
)
{
int
firstCount
=
1
;
String
keyword1
=
"【品见】舆情动态-阿里"
;
String
keyword2
=
"央级、门户媒体,负面(本品)"
;
String
keyword3
=
"2022.02.03 08:00 ~ 2022.02.03 08:10"
;
String
keyword4
=
"网媒-人民网\r\n1、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n平媒-人民日报\r\n2、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n..."
;
return
new
BrandkbsWarnTemplate
(
firstCount
,
keyword1
,
keyword2
,
keyword3
,
keyword4
,
warn1
);
}
private
BrandkbsWarnTemplate
getWarnTemplate
(
BrandkbsChannelWarn
warn2
)
{
int
firstCount
=
1
;
String
keyword1
=
"【品见】舆情动态-阿里"
;
String
keyword2
=
"央级、门户媒体,负面(本品)"
;
String
keyword3
=
"2022.02.03 08:00 ~ 2022.02.03 08:10"
;
String
keyword4
=
"网媒-人民网\r\n1、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n平媒-人民日报\r\n2、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n..."
;
return
new
BrandkbsWarnTemplate
(
firstCount
,
keyword1
,
keyword2
,
keyword3
,
keyword4
,
warn2
);
}
private
BrandkbsWarnTemplate
getWarnTemplate
(
BrandkbsHotEventWarn
warn3
)
{
int
firstCount
=
1
;
String
keyword1
=
"【品见】舆情动态-阿里"
;
String
keyword2
=
"央级、门户媒体,负面(本品)"
;
String
keyword3
=
"2022.02.03 08:00 ~ 2022.02.03 08:10"
;
String
keyword4
=
"网媒-人民网\r\n1、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n平媒-人民日报\r\n2、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n..."
;
return
new
BrandkbsWarnTemplate
(
firstCount
,
keyword1
,
keyword2
,
keyword3
,
keyword4
,
warn3
);
}
private
BrandkbsWarnTemplate
getWarnTemplate
(
BrandkbsHotTopWarn
warn4
)
{
int
firstCount
=
1
;
String
keyword1
=
"【品见】舆情动态-阿里"
;
String
keyword2
=
"央级、门户媒体,负面(本品)"
;
String
keyword3
=
"2022.02.03 08:00 ~ 2022.02.03 08:10"
;
String
keyword4
=
"网媒-人民网\r\n1、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n平媒-人民日报\r\n2、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n..."
;
return
new
BrandkbsWarnTemplate
(
firstCount
,
keyword1
,
keyword2
,
keyword3
,
keyword4
,
warn4
);
}
private
BrandkbsWarnTemplate
getWarnTemplate
(
BrandkbsNewCaseWarn
warn5
)
{
int
firstCount
=
1
;
String
keyword1
=
"【品见】舆情动态-阿里"
;
String
keyword2
=
"央级、门户媒体,负面(本品)"
;
String
keyword3
=
"2022.02.03 08:00 ~ 2022.02.03 08:10"
;
String
keyword4
=
"网媒-人民网\r\n1、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n平媒-人民日报\r\n2、顺丰快递全球发售1.31亿股,引入阿里巴巴等\r\n..."
;
return
new
BrandkbsWarnTemplate
(
firstCount
,
keyword1
,
keyword2
,
keyword3
,
keyword4
,
warn5
);
}
private
BaseMapCompound
getBaseMapCompoundTemplate
()
{
BaseMap
baseMap
=
new
BaseMap
();
baseMap
.
setTitle
(
"和府捞面新故事难讲"
);
baseMap
.
setContent
(
"和府捞面新故事难讲2022-11-0114:32新消费和府捞面来源:燃次元(ID:chaintruth)作者:张琳编辑:曹杨作为消费界的跨界流量担当,这次盯上咖啡的是面馆。作为昔日网红中式面馆的和府捞面,其旗下新品牌“PickMEの咖啡&热食”门店已经在上海外滩SOHO落地。和府捞面官方小程序显示,PickME目前售卖的品类涵盖拌饭、拌面、烘焙小食和咖啡。咖啡共有6款,包括PickMe美式、拿铁、大白梨特调生椰拿铁、桑葚特调拿铁等,售价在12-20元之间。图/“PickMEの咖啡&热食”门店示意图,来源/和府捞面官网2013年8月,和府捞面的第一家门店在江苏如皋大润发正式开业。凭借“书房里的养生面”这一独特定位,很快便从一众同质化的传统面馆中脱颖而出,不但吸引了大量食客前去打卡,还成功抬高了面馆的身价,将一碗中式面条卖到了40-50元的价格。新颖的概念也让和府捞面成了资本眼中的“香饽饽”。企查查显示,和府捞面至今共获得6次融资,金额分别为3000万元、5000万元、1亿元、2.15亿元、4.5亿元以及8亿元。其最近一次融资是在2021年7月,由CMC资本领投,众为资本,龙湖资本,腾讯投资等机构跟投,投后估值金额约70亿元人民币。对于本轮融资,和府表示,将主要用于深入布局全产业链体系、新品牌打造、渠道建设及数字化能力构建等方面。很显然,“PickMEの咖啡&热食”就是和府捞面要打造的新品牌,也成为了和府捞面众多“副业大军”中的一员。实际上,和府捞面在产业链的尝试从未止步,先试水火锅,开出“和府火锅和她的面”,而后趁着“餐饮+小酒馆”的热潮,推出子品牌“和府小面小酒”,再之后是主打聚会场景的“财神小排档”。今年5月,和府捞面又杀入兰州拉面赛道,开出首家“阿兰家兰州牛肉面”。对此,艾媒咨询CEO兼首席分析师张毅对燃次元表示,和府捞面在其“捞面”主营业务上已经打通了连锁经营的模式,将这一模式复制到其它子品牌上,可以增加整体营收规模,这也是和府捞面多次尝试发展子品牌的主要原因。不过,从和府捞面其它业务的经营上来看,似乎单纯的复制“捞面”模式并不奏效。比如,试水不足一年时间,和府捞面的火锅业务就“折戟”了,其北京、上海、济南等地的门店已将店名从“和府火锅和她的面”变更为“和府捞面”。除此之外,其它副业也并未在消费者中激起太多“水花”。零售电商行业专家、百联咨询创始人庄帅对燃次元表示,企业发展多业态大都是为了更好地盈利,但成功的却极少,“原因在于每种业态的组织管理、选址、经营模式、供应链体系、客户服务、消费习惯和竞争都很不一样,目前全球范围能做好三个以上规模化业态的零售企业非常少。”事实上,在竞争愈发激烈且同质化严重的新中式面馆赛道里,“书房里的捞面”对消费者的吸引力正在削弱。行至资本市场大门前,是继续讲好捞面的故事还是找到“第二增长曲线”,对和府捞面来说,都极具挑战。"
);
baseMap
.
setPlatform
(
"网媒"
);
baseMap
.
setSource
(
"i黑马"
);
baseMap
.
setEmotion
(
"正面"
);
baseMap
.
setUrl
(
"http://www.iheima.com/article-346459.html"
);
List
<
String
>
tags
=
new
ArrayList
<>();
tags
.
add
(
"央级"
);
tags
.
add
(
"原创"
);
tags
.
add
(
"腾讯"
);
return
new
BaseMapCompound
(
baseMap
,
tags
);
}
private
BrandkbsHotEventWarn
.
HotEvent
getHotEventTemplate
()
{
BrandkbsHotEventWarn
.
HotEvent
hotEvent
=
new
BrandkbsHotEventWarn
.
HotEvent
();
hotEvent
.
setType
(
"品牌动态"
);
hotEvent
.
setTitle
(
"中国电动汽车百人讨论会"
);
hotEvent
.
setEmotion
(
"正面"
);
hotEvent
.
setTotalDisseminationVolume
(
533L
);
hotEvent
.
setTotalChannelVolume
(
429L
);
hotEvent
.
setStartTime
(
1664553600000L
);
hotEvent
.
setInfluence
(
83.2
);
return
hotEvent
;
}
private
BrandkbsHotTopWarn
.
HotTop
getHotTopTemplate
()
{
BrandkbsHotTopWarn
.
HotTop
hotTop
=
new
BrandkbsHotTopWarn
.
HotTop
();
hotTop
.
setTitle
(
"阿里疫情防控"
);
hotTop
.
setTopReason
(
"排名新高"
);
hotTop
.
setRank
(
"18名"
);
hotTop
.
setHot
(
"44.5W"
);
hotTop
.
setTopName
(
"微博热搜"
);
hotTop
.
setTime
(
System
.
currentTimeMillis
());
return
hotTop
;
}
private
BrandkbsNewCaseWarn
.
NewCase
getNewCaseWarn
()
{
BrandkbsNewCaseWarn
.
NewCase
newCase
=
new
BrandkbsNewCaseWarn
.
NewCase
();
newCase
.
setTitle
(
"椰树集团直播带货风格引争议"
);
newCase
.
setTagList
(
Arrays
.
asList
(
"椰树集团"
,
"价值观问题"
));
newCase
.
setContent
(
"2022年10月8日,据媒体报道..."
);
newCase
.
setSpreadIndex
(
85.5
);
newCase
.
setCaseType
(
"营销风险"
);
return
newCase
;
}
}
@Override
@Override
public
ResponseResult
getYuqingWaring
(
String
projectId
,
BrandkbsYuQingConfig
config
)
{
public
void
newCrisisCaseWarn
(
CrisisCaseWarnVO
caseWarnVO
)
{
return
ResponseResult
.
success
(
getWarnTemplate
(
new
BrandkbsYuQingWarn
(
Arrays
.
asList
(
getBaseMapCompoundTemplate
(),
getBaseMapCompoundTemplate
(),
// 存入redis缓存
getBaseMapCompoundTemplate
(),
getBaseMapCompoundTemplate
(),
getBaseMapCompoundTemplate
()))));
String
listKey
=
RedisUtil
.
getNewCrisisCaseListKey
(
String
.
valueOf
(
caseWarnVO
.
getId
()));
redisUtil
.
setExpire
(
listKey
,
JSON
.
toJSONString
(
caseWarnVO
),
Constant
.
ONE_DAY
*
7
,
TimeUnit
.
DAYS
);
}
}
@Override
private
String
getCrisisEventUrlByCrisisEventId
(
int
id
)
{
public
ResponseResult
getChannelWaring
(
String
projectId
,
BrandkbsChannelConfig
brandkbsChannelConfig
)
{
ResponseEntity
<
String
>
forEntity
=
restTemplate
.
getForEntity
(
crisisEventShareUrl
,
String
.
class
,
id
);
return
ResponseResult
.
success
(
getWarnTemplate
(
new
BrandkbsChannelWarn
(
Arrays
.
asList
(
getBaseMapCompoundTemplate
(),
getBaseMapCompoundTemplate
(),
JSONObject
jsonObject
=
JSON
.
parseObject
(
forEntity
.
getBody
());
getBaseMapCompoundTemplate
(),
getBaseMapCompoundTemplate
(),
getBaseMapCompoundTemplate
()),
"敏感渠道(敏感指数>70)"
)));
String
share
=
jsonObject
.
getJSONObject
(
"data"
).
getString
(
"share"
);
}
return
crisisEventUrl
.
replace
(
"{1}"
,
String
.
valueOf
(
id
)).
replace
(
"{2}"
,
share
);
@Override
public
ResponseResult
getHotEventWaring
(
String
projectId
,
BrandkbsHotEventConfig
brandkbsHotEventConfig
)
{
return
ResponseResult
.
success
(
getWarnTemplate
(
new
BrandkbsHotEventWarn
(
Arrays
.
asList
(
getHotEventTemplate
(),
getHotEventTemplate
(),
getHotEventTemplate
(),
getHotEventTemplate
(),
getHotEventTemplate
()))));
}
@Override
public
ResponseResult
getHotTopWaring
(
String
projectId
,
BrandkbsHotTopConfig
config
)
{
return
ResponseResult
.
success
(
getWarnTemplate
(
new
BrandkbsHotTopWarn
(
"阿里"
,
"腾讯"
,
Arrays
.
asList
(
getHotTopTemplate
(),
getHotTopTemplate
(),
getHotTopTemplate
(),
getHotTopTemplate
(),
getHotTopTemplate
()))));
}
@Override
public
ResponseResult
getNewCaseWaring
(
String
projectId
)
{
return
ResponseResult
.
success
(
getWarnTemplate
(
new
BrandkbsNewCaseWarn
(
Arrays
.
asList
(
getNewCaseWarn
(),
getNewCaseWarn
(),
getNewCaseWarn
(),
getNewCaseWarn
(),
getNewCaseWarn
()))));
}
}
public
static
class
CriteriaHelper
{
public
static
class
CriteriaHelper
{
...
...
src/main/java/com/zhiwei/brandkbs2/util/RedisUtil.java
View file @
07df721f
...
@@ -5,6 +5,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -5,6 +5,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
/**
/**
...
@@ -55,6 +57,18 @@ public class RedisUtil {
...
@@ -55,6 +57,18 @@ public class RedisUtil {
return
RedisKeyPrefix
.
CHANNEL_RECORD_LIST
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
return
RedisKeyPrefix
.
CHANNEL_RECORD_LIST
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
);
}
}
public
static
String
getNewCrisisCaseListAllKey
()
{
return
RedisKeyPrefix
.
PROJECT_WARN_NEW_CASE_LIST
+
"*"
;
}
public
static
String
getNewCrisisCaseListKey
(
String
id
)
{
return
RedisKeyPrefix
.
PROJECT_WARN_NEW_CASE_LIST
+
id
;
}
public
static
String
getNewCrisisCaseCursor
(
String
projectId
)
{
return
RedisKeyPrefix
.
PROJECT_WARN_NEW_CASE_CURSOR
+
projectId
;
}
public
void
setExpire
(
String
key
,
String
value
,
long
timeout
,
TimeUnit
unit
)
{
public
void
setExpire
(
String
key
,
String
value
,
long
timeout
,
TimeUnit
unit
)
{
stringRedisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
unit
);
stringRedisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
unit
);
}
}
...
@@ -74,6 +88,21 @@ public class RedisUtil {
...
@@ -74,6 +88,21 @@ public class RedisUtil {
return
stringRedisTemplate
.
opsForValue
().
get
(
key
);
return
stringRedisTemplate
.
opsForValue
().
get
(
key
);
}
}
public
Set
<
String
>
keys
(
String
key
)
{
return
stringRedisTemplate
.
keys
(
key
);
}
public
void
setListLeft
(
String
key
,
String
value
)
{
if
(
null
==
key
)
{
return
;
}
stringRedisTemplate
.
opsForList
().
leftPush
(
key
,
value
);
}
public
List
<
String
>
getListAll
(
String
key
)
{
return
stringRedisTemplate
.
opsForList
().
range
(
key
,
0
,
-
1
);
}
public
void
remove
(
String
key
)
{
public
void
remove
(
String
key
)
{
setExpire
(
key
,
"-1"
,
1
,
TimeUnit
.
SECONDS
);
setExpire
(
key
,
"-1"
,
1
,
TimeUnit
.
SECONDS
);
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
View file @
07df721f
...
@@ -852,6 +852,9 @@ public class Tools {
...
@@ -852,6 +852,9 @@ public class Tools {
}
}
public
static
boolean
isContains
(
String
keyword
,
String
content
)
{
public
static
boolean
isContains
(
String
keyword
,
String
content
)
{
if
(
null
==
keyword
)
{
return
true
;
}
return
isContains
(
Arrays
.
asList
(
keyword
.
split
(
"\\|"
)),
content
);
return
isContains
(
Arrays
.
asList
(
keyword
.
split
(
"\\|"
)),
content
);
}
}
...
@@ -884,6 +887,37 @@ public class Tools {
...
@@ -884,6 +887,37 @@ public class Tools {
return
false
;
return
false
;
}
}
public
static
boolean
isExclusive
(
String
keyword
,
String
content
)
{
if
(
null
==
keyword
)
{
return
true
;
}
return
isExclusive
(
Arrays
.
asList
(
keyword
.
split
(
"\\|"
)),
content
);
}
/**
* 是否排除关键字 只有或逻辑
*
* @param filterKeywords 排除关键词
* @param data 字符串标题+内容
* @return 是否包含关键字
*/
public
static
boolean
isExclusive
(
List
<
String
>
filterKeywords
,
String
data
)
{
boolean
exclusive
=
true
;
for
(
String
key
:
filterKeywords
)
{
if
(
StringUtils
.
isBlank
(
key
)){
continue
;
}
if
(
data
.
contains
(
key
.
toLowerCase
()))
{
exclusive
=
false
;
}
if
(!
exclusive
)
{
//已经满足条件,视为有效数据,结束循环
break
;
}
}
return
exclusive
;
}
public
static
JSONObject
getBrandkbsHitMap
(
Map
<
String
,
Object
>
esMap
,
String
hitKey
)
{
public
static
JSONObject
getBrandkbsHitMap
(
Map
<
String
,
Object
>
esMap
,
String
hitKey
)
{
List
<
Map
<
String
,
Object
>>
cacheMaps
=
(
List
<
Map
<
String
,
Object
>>)
esMap
.
get
(
GenericAttribute
.
ES_BRANDKBS_CACHE_MAPS
);
List
<
Map
<
String
,
Object
>>
cacheMaps
=
(
List
<
Map
<
String
,
Object
>>)
esMap
.
get
(
GenericAttribute
.
ES_BRANDKBS_CACHE_MAPS
);
for
(
Map
<
String
,
Object
>
cacheMap
:
cacheMaps
)
{
for
(
Map
<
String
,
Object
>
cacheMap
:
cacheMaps
)
{
...
...
src/main/resources/application-dev.properties
View file @
07df721f
...
@@ -64,6 +64,7 @@ crisis.top3.url=https://crisis.zhiweidata.com/app/brandkbs/event/online-top3
...
@@ -64,6 +64,7 @@ crisis.top3.url=https://crisis.zhiweidata.com/app/brandkbs/event/online-top3
crisis.searchCriteria.url
=
https://crisis.zhiweidata.com/app/brandkbs/condition
crisis.searchCriteria.url
=
https://crisis.zhiweidata.com/app/brandkbs/condition
crisis.list.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&size={2}&startTime={3}&endTime={4}&category={5}
crisis.list.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&size={2}&startTime={3}&endTime={4}&category={5}
crisis.share.url
=
https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.share.url
=
https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url
=
https://crisis.zhiweidata.com/event/{1}/general?share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
...
@@ -82,14 +83,15 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
...
@@ -82,14 +83,15 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
whole.extraParam.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
whole.extraParam.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token
=
AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.pushTask.token
=
AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/project?projectId={1}&projectName={2}
warn.project.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/project?projectId={1}&projectName={2}
warn.ticket.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/code?pushId={1}&taskType={2}
warn.ticket.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/pushRecipients/{1}?taskType={2}
warn.pushRecipientsList.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.deletePushRecipients.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.channel.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/config/channel/{1}
warn.channel.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/config/channel/{1}
warn.hotEvent.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/config/hotEvent/{1}
warn.hotEvent.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/config/hotEvent/{1}
warn.hotTop.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/config/hotTop/{1}
warn.hotTop.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/config/hotTop/{1}
warn.yuQing.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/config/yuQing/{1}
warn.yuQing.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/config/yuQing/{1}
warn.taskSwitch.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/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}
\ No newline at end of file
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
\ No newline at end of file
src/main/resources/application-local.properties
View file @
07df721f
...
@@ -66,6 +66,7 @@ crisis.top3.url=https://crisis.zhiweidata.com/app/brandkbs/event/online-top3
...
@@ -66,6 +66,7 @@ crisis.top3.url=https://crisis.zhiweidata.com/app/brandkbs/event/online-top3
crisis.searchCriteria.url
=
https://crisis.zhiweidata.com/app/brandkbs/condition
crisis.searchCriteria.url
=
https://crisis.zhiweidata.com/app/brandkbs/condition
crisis.list.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&size={2}&startTime={3}&endTime={4}&category={5}
crisis.list.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&size={2}&startTime={3}&endTime={4}&category={5}
crisis.share.url
=
https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.share.url
=
https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url
=
https://crisis.zhiweidata.com/event/{1}/general?share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
...
@@ -84,14 +85,15 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
...
@@ -84,14 +85,15 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
whole.extraParam.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
whole.extraParam.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token
=
AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.pushTask.token
=
AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/interface/brandkbs/project?projectId={1}&projectName={2}
warn.project.url
=
http://192.168.0.225:11003/qbjc/
brandkbsPush
/interface/brandkbs/project?projectId={1}&projectName={2}
warn.ticket.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/interface/code?pushId={1}&taskType={2}
warn.ticket.url
=
http://192.168.0.225:11003/qbjc/
brandkbsPush
/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/interface/pushRecipients/{1}?taskType={2}
warn.pushRecipientsList.url
=
http://192.168.0.225:11003/qbjc/
brandkbsPush
/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.deletePushRecipients.url
=
http://192.168.0.225:11003/qbjc/
brandkbsPush
/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.channel.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/interface/brandkbs/config/channel/{1}
warn.channel.url
=
http://192.168.0.225:11003/qbjc/
brandkbsPush
/interface/brandkbs/config/channel/{1}
warn.hotEvent.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/interface/brandkbs/config/hotEvent/{1}
warn.hotEvent.url
=
http://192.168.0.225:11003/qbjc/
brandkbsPush
/interface/brandkbs/config/hotEvent/{1}
warn.hotTop.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/interface/brandkbs/config/hotTop/{1}
warn.hotTop.url
=
http://192.168.0.225:11003/qbjc/
brandkbsPush
/interface/brandkbs/config/hotTop/{1}
warn.yuQing.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/interface/brandkbs/config/yuQing/{1}
warn.yuQing.url
=
http://192.168.0.225:11003/qbjc/
brandkbsPush
/interface/brandkbs/config/yuQing/{1}
warn.taskSwitch.url
=
http://192.168.0.225:11003/qbjc/
pushTask
/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}
\ No newline at end of file
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
\ No newline at end of file
src/main/resources/application-prod.properties
View file @
07df721f
...
@@ -64,6 +64,7 @@ crisis.top3.url=https://crisis.zhiweidata.com/app/brandkbs/event/online-top3
...
@@ -64,6 +64,7 @@ crisis.top3.url=https://crisis.zhiweidata.com/app/brandkbs/event/online-top3
crisis.searchCriteria.url
=
https://crisis.zhiweidata.com/app/brandkbs/condition
crisis.searchCriteria.url
=
https://crisis.zhiweidata.com/app/brandkbs/condition
crisis.list.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&size={2}&startTime={3}&endTime={4}&category={5}
crisis.list.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisList?page={1}&size={2}&startTime={3}&endTime={4}&category={5}
crisis.share.url
=
https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.share.url
=
https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url
=
https://crisis.zhiweidata.com/event/{1}/general?share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
...
@@ -82,14 +83,15 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
...
@@ -82,14 +83,15 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
whole.extraParam.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
whole.extraParam.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token
=
AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.pushTask.token
=
AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/project?projectId={1}&projectName={2}
warn.project.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/project?projectId={1}&projectName={2}
warn.ticket.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/code?pushId={1}&taskType={2}
warn.ticket.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/pushRecipients/{1}?taskType={2}
warn.pushRecipientsList.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.deletePushRecipients.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.channel.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/config/channel/{1}
warn.channel.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/config/channel/{1}
warn.hotEvent.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/config/hotEvent/{1}
warn.hotEvent.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/config/hotEvent/{1}
warn.hotTop.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/config/hotTop/{1}
warn.hotTop.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/config/hotTop/{1}
warn.yuQing.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/interface/brandkbs/config/yuQing/{1}
warn.yuQing.url
=
https://auto-push.zhiweidata.com/qbjc/
brandkbsPush
/interface/brandkbs/config/yuQing/{1}
warn.taskSwitch.url
=
https://auto-push.zhiweidata.com/qbjc/
pushTask
/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}
\ No newline at end of file
hot.search.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findNewHotSearch?type={1}
\ 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