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
a9a001a4
Commit
a9a001a4
authored
Sep 20, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'dev'
调整用户查询key See merge request
!43
parents
ea440514
7e7903c4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
5 deletions
+13
-5
src/main/java/com/zhiwei/brandkbs2/common/GenericAttribute.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/pojo/UserRole.java
+4
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkFlowServiceImpl.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
+2
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
+4
-2
No files found.
src/main/java/com/zhiwei/brandkbs2/common/GenericAttribute.java
View file @
a9a001a4
...
...
@@ -37,7 +37,7 @@ public class GenericAttribute {
// es platform_id
public
static
final
String
ES_PLATFORM_ID
=
"platform_id"
;
// es channel_influence
public
static
final
String
ES_CHANNEL_IN
DEX
=
"channel_influence"
;
public
static
final
String
ES_CHANNEL_IN
FLUENCE
=
"channel_influence"
;
/**
* es rootSource
**/
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/UserRole.java
View file @
a9a001a4
...
...
@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.pojo;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
...
...
@@ -29,6 +30,8 @@ public class UserRole {
private
final
static
int
DEFAULT_ROLE_ID
=
RoleEnum
.
CUSTOMER
.
getState
();
private
final
static
int
MAX_EXPORT_LIMIT
=
10000
;
private
String
key
;
// 仅在header存储信息时使用到
private
String
userId
;
...
...
@@ -58,6 +61,7 @@ public class UserRole {
this
.
roleId
=
roleId
;
this
.
expiredTime
=
expiredTime
;
this
.
exportAmount
=
exportAmount
;
this
.
key
=
Tools
.
concat
(
projectId
,
roleId
);
}
public
static
UserRole
createFromUserDto
(
UserDTO
userDTO
)
{
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
a9a001a4
...
...
@@ -1422,6 +1422,7 @@ public class ChannelServiceImpl implements ChannelService {
private
Query
channelListQuery
(
String
contendId
,
Boolean
show
,
String
emotion
,
String
platform
,
String
keyword
,
String
sorter
)
{
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"projectId"
).
is
(
UserThreadLocal
.
getProjectId
()));
query
.
addCriteria
(
Criteria
.
where
(
"contendId"
).
is
(
contendId
));
if
(
null
!=
show
)
{
query
.
addCriteria
(
Criteria
.
where
(
"show"
).
is
(
show
));
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkFlowServiceImpl.java
View file @
a9a001a4
...
...
@@ -140,7 +140,7 @@ public class MarkFlowServiceImpl implements MarkFlowService {
if
(
null
!=
brandkbsHitJson
.
get
(
"channel_emotion"
))
{
sourceDetails
.
put
(
"channelEmotion"
,
ChannelEmotion
.
getNameFromState
(
brandkbsHitJson
.
getIntValue
(
"channel_emotion"
)));
}
double
channelValue
=
tJson
.
getDoubleValue
(
GenericAttribute
.
ES_CHANNEL_IN
DEX
);
double
channelValue
=
tJson
.
getDoubleValue
(
GenericAttribute
.
ES_CHANNEL_IN
FLUENCE
);
if
(
channelValue
>
0
)
{
sourceDetails
.
put
(
"channelInfluence"
,
new
BigDecimal
(
channelValue
).
setScale
(
2
,
RoundingMode
.
UP
));
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
View file @
a9a001a4
...
...
@@ -72,9 +72,10 @@ public class ProjectServiceImpl implements ProjectService {
@Override
public
PageVO
<
JSONObject
>
findProjectList
(
int
page
,
int
size
,
String
keyword
)
{
Query
query
=
new
Query
();
projectDao
.
addKeywordFuzz
(
query
,
keyword
,
"projectName"
);
long
count
=
projectDao
.
count
(
query
);
mongoUtil
.
start
(
page
,
size
,
query
);
List
<
Project
>
projectList
=
projectDao
.
findList
ByKeywordFuzz
(
query
,
keyword
,
new
String
[]{
"projectName"
}
);
List
<
Project
>
projectList
=
projectDao
.
findList
(
query
);
List
<
JSONObject
>
resList
=
projectList
.
stream
().
map
(
project
->
{
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"id"
,
project
.
getId
());
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
View file @
a9a001a4
...
...
@@ -17,6 +17,7 @@ import com.zhiwei.brandkbs2.pojo.dto.UserDTO;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.auth.pojo.CenterUser
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -109,9 +110,10 @@ public class UserServiceImpl implements UserService {
@Override
public
PageVO
<
JSONObject
>
findUserList
(
int
page
,
int
size
,
String
keyword
,
String
pid
,
int
role
)
{
Criteria
criteria
=
Criteria
.
where
(
"
roles.projectId"
).
is
(
pid
).
and
(
"
superAdmin"
).
is
(
false
);
Criteria
criteria
=
Criteria
.
where
(
"superAdmin"
).
is
(
false
);
if
(-
1
!=
role
)
{
criteria
=
criteria
.
andOperator
(
Criteria
.
where
(
"roles.roleId"
).
is
(
role
));
criteria
=
criteria
.
andOperator
(
Criteria
.
where
(
"roles.key"
).
is
(
Tools
.
concat
(
pid
,
role
)));
// criteria = criteria.andOperator(Criteria.where("roles.roleId").is(role));
}
return
findList
(
page
,
size
,
keyword
,
pid
,
new
Query
(
criteria
));
}
...
...
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