Skip to content

新增微信小店代发管理模块:Supplier 关联、自动分配与 Dropship 单据接口支持#4031

Merged
binarywang merged 3 commits into
developfrom
copilot/fix-1343140-49122742-9a4504fb-0040-486e-93ce-33f73309afba
Jul 18, 2026
Merged

新增微信小店代发管理模块:Supplier 关联、自动分配与 Dropship 单据接口支持#4031
binarywang merged 3 commits into
developfrom
copilot/fix-1343140-49122742-9a4504fb-0040-486e-93ce-33f73309afba

Conversation

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor

当前 weixin-java-channel 缺少代发管理能力,无法覆盖商家与供货商关联、订单自动分配以及代发单管理场景。
本 PR 基于官方代发管理文档,补齐 12 个接口在服务层、路由入口与数据模型层的支持。

  • 服务入口与能力挂载

    • 新增 WxChannelSupplierService,定义 12 个代发管理接口方法(供货商列表、分配策略、代发单分配/取消/查询/列表/搜索)。
    • WxChannelService 暴露 getSupplierService()
    • BaseWxChannelServiceImpl 中完成 WxChannelSupplierServiceImpl 的懒加载接入。
  • API 常量补齐(官方路径)

    • WxChannelApiUrlConstants 新增 Supplier 分组,增加以下路径常量:
      • /channels/ec/supplier/relation/get_supplier_list
      • /channels/ec/supplier/relation/get_distribute
      • /channels/ec/supplier/relation/set_manually_distribute
      • /channels/ec/supplier/relation/set_all_distribution
      • /channels/ec/supplier/relation/set_product_distribute
      • /channels/ec/supplier/relation/get_product_default_distribute
      • /channels/ec/supplier/relation/get_product_list
      • /channels/ec/order/dropship/assign
      • /channels/ec/order/dropship/cancel
      • /channels/ec/order/dropship/get
      • /channels/ec/order/dropship/list
      • /channels/ec/order/dropship/search
  • 请求/响应模型新增

    • 新增 bean/supplier 下请求与响应对象,覆盖:
      • 分配设置:ProductDistributeRequestDistributeTypeResponseSupplierInfoResponseProductListResponse
      • 代发单:DropshipAssignRequestDropshipResponseDropshipDetailResponseDropshipListRequestDropshipSearchRequestDropshipListResponse
      • 基础实体:SupplierInfoDropshipInfo
    • 字段命名统一使用 @JsonProperty 对齐接口 JSON 键(如 supplier_idproduct_id_listdropship_list)。
  • 实现示例(服务调用形态)

    WxChannelSupplierService supplierService = channelService.getSupplierService();
    
    // 设置按商品自动分配
    ProductDistributeRequest req = new ProductDistributeRequest();
    req.setSupplierId("10001");
    req.setProductIdList(Arrays.asList("p100", "p101"));
    supplierService.setProductDistribute(req);
    
    // 拉取代发单列表
    DropshipListRequest listReq = new DropshipListRequest();
    listReq.setSupplierId("10001");
    listReq.setPageSize(20);
    DropshipListResponse resp = supplierService.listDropship(listReq);
  • 单元测试补充

    • 新增 WxChannelSupplierBeanTest,覆盖新增模型的关键序列化/反序列化契约,确保请求体与响应映射可用。

Copilot AI linked an issue May 31, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add代发管理模块支持 for WxJava 新增微信小店代发管理模块:Supplier 关联、自动分配与 Dropship 单据接口支持 May 31, 2026
Copilot AI requested a review from binarywang May 31, 2026 14:32
@binarywang
binarywang marked this pull request as ready for review May 31, 2026 14:32
Copilot AI review requested due to automatic review settings May 31, 2026 14:32

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

weixin-java-channel 模块新增了视频号小店"代发管理"能力,覆盖供货商关联、分配策略与代发单管理共 12 个接口,并补充服务入口、URL 常量、请求/响应模型以及关键序列化单测。

Changes:

  • 新增 WxChannelSupplierService 接口与实现,并在 WxChannelService/BaseWxChannelServiceImpl 中以懒加载方式暴露。
  • WxChannelApiUrlConstants 增加 Supplier 分组的 12 条官方接口 URL 常量。
  • bean/supplier 下新增供货商/代发单的请求与响应模型,并补充 WxChannelSupplierBeanTest 验证序列化契约。

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java 暴露 getSupplierService() 入口
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelSupplierService.java 新增代发管理服务接口,定义 12 个方法
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java 注册并懒加载 WxChannelSupplierServiceImpl
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSupplierServiceImpl.java 服务实现,调用各接口 URL
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java 新增 Supplier URL 常量分组
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/SupplierInfo.java 基础供货商实体
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/SupplierInfoResponse.java 单个供货商响应
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/SupplierListResponse.java 供货商列表分页响应
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/ProductDistributeRequest.java 按商品分配请求
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/ProductListResponse.java 商品分配列表响应
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/DistributeTypeResponse.java 分配方式响应
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/DropshipInfo.java 代发单实体
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/DropshipAssignRequest.java 代发单分配请求
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/DropshipResponse.java 代发单分配响应
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/DropshipDetailResponse.java 代发单详情响应
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/DropshipListRequest.java 代发单列表请求
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/DropshipListResponse.java 代发单列表响应
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/supplier/DropshipSearchRequest.java 代发单搜索请求(继承列表请求)
weixin-java-channel/src/test/java/me/chanjar/weixin/channel/bean/supplier/WxChannelSupplierBeanTest.java 关键序列化/反序列化单测

@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: 75ac877537

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

@binarywang binarywang added this to the 4.8.5 milestone Jun 8, 2026
@binarywang
binarywang merged commit 6d58434 into develop Jul 18, 2026
1 check passed
@binarywang
binarywang deleted the copilot/fix-1343140-49122742-9a4504fb-0040-486e-93ce-33f73309afba branch July 18, 2026 08:49
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