Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
062942be
Commit
062942be
authored
Dec 07, 2020
by
suntao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户信息
parent
8948153f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
UserServiceImpl.java
...up/cashloanflowboss/api/user/service/UserServiceImpl.java
+19
-16
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/user/service/UserServiceImpl.java
View file @
062942be
...
@@ -269,7 +269,13 @@ public class UserServiceImpl implements UserService {
...
@@ -269,7 +269,13 @@ public class UserServiceImpl implements UserService {
return
Result
.
buildFail
(
"不存在相应的用户,不能更新"
);
return
Result
.
buildFail
(
"不存在相应的用户,不能更新"
);
}
}
User
exist
=
userRepository
.
getOne
(
id
);
User
exist
=
userRepository
.
getOne
(
id
);
String
password
=
exist
.
getPassword
();
// 修改密码是单独的接口
if
(
StringUtils
.
isNotEmpty
(
userModelVo
.
getPassword
()))
{
exist
.
setPassword
(
userModelVo
.
getPassword
());
}
if
(
StringUtils
.
isNotEmpty
(
userModelVo
.
getNickname
()))
{
exist
.
setNickname
(
userModelVo
.
getNickname
());
}
String
existUsername
=
exist
.
getUsername
();
String
existUsername
=
exist
.
getUsername
();
String
username
=
userModelVo
.
getUsername
();
String
username
=
userModelVo
.
getUsername
();
if
(!
existUsername
.
equals
(
username
))
{
if
(!
existUsername
.
equals
(
username
))
{
...
@@ -285,32 +291,29 @@ public class UserServiceImpl implements UserService {
...
@@ -285,32 +291,29 @@ public class UserServiceImpl implements UserService {
return
Result
.
buildFail
(
"不存在对应的角色"
);
return
Result
.
buildFail
(
"不存在对应的角色"
);
}
}
role
=
roleRepository
.
getOne
(
roleId
);
role
=
roleRepository
.
getOne
(
roleId
);
if
(
roleId
==
1L
)
{
// 将普通用户设置成超级管理,需要级联设置用户级别
exist
.
setRank
(
UserRank
.
SUPER_ADMINISTRATOR
);
}
else
{
if
(
exist
.
getRank
().
equals
(
UserRank
.
SUPER_ADMINISTRATOR
))
{
// 如果之前是超管 改成普通操作员,用户级别做相应调整
exist
.
setRank
(
UserRank
.
OPERATOR
);
}
}
}
}
BeanUtils
.
copyProperties
(
userModelVo
,
exist
);
exist
.
setPassword
(
password
);
Long
channelId
=
exist
.
getChannelId
();
Long
channelId
=
exist
.
getChannelId
();
// 渠道id检查
//渠道检查
if
(
channelId
!=
null
)
{
if
(
channelId
!=
null
)
{
ClfChannelConfiguration
configuration
=
clfChannelConfigurationRepository
.
findByRegisteredFrom
(
channelId
);
ClfChannelConfiguration
configuration
=
clfChannelConfigurationRepository
.
findByRegisteredFrom
(
channelId
);
if
(
configuration
==
null
)
{
if
(
configuration
==
null
)
{
log
.
error
(
"{},渠道不存在 channelId={}"
,
LOG_PRE
,
channelId
);
log
.
error
(
"{},渠道不存在 channelId={}"
,
LOG_PRE
,
channelId
);
return
Result
.
buildFail
(
"channelId="
+
channelId
+
"的渠道不存在"
);
return
Result
.
buildFail
(
"channelId="
+
channelId
+
"的渠道不存在"
);
}
}
exist
.
setChannelId
(
channelId
);
exist
.
setChannelName
(
configuration
.
getChannelName
());
exist
.
setChannelName
(
configuration
.
getChannelName
());
}
}
if
(
roleId
==
1L
)
{
// 将普通用户设置成超级管理,需要级联设置用户级别
exist
.
setRank
(
UserRank
.
SUPER_ADMINISTRATOR
);
}
else
{
if
(
exist
.
getRank
().
equals
(
UserRank
.
SUPER_ADMINISTRATOR
))
{
// 如果之前是超管 改成普通操作员,用户级别做相应调整
exist
.
setRank
(
UserRank
.
OPERATOR
);
}
}
//exist.setPassword(MD5Tools.md5(userModelVo.getPassword()));
exist
.
setRoles
(
Collections
.
singletonList
(
role
));
exist
.
setRoles
(
Collections
.
singletonList
(
role
));
exist
.
setUpdateTime
(
new
Date
());
exist
.
setUpdateTime
(
new
Date
());
userRepository
.
save
(
exist
);
userRepository
.
save
(
exist
);
...
...
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