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
92d62da3
Commit
92d62da3
authored
Mar 06, 2020
by
王向伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user 添加channelName字段
parent
2f33b3a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
RoleController.java
.../cashloanflowboss/api/role/controller/RoleController.java
+0
-2
User.java
.../cn/quantgroup/cashloanflowboss/api/user/entity/User.java
+3
-0
UserServiceImpl.java
...up/cashloanflowboss/api/user/service/UserServiceImpl.java
+28
-0
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/role/controller/RoleController.java
View file @
92d62da3
...
...
@@ -4,9 +4,7 @@ import cn.quantgroup.cashloanflowboss.api.role.entity.Role;
import
cn.quantgroup.cashloanflowboss.api.role.model.RoleModel
;
import
cn.quantgroup.cashloanflowboss.api.role.model.RoleModelVo
;
import
cn.quantgroup.cashloanflowboss.api.role.model.RoleQueryModel
;
import
cn.quantgroup.cashloanflowboss.api.role.model.RoleVO
;
import
cn.quantgroup.cashloanflowboss.api.role.service.RoleService
;
import
cn.quantgroup.cashloanflowboss.component.security.annotiation.Security
;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/user/entity/User.java
View file @
92d62da3
...
...
@@ -48,6 +48,9 @@ public class User extends Primary {
@Column
(
name
=
"channel_id"
)
private
Long
channelId
;
@Column
(
name
=
"channel_name"
)
private
String
channelName
;
/**
* 用户级别
*/
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/user/service/UserServiceImpl.java
View file @
92d62da3
...
...
@@ -15,6 +15,8 @@ import cn.quantgroup.cashloanflowboss.core.asserts.Assert;
import
cn.quantgroup.cashloanflowboss.core.base.Result
;
import
cn.quantgroup.cashloanflowboss.core.base.Tuple
;
import
cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfChannelConfiguration
;
import
cn.quantgroup.cashloanflowboss.spi.clf.repository.ClfChannelConfigurationRepository
;
import
cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService
;
import
cn.quantgroup.cashloanflowboss.spi.xyqb.service.XYQBCenterService
;
import
cn.quantgroup.cashloanflowboss.utils.MD5Tools
;
...
...
@@ -50,6 +52,9 @@ public class UserServiceImpl implements UserService {
@Autowired
private
RoleRepository
roleRepository
;
@Autowired
private
ClfChannelConfigurationRepository
clfChannelConfigurationRepository
;
/**
* 创建用户
...
...
@@ -238,6 +243,17 @@ public class UserServiceImpl implements UserService {
}
User
user
=
User
.
valueOf
(
userModelVo
,
role
);
//渠道检查
Long
channelId
=
user
.
getChannelId
();
if
(
channelId
!=
null
)
{
if
(!
clfChannelConfigurationRepository
.
exists
(
channelId
))
{
log
.
error
(
"{},渠道不存在 channelId={}"
,
LOG_PRE
,
channelId
);
return
Result
.
buildFail
(
"channelId="
+
channelId
+
"的渠道不存在"
);
}
ClfChannelConfiguration
configuration
=
clfChannelConfigurationRepository
.
findOne
(
channelId
);
user
.
setChannelName
(
configuration
.
getChannelName
());
}
userRepository
.
save
(
user
);
return
Result
.
buildSuccess
(
true
);
}
...
...
@@ -277,6 +293,18 @@ public class UserServiceImpl implements UserService {
BeanUtils
.
copyProperties
(
userModelVo
,
exist
);
Long
channelId
=
exist
.
getChannelId
();
if
(
channelId
!=
null
)
{
if
(!
clfChannelConfigurationRepository
.
exists
(
channelId
))
{
log
.
error
(
"{},渠道不存在 channelId={}"
,
LOG_PRE
,
channelId
);
return
Result
.
buildFail
(
"channelId="
+
channelId
+
"的渠道不存在"
);
}
ClfChannelConfiguration
configuration
=
clfChannelConfigurationRepository
.
findOne
(
channelId
);
exist
.
setChannelName
(
configuration
.
getChannelName
());
}
exist
.
setPassword
(
MD5Tools
.
md5
(
userModelVo
.
getPassword
()));
exist
.
setRoles
(
Collections
.
singletonList
(
role
));
exist
.
setUpdateTime
(
new
Date
());
...
...
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