【fix】用户无角色问题
This commit is contained in:
parent
8ff534ca1e
commit
c59c3be345
|
@ -7,7 +7,9 @@ import com.chint.domain.aggregates.system.AccountCompany;
|
|||
import com.chint.domain.aggregates.system.SystemCode;
|
||||
import com.chint.domain.aggregates.system.SystemOrganization;
|
||||
import com.chint.domain.aggregates.system.SystemOrganizationExtension;
|
||||
import com.chint.domain.aggregates.user.Role;
|
||||
import com.chint.domain.aggregates.user.RoleOrganization;
|
||||
import com.chint.domain.aggregates.user.RoleUser;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.exceptions.NotFoundException;
|
||||
import com.chint.domain.repository.*;
|
||||
|
@ -163,12 +165,12 @@ public class SystemDomainService {
|
|||
@ListenTo(command = "UserRoleCommand", order = 0)
|
||||
public void loadUserRole(UserRoleCommand command) {
|
||||
User user = command.getUser();
|
||||
// List<RoleUser> byUserId = roleUserRepository.findByUserId(user.getUserId());
|
||||
// List<Role> roleList = byUserId.stream().flatMap(it -> roleRepository
|
||||
// .findById(it.getRoleId())
|
||||
// .stream())
|
||||
// .toList();
|
||||
// user.setRoleList(roleList);
|
||||
List<RoleUser> byUserId = roleUserRepository.findByUserId(user.getUserId());
|
||||
List<Role> roleList = byUserId.stream().flatMap(it -> roleRepository
|
||||
.findById(it.getRoleId())
|
||||
.stream())
|
||||
.toList();
|
||||
user.setRoleList(roleList);
|
||||
roleRepository.loadUserRole(user);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue