Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

企业微信获取审批详情接口返回的 sum_money 字段(总费用金额)未在 SDK 实体类中定义,导致用户无法获取该数据。

变更内容

  • WxCpApprovalDetailResult.WxCpApprovalDetail:新增 sumMoney 字段(映射 JSON sum_money

    • 类型:Long,单位:分
    • 仅在审批单包含费用相关控件时返回,否则为 null
  • WxCpOaServiceImplTest:添加单元测试验证字段序列化/反序列化及向后兼容性

使用示例

WxCpOaService oaService = wxCpService.getOaService();
WxCpApprovalDetailResult result = oaService.getApprovalDetail("202601140001");

// 获取总费用金额(单位:分)
Long sumMoney = result.getInfo().getSumMoney();
if (sumMoney != null) {
    System.out.println("总费用:" + sumMoney / 100.0 + " 元");
}

向后兼容,不影响现有代码。

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • developer.work.weixin.qq.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>企业微信获取审批详情,返回结果缺少字段-总费用金额</issue_title>
<issue_description>原始需求来自:https://gitee.com/binary/weixin-java-tools/issues/IDK4DX

示例代码
WxCpOaService oaService = wxCpService.getOaService();
WxCpApprovalDetailResult approvalDetail = oaService.getApprovalDetail("202601140001");

WxCpApprovalDetailResult 实体中没有总费用金额这个字段</issue_description>

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

Custom agent used: 全部用中文
需要用中文,包括PR标题和分析总结过程


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

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add total cost field to approval detail result 添加企业微信审批详情总费用金额字段支持 Jan 19, 2026
Copilot AI requested a review from binarywang January 19, 2026 03:44
@binarywang binarywang marked this pull request as ready for review January 19, 2026 03:44
Copilot AI review requested due to automatic review settings January 19, 2026 03:44
@augmentcode
Copy link

augmentcode bot commented Jan 19, 2026

🤖 Augment PR Summary

概述:本 PR 为企业微信「获取审批详情」结果补齐缺失的总费用金额字段,便于 SDK 用户直接读取接口返回的总金额数据。

主要变更:

  • WxCpApprovalDetailResult.WxCpApprovalDetail 中新增 sumMoney 字段,并通过 @SerializedName("sum_money") 映射接口返回值。
  • 字段类型为 Long,金额单位为「分」,当审批单包含费用相关控件时才会返回,否则为 null
  • WxCpOaServiceImplTest 增加单测,覆盖包含/不包含 sum_money 两种 JSON 场景,验证反序列化与向后兼容。
技术说明:改动仅为实体扩展与 JSON 映射,不改变现有接口调用逻辑,属于向后兼容增强。

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本 Pull Request 为企业微信审批详情接口添加了 sum_money(总费用金额)字段支持,解决了用户无法获取审批单总费用数据的问题。

变更内容:

  • WxCpApprovalDetailResult.WxCpApprovalDetail 实体类中新增 sumMoney 字段(类型为 Long,单位:分)
  • 添加完整的单元测试验证字段的序列化/反序列化功能以及向后兼容性

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpApprovalDetailResult.java 新增 sumMoney 字段及完整的 JavaDoc 注释,使用 @SerializedName("sum_money") 注解映射 JSON 字段
weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java 添加 testApprovalDetailSumMoney() 测试方法,覆盖字段存在和不存在两种场景,确保向后兼容性

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.

企业微信获取审批详情,返回结果缺少字段-总费用金额

2 participants