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
af665bc2
Commit
af665bc2
authored
Aug 22, 2023
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
渠道库关联舆情系统重要渠道
parent
5c6c6d0f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
251 additions
and
4 deletions
+251
-4
src/main/java/com/zhiwei/brandkbs2/controller/app/AppChannelController.java
+83
-4
src/main/java/com/zhiwei/brandkbs2/dao/QbjcPojoDao.java
+16
-0
src/main/java/com/zhiwei/brandkbs2/dao/impl/QbjcPojoDaoImpl.java
+15
-0
src/main/java/com/zhiwei/brandkbs2/pojo/SensitiveChannel.java
+100
-0
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
+30
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+0
-0
src/main/java/com/zhiwei/brandkbs2/util/RedisUtil.java
+4
-0
src/main/resources/application-dev.properties
+1
-0
src/main/resources/application-local.properties
+1
-0
src/main/resources/application-prod.properties
+1
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/controller/app/AppChannelController.java
View file @
af665bc2
package
com
.
zhiwei
.
brandkbs2
.
controller
.
app
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.aop.LogRecord
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
import
com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil
;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportAppChannelArticleDTO
;
...
...
@@ -9,14 +11,20 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.ExportAppChannelEventDTO
;
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
com.zhiwei.brandkbs2.service.ProjectService
;
import
io.swagger.annotations.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Objects
;
/**
* @ClassName: AppChannelController
...
...
@@ -33,6 +41,14 @@ public class AppChannelController extends BaseController {
@Resource
(
name
=
"channelServiceImpl"
)
ChannelService
channelService
;
@Resource
(
name
=
"projectServiceImpl"
)
ProjectService
projectService
;
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${qbjc.channel.application.url}"
)
private
String
channelApplicationUrl
;
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"contendId"
,
value
=
"品牌id"
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"platform"
,
value
=
"平台"
,
paramType
=
"query"
,
dataType
=
"string"
),
...
...
@@ -232,4 +248,67 @@ public class AppChannelController extends BaseController {
return
ResponseResult
.
success
();
}
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"contendId"
,
value
=
"品牌id"
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"起始时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"选取前几"
,
defaultValue
=
"50"
,
paramType
=
"query"
,
dataType
=
"int"
),
})
@ApiOperation
(
"渠道库-活跃渠道榜"
)
@LogRecord
(
description
=
"渠道库-活跃渠道榜"
)
@GetMapping
(
"/list/new/active"
)
public
ResponseResult
getActiveChannelList
(
@RequestParam
(
value
=
"contendId"
,
defaultValue
=
"0"
)
String
contendId
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
Long
endTime
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"50"
)
int
size
)
{
return
ResponseResult
.
success
(
channelService
.
getActiveChannelList
(
contendId
,
startTime
,
endTime
,
size
));
}
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"contendId"
,
value
=
"品牌id"
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"起始时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"选取前几"
,
defaultValue
=
"50"
,
paramType
=
"query"
,
dataType
=
"int"
),
})
@ApiOperation
(
"渠道库-友好渠道榜"
)
@LogRecord
(
description
=
"渠道库-友好渠道榜"
)
@GetMapping
(
"/list/new/positive"
)
public
ResponseResult
getPositiveChannelList
(
@RequestParam
(
value
=
"contendId"
,
defaultValue
=
"0"
)
String
contendId
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
Long
endTime
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"50"
)
int
size
)
{
return
ResponseResult
.
success
(
channelService
.
getPositiveChannelList
(
contendId
,
startTime
,
endTime
,
size
));
}
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"contendId"
,
value
=
"品牌id"
,
defaultValue
=
"0"
,
paramType
=
"query"
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"起始时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"选取前几"
,
defaultValue
=
"50"
,
paramType
=
"query"
,
dataType
=
"int"
),
})
@ApiOperation
(
"渠道库-敏感渠道榜"
)
@LogRecord
(
description
=
"渠道库-敏感渠道榜"
)
@GetMapping
(
"/list/new/negative"
)
public
ResponseResult
getNegativeChannelList
(
@RequestParam
(
value
=
"contendId"
,
defaultValue
=
"0"
)
String
contendId
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
Long
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
Long
endTime
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"50"
)
int
size
)
{
return
ResponseResult
.
success
(
channelService
.
getNegativeChannelList
(
contendId
,
startTime
,
endTime
,
size
));
}
@ApiOperation
(
"渠道库-渠道申请"
)
@PostMapping
(
"/channel-application"
)
public
ResponseResult
channelApplication
(
@ApiParam
(
name
=
"info"
,
value
=
"渠道申请-json:{source:中华网}"
,
required
=
true
)
@RequestBody
JSONObject
info
)
{
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"name"
,
info
.
getString
(
"source"
));
body
.
put
(
"submitter"
,
UserThreadLocal
.
getNickname
());
String
linkedGroupId
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
()).
getBrandLinkedGroupId
();
body
.
put
(
"projectId"
,
linkedGroupId
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
HttpEntity
<
String
>
request
=
new
HttpEntity
<>(
body
.
toJSONString
(),
headers
);
ResponseEntity
<
JSONObject
>
response
=
restTemplate
.
postForEntity
(
channelApplicationUrl
,
request
,
JSONObject
.
class
);
if
(
200
==
Objects
.
requireNonNull
(
response
.
getBody
()).
getIntValue
(
"code"
))
{
return
ResponseResult
.
success
();
}
return
ResponseResult
.
failure
(
"渠道申请失败"
);
}
}
src/main/java/com/zhiwei/brandkbs2/dao/QbjcPojoDao.java
View file @
af665bc2
package
com
.
zhiwei
.
brandkbs2
.
dao
;
import
com.zhiwei.brandkbs2.pojo.SensitiveChannel
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
...
...
@@ -35,4 +36,19 @@ public interface QbjcPojoDao {
* @return tags
*/
List
<
Tag
>
findEmotionTagByLinkedGroupId
();
/**
* qbjc项目重要渠道
* @param linkedGroupId
* @param source
* @return
*/
SensitiveChannel
findSensitiveChannelBySource
(
String
linkedGroupId
,
String
source
);
/**
* qbjc通用重要渠道
* @param source
* @return
*/
SensitiveChannel
findSensitiveChannelBySource
(
String
source
);
}
src/main/java/com/zhiwei/brandkbs2/dao/impl/QbjcPojoDaoImpl.java
View file @
af665bc2
package
com
.
zhiwei
.
brandkbs2
.
dao
.
impl
;
import
com.zhiwei.brandkbs2.dao.QbjcPojoDao
;
import
com.zhiwei.brandkbs2.pojo.SensitiveChannel
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Component
;
...
...
@@ -39,6 +41,19 @@ public class QbjcPojoDaoImpl implements QbjcPojoDao {
return
mongoTemplate
.
find
(
new
Query
(),
Tag
.
class
).
stream
().
filter
(
tag
->
tag
.
getGroupName
().
equals
(
"情感倾向"
)).
collect
(
Collectors
.
toList
());
}
@Override
public
SensitiveChannel
findSensitiveChannelBySource
(
String
linkedGroupId
,
String
source
)
{
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"projectId"
).
is
(
linkedGroupId
));
query
.
addCriteria
(
Criteria
.
where
(
"name"
).
is
(
source
));
return
mongoTemplate
.
findOne
(
query
,
SensitiveChannel
.
class
,
"qbjc_sensitive_channel"
);
}
@Override
public
SensitiveChannel
findSensitiveChannelBySource
(
String
source
)
{
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"name"
).
is
(
source
));
return
mongoTemplate
.
findOne
(
query
,
SensitiveChannel
.
class
,
"qbjc_sensitive_channel_system"
);
}
}
src/main/java/com/zhiwei/brandkbs2/pojo/SensitiveChannel.java
0 → 100644
View file @
af665bc2
package
com
.
zhiwei
.
brandkbs2
.
pojo
;
import
lombok.Data
;
@Data
public
class
SensitiveChannel
{
private
String
id
;
/**
* 渠道名称
*/
private
String
name
;
/**
* 主体类型 央级
*/
private
String
mainBodyType
;
/**
* 地域
*/
private
String
region
;
/**
* 行政级别
*/
private
String
politicsLevel
;
/**
* 领域
*/
private
String
field
;
/**
* 主办单位
*/
private
String
sponsor
;
/**
* 矩阵归属
*/
private
String
matrixAttribution
;
/**
* 背景资料
*/
private
String
backgroundInfo
;
/**
* ccid
*/
private
String
ccid
;
/**
* 省份
*/
private
String
province
;
/**
* 细分领域
*/
private
String
subDividedField
;
/**
* 展现领域
*/
private
String
displayField
;
/**
* 项目标签
*/
private
String
projectTag
;
/**
* 类别身份
*/
private
String
identity
;
/**
* 更新渠道状态
*/
private
Boolean
updateStatus
;
/**
* 项目
*/
private
String
project
;
/**
* 项目id
*/
private
String
projectId
;
/**
* createAt 创建时间
*/
private
Long
createAt
;
/**
* creator 创建者
*/
private
String
creator
;
/**
* creatorId 创建者id
*/
private
String
creatorId
;
/**
* updateAt 更新时间
*/
private
Long
updateAt
;
/**
* submitter 最后提交人 用于呈现最后操作者
*/
private
String
submitter
;
/**
* submitterId 最后提交人id 用于记录最后操作者
*/
private
String
submitterId
;
}
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
View file @
af665bc2
...
...
@@ -152,6 +152,36 @@ public interface ChannelService {
List
<
ChannelListVO
>
getNegativeList
(
String
contendId
,
String
platform
,
String
keyword
,
String
sorter
,
Long
startTime
,
Long
endTime
,
int
size
,
boolean
cache
);
/**
* 新-活跃渠道榜
* @param contendId 品牌id
* @param startTime 开始时间
* @param endTime 结束时间
* @param size 数据量
* @return
*/
JSONObject
getActiveChannelList
(
String
contendId
,
Long
startTime
,
Long
endTime
,
int
size
);
/**
* 新-友好渠道榜
* @param contendId 品牌id
* @param startTime 开始时间
* @param endTime 结束时间
* @param size 数据量
* @return
*/
JSONObject
getPositiveChannelList
(
String
contendId
,
Long
startTime
,
Long
endTime
,
int
size
);
/**
* 新-敏感渠道榜
* @param contendId 品牌id
* @param startTime 开始时间
* @param endTime 结束时间
* @param size 数据量
* @return
*/
JSONObject
getNegativeChannelList
(
String
contendId
,
Long
startTime
,
Long
endTime
,
int
size
);
/**
* 收藏渠道
*
* @param channelId
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
af665bc2
This diff is collapsed.
Click to expand it.
src/main/java/com/zhiwei/brandkbs2/util/RedisUtil.java
View file @
af665bc2
...
...
@@ -58,6 +58,10 @@ public class RedisUtil {
return
RedisKeyPrefix
.
CHANNEL_RECORD_LIST
+
Tools
.
concat
(
projectId
,
startTime
,
endTime
,
platform
,
emotion
);
}
public
static
String
getChannelRecordList
(
String
projectId
,
String
contendId
,
Long
startTime
,
Long
endTime
,
int
emotion
)
{
return
RedisKeyPrefix
.
CHANNEL_RECORD_LIST
+
Tools
.
concat
(
projectId
,
contendId
,
startTime
,
endTime
,
emotion
);
}
public
static
String
getNewCrisisCaseListAllKey
()
{
return
RedisKeyPrefix
.
PROJECT_WARN_NEW_CASE_LIST
+
"*"
;
}
...
...
src/main/resources/application-dev.properties
View file @
af665bc2
...
...
@@ -72,6 +72,7 @@ qbjc.event.tag.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/tag/e
qbjc.platform.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/platform/resource
qbjc.userCenter.url
=
https://login.zhiweidata.com/plogin/center
qbjc.userCenter.token
=
AoJ0ooy3HV1EElWnvQw9YTS9b5Y+fmtkbM6DdpPgDO6D/OhNqH4qrJKarzMr
qbjc.channel.application.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/channel-application
#\u5371\u673A\u5E93\u5916\u90E8\u63A5\u53E3
crisis.search.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisSearch?page={1}&size={2}&keyword={3}
crisis.searchTags.url
=
https://crisis.zhiweidata.com/app/brandkbs/searchCrisisByTags?page={1}&size={2}&brand={3}&category={4}
...
...
src/main/resources/application-local.properties
View file @
af665bc2
...
...
@@ -75,6 +75,7 @@ qbjc.platform.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/platfo
#qbjc.userCenter.url=http://192.168.0.225:10000
qbjc.userCenter.url
=
http://login.zhiweidata.top/plogin/center
qbjc.userCenter.token
=
AoJ0ooy3HV1EElWnvQw9YTS9b5Y+fmtkbM6DdpPgDO6D/OhNqH4qrJKarzMr
qbjc.channel.application.url
=
http://192.168.0.79:11000/qbjcbackPhoenix/interface/middleware/channel-application
#\u5371\u673A\u5E93\u5916\u90E8\u63A5\u53E3
crisis.search.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisSearch?page={1}&size={2}&keyword={3}
crisis.searchTags.url
=
https://crisis.zhiweidata.com/app/brandkbs/searchCrisisByTags?page={1}&size={2}&brand={3}&category={4}
...
...
src/main/resources/application-prod.properties
View file @
af665bc2
...
...
@@ -72,6 +72,7 @@ qbjc.event.tag.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/tag/e
qbjc.platform.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/platform/resource
qbjc.userCenter.url
=
https://login.zhiweidata.com/plogin/center
qbjc.userCenter.token
=
AoJ0ooy3HV1EElWnvQw9YTS9b5Y+fmtkbM6DdpPgDO6D/OhNqH4qrJKarzMr
qbjc.channel.application.url
=
https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/channel-application
#\u5371\u673A\u5E93\u5916\u90E8\u63A5\u53E3
crisis.search.url
=
https://crisis.zhiweidata.com/app/brandkbs/crisisSearch?page={1}&size={2}&keyword={3}
crisis.searchTags.url
=
https://crisis.zhiweidata.com/app/brandkbs/searchCrisisByTags?page={1}&size={2}&brand={3}&category={4}
...
...
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