tourze/wechat-work-staff-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tourze/wechat-work-staff-bundle

最新稳定版本:0.2.0

Composer 安装命令:

composer require tourze/wechat-work-staff-bundle

包简介

企业微信员工管理模块

README 文档

README

English | 中文

Latest Version Build Status Software License

Coverage Status PHP Version Symfony Total Downloads

A Symfony Bundle for enterprise WeChat (DingTalk) staff management, providing comprehensive APIs for user, department, and tag management.

Features

  • User Management: Create, update, delete, and sync enterprise WeChat users
  • Department Management: Handle department structure and hierarchies
  • Tag Management: Create and manage user tags for organization
  • Avatar Management: Automatic user avatar synchronization and storage
  • Authentication: OAuth integration with enterprise WeChat
  • Cron Jobs: Automated data synchronization tasks
  • JSON-RPC API: RESTful API endpoints for external integration

Installation

composer require tourze/wechat-work-staff-bundle

Quick Start

Basic Configuration

<?php
// config/packages/wechat_work_staff.yaml
wechat_work_staff:
    # Configuration will be loaded from other bundles

User Management

<?php

use WechatWorkStaffBundle\Service\BizUserService;
use WechatWorkStaffBundle\Repository\UserRepository;

// Inject the service
public function __construct(
    private BizUserService $userService,
    private UserRepository $userRepository
) {}

// Get user by ID
$user = $this->userRepository->findByUserId('user123');

// Sync user data from WeChat Work
$this->userService->syncUserData($agentId);

Console Commands

The bundle provides several console commands for data synchronization:

User Management Commands

# Sync user list for specific agent
php bin/console wechat-work:sync-user-list <agentId>

# Check and update user avatars (runs automatically every 8 hours)
php bin/console wechat-work:check-user-avatar

Tag Management Commands

# Sync user tags (runs automatically every 8 hours)
php bin/console wechat-work:sync-user-tags

# Sync users associated with tags (runs automatically every 20 minutes)
php bin/console wechat-work:sync-tag-users

API Endpoints

The bundle provides several controller endpoints:

  • Authentication: /wechat-work/auth/* - OAuth flow handling
  • User Connection: /wechat-work/connect/* - User account linking
  • Testing Endpoints: Various test endpoints for development

JSON-RPC Procedures

Available JSON-RPC procedures:

  • GetWechatWorkDepartmentTree - Retrieve department hierarchy
  • GetWechatWorkUserByAuthCode - Get user information by auth code

Entities

  • User: Enterprise WeChat user entity
  • Department: Department/organization structure
  • UserTag: User categorization tags
  • AgentUser: Association between agents and users

Advanced Usage

Cron Jobs

Automated tasks (configured via AsCronTask attribute):

  • Avatar Check: Every 8 hours at minute 14
  • Tag Sync: Every 8 hours at minute 30
  • Tag Users Sync: Every 20 minutes

Custom Event Listeners

The bundle dispatches events that you can listen to:

<?php

use WechatWorkStaffBundle\EventSubscriber\UserTagListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class CustomUserTagListener implements EventSubscriberInterface
{
    // Your custom logic
}

Dependencies

This bundle requires:

  • PHP 8.1 or higher
  • Symfony 6.4 or higher
  • Doctrine ORM
  • Bundle Dependency Bundle
  • HTTP Client Bundle
  • WeChat Work Contracts Bundle
  • League Flysystem (for avatar storage)

Contributing

Please see CONTRIBUTING.md for details.

Security

Security Considerations

  • All external API calls include audit logging
  • User data is properly validated and sanitized
  • OAuth flows follow security best practices
  • Sensitive information is properly encrypted

Reporting Security Issues

Please report security vulnerabilities to security@example.com.

License

The MIT License (MIT). Please see License File for more information.

tourze/wechat-work-staff-bundle 适用场景与选型建议

tourze/wechat-work-staff-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 06 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 tourze/wechat-work-staff-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tourze/wechat-work-staff-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 tourze/wechat-work-staff-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-03