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
3099ff29
Commit
3099ff29
authored
Dec 26, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目及人员部分修改
parent
c3e62b85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
+1
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
+6
-1
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
View file @
3099ff29
...
...
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.common.GenericAttribute
;
import
com.zhiwei.brandkbs2.common.GlobalPojo
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.dao.ProjectDao
;
import
com.zhiwei.brandkbs2.dao.UserDao
;
import
com.zhiwei.brandkbs2.enmus.response.ProjectCodeEnum
;
...
...
@@ -35,7 +34,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -115,6 +113,7 @@ public class ProjectServiceImpl implements ProjectService {
Query
query
=
new
Query
();
projectDao
.
addKeywordFuzz
(
query
,
keyword
,
"projectName"
);
long
count
=
projectDao
.
count
(
query
);
projectDao
.
addSort
(
query
,
"{\"cTime\":\"descend\"}"
);
mongoUtil
.
start
(
page
,
size
,
query
);
List
<
Project
>
projectList
=
projectDao
.
findList
(
query
);
List
<
JSONObject
>
resList
=
projectList
.
stream
().
map
(
project
->
{
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
View file @
3099ff29
...
...
@@ -173,7 +173,12 @@ public class UserServiceImpl implements UserService {
user
.
getRoles
().
stream
().
filter
(
userRoles
->
userRoles
.
getProjectId
().
equals
(
userDTO
.
getProjectId
())).
findAny
().
ifPresent
(
userRole
->
{
// 更新原userRole
userRole
.
setRoleId
(
userDTO
.
getRoleId
());
OptionalLong
.
of
(
userDTO
.
getExpiredTime
()).
ifPresent
(
userRole:
:
setExpiredTime
);
// 权限用户以上则清空过期时间
if
(
userDTO
.
getRoleId
()
<
RoleEnum
.
CUSTOMER
.
getState
())
{
userRole
.
setExpiredTime
(
null
);
}
else
{
OptionalLong
.
of
(
userDTO
.
getExpiredTime
()).
ifPresent
(
userRole:
:
setExpiredTime
);
}
OptionalInt
.
of
(
userDTO
.
getExportAmount
()).
ifPresent
(
userRole:
:
setExportAmount
);
userDao
.
updateOneByIdWithField
(
userDTO
.
getId
(),
new
Update
().
set
(
"roles"
,
roles
));
});
...
...
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