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
618c0907
Commit
618c0907
authored
Sep 01, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/9/1 17:59
parent
fc95fd23
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
193 additions
and
82 deletions
+193
-82
src/main/java/com/zhiwei/brandkbs2/common/GenericAttribute.java
+2
-0
src/main/java/com/zhiwei/brandkbs2/controller/LoginController.java
+1
-2
src/main/java/com/zhiwei/brandkbs2/controller/app/AppHotController.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
+6
-6
src/main/java/com/zhiwei/brandkbs2/enmus/ChannelEmotion.java
+12
-0
src/main/java/com/zhiwei/brandkbs2/es/ChannelEsDao.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/pojo/Channel.java
+11
-12
src/main/java/com/zhiwei/brandkbs2/pojo/ChannelRecord.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/pojo/UserInfo.java
+6
-3
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ChannelVO.java
+71
-0
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
+3
-1
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/UserService.java
+8
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+32
-23
src/main/java/com/zhiwei/brandkbs2/service/impl/EventDataServiceImpl.java
+4
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/IndexServiceImpl.java
+14
-14
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+13
-17
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
+6
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/common/GenericAttribute.java
View file @
618c0907
...
@@ -122,6 +122,8 @@ public class GenericAttribute {
...
@@ -122,6 +122,8 @@ public class GenericAttribute {
public
static
final
String
ROLE_ID
=
"roleId"
;
public
static
final
String
ROLE_ID
=
"roleId"
;
public
static
final
String
PROJECT_ID
=
"projectId"
;
public
static
final
String
PROJECT_ID
=
"projectId"
;
public
static
final
String
AVATAR_URL
=
"avatarUrl"
;
public
static
final
String
AVATAR_URL
=
"avatarUrl"
;
public
static
final
String
EXPORT_AMOUNT
=
"exportAmount"
;
public
static
final
String
EXPIRED_TIME
=
"expiredTime"
;
// public enum ChannelParam{
// public enum ChannelParam{
// 负面稿件数("negativeArticles"),
// 负面稿件数("negativeArticles"),
...
...
src/main/java/com/zhiwei/brandkbs2/controller/LoginController.java
View file @
618c0907
...
@@ -2,7 +2,6 @@ package com.zhiwei.brandkbs2.controller;
...
@@ -2,7 +2,6 @@ package com.zhiwei.brandkbs2.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
...
@@ -51,7 +50,7 @@ public class LoginController extends BaseController {
...
@@ -51,7 +50,7 @@ public class LoginController extends BaseController {
@GetMapping
(
"/user/getLoginInfo"
)
@GetMapping
(
"/user/getLoginInfo"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
ResponseResult
getLoginInfo
()
{
public
ResponseResult
getLoginInfo
()
{
return
ResponseResult
.
success
(
User
ThreadLocal
.
get
());
return
ResponseResult
.
success
(
User
Service
.
getLoginInfo
());
}
}
@ApiOperation
(
"重置绑定关系(本地测试)"
)
@ApiOperation
(
"重置绑定关系(本地测试)"
)
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppHotController.java
View file @
618c0907
...
@@ -118,7 +118,7 @@ public class AppHotController extends BaseController {
...
@@ -118,7 +118,7 @@ public class AppHotController extends BaseController {
@ApiOperation
(
"热点库-最新资讯"
)
@ApiOperation
(
"热点库-最新资讯"
)
@GetMapping
(
"/latestNews"
)
@GetMapping
(
"/latestNews"
)
public
ResponseResult
latestNews
(
@RequestParam
(
value
=
"
pageS
ize"
,
defaultValue
=
"5"
)
Integer
size
)
throws
IOException
{
public
ResponseResult
latestNews
(
@RequestParam
(
value
=
"
s
ize"
,
defaultValue
=
"5"
)
Integer
size
)
throws
IOException
{
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
String
linkedGroupId
=
projectService
.
getProjectVOById
(
projectId
).
getBrandLinkedGroupId
();
Date
endDate
=
new
Date
();
Date
endDate
=
new
Date
();
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppSearchController.java
View file @
618c0907
...
@@ -62,8 +62,8 @@ public class AppSearchController {
...
@@ -62,8 +62,8 @@ public class AppSearchController {
public
ResponseResult
searchHotList
(
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
limit
,
public
ResponseResult
searchHotList
(
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"weibo"
)
String
type
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"weibo"
)
String
type
,
@RequestParam
(
value
=
"
word"
)
String
word
)
{
@RequestParam
(
value
=
"
keyword"
)
String
key
word
)
{
ResponseEntity
<
JSONObject
>
jsonObjectResponseEntity
=
restTemplate
.
getForEntity
(
trendsSearchUrl
,
JSONObject
.
class
,
limit
,
page
,
type
,
word
);
ResponseEntity
<
JSONObject
>
jsonObjectResponseEntity
=
restTemplate
.
getForEntity
(
trendsSearchUrl
,
JSONObject
.
class
,
limit
,
page
,
type
,
key
word
);
JSONObject
result
=
jsonObjectResponseEntity
.
getBody
();
JSONObject
result
=
jsonObjectResponseEntity
.
getBody
();
if
(
Objects
.
nonNull
(
result
))
{
if
(
Objects
.
nonNull
(
result
))
{
return
ResponseResult
.
success
(
result
);
return
ResponseResult
.
success
(
result
);
...
@@ -127,13 +127,13 @@ public class AppSearchController {
...
@@ -127,13 +127,13 @@ public class AppSearchController {
@ApiOperation
(
"查渠道 渠道库"
)
@ApiOperation
(
"查渠道 渠道库"
)
@
Ge
tMapping
(
value
=
"/channel/channelList"
)
@
Pos
tMapping
(
value
=
"/channel/channelList"
)
public
ResponseResult
getChannelList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
public
ResponseResult
getChannelList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
int
pageSize
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
int
pageSize
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"platforms"
,
defaultValue
=
"全部"
)
List
<
String
>
platforms
,
@RequestParam
(
value
=
"platforms"
,
required
=
false
)
List
<
String
>
platforms
,
@RequestParam
(
value
=
"emotions"
,
defaultValue
=
""
)
List
<
Integer
>
emotions
,
@RequestParam
(
value
=
"emotions"
,
required
=
false
)
List
<
Integer
>
emotions
,
@RequestParam
(
value
=
"mediaTypes"
,
defaultValue
=
"全部"
)
List
<
String
>
mediaTypes
,
@RequestParam
(
value
=
"mediaTypes"
,
required
=
false
)
List
<
String
>
mediaTypes
,
@RequestParam
(
value
=
"articlesCount"
,
required
=
false
)
String
[]
articlesCount
,
@RequestParam
(
value
=
"articlesCount"
,
required
=
false
)
String
[]
articlesCount
,
@RequestParam
(
value
=
"sorter"
,
defaultValue
=
"{\"influence\":\"descend\"}"
)
String
sorter
)
{
@RequestParam
(
value
=
"sorter"
,
defaultValue
=
"{\"influence\":\"descend\"}"
)
String
sorter
)
{
return
ResponseResult
.
success
(
channelService
.
getChannelList
(
page
,
pageSize
,
keyword
,
platforms
,
emotions
,
mediaTypes
,
articlesCount
,
sorter
));
return
ResponseResult
.
success
(
channelService
.
getChannelList
(
page
,
pageSize
,
keyword
,
platforms
,
emotions
,
mediaTypes
,
articlesCount
,
sorter
));
...
...
src/main/java/com/zhiwei/brandkbs2/enmus/ChannelEmotion.java
View file @
618c0907
...
@@ -54,4 +54,16 @@ public enum ChannelEmotion {
...
@@ -54,4 +54,16 @@ public enum ChannelEmotion {
throw
new
IllegalArgumentException
(
"不识别的类型:"
+
state
);
throw
new
IllegalArgumentException
(
"不识别的类型:"
+
state
);
}
}
public
static
int
getEmotionRank
(
Double
emotionIndex
)
{
int
rank
;
if
(
emotionIndex
>=
80
)
{
rank
=
1
;
}
else
if
(
emotionIndex
>=
60
)
{
rank
=
2
;
}
else
{
rank
=
3
;
}
return
rank
;
}
}
}
src/main/java/com/zhiwei/brandkbs2/es/ChannelEsDao.java
View file @
618c0907
...
@@ -73,7 +73,7 @@ public class ChannelEsDao extends EsClientDao {
...
@@ -73,7 +73,7 @@ public class ChannelEsDao extends EsClientDao {
BulkRequest
bulkRequest
=
new
BulkRequest
();
BulkRequest
bulkRequest
=
new
BulkRequest
();
Long
startTime
=
null
;
Long
startTime
=
null
;
Long
endTime
=
null
;
Long
endTime
=
null
;
for
(
List
<
ChannelRecord
>
records
:
ListUtils
.
partition
(
channelRecords
,
100
0
))
{
for
(
List
<
ChannelRecord
>
records
:
ListUtils
.
partition
(
channelRecords
,
100
))
{
for
(
ChannelRecord
record
:
records
)
{
for
(
ChannelRecord
record
:
records
)
{
startTime
=
null
==
startTime
?
record
.
getRangeStartTime
()
:
Math
.
min
(
startTime
,
record
.
getRangeStartTime
());
startTime
=
null
==
startTime
?
record
.
getRangeStartTime
()
:
Math
.
min
(
startTime
,
record
.
getRangeStartTime
());
endTime
=
null
==
endTime
?
record
.
getRangeEndTime
()
:
Math
.
max
(
endTime
,
record
.
getRangeEndTime
());
endTime
=
null
==
endTime
?
record
.
getRangeEndTime
()
:
Math
.
max
(
endTime
,
record
.
getRangeEndTime
());
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/Channel.java
View file @
618c0907
package
com
.
zhiwei
.
brandkbs2
.
pojo
;
package
com
.
zhiwei
.
brandkbs2
.
pojo
;
import
com.zhiwei.brandkbs2.enmus.ChannelEmotion
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
...
@@ -101,17 +100,17 @@ public class Channel extends ChannelIndex {
...
@@ -101,17 +100,17 @@ public class Channel extends ChannelIndex {
channel
.
setLastTime
(
record
.
getLastTime
());
channel
.
setLastTime
(
record
.
getLastTime
());
channel
.
setRecord
(
record
);
channel
.
setRecord
(
record
);
// TODO 调性随机分配
//
// TODO 调性随机分配
double
random
=
Math
.
random
();
//
double random = Math.random();
if
(
random
<
0.3
)
{
//
if (random < 0.3) {
channel
.
setEmotion
(
ChannelEmotion
.
POSITIVE
.
getState
());
//
channel.setEmotion(ChannelEmotion.POSITIVE.getState());
}
else
if
(
random
<
0.6
)
{
//
} else if (random < 0.6) {
channel
.
setEmotion
(
ChannelEmotion
.
NEGATIVE
.
getState
());
//
channel.setEmotion(ChannelEmotion.NEGATIVE.getState());
}
else
{
//
} else {
channel
.
setEmotion
(
ChannelEmotion
.
NEUTRAL
.
getState
());
//
channel.setEmotion(ChannelEmotion.NEUTRAL.getState());
}
//
}
// TODO 情感指数随机分配
//
// TODO 情感指数随机分配
channel
.
setEmotionIndex
(
Math
.
random
()
*
100
);
//
channel.setEmotionIndex(Math.random() * 100);
return
channel
;
return
channel
;
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/ChannelRecord.java
View file @
618c0907
...
@@ -145,7 +145,7 @@ public class ChannelRecord {
...
@@ -145,7 +145,7 @@ public class ChannelRecord {
Long
lastTime
=
templateRecord
.
getLastTime
();
Long
lastTime
=
templateRecord
.
getLastTime
();
List
<
ChannelIndex
.
Article
>
articles
=
templateRecord
.
getArticles
();
List
<
ChannelIndex
.
Article
>
articles
=
templateRecord
.
getArticles
();
int
shards
=
0
;
int
shards
=
0
;
// 防止数据量过大无法存储,故按
10
0 拆分
// 防止数据量过大无法存储,故按
5
0 拆分
for
(
List
<
ChannelIndex
.
Article
>
partList
:
Lists
.
partition
(
articles
,
SHARDS_LIMIT
))
{
for
(
List
<
ChannelIndex
.
Article
>
partList
:
Lists
.
partition
(
articles
,
SHARDS_LIMIT
))
{
ChannelRecord
channelRecord
=
new
ChannelRecord
(
rangeStartTime
,
rangeEndTime
,
entry
.
getKey
(),
entry
.
getValue
());
ChannelRecord
channelRecord
=
new
ChannelRecord
(
rangeStartTime
,
rangeEndTime
,
entry
.
getKey
(),
entry
.
getValue
());
// 保留最近发文时间,更新partList,articleCount和shards
// 保留最近发文时间,更新partList,articleCount和shards
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/UserInfo.java
View file @
618c0907
...
@@ -19,15 +19,16 @@ public class UserInfo {
...
@@ -19,15 +19,16 @@ public class UserInfo {
private
String
userId
;
private
String
userId
;
private
Integer
roleId
;
private
Integer
roleId
;
private
String
projectId
;
private
String
projectId
;
private
Integer
exportAmount
;
private
String
avatarUrl
;
private
String
avatarUrl
;
private
Integer
exportAmount
;
private
Long
expiredTime
;
public
UserInfo
setUserId
(
String
userId
){
public
UserInfo
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
this
.
userId
=
userId
;
return
this
;
return
this
;
}
}
public
UserInfo
setProjectId
(
String
projectId
){
public
UserInfo
setProjectId
(
String
projectId
)
{
this
.
projectId
=
projectId
;
this
.
projectId
=
projectId
;
return
this
;
return
this
;
}
}
...
@@ -39,6 +40,8 @@ public class UserInfo {
...
@@ -39,6 +40,8 @@ public class UserInfo {
res
.
put
(
GenericAttribute
.
USER_ID
,
this
.
userId
);
res
.
put
(
GenericAttribute
.
USER_ID
,
this
.
userId
);
res
.
put
(
GenericAttribute
.
ROLE_ID
,
this
.
roleId
);
res
.
put
(
GenericAttribute
.
ROLE_ID
,
this
.
roleId
);
res
.
put
(
GenericAttribute
.
AVATAR_URL
,
this
.
avatarUrl
);
res
.
put
(
GenericAttribute
.
AVATAR_URL
,
this
.
avatarUrl
);
res
.
put
(
GenericAttribute
.
EXPORT_AMOUNT
,
this
.
exportAmount
);
res
.
put
(
GenericAttribute
.
EXPIRED_TIME
,
this
.
expiredTime
);
return
res
;
return
res
;
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ChannelVO.java
0 → 100644
View file @
618c0907
package
com
.
zhiwei
.
brandkbs2
.
pojo
.
vo
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.common.GlobalPojo
;
import
com.zhiwei.brandkbs2.enmus.ChannelEmotion
;
import
com.zhiwei.brandkbs2.pojo.Channel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.ToString
;
@Data
@ToString
public
class
ChannelVO
{
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"渠道"
)
private
String
source
;
@ApiModelProperty
(
value
=
"真实来源"
)
private
String
realSource
;
@ApiModelProperty
(
value
=
"情感倾向"
)
private
String
emotion
;
@ApiModelProperty
(
value
=
"情感倾向等级"
)
private
Integer
emotionRank
;
@ApiModelProperty
(
value
=
"头像地址"
)
private
String
avatarUrl
;
@ApiModelProperty
(
value
=
"参与事件数"
)
private
Long
eventCount
;
@ApiModelProperty
(
value
=
"发布稿件数"
)
private
Long
articleCount
;
@ApiModelProperty
(
value
=
"影响力"
)
private
Double
influence
;
@ApiModelProperty
(
value
=
"媒体类型标签"
)
private
String
mediaType
;
@ApiModelProperty
(
value
=
"最近发文链接"
)
private
JSONObject
lastArticle
;
public
static
ChannelVO
createFromChannelInfo
(
JSONObject
channelInfo
,
String
projectId
)
{
Channel
channel
=
(
Channel
)
channelInfo
.
get
(
"channel"
);
JSONObject
lastArticle
=
channelInfo
.
getJSONObject
(
"lastArticle"
);
return
createFromChannelVO
(
channel
,
projectId
,
lastArticle
);
}
public
static
ChannelVO
createFromChannelVO
(
Channel
channel
,
String
projectId
,
JSONObject
lastArticle
)
{
ChannelVO
channelVO
=
new
ChannelVO
();
channelVO
.
setId
(
channel
.
getId
());
channelVO
.
setSource
(
channel
.
getSource
());
channelVO
.
setRealSource
(
channel
.
getRealSource
());
channelVO
.
setEmotion
(
ChannelEmotion
.
getNameFromState
(
channel
.
getEmotion
()));
channelVO
.
setEmotionRank
(
ChannelEmotion
.
getEmotionRank
(
channel
.
getEmotionIndex
()));
channelVO
.
setAvatarUrl
(
channel
.
getAvatarUrl
());
channelVO
.
setEventCount
(
channel
.
getEventCount
());
channelVO
.
setArticleCount
(
channel
.
getArticleCount
());
// TODO influence实现
channelVO
.
setInfluence
(
null
);
channelVO
.
setMediaType
(
GlobalPojo
.
getMediaType
(
projectId
,
channel
.
getPlatform
(),
channel
.
getSource
()));
channelVO
.
setLastArticle
(
lastArticle
);
return
channelVO
;
}
}
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
View file @
618c0907
...
@@ -9,6 +9,7 @@ import com.zhiwei.brandkbs2.pojo.Channel;
...
@@ -9,6 +9,7 @@ import com.zhiwei.brandkbs2.pojo.Channel;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ExportAppChannelEventDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ExportAppChannelEventDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelListVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelListVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -258,6 +259,7 @@ public interface ChannelService {
...
@@ -258,6 +259,7 @@ public interface ChannelService {
*/
*/
JSONObject
getChannelSearchCriteria
();
JSONObject
getChannelSearchCriteria
();
PageVO
<
JSONObject
>
getChannelList
(
int
page
,
int
pageSize
,
String
keyword
,
List
<
String
>
platforms
,
List
<
Integer
>
emotions
,
List
<
String
>
mediaTypes
,
String
[]
articlesCount
,
String
sorter
);
PageVO
<
ChannelVO
>
getChannelList
(
int
page
,
int
pageSize
,
String
keyword
,
List
<
String
>
platforms
,
List
<
Integer
>
emotions
,
List
<
String
>
mediaTypes
,
String
[]
articlesCount
,
String
sorter
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
View file @
618c0907
...
@@ -264,6 +264,6 @@ public interface MarkDataService {
...
@@ -264,6 +264,6 @@ public interface MarkDataService {
*/
*/
List
<
Map
<
String
,
Object
>>
getEsTopSource
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
linkedGroupId
,
String
contendId
,
String
emotion
,
int
size
)
throws
IOException
;
List
<
Map
<
String
,
Object
>>
getEsTopSource
(
Long
startTime
,
Long
endTime
,
String
projectId
,
String
linkedGroupId
,
String
contendId
,
String
emotion
,
int
size
)
throws
IOException
;
String
getLastMarkUrl
(
String
projectId
,
String
linkedGroupId
,
String
contendId
,
String
platform
,
String
realSource
,
String
source
);
JSONObject
getLastMarkData
(
String
projectId
,
String
linkedGroupId
,
String
contendId
,
String
platform
,
String
realSource
,
String
source
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/UserService.java
View file @
618c0907
...
@@ -6,6 +6,7 @@ import com.zhiwei.brandkbs2.pojo.dto.UserDTO;
...
@@ -6,6 +6,7 @@ import com.zhiwei.brandkbs2.pojo.dto.UserDTO;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @ClassName: UserService
* @ClassName: UserService
...
@@ -23,6 +24,13 @@ public interface UserService {
...
@@ -23,6 +24,13 @@ public interface UserService {
UserInfo
login
();
UserInfo
login
();
/**
/**
* 获取登录信息
*
* @return
*/
Map
<
String
,
Object
>
getLoginInfo
();
/**
* 查询用户信息
* 查询用户信息
*
*
* @param userId
* @param userId
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
618c0907
...
@@ -22,6 +22,7 @@ import com.zhiwei.brandkbs2.pojo.*;
...
@@ -22,6 +22,7 @@ import com.zhiwei.brandkbs2.pojo.*;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ExportAppChannelEventDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ExportAppChannelEventDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelListVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelListVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
...
@@ -781,13 +782,18 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -781,13 +782,18 @@ public class ChannelServiceImpl implements ChannelService {
// 平台
// 平台
result
.
put
(
"platformList"
,
commonService
.
getQbjcPlatform
(
"id"
,
"name"
));
result
.
put
(
"platformList"
,
commonService
.
getQbjcPlatform
(
"id"
,
"name"
));
//渠道倾向
//渠道倾向
List
<
EmotionEnum
>
emotionList
=
Arrays
.
asList
(
EmotionEnum
.
ALL
,
EmotionEnum
.
POSITIVE
,
EmotionEnum
.
NEUTRAL
,
EmotionEnum
.
NEGATIVE
);
List
<
ChannelEmotion
>
emotionList
=
Arrays
.
asList
(
ChannelEmotion
.
POSITIVE
,
ChannelEmotion
.
NEUTRAL
,
ChannelEmotion
.
NEGATIVE
);
result
.
put
(
"emotionList"
,
emotionList
.
stream
().
map
(
emotion
->
{
List
<
JSONObject
>
collect
=
emotionList
.
stream
().
map
(
emotion
->
{
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
emotion
.
getState
());
json
.
put
(
"id"
,
emotion
.
getState
());
json
.
put
(
"name"
,
emotion
.
getName
());
json
.
put
(
"name"
,
emotion
.
getName
());
return
json
;
return
json
;
}).
collect
(
Collectors
.
toList
()));
}).
collect
(
Collectors
.
toList
());
JSONObject
allEmotion
=
new
JSONObject
();
allEmotion
.
put
(
"id"
,
-
1
);
allEmotion
.
put
(
"name"
,
"全部"
);
collect
.
add
(
0
,
allEmotion
);
result
.
put
(
"emotionList"
,
collect
);
//渠道级别
//渠道级别
List
<
String
>
mediaTypeList
=
ImportantChannelEnum
.
getAllTagExceptSpec
();
List
<
String
>
mediaTypeList
=
ImportantChannelEnum
.
getAllTagExceptSpec
();
mediaTypeList
.
add
(
0
,
"全部"
);
mediaTypeList
.
add
(
0
,
"全部"
);
...
@@ -798,36 +804,47 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -798,36 +804,47 @@ public class ChannelServiceImpl implements ChannelService {
}
}
@Override
@Override
public
PageVO
<
JSONObject
>
getChannelList
(
int
page
,
int
pageSize
,
String
keyword
,
List
<
String
>
platforms
,
List
<
Integer
>
emotions
,
List
<
String
>
mediaTypes
,
public
PageVO
<
ChannelVO
>
getChannelList
(
int
page
,
int
pageSize
,
String
keyword
,
List
<
String
>
platforms
,
List
<
Integer
>
emotions
,
List
<
String
>
mediaTypes
,
String
[]
articlesCount
,
String
sorter
)
{
String
[]
articlesCount
,
String
sorter
)
{
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
projectId
=
UserThreadLocal
.
getProjectId
();
String
contendId
=
"0"
;
String
contendId
=
"0"
;
String
linkedGroupId
=
projectService
.
getProjectByContendId
(
projectId
,
contendId
).
getBrandLinkedGroupId
();
String
linkedGroupId
=
projectService
.
getProjectByContendId
(
projectId
,
contendId
).
getBrandLinkedGroupId
();
Query
query
=
new
Query
(
Criteria
.
where
(
"projectId"
).
is
(
projectId
).
and
(
"contendId"
).
is
(
contendId
));
Query
query
=
new
Query
(
Criteria
.
where
(
"projectId"
).
is
(
projectId
).
and
(
"contendId"
).
is
(
contendId
));
channelDao
.
addKeywordFuzz
(
query
,
keyword
,
"source"
);
channelDao
.
addKeywordFuzz
(
query
,
keyword
,
"source"
);
if
(!
platforms
.
contains
(
"全部"
))
{
if
(!
(
null
==
platforms
||
platforms
.
contains
(
"全部"
)
))
{
query
.
addCriteria
(
Criteria
.
where
(
"platform"
).
in
(
platforms
));
query
.
addCriteria
(
Criteria
.
where
(
"platform"
).
in
(
platforms
));
}
}
if
(!
emotions
.
contains
(-
1
))
{
if
(!
(
null
==
emotions
||
emotions
.
contains
(-
1
)
))
{
query
.
addCriteria
(
Criteria
.
where
(
"emotion"
).
in
(
emotions
));
query
.
addCriteria
(
Criteria
.
where
(
"emotion"
).
in
(
emotions
));
}
}
if
(!
mediaTypes
.
contains
(
"全部"
))
{
if
(!
(
null
==
mediaTypes
||
mediaTypes
.
contains
(
"全部"
)
))
{
// TODO
// TODO
}
}
if
(
null
!=
articlesCount
)
{
if
(
null
!=
articlesCount
)
{
query
.
addCriteria
(
Criteria
.
where
(
"articleCount"
).
gte
(
articlesCount
[
0
]).
lt
(
articlesCount
[
1
]));
query
.
addCriteria
(
Criteria
.
where
(
"articleCount"
).
gte
(
articlesCount
[
0
]).
lt
(
articlesCount
[
1
]));
}
}
mongoUtil
.
start
(
page
,
pageSize
,
query
);
long
total
=
channelDao
.
count
(
query
);
long
total
=
channelDao
.
count
(
query
);
channelDao
.
addSort
(
query
,
sorter
);
channelDao
.
addSort
(
query
,
sorter
);
List
<
Channel
>
channelList
=
channelDao
.
findList
(
query
);
List
<
Channel
>
channelList
=
channelDao
.
findList
(
query
);
List
<
JSONObject
>
resultList
=
channelList
.
stream
().
map
(
channel
->
{
List
<
CompletableFuture
<
JSONObject
>>
futureList
=
channelList
.
stream
().
map
(
channel
->
CompletableFuture
.
supplyAsync
(()
->
{
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"channelInfo"
,
channel
);
result
.
put
(
"id"
,
channel
.
getId
());
result
.
put
(
"lastArticle"
,
markDataService
.
getLastMarkUrl
(
projectId
,
linkedGroupId
,
contendId
,
channel
.
getPlatform
(),
channel
.
getRealSource
(),
result
.
put
(
"channel"
,
channel
);
result
.
put
(
"lastArticle"
,
markDataService
.
getLastMarkData
(
projectId
,
linkedGroupId
,
contendId
,
channel
.
getPlatform
(),
channel
.
getRealSource
(),
channel
.
getSource
()));
channel
.
getSource
()));
return
result
;
return
result
;
}).
collect
(
Collectors
.
toList
());
},
esSearchExecutor
)).
collect
(
Collectors
.
toList
());
return
PageVO
.
createPageVo
(
total
,
page
,
pageSize
,
resultList
);
CompletableFuture
.
allOf
(
futureList
.
toArray
(
new
CompletableFuture
[
0
])).
join
();
Map
<
String
,
JSONObject
>
idMap
=
futureList
.
stream
().
map
(
CompletableFuture:
:
join
).
collect
(
Collectors
.
toMap
(
json
->
json
.
getString
(
"id"
),
a
->
a
));
// List<JSONObject> resultList = channelList.stream().map(channel -> {
// JSONObject result = new JSONObject();
// result.put("channelInfo", channel);
// result.put("lastArticle", markDataService.getLastMarkUrl(projectId, linkedGroupId, contendId, channel.getPlatform(), channel.getRealSource(), channel.getSource()));
// return result;
// }).collect(Collectors.toList());
return
PageVO
.
createPageVo
(
total
,
page
,
pageSize
,
channelList
.
stream
().
map
(
channel
->
ChannelVO
.
createFromChannelInfo
(
idMap
.
get
(
channel
.
getId
()),
projectId
)).
collect
(
Collectors
.
toList
()));
}
}
private
List
<
JSONObject
>
getArticleList
()
{
private
List
<
JSONObject
>
getArticleList
()
{
...
@@ -838,7 +855,7 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -838,7 +855,7 @@ public class ChannelServiceImpl implements ChannelService {
if
(
"全部"
.
equals
(
name
))
{
if
(
"全部"
.
equals
(
name
))
{
json
.
put
(
"value"
,
null
);
json
.
put
(
"value"
,
null
);
}
else
{
}
else
{
String
[]
split
=
name
.
substring
(
name
.
length
()
-
1
).
split
(
"-"
);
String
[]
split
=
name
.
substring
(
0
,
name
.
length
()
-
1
).
split
(
"-"
);
json
.
put
(
"value"
,
new
Long
[]{
Long
.
parseLong
(
split
[
0
]),
Long
.
parseLong
(
split
[
1
])});
json
.
put
(
"value"
,
new
Long
[]{
Long
.
parseLong
(
split
[
0
]),
Long
.
parseLong
(
split
[
1
])});
}
}
res
.
add
(
json
);
res
.
add
(
json
);
...
@@ -1424,7 +1441,7 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -1424,7 +1441,7 @@ public class ChannelServiceImpl implements ChannelService {
private
String
[]
getTitleAndUrlById
(
String
id
)
{
private
String
[]
getTitleAndUrlById
(
String
id
)
{
try
{
try
{
BaseMap
baseMap
=
Tools
.
getBaseFromEsMap
(
esClientDao
.
searchById
(
id
));
BaseMap
baseMap
=
Tools
.
getBaseFromEsMap
(
esClientDao
.
searchById
(
id
));
return
new
String
[]{
baseMap
.
getTitle
(),
baseMap
.
getUrl
()};
return
new
String
[]{
baseMap
.
getTitle
NullOptionalContent
(),
baseMap
.
getUrl
()};
}
catch
(
IOException
ignored
)
{
}
catch
(
IOException
ignored
)
{
}
}
return
new
String
[]{
null
,
null
};
return
new
String
[]{
null
,
null
};
...
@@ -1465,15 +1482,7 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -1465,15 +1482,7 @@ public class ChannelServiceImpl implements ChannelService {
}
}
private
String
getChannelEmotionRank
(
Double
emotionIndex
,
int
emotion
)
{
private
String
getChannelEmotionRank
(
Double
emotionIndex
,
int
emotion
)
{
int
rank
;
return
ChannelEmotion
.
getEmotionRank
(
emotionIndex
)
+
"级"
+
ChannelEmotion
.
getNameFromState
(
emotion
);
if
(
emotionIndex
>=
80
)
{
rank
=
1
;
}
else
if
(
emotionIndex
>=
60
)
{
rank
=
2
;
}
else
{
rank
=
3
;
}
return
rank
+
"级"
+
ChannelEmotion
.
getNameFromState
(
emotion
);
}
}
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/EventDataServiceImpl.java
View file @
618c0907
...
@@ -224,6 +224,10 @@ public class EventDataServiceImpl implements EventDataService {
...
@@ -224,6 +224,10 @@ public class EventDataServiceImpl implements EventDataService {
details
.
add
(
entry
.
getKey
());
details
.
add
(
entry
.
getKey
());
details
.
add
(
new
BigDecimal
((
double
)
(
entry
.
getValue
().
get
()
*
100
)
/
sum
).
setScale
(
2
,
RoundingMode
.
UP
).
toString
());
details
.
add
(
new
BigDecimal
((
double
)
(
entry
.
getValue
().
get
()
*
100
)
/
sum
).
setScale
(
2
,
RoundingMode
.
UP
).
toString
());
});
});
if
(
details
.
size
()
==
2
)
{
details
.
add
(
"其他"
);
details
.
add
(
"0.00"
);
}
details
.
add
(
top8Titles
.
get
(
0
).
getKey
());
details
.
add
(
top8Titles
.
get
(
0
).
getKey
());
details
.
add
(
String
.
valueOf
(
top8Titles
.
get
(
0
).
getValue
().
size
()));
details
.
add
(
String
.
valueOf
(
top8Titles
.
get
(
0
).
getValue
().
size
()));
return
details
;
return
details
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/IndexServiceImpl.java
View file @
618c0907
...
@@ -432,23 +432,23 @@ public class IndexServiceImpl implements IndexService {
...
@@ -432,23 +432,23 @@ public class IndexServiceImpl implements IndexService {
private
JSONObject
getTopSource
(
long
startTime
,
long
endTime
,
String
projectId
,
String
linkedGroupId
,
String
contendId
)
throws
IOException
{
private
JSONObject
getTopSource
(
long
startTime
,
long
endTime
,
String
projectId
,
String
linkedGroupId
,
String
contendId
)
throws
IOException
{
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
// TODO 等待线上es数据格式调整
// TODO 等待线上es数据格式调整
//
List<Map<String, Object>> positiveList = markDataService.getEsTopSource(startTime, endTime, projectId, linkedGroupId, contendId, EmotionEnum.POSITIVE.getName(), 3);
List
<
Map
<
String
,
Object
>>
positiveList
=
markDataService
.
getEsTopSource
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
contendId
,
EmotionEnum
.
POSITIVE
.
getName
(),
3
);
//
List<Map<String, Object>> negativeList = markDataService.getEsTopSource(startTime, endTime, projectId, linkedGroupId, contendId, EmotionEnum.NEGATIVE.getName(), 1);
List
<
Map
<
String
,
Object
>>
negativeList
=
markDataService
.
getEsTopSource
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
contendId
,
EmotionEnum
.
NEGATIVE
.
getName
(),
1
);
result
.
put
(
"positiveList"
,
tempTopSource
()
);
result
.
put
(
"positiveList"
,
positiveList
);
result
.
put
(
"negativeList"
,
tempTopSource
()
);
result
.
put
(
"negativeList"
,
negativeList
);
return
result
;
return
result
;
}
}
private
List
<
Map
<
String
,
Object
>>
tempTopSource
()
{
//
private List<Map<String, Object>> tempTopSource() {
List
<
Map
<
String
,
Object
>>
channelResultList
=
new
ArrayList
<>();
//
List<Map<String, Object>> channelResultList = new ArrayList<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
//
Map<String, Object> result = new HashMap<>();
result
.
put
(
"id"
,
"testId"
);
//
result.put("id", "testId");
result
.
put
(
"source"
,
"source"
);
//
result.put("source", "source");
result
.
put
(
"platform"
,
"微信"
);
//
result.put("platform", "微信");
result
.
put
(
"num"
,
"1"
);
//
result.put("num", "1");
channelResultList
.
add
(
result
);
//
channelResultList.add(result);
return
channelResultList
;
//
return channelResultList;
}
//
}
/**
/**
* 传播趋势
* 传播趋势
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
618c0907
...
@@ -587,7 +587,8 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -587,7 +587,8 @@ public class MarkDataServiceImpl implements MarkDataService {
// keyword
// keyword
if
(
StringUtils
.
isNotEmpty
(
dto
.
getKeyword
()))
{
if
(
StringUtils
.
isNotEmpty
(
dto
.
getKeyword
()))
{
// Query
// Query
String
[]
fieldSearch
=
"标题"
.
equals
(
dto
.
getSearchField
())
?
new
String
[]{
GenericAttribute
.
ES_IND_TITLE
}
:
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
};
String
[]
fieldSearch
=
"仅标题"
.
equals
(
dto
.
getSearchField
())
?
new
String
[]{
GenericAttribute
.
ES_IND_TITLE
}
:
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
};
postFilter
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
dto
.
getKeyword
(),
fieldSearch
));
postFilter
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
dto
.
getKeyword
(),
fieldSearch
));
}
}
// sourceKeyword
// sourceKeyword
...
@@ -973,7 +974,8 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -973,7 +974,8 @@ public class MarkDataServiceImpl implements MarkDataService {
// keyword
// keyword
if
(
StringUtils
.
isNotEmpty
(
dto
.
getKeyword
()))
{
if
(
StringUtils
.
isNotEmpty
(
dto
.
getKeyword
()))
{
// Query
// Query
String
[]
fieldSearch
=
"标题"
.
equals
(
dto
.
getSearchField
())
?
new
String
[]{
GenericAttribute
.
ES_IND_TITLE
}
:
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
};
String
[]
fieldSearch
=
"仅标题"
.
equals
(
dto
.
getSearchField
())
?
new
String
[]{
GenericAttribute
.
ES_IND_TITLE
}
:
new
String
[]{
GenericAttribute
.
ES_IND_FULL_TEXT
};
postFilter
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
dto
.
getKeyword
(),
fieldSearch
));
postFilter
.
must
(
EsQueryTools
.
assembleNormalKeywordQuery
(
dto
.
getKeyword
(),
fieldSearch
));
}
}
// sourceKeyword
// sourceKeyword
...
@@ -1431,38 +1433,32 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -1431,38 +1433,32 @@ public class MarkDataServiceImpl implements MarkDataService {
}
}
@Override
@Override
public
String
getLastMarkUrl
(
String
projectId
,
String
linkedGroupId
,
String
contendId
,
String
platform
,
String
realSource
,
String
source
)
{
public
JSONObject
getLastMarkData
(
String
projectId
,
String
linkedGroupId
,
String
contendId
,
String
platform
,
String
realSource
,
String
source
)
{
try
{
try
{
EsClientDao
.
SearchHelper
searchHelper
=
EsClientDao
.
createSearchHelper
();
EsClientDao
.
SearchHelper
searchHelper
=
EsClientDao
.
createSearchHelper
();
BoolQueryBuilder
query
=
projectLinkedGroupContendIdQuery
(
projectId
,
linkedGroupId
,
contendId
);
BoolQueryBuilder
query
=
projectLinkedGroupContendIdQuery
(
projectId
,
linkedGroupId
,
contendId
);
query
.
must
(
QueryBuilders
.
termQuery
(
"platform
"
,
platform
));
query
.
must
(
QueryBuilders
.
termQuery
(
"platform
_id"
,
GlobalPojo
.
getPlatformIdByName
(
platform
)
));
query
.
must
(
QueryBuilders
.
termQuery
(
"real_source"
,
realSource
));
query
.
must
(
QueryBuilders
.
termQuery
(
"real_source"
,
realSource
));
query
.
must
(
QueryBuilders
.
termQuery
(
"source"
,
source
));
query
.
must
(
QueryBuilders
.
termQuery
(
"source"
,
source
));
searchHelper
.
setQuery
(
query
);
searchHelper
.
setQuery
(
query
);
searchHelper
.
setSort
(
SortBuilders
.
fieldSort
(
"time"
).
order
(
SortOrder
.
DESC
));
searchHelper
.
setSort
(
SortBuilders
.
fieldSort
(
"time"
).
order
(
SortOrder
.
DESC
));
searchHelper
.
setSize
(
1
);
searchHelper
.
setSize
(
1
);
searchHelper
.
setFetchSource
(
new
String
[]{
"url"
,
"question_url"
,
"answer_url"
});
SearchHits
searchHits
=
esClientDao
.
searchHits
(
searchHelper
);
SearchHits
searchHits
=
esClientDao
.
searchHits
(
searchHelper
);
if
(
0
==
searchHits
.
getTotalHits
().
value
)
{
if
(
0
==
searchHits
.
getTotalHits
().
value
)
{
return
null
;
return
null
;
}
}
return
getUrl
(
searchHits
.
getAt
(
0
).
getSourceAsMap
());
return
get
TitleAnd
Url
(
searchHits
.
getAt
(
0
).
getSourceAsMap
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
return
null
;
return
null
;
}
}
}
}
private
static
String
getUrl
(
Map
<
String
,
Object
>
map
)
{
private
static
JSONObject
getTitleAndUrl
(
Map
<
String
,
Object
>
map
)
{
JSONObject
json
=
new
JSONObject
(
map
);
JSONObject
json
=
new
JSONObject
();
String
url
=
json
.
getString
(
"url"
);
BaseMap
baseMap
=
Tools
.
getBaseFromEsMap
(
map
);
// 如果url为空,则查询QA类型url字段
json
.
put
(
"title"
,
baseMap
.
getTitleNullOptionalContent
());
if
(
null
==
url
)
{
json
.
put
(
"url"
,
baseMap
.
getUrl
());
url
=
json
.
getString
(
"answer_url"
);
return
json
;
}
if
(
null
==
url
)
{
url
=
json
.
getString
(
"question_url"
);
}
return
url
;
}
}
/**
/**
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
View file @
618c0907
...
@@ -98,6 +98,7 @@ public class UserServiceImpl implements UserService {
...
@@ -98,6 +98,7 @@ public class UserServiceImpl implements UserService {
userInfo
.
setRoleId
(
userRole
.
getRoleId
());
userInfo
.
setRoleId
(
userRole
.
getRoleId
());
userInfo
.
setAvatarUrl
(
user
.
getAvatarUrl
());
userInfo
.
setAvatarUrl
(
user
.
getAvatarUrl
());
userInfo
.
setExportAmount
(
userRole
.
getExportAmount
());
userInfo
.
setExportAmount
(
userRole
.
getExportAmount
());
userInfo
.
setExpiredTime
(
userRole
.
getExpiredTime
());
});
});
if
(!
hit
.
get
())
{
if
(!
hit
.
get
())
{
return
null
;
return
null
;
...
@@ -278,6 +279,11 @@ public class UserServiceImpl implements UserService {
...
@@ -278,6 +279,11 @@ public class UserServiceImpl implements UserService {
userOldDao
.
updateOneByIdWithField
(
userOld
.
getId
(),
Update
.
update
(
"bindUser"
,
false
));
userOldDao
.
updateOneByIdWithField
(
userOld
.
getId
(),
Update
.
update
(
"bindUser"
,
false
));
}
}
@Override
public
Map
<
String
,
Object
>
getLoginInfo
()
{
return
queryUserInfo
(
UserThreadLocal
.
getUserId
(),
UserThreadLocal
.
getProjectId
()).
toMap
();
}
private
User
createNewUser
(
UserDTO
userDTO
)
{
private
User
createNewUser
(
UserDTO
userDTO
)
{
User
user
=
new
User
();
User
user
=
new
User
();
user
.
setId
(
userDTO
.
getId
());
user
.
setId
(
userDTO
.
getId
());
...
...
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