Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
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
base_platform_enterprise
gic-platform-auth
Commits
3b2ee9c0
Commit
3b2ee9c0
authored
Jun 04, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理员编辑受审组编辑调整:同步
parent
93ca7a71
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
4 deletions
+51
-4
AuditedGroupUserRelService.java
...java/com/gic/auth/service/AuditedGroupUserRelService.java
+8
-0
AuditedGroupUserRelServiceImpl.java
...gic/auth/service/impl/AuditedGroupUserRelServiceImpl.java
+24
-0
UserApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
+19
-4
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditedGroupUserRelService.java
View file @
3b2ee9c0
...
@@ -90,4 +90,12 @@ public interface AuditedGroupUserRelService {
...
@@ -90,4 +90,12 @@ public interface AuditedGroupUserRelService {
* @throws
* @throws
*/
*/
void
deleteByUserId
(
Integer
userId
);
void
deleteByUserId
(
Integer
userId
);
/**
* 管理员入口编辑受审组
* @param userId
* @param enterpriseId
* @param auditedGroupId
*/
void
setUserAuditedGroup
(
Integer
userId
,
Integer
enterpriseId
,
List
<
Integer
>
auditedGroupId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditedGroupUserRelServiceImpl.java
View file @
3b2ee9c0
...
@@ -6,8 +6,10 @@ import com.gic.auth.dto.AuditedGroupDTO;
...
@@ -6,8 +6,10 @@ import com.gic.auth.dto.AuditedGroupDTO;
import
com.gic.auth.dto.AuditedGroupUserRelDTO
;
import
com.gic.auth.dto.AuditedGroupUserRelDTO
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
com.gic.auth.service.AuditedGroupUserRelService
;
import
com.gic.auth.service.AuditedGroupUserRelService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -83,4 +85,26 @@ public class AuditedGroupUserRelServiceImpl implements AuditedGroupUserRelServic
...
@@ -83,4 +85,26 @@ public class AuditedGroupUserRelServiceImpl implements AuditedGroupUserRelServic
public
void
deleteByUserId
(
Integer
userId
)
{
public
void
deleteByUserId
(
Integer
userId
)
{
tabAuditedGroupUserRelMapper
.
deleteByUserId
(
userId
);
tabAuditedGroupUserRelMapper
.
deleteByUserId
(
userId
);
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
setUserAuditedGroup
(
Integer
userId
,
Integer
enterpriseId
,
List
<
Integer
>
auditedGroupId
)
{
if
(
CollectionUtils
.
isEmpty
(
auditedGroupId
))
{
return
;
}
//删除该用户的所有关联
deleteByUserId
(
userId
);
//建立关联
Date
now
=
new
Date
();
for
(
Integer
auditedGroupIdTemp
:
auditedGroupId
)
{
TabAuditedGroupUserRel
record
=
new
TabAuditedGroupUserRel
();
record
.
setDeleteFlag
(
DeleteFlagConstants
.
NORMAL_STATUS
);
record
.
setAuditedGroupId
(
auditedGroupIdTemp
);
record
.
setCreateTime
(
now
);
record
.
setUpdateTime
(
now
);
record
.
setUserId
(
userId
);
record
.
setEnterpriseId
(
enterpriseId
);
tabAuditedGroupUserRelMapper
.
insert
(
record
);
}
}
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
View file @
3b2ee9c0
...
@@ -128,7 +128,7 @@ public class UserApiServiceImpl implements UserApiService {
...
@@ -128,7 +128,7 @@ public class UserApiServiceImpl implements UserApiService {
}
}
ServiceResponse
<
Integer
>
response
=
saveRole
(
userId
,
userDTO
.
getEnterpriseId
(),
userDTO
.
getUserRoleIds
(),
ServiceResponse
<
Integer
>
response
=
saveRole
(
userId
,
userDTO
.
getEnterpriseId
(),
userDTO
.
getUserRoleIds
(),
userDTO
.
getUserResourceIds
(),
userDTO
.
getAccountGroupIds
());
userDTO
.
getUserResourceIds
(),
userDTO
.
getAccountGroupIds
()
,
userDTO
.
getUserGroupIds
()
);
if
(
response
.
isSuccess
())
{
if
(
response
.
isSuccess
())
{
return
response
;
return
response
;
}
else
{
}
else
{
...
@@ -259,7 +259,7 @@ public class UserApiServiceImpl implements UserApiService {
...
@@ -259,7 +259,7 @@ public class UserApiServiceImpl implements UserApiService {
auditorApiService
.
syncModifyNameOrPhone
(
userDTO
.
getUserId
(),
tabUser
.
getEnterpriseId
(),
userDTO
.
getPhoneNumber
(),
userDTO
.
getUserName
(),
null
);
auditorApiService
.
syncModifyNameOrPhone
(
userDTO
.
getUserId
(),
tabUser
.
getEnterpriseId
(),
userDTO
.
getPhoneNumber
(),
userDTO
.
getUserName
(),
null
);
ServiceResponse
response
=
saveRole
(
userDTO
.
getUserId
(),
userDTO
.
getEnterpriseId
(),
userDTO
.
getUserRoleIds
(),
ServiceResponse
response
=
saveRole
(
userDTO
.
getUserId
(),
userDTO
.
getEnterpriseId
(),
userDTO
.
getUserRoleIds
(),
userDTO
.
getUserResourceIds
(),
userDTO
.
getAccountGroupIds
());
userDTO
.
getUserResourceIds
(),
userDTO
.
getAccountGroupIds
()
,
userDTO
.
getUserGroupIds
()
);
if
(
response
.
isSuccess
())
{
if
(
response
.
isSuccess
())
{
return
response
;
return
response
;
}
else
{
}
else
{
...
@@ -846,7 +846,7 @@ public class UserApiServiceImpl implements UserApiService {
...
@@ -846,7 +846,7 @@ public class UserApiServiceImpl implements UserApiService {
}
}
/**
/**
* 保存关联数据,角色关联、资源关联
* 保存关联数据,角色关联、资源关联
、受审组
* @Title: saveRole
* @Title: saveRole
* @Description:
* @Description:
* @author guojuxing
* @author guojuxing
...
@@ -857,10 +857,25 @@ public class UserApiServiceImpl implements UserApiService {
...
@@ -857,10 +857,25 @@ public class UserApiServiceImpl implements UserApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
*/
private
ServiceResponse
<
Integer
>
saveRole
(
Integer
userId
,
Integer
enterpriseId
,
String
userRoleIds
,
private
ServiceResponse
<
Integer
>
saveRole
(
Integer
userId
,
Integer
enterpriseId
,
String
userRoleIds
,
String
userResourceIds
,
String
accountGroupIds
)
{
String
userResourceIds
,
String
accountGroupIds
,
String
userGroupIds
)
{
String
[]
userRoleIdArr
;
String
[]
userRoleIdArr
;
String
[]
userResourceIdArr
;
String
[]
userResourceIdArr
;
String
[]
accountGroupIdArr
;
String
[]
accountGroupIdArr
;
String
[]
userGroupIdArr
;
ServiceResponse
<
String
[]>
userGroupIdValid
=
ValidSplitUtils
.
validStr
(
userRoleIds
);
if
(
userGroupIdValid
.
isSuccess
())
{
userGroupIdArr
=
userGroupIdValid
.
getResult
();
//受审组同步
auditedGroupUserRelService
.
setUserAuditedGroup
(
userId
,
enterpriseId
,
Arrays
.
stream
(
userGroupIdArr
).
filter
(
e
->
StringUtils
.
isNotBlank
(
e
)
&&
StringUtils
.
isNumeric
(
e
))
.
mapToInt
(
e
->
Integer
.
valueOf
(
e
))
.
boxed
()
.
collect
(
Collectors
.
toList
()));
}
else
{
return
ServiceResponse
.
failure
(
userGroupIdValid
.
getCode
(),
userGroupIdValid
.
getMessage
());
}
ServiceResponse
<
String
[]>
userRoleValid
=
ValidSplitUtils
.
validStr
(
userRoleIds
);
ServiceResponse
<
String
[]>
userRoleValid
=
ValidSplitUtils
.
validStr
(
userRoleIds
);
if
(
userRoleValid
.
isSuccess
())
{
if
(
userRoleValid
.
isSuccess
())
{
userRoleIdArr
=
userRoleValid
.
getResult
();
userRoleIdArr
=
userRoleValid
.
getResult
();
...
...
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