class OrganizationService extends GenericReactiveTreeSupportCrudService<OrganizationEntity, String> {

    private DefaultDimensionUserService dimensionUserService;

    @Override
    public IDGenerator<String> getIDGenerator() {
        return IDGenerator.UUID;
    }

    @Override
    public void setChildren(OrganizationEntity entity, List<OrganizationEntity> children) {
        entity.setChildren(children);
    }

    @Transactional
    public Mono<Integer> bindUser(String orgId, List<String> userIdList) {
        Flux<String> userIdStream = Flux.fromIterable(userIdList);

        return this
            .findById(orgId)
            .flatMap(org -> userIdStream
                .map(userId -> {
                    DimensionUserEntity userEntity = new DimensionUserEntity();
                    userEntity.setUserId(userId);
                    userEntity.setUserName(userId);
                    userEntity.setDimensionId(orgId);
                    userEntity.setDimensionTypeId(OrgDimensionType.org.getId());
                    userEntity.setDimensionName(org.getName());
                    return userEntity;
                })
                .as(dimensionUserService::save))
            .map(SaveResult::getTotal);

    }

    @Transactional
    public Mono<Integer> unbindUser(String orgId, List<String> userIdList) {<FILL_FUNCTION_BODY>}


    /**
     * 绑定用户到机构(部门)
     *
     * @param userIdList    用户ID
     * @param orgIdList     机构Id
     * @param removeOldBind 是否删除旧的绑定信息
     * @return void
     */
    @Transactional
    public Mono<Void> bindUser(Collection<String> userIdList,
                               Collection<String> orgIdList,
                               boolean removeOldBind) {
        if (CollectionUtils.isEmpty(userIdList)) {
            return Mono.empty();
        }
        return DimensionUserBindUtils.bindUser(dimensionUserService, userIdList, OrgDimensionType.org.getId(), orgIdList, removeOldBind);
    }



}

        Flux<String> userIdStream = Flux.fromIterable(userIdList);

        return userIdStream
            .collectList()
            .filter(CollectionUtils::isNotEmpty)
            .flatMap(newUserIdList -> dimensionUserService
                .createDelete()
                .where(DimensionUserEntity::getDimensionTypeId, OrgDimensionType.org.getId())
                .in(DimensionUserEntity::getUserId, newUserIdList)
                .and(DimensionUserEntity::getDimensionId, orgId)
                .execute())
            ;
    
<no_super_class>