public void saveRoleUser(String roleId, RoleUserDto roleUserDto) {
        roleUserRepository.deleteByRoleIdAndUserIdIn(roleId, Arrays.asList(roleUserDto.getUserIds()));
        if (ArrayUtils.isNotEmpty(roleUserDto.getCheckIds())) {
            roleUserRepository.saveAll(Arrays.stream(roleUserDto.getCheckIds())
                    .map(checkId -> new RoleUser()
                            .setId(StringExtUtils.getUuid())
                            .setUserId(checkId)
                            .setRoleId(roleId))
                    .collect(Collectors.toList()));
        }
    }
saveRoleUser

@param roleId roleId
@param roleUserDto roleUserDto
src/main/java/com/tuituidan/openhub/service/RoleService.java