Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

企业微信官方API支持通过 process 参数在 use_template_approver=0 时动态指定审批流程节点,但SDK缺少该实现。用户无法根据业务逻辑动态设置审批人。

Changes

Core Classes

  • Added process field to WxCpOaApplyEventRequest with Process and ProcessNode nested classes
  • Process contains node_list for approval flow nodes
  • ProcessNode supports:
    • type: node type (1=approver, 2=notifier, 3=notifier)
    • apv_rel: multi-person approval mode (1=all-sign, 2=or-sign, 3=sequential)
    • userid: array of user IDs

Testing

  • Added testToJsonWithProcess() to verify JSON serialization with multiple node types and approval modes

Compatibility

  • Existing approver and notifyer fields preserved for backward compatibility

Usage

request.setUseTemplateApprover(0)
  .setProcess(new WxCpOaApplyEventRequest.Process()
    .setNodeList(Arrays.asList(
      // Multi-person all-sign approval node
      new WxCpOaApplyEventRequest.ProcessNode()
        .setType(1).setApvRel(1)
        .setUserIds(new String[]{"user1", "user2"}),
      // Notifier node
      new WxCpOaApplyEventRequest.ProcessNode()
        .setType(2)
        .setUserIds(new String[]{"user3", "user4"})
    )));

Resolves dynamic approver assignment requirement from WeChat Work API.

Original prompt

This section details on the original issue you should resolve

<issue_title>use_template_approver:0, 关于通过接口指定审批人process参数</issue_title>
<issue_description>Image

Image

未看到该库和腾讯有对应的方法处理process参数

1、请问能否处理?该怎么处理?审批人要根据业务系统业务数据的逻辑动态给定
2、是否发布新版跟进腾讯官方?何时跟进</issue_description>

Comments on the Issue (you are @copilot in this section)

@binarywang 可能是最近新增的字段吗?如果你了解细节,可以直接提供对应实现的PR代码

Custom agent used: 自定义的
需要用中文


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix handling of process parameter for approver 添加 process 参数支持企业微信审批流程动态指定 Nov 17, 2025
Copilot AI requested a review from binarywang November 17, 2025 03:53
@binarywang binarywang marked this pull request as ready for review November 17, 2025 03:55
@binarywang binarywang merged commit 1922aaa into develop Nov 17, 2025
1 check passed
@binarywang binarywang added this to the 4.7.9 milestone Nov 17, 2025
@binarywang binarywang deleted the copilot/fix-process-parameter-logic branch November 17, 2025 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use_template_approver:0, 关于通过接口指定审批人process参数

2 participants