Skip to content

Conversation

@buaazyl
Copy link
Contributor

@buaazyl buaazyl commented Dec 6, 2025

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 为微信小程序发货信息管理功能补充消息推送字段,支持订单发货和结算事件的完整信息接收。实现了微信官方文档中定义的发货信息推送协议,使开发者能够接收订单发货提醒和结算通知。

主要变更:

  • 在 WxMaMessage 类中新增 11 个发货相关字段,包括支付订单信息、商户信息、发货时间、结算时间等
  • 在 WxConsts.EventType 中新增两个事件类型常量:发货提醒事件和订单结算事件
  • 修正了部分代码格式问题,统一了常量声明的空格风格

Reviewed changes

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

File Description
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java 新增 11 个字段支持发货信息消息推送,包括交易订单号、商户信息、支付/发货/结算时间等字段
weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java 新增 TRADE_MANAGE_REMIND_SHIPPING 和 TRADE_MANAGE_ORDER_SETTLEMENT 两个事件类型常量,并修正部分格式问题

Comment on lines +260 to +314
/**
* 微信支付订单号
*/
@XStreamAlias("transaction_id")
private String transactionId;
/**
* 商户号
*/
@XStreamAlias("merchant_id")
private String merchantId;
/**
* 子商户号
*/
@XStreamAlias("sub_merchant_id")
private String subMerchantId;
/**
* 商户订单号
*/
@XStreamAlias("merchant_trade_no")
private String merchantTradeNo;
/**
* 支付成功时间,秒级时间戳
*/
@XStreamAlias("pay_time")
private Long payTime;
/**
* 消息文本内容
*/
@XStreamAlias("msg")
private String msg;
/**
* 支付成功时间,秒级时间戳
*/
@XStreamAlias("shipped_time")
private Long shippedTime;
/**
* 预计结算时间,秒级时间戳。发货时推送才有该字段
*/
@XStreamAlias("estimated_settlement_time")
private Long estimatedSettlementTime;
/**
* 确认收货方式:1. 手动确认收货;2. 自动确认收货。结算时推送才有该字段
*/
@XStreamAlias("confirm_receive_method")
private Integer confirmReceiveMethod;
/**
* 确认收货时间,秒级时间戳。结算时推送才有该字段
*/
@XStreamAlias("confirm_receive_time")
private Long confirmReceiveTime;
/**
* 订单结算时间,秒级时间戳。结算时推送才有该字段
*/
@XStreamAlias("settlement_time")
private Long settlementTime;
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

缺少对新增发货信息字段的测试覆盖。建议在 WxMaMessageTest.java 中添加针对 TRADE_MANAGE_REMIND_SHIPPING 和 TRADE_MANAGE_ORDER_SETTLEMENT 事件的测试用例,验证这些新字段(transactionId, merchantId, subMerchantId, merchantTradeNo, payTime, msg, shippedTime, estimatedSettlementTime, confirmReceiveMethod, confirmReceiveTime, settlementTime)能够正确解析。可以参考现有的 testSubscribeMsgPopupEvent() 和 testFromXmlForOpenProductOrderPayEvent() 方法的测试模式。

Copilot uses AI. Check for mistakes.
@XStreamAlias("msg")
private String msg;
/**
* 支付成功时间,秒级时间戳
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

JavaDoc 注释错误:此字段为"发货时间"(shipped_time),但注释写成了"支付成功时间"。这与 payTime 字段的注释重复了。应改为"发货时间,秒级时间戳"或类似描述。

Suggested change
* 支付成功时间秒级时间戳
* 发货时间秒级时间戳

Copilot uses AI. Check for mistakes.
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.

1 participant