Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3843d5ce
authored
Sep 27, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户组织关联关系优化
1 parent
fa3546d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
project-interface/src/main/java/com/dituhui/pea/pojo/UserInfo.java
project-user/src/main/java/com/dituhui/pea/user/entity/UserOrgEntity.java
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
project-interface/src/main/java/com/dituhui/pea/pojo/UserInfo.java
View file @
3843d5c
...
...
@@ -86,7 +86,7 @@ public class UserInfo {
/**
* 组织ids
*/
private
List
<
String
>
orgIds
;
private
List
<
Integer
>
orgIds
;
/**
* 组织级别 0:大区 1:分部 2:站点
*/
...
...
project-user/src/main/java/com/dituhui/pea/user/entity/UserOrgEntity.java
View file @
3843d5c
...
...
@@ -19,8 +19,8 @@ public class UserOrgEntity {
@Column
(
name
=
"user_id"
,
nullable
=
false
,
unique
=
true
)
private
String
userId
;
@Column
(
name
=
"org_id
s
"
,
nullable
=
false
)
private
String
orgIds
;
@Column
(
name
=
"org_id"
,
nullable
=
false
)
private
Integer
orgId
;
/**
* 组织级别 0:大区 1:分部 2:站点
...
...
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
View file @
3843d5c
...
...
@@ -463,14 +463,14 @@ public class UserService {
}
//处理用户机构关联信息
if
(
CollectionUtils
.
isNotEmpty
(
userInfo
.
getOrgIds
())
&&
null
!=
userInfo
.
getOrgIds
())
{
UserOrgEntity
userOrgEntity
=
userOrgDao
.
findByUserId
(
userInfo
.
getId
());
if
(
null
==
userOrgEntity
)
{
userOrgEntity
=
new
UserOrgEntity
();
for
(
Integer
orgId
:
userInfo
.
getOrgIds
())
{
userOrgDao
.
deleteByUserId
(
userInfo
.
getId
());
UserOrgEntity
userOrgEntity
=
new
UserOrgEntity
();
userOrgEntity
.
setUserId
(
userInfo
.
getId
());
userOrgEntity
.
setOrgId
(
orgId
);
userOrgEntity
.
setOrgLevel
(
userInfo
.
getOrgLevel
());
userOrgDao
.
save
(
userOrgEntity
);
}
userOrgEntity
.
setOrgIds
(
String
.
join
(
","
,
userInfo
.
getOrgIds
()));
userOrgEntity
.
setOrgLevel
(
userInfo
.
getOrgLevel
());
userOrgDao
.
save
(
userOrgEntity
);
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment