Skip to content

feat(channel): 新增微信小店质检管理(QIC)5个官方接口支持#4039

Open
binarywang with Copilot wants to merge 2 commits into
developfrom
copilot/feature-add-quality-inspection-module
Open

feat(channel): 新增微信小店质检管理(QIC)5个官方接口支持#4039
binarywang with Copilot wants to merge 2 commits into
developfrom
copilot/feature-add-quality-inspection-module

Conversation

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor

当前 weixin-java-channel 缺少质检管理能力,无法覆盖珠宝/奢侈品等需送检场景。该 PR 按微信官方 QIC 文档补齐 5 个接口,并将能力接入 WxChannelService 主服务入口。

  • 接口层:新增质检服务抽象与入口接入

    • 新增 WxChannelQicService,提供以下能力:
      • 查询质检仓配置 getInspectConfig()
      • 查询送检配置模板 getSubmitConfig(String orderId) / getSubmitConfig()
      • 打印质检码 printInspectCode(String orderId)
      • 绑定送检信息 submitInspectInfo(SubmitInspectRequest)
      • 自寄快递送检 registerLogistics(RegisterLogisticsRequest)
    • WxChannelService 增加 getQicService(),并在 BaseWxChannelServiceImpl 中完成懒加载注入。
  • 实现层:新增 QIC 服务实现与官方路径常量

    • 新增 WxChannelQicServiceImpl,按官方路径调用:
      • /channels/ec/qic/inspect/config/get
      • /channels/ec/qic/inspect/submitconfig/get
      • /channels/ec/qic/inspect/code/print
      • /channels/ec/qic/inspect/submit
      • /channels/ec/qic/inspect/register_logistics
    • WxChannelApiUrlConstants 中新增 Qic 常量分组,集中维护路径。
  • 数据模型:补齐请求/响应对象并对齐官方字段

    • 新增响应模型:
      • InspectConfigResponse
      • SubmitConfigResponse
      • InspectCodeResponse
    • 新增请求模型:
      • SubmitInspectRequest
      • RegisterLogisticsRequest
    • 字段映射覆盖质检机构、快递产品、保价信息、沉香机构字段、打印模板信息等文档定义项。
  • 测试:新增质检服务单元测试

    • 新增 WxChannelQicServiceImplTest,覆盖 5 个接口的调用入口与核心请求对象构造。

示例(新增服务调用方式):

WxChannelQicService qicService = channelService.getQicService();

// 1) 查询质检仓配置
InspectConfigResponse inspectConfig = qicService.getInspectConfig();

// 2) 打印质检码
InspectCodeResponse codeResponse = qicService.printInspectCode("37423523451235145");

// 3) 绑定送检信息
SubmitInspectRequest req = new SubmitInspectRequest();
req.setOrderId("37423523451235145");
WxChannelBaseResponse submitResp = qicService.submitInspectInfo(req);

Copilot AI linked an issue May 31, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add quality inspection management module support feat(channel): 新增微信小店质检管理(QIC)5个官方接口支持 May 31, 2026
Copilot AI requested a review from binarywang May 31, 2026 14:36
@binarywang binarywang marked this pull request as ready for review May 31, 2026 14:37
Copilot AI review requested due to automatic review settings May 31, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown

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.

@binarywang

Copy link
Copy Markdown
Owner

@codex auggie review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment on lines +40 to +44
public SubmitConfigResponse getSubmitConfig(String orderId) throws WxErrorException {
String queryParam = StringUtils.isBlank(orderId) ? "" : "order_id=" + orderId;
String respJson = shopService.get(GET_SUBMIT_CONFIG_URL, queryParam);
return ResponseUtils.decode(respJson, SubmitConfigResponse.class);
}
Comment on lines +23 to +33
public static class DataPayload implements Serializable {
private static final long serialVersionUID = 684071509005627272L;

@JsonProperty("backupDeliveryId")
private String backupDeliveryId;

@JsonProperty("backupDeliveryName")
private String backupDeliveryName;

@JsonProperty("boxDTOList")
private List<BoxInfo> boxInfoList;
@augmentcode

augmentcode Bot commented Jul 11, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds “质检管理(QIC)” support to weixin-java-channel so the SDK can cover jewelry/luxury inspection workflows.

Changes:

  • Introduced WxChannelQicService with 5 official QIC endpoints (inspect config, submit config, print inspect code, submit inspect info, register logistics).
  • Exposed the new capability via WxChannelService#getQicService() and added lazy initialization in BaseWxChannelServiceImpl.
  • Implemented the API calls in WxChannelQicServiceImpl using centralized URL constants.
  • Added a new WxChannelApiUrlConstants.Qic group to maintain the 5 endpoint URLs.
  • Added request/response DTOs under me.chanjar.weixin.channel.bean.qic aligned to the official field names.
  • Added TestNG integration-style tests (WxChannelQicServiceImplTest) to exercise the 5 new service methods.

Technical Notes: Requests are executed through BaseWxChannelServiceImpl which injects access_token, and responses are parsed via ResponseUtils.decode.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

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


@Override
public SubmitConfigResponse getSubmitConfig(String orderId) throws WxErrorException {
String queryParam = StringUtils.isBlank(orderId) ? "" : "order_id=" + orderId;

@augmentcode augmentcode Bot Jul 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelQicServiceImpl.java:41 — When orderId is blank this sets queryParam to ""; because BaseWxChannelServiceImpl already appends ?access_token=..., the GET executor will append an extra trailing & (e.g. ...access_token=...&). Consider passing null when no optional params are present so the final request URL isn't malformed/ambiguous.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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

Copy link
Copy Markdown

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: 0748aa9f0f

ℹ️ 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".

public static class DataPayload implements Serializable {
private static final long serialVersionUID = 684071509005627272L;

@JsonProperty("backupDeliveryId")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Map inspect-code fields to the API payload names

The print-inspect-code response DTO starts annotating every returned field with camelCase names such as backupDeliveryId/boxDTOList, unlike the QIC API payload naming used by the other new DTOs. When WeChat returns the documented snake_case response fields, Jackson will silently leave these properties null, so a successful printInspectCode call won't expose the inspection code details to callers. Please align these @JsonProperty values with the actual response field names.

Useful? React with 👍 / 👎.

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