Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

微工卡批量转账API的 PayrollTransferBatchesRequest 缺少必要字段,导致无法正确传递完整参数到微信支付API。

新增字段

PayrollTransferBatchesRequest 主类:

  • employmentType (必填) - 用工类型:LONG_TERM_EMPLOYMENT, SHORT_TERM_EMPLOYMENT, COOPERATION_EMPLOYMENT
  • employmentScene (可选) - 用工场景:LOGISTICS, MANUFACTURING, HOTEL, CATERING, EVENT, RETAIL, OTHERS
  • authorizationType (必填) - 授权类型:INFORMATION_AUTHORIZATION_TYPE, FUND_AUTHORIZATION_TYPE, INFORMATION_AND_FUND_AUTHORIZATION_TYPE

TransferDetail 内部类:

  • userIdCard (可选, 加密) - 收款用户身份证号

使用示例

PayrollTransferBatchesRequest request = PayrollTransferBatchesRequest.builder()
  .employmentType("LONG_TERM_EMPLOYMENT")
  .employmentScene("LOGISTICS")
  .authorizationType("INFORMATION_AUTHORIZATION_TYPE")
  .transferDetailList(Collections.singletonList(
    TransferDetail.builder()
      .userIdCard("8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f")
      .build()
  ))
  .build();

所有敏感字段已使用 @SpecEncrypt 注解标记,字段注释遵循项目规范格式。

Original prompt

This section details on the original issue you should resolve

<issue_title>4.8.1.B新增的微工卡批量转账入参好像缺少了部分字段,如employmentType,employmentScene,authorizationType等字段</issue_title>
<issue_description>截止最新发版的4.8.1.B新增的微工卡批量转账一经发布,我并第一时间进行验证, 发现入参PayrollTransferBatchesRequest好像缺少了部分字段,如employmentType,employmentScene,authorizationType,明细里面非必要字段userIdCard等字段。

employmentType类型分别有:长期用工(LONG_TERM_EMPLOYMENT)、短期用工(SHORT_TERM_EMPLOYMENT)、合作关系(COOPERATION_EMPLOYMENT)
employmentScene用工场景有:LOGISTICS:物流;MANUFACTURING:制造业;HOTEL:酒店;CATERING:餐饮业;EVENT:活动促销;RETAIL:零售;OTHERS:其他等选项。
authorizationType类型分别有INFORMATION_AUTHORIZATION_TYPE:特约商户信息授权类型、FUND_AUTHORIZATION_TYPE:特约商户资金授权类型、 INFORMATION_AND_FUND_AUTHORIZATION_TYPE:特约商户信息和资金授权类型。
以上提供的信息还请作者予以核实,不胜感谢。</issue_description>

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

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 26, 2026 14:41
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing fields to PayrollTransferBatchesRequest 补充微工卡批量转账API缺失字段 Jan 26, 2026
Copilot AI requested a review from binarywang January 26, 2026 14:48
@binarywang binarywang marked this pull request as ready for review January 26, 2026 14:55
Copilot AI review requested due to automatic review settings January 26, 2026 14:55
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

此 PR 补充了微工卡批量转账 API (PayrollTransferBatchesRequest) 中缺失的必要字段,以确保能够正确传递完整参数到微信支付 API。此修复基于 issue #3869 中用户报告的字段缺失问题。

Changes:

  • PayrollTransferBatchesRequest 主类中新增三个字段:employmentType(用工类型,必填)、employmentScene(用工场景,可选)、authorizationType(授权类型,必填)
  • TransferDetail 内部类中新增 userIdCard 字段(收款用户身份证号,可选,需加密)
  • 更新测试用例以使用新增字段,确保 API 调用的完整性

Reviewed changes

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

File Description
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/marketing/payroll/PayrollTransferBatchesRequest.java 新增三个必要的主类字段(employmentType、employmentScene、authorizationType)和一个 TransferDetail 内部类字段(userIdCard),所有字段都包含完整的 JavaDoc 注释和正确的注解
weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImplTest.java 更新测试用例以使用新增的字段,确保 API 的完整测试覆盖

* 字段名:用工类型
* 变量名:employment_type
* 是否必填:是
* 类型:string[1,32]
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

类型描述格式不一致。现有字段使用 string[1, 32](逗号后有空格),而新增的字段使用 string[1,32](逗号后无空格)。建议修改为 string[1, 32] 以保持代码库的一致性。

Copilot uses AI. Check for mistakes.
* 字段名:用工场景
* 变量名:employment_scene
* 是否必填:否
* 类型:string[1,32]
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

类型描述格式不一致。现有字段使用 string[1, 32](逗号后有空格),而新增的字段使用 string[1,32](逗号后无空格)。建议修改为 string[1, 32] 以保持代码库的一致性。

Copilot uses AI. Check for mistakes.
* 字段名:特约商户授权类型
* 变量名:authorization_type
* 是否必填:是
* 类型:string[1,32]
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

类型描述格式不一致。现有字段使用 string[1, 32](逗号后有空格),而新增的字段使用 string[1,32](逗号后无空格)。建议修改为 string[1, 32] 以保持代码库的一致性。

Copilot uses AI. Check for mistakes.
@augmentcode
Copy link

augmentcode bot commented Jan 26, 2026

🤖 Augment PR Summary

Summary: 本 PR 补全了微工卡批量转账(payroll-card/transfer-batches)请求体中缺失的关键入参字段,避免因参数不全导致微信支付侧校验失败。

Changes:

  • PayrollTransferBatchesRequest 主类新增 employmentType(必填)、employmentScene(可选)、authorizationType(必填)并补齐对应的 @SerializedName
  • 在内部类 TransferDetail 新增可选敏感字段 userIdCard,并使用 @SpecEncrypt 标记以支持加密
  • 更新 PayrollServiceImplTest 的构造示例以覆盖新增字段

Technical Notes: 新增字段均按微信支付 API 参数命名进行 JSON 序列化;敏感字段通过 @SpecEncrypt 与现有加密流程对齐。

🤖 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. 1 suggestions posted.

Fix All in Augment

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

.transferRemark("2020年4月报销")
.openid("o-MYE42l80oelYMDE34nYD456Xoy")
.userName("张三")
.userIdCard("8609cb22e1774a50a930e414cc71eca06121bcd266335cda230d24a7886a8d9f")
Copy link

Choose a reason for hiding this comment

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

这里的 userIdCard 看起来更像是示例密文/摘要值;但 payrollCardTransferBatches 会对 @SpecEncrypt 字段再做一次 RSA 加密,最终微信侧解密后会得到一个格式不合法的“身份证号”,容易导致联调/测试失败。另外 PR 描述中的示例也有同样的误导风险。

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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.

4.8.1.B新增的微工卡批量转账入参好像缺少了部分字段,如employmentType,employmentScene,authorizationType等字段

2 participants