Browse Source

用户组同步状态

hym 4 years ago
parent
commit
40ac94d974

+ 3 - 0
user_center/src/main/java/com/huaxu/service/impl/UserGroupServiceImpl.java

@@ -137,6 +137,7 @@ public class UserGroupServiceImpl implements UserGroupService {
             userRoleEntity.setRoleId(id);
             userRoleEntity.setUserId(userEntity.getId());
             userRoleEntity.setStatus(1);
+            userRoleEntity.setCreateBy(currentUser.getUsername());
             userRoleEntities.add(userRoleEntity);
         });
         if(userIds.size()>0){
@@ -218,6 +219,7 @@ public class UserGroupServiceImpl implements UserGroupService {
     @Transactional
     public int updateRolesByUserGroup(UserGroupDto userGroupDto) {
         UserGroup userGroup=new UserGroup();
+        LoginUser currentUser = UserUtil.getCurrentUser();
         Integer groupId=userGroupDto.getGroupId();
         userGroup.setId(groupId);
         userGroupMapper.deleteUserGroupRelations(userGroup);
@@ -234,6 +236,7 @@ public class UserGroupServiceImpl implements UserGroupService {
             userRoleEntity.setRoleId(userGroupDto.getRoleId());
             userRoleEntity.setUserId(id);
             userRoleEntity.setStatus(1);
+            userRoleEntity.setCreateBy(currentUser.getUsername());
             groupUsers.add(user);
             user.setStatus(1);
             userRoleEntities.add(userRoleEntity);