Skip to content

[Feature] 新增电子面单模块支持 #3984

@binarywang

Description

@binarywang

功能描述

电子面单是物流发货的核心功能,目前WxJava完全未实现该模块。建议新增 WxChannelEwaybillService 接口及实现类。

官方文档

https://developers.weixin.qq.com/doc/channels/API/channels-shop-delivery/ewaybill/

需要实现的接口列表(16个)

接口名称 请求路径
获取面单标准模板 /channels/ec/logistics/ewaybill/biz/template/config
新增面单模板 /channels/ec/logistics/ewaybill/biz/template/create
删除面单模版 /channels/ec/logistics/ewaybill/biz/template/delete
更新面单模版 /channels/ec/logistics/ewaybill/biz/template/update
获取面单模板信息 /channels/ec/logistics/ewaybill/biz/template/get
根据模板ID获取面单模板信息 /channels/ec/logistics/ewaybill/biz/template/getbyid
查询开通的电子面单网点/账号信息 /channels/ec/logistics/ewaybill/biz/account/get
查询开通的快递公司列表 /channels/ec/logistics/ewaybill/biz/delivery/get
电子面单预取号 /channels/ec/logistics/ewaybill/biz/order/precreate
电子面单取号 /channels/ec/logistics/ewaybill/biz/order/create
电子面单子件追加 /channels/ec/logistics/ewaybill/biz/order/addsuborder
电子面单取消下单 /channels/ec/logistics/ewaybill/biz/order/cancel
查询面单详情 /channels/ec/logistics/ewaybill/biz/order/get
获取打印报文 /channels/ec/logistics/ewaybill/biz/print/get
打印成功通知 /channels/ec/logistics/ewaybill/biz/order/print
批量打印通知 /channels/ec/logistics/ewaybill/biz/order/batchprint

实现要点

1. 新建服务接口

public interface WxChannelEwaybillService {
  // 模板管理
  TemplateConfigResponse getTemplateConfig() throws WxErrorException;
  TemplateIdResponse createTemplate(TemplateCreateRequest req) throws WxErrorException;
  WxChannelBaseResponse deleteTemplate(String templateId) throws WxErrorException;
  WxChannelBaseResponse updateTemplate(TemplateUpdateRequest req) throws WxErrorException;
  TemplateInfoResponse getTemplate(String templateId) throws WxErrorException;
  TemplateInfoResponse getTemplateById(String templateId) throws WxErrorException;
  
  // 账号管理
  AccountInfoResponse getAccount() throws WxErrorException;
  DeliveryListResponse getDeliveryList() throws WxErrorException;
  
  // 订单管理
  PreCreateResponse preCreateOrder(PreCreateRequest req) throws WxErrorException;
  CreateOrderResponse createOrder(CreateOrderRequest req) throws WxErrorException;
  WxChannelBaseResponse addSubOrder(AddSubOrderRequest req) throws WxErrorException;
  WxChannelBaseResponse cancelOrder(String waybillId) throws WxErrorException;
  OrderDetailResponse getOrder(String waybillId) throws WxErrorException;
  
  // 打印管理
  PrintContentResponse getPrintContent(String waybillId) throws WxErrorException;
  WxChannelBaseResponse printOrder(String waybillId) throws WxErrorException;
  WxChannelBaseResponse batchPrintOrder(List<String> waybillIds) throws WxErrorException;
}

2. 新建Bean类

  • TemplateConfigResponse - 面单标准模板响应
  • TemplateCreateRequest - 新增模板请求
  • TemplateUpdateRequest - 更新模板请求
  • TemplateInfoResponse - 模板信息响应
  • AccountInfoResponse - 账号信息响应
  • DeliveryListResponse - 快递公司列表响应
  • PreCreateRequest/Response - 预取号请求/响应
  • CreateOrderRequest/Response - 取号请求/响应
  • OrderDetailResponse - 面单详情响应
  • PrintContentResponse - 打印报文响应

3. URL常量定义

WxChannelApiUrlConstants.java 中新增 Ewaybill 接口。

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions