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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 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 {
...
@@ -86,7 +86,7 @@ public class UserInfo {
/**
/**
* 组织ids
* 组织ids
*/
*/
private
List
<
String
>
orgIds
;
private
List
<
Integer
>
orgIds
;
/**
/**
* 组织级别 0:大区 1:分部 2:站点
* 组织级别 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 {
...
@@ -19,8 +19,8 @@ public class UserOrgEntity {
@Column
(
name
=
"user_id"
,
nullable
=
false
,
unique
=
true
)
@Column
(
name
=
"user_id"
,
nullable
=
false
,
unique
=
true
)
private
String
userId
;
private
String
userId
;
@Column
(
name
=
"org_id
s
"
,
nullable
=
false
)
@Column
(
name
=
"org_id"
,
nullable
=
false
)
private
String
orgIds
;
private
Integer
orgId
;
/**
/**
* 组织级别 0:大区 1:分部 2:站点
* 组织级别 0:大区 1:分部 2:站点
...
...
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
View file @
3843d5c
...
@@ -463,16 +463,16 @@ public class UserService {
...
@@ -463,16 +463,16 @@ public class UserService {
}
}
//处理用户机构关联信息
//处理用户机构关联信息
if
(
CollectionUtils
.
isNotEmpty
(
userInfo
.
getOrgIds
())
&&
null
!=
userInfo
.
getOrgIds
())
{
if
(
CollectionUtils
.
isNotEmpty
(
userInfo
.
getOrgIds
())
&&
null
!=
userInfo
.
getOrgIds
())
{
UserOrgEntity
userOrgEntity
=
userOrgDao
.
findByUserId
(
userInfo
.
getId
());
for
(
Integer
orgId
:
userInfo
.
getOrgIds
())
{
if
(
null
==
userOrgEntity
)
{
userOrgDao
.
deleteByUserId
(
userInfo
.
getId
());
userOrgEntity
=
new
UserOrgEntity
();
UserOrgEntity
userOrgEntity
=
new
UserOrgEntity
();
userOrgEntity
.
setUserId
(
userInfo
.
getId
());
userOrgEntity
.
setUserId
(
userInfo
.
getId
());
}
userOrgEntity
.
setOrgId
(
orgId
);
userOrgEntity
.
setOrgIds
(
String
.
join
(
","
,
userInfo
.
getOrgIds
()));
userOrgEntity
.
setOrgLevel
(
userInfo
.
getOrgLevel
());
userOrgEntity
.
setOrgLevel
(
userInfo
.
getOrgLevel
());
userOrgDao
.
save
(
userOrgEntity
);
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