Skip to content

补充视频号小店订单管理缺失的13个接口#4038

Open
Copilot wants to merge 2 commits into
developfrom
copilot/feature
Open

补充视频号小店订单管理缺失的13个接口#4038
Copilot wants to merge 2 commits into
developfrom
copilot/feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 31, 2026

WxChannelOrderService 缺少礼物订单、发货前换SKU、真实号码/虚拟号管理、商家私密手机号及订单补发货等共13个接口的实现。

变更内容

URL 常量(WxChannelApiUrlConstants

  • Order 接口新增10个常量(PRESENT_NOTE_ADD_URLPRE_SHIPMENT_CHANGE_SKU_*REAL_NUMBER_*VIRTUAL_NUMBER_*DELIVERY_COMPENSATION_URL
  • 新增 PrivateNumber 接口,包含3个商家私密手机号相关URL常量

新增 Bean 类

类名 用途
PresentNoteAddParam 礼物订单新增备注请求参数
PresentSubOrderResponse 礼物单子单列表响应
PreShipmentChangeSkuResponse 获取待换SKU请求响应
PreShipmentChangeSkuRejectParam 拒绝换SKU请求参数
RealNumberViewAuditResponse 真实号审核状态响应
PrivateNumberAddPhoneParam / PrivateNumberSendVerifyCodeParam 手机号管理请求参数
PrivateNumberGetPhoneResponse / PrivateNumberPhoneInfo 手机号认证状态响应
OrderCompensationDeliveryParam 订单补发货请求参数

服务接口与实现

WxChannelOrderServiceWxChannelOrderServiceImpl 新增以下13个方法:

// 礼物订单
orderService.addPresentNote(orderId, note);
orderService.getPresentSubOrders(orderId);

// 发货前换SKU
orderService.getPreShipmentChangeSku(orderId);
orderService.approvePreShipmentChangeSku(orderId);
orderService.rejectPreShipmentChangeSku(orderId, rejectReason);

// 真实号码 / 虚拟号
orderService.applyRealNumber(orderId);
orderService.getRealNumberViewAudit(orderId);
orderService.applyVirtualNumberAgain(orderId);
orderService.delayVirtualNumber(orderId);

// 商家私密手机号
orderService.addPrivatePhone(phone);
orderService.sendPrivatePhoneVerifyCode(phone);
orderService.getPrivatePhone();

// 补发货
orderService.compensationDelivery(param);

WxChannelOrderServiceImplTest 同步新增对应的13个测试方法。

Copilot AI linked an issue May 31, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Implement missing order management APIs 补充视频号小店订单管理缺失的13个接口 May 31, 2026
Copilot AI requested a review from binarywang May 31, 2026 14:35
@binarywang binarywang marked this pull request as ready for review May 31, 2026 14:36
Copilot AI review requested due to automatic review settings May 31, 2026 14:36
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ef299b20b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +219 to +223
String PRESENT_NOTE_ADD_URL = "https://api.weixin.qq.com/channels/ec/order/presentnote/add";
/** 获取礼物单的子单列表 */
String PRESENT_SUB_ORDER_GET_URL = "https://api.weixin.qq.com/channels/ec/order/presentsuborder/get";
/** 获取待发货前更换sku待处理请求 */
String PRE_SHIPMENT_CHANGE_SKU_GET_URL = "https://api.weixin.qq.com/channels/ec/order/preshipmentchangesku/get";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use documented order API paths

These new URL constants do not match the order-management endpoints exposed by the WeChat shop docs for the same operations: gift notes/suborders use channels/ec/order/present/note and channels/ec/order/present/sublist, and pending SKU changes use channels/ec/order/sku/change/list, not the presentnote/add, presentsuborder/get, or preshipmentchangesku/get paths added here. Any caller of these newly added methods will post to an invalid API path before the request body is even considered.

Useful? React with 👍 / 👎.

Comment on lines +244 to +248
String ADD_PHONE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/addphone";
/** 获取短信验证码 */
String SEND_VERIFY_CODE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/sendverifycode";
/** 获取小店手机号认证状态 */
String GET_PHONE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/getphone";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Send private-number requests to the order phone APIs

The phone verification endpoints documented for these order-management operations are under channels/ec/order/phone/... (verifycode/add, verifycode/send, and status), but these constants point to channels/ec/merchant/privatenumber/.... In a real shop integration, addPrivatePhone, sendPrivatePhoneVerifyCode, and getPrivatePhone will therefore hit unrelated/nonexistent endpoints and fail with an API error.

Useful? React with 👍 / 👎.

Comment on lines +241 to +243
public WxChannelBaseResponse applyRealNumber(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(REAL_NUMBER_APPLY_URL, param);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include the required reason when applying for real numbers

The real-number application API requires a merchant-supplied reason in addition to order_id, but this method constructs an OrderIdParam and the public signature only accepts orderId. Callers cannot provide the required reason, so every request made through this new method is missing mandatory data and will be rejected by WeChat.

Useful? React with 👍 / 👎.

Comment on lines +226 to +228
public WxChannelBaseResponse approvePreShipmentChangeSku(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL, param);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass the SKU-change id when approving a change

Approving a pre-shipment SKU change requires identifying the specific change request with sku_change_id as well as the order, but this implementation posts only order_id. For orders with a pending SKU-change request, WeChat cannot know which request to approve, and the new API method will be rejected rather than approving the change.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

[Feature] 补充订单管理缺失接口

3 participants