-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
补充视频号小店订单管理缺失的13个接口 #4038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
补充视频号小店订单管理缺失的13个接口 #4038
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,16 +5,29 @@ | |
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.GET_DELIVERY_COMPANY_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ACCEPT_ADDRESS_MODIFY_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.DECODE_SENSITIVE_INFO_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.DELIVERY_COMPENSATION_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_GET_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_LIST_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_SEARCH_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRE_SHIPMENT_CHANGE_SKU_GET_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRE_SHIPMENT_CHANGE_SKU_REJECT_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRESENT_NOTE_ADD_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRESENT_SUB_ORDER_GET_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REAL_NUMBER_APPLY_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REAL_NUMBER_VIEW_AUDIT_GET_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REJECT_ADDRESS_MODIFY_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_ADDRESS_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_EXPRESS_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_PRICE_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_REMARK_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPLOAD_FRESH_INSPECT_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_NUMBER_APPLY_AGAIN_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_NUMBER_DELAY_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_TEL_NUMBER_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.ADD_PHONE_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.GET_PHONE_URL; | ||
| import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.SEND_VERIFY_CODE_URL; | ||
|
|
||
| import java.util.List; | ||
| import lombok.extern.slf4j.Slf4j; | ||
|
|
@@ -30,6 +43,7 @@ | |
| import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse; | ||
| import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam; | ||
| import me.chanjar.weixin.channel.bean.order.OrderAddressParam; | ||
| import me.chanjar.weixin.channel.bean.order.OrderCompensationDeliveryParam; | ||
| import me.chanjar.weixin.channel.bean.order.OrderIdParam; | ||
| import me.chanjar.weixin.channel.bean.order.OrderInfoParam; | ||
| import me.chanjar.weixin.channel.bean.order.OrderInfoResponse; | ||
|
|
@@ -38,6 +52,14 @@ | |
| import me.chanjar.weixin.channel.bean.order.OrderPriceParam; | ||
| import me.chanjar.weixin.channel.bean.order.OrderRemarkParam; | ||
| import me.chanjar.weixin.channel.bean.order.OrderSearchParam; | ||
| import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuRejectParam; | ||
| import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuResponse; | ||
| import me.chanjar.weixin.channel.bean.order.PresentNoteAddParam; | ||
| import me.chanjar.weixin.channel.bean.order.PresentSubOrderResponse; | ||
| import me.chanjar.weixin.channel.bean.order.PrivateNumberAddPhoneParam; | ||
| import me.chanjar.weixin.channel.bean.order.PrivateNumberGetPhoneResponse; | ||
| import me.chanjar.weixin.channel.bean.order.PrivateNumberSendVerifyCodeParam; | ||
| import me.chanjar.weixin.channel.bean.order.RealNumberViewAuditResponse; | ||
| import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse; | ||
| import me.chanjar.weixin.channel.util.ResponseUtils; | ||
| import me.chanjar.weixin.common.error.WxErrorException; | ||
|
|
@@ -178,4 +200,95 @@ public DecodeSensitiveInfoResponse decodeSensitiveInfo(String orderId) throws Wx | |
| String resJson = shopService.post(DECODE_SENSITIVE_INFO_URL, reqJson); | ||
| return ResponseUtils.decode(resJson, DecodeSensitiveInfoResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse addPresentNote(String orderId, String note) throws WxErrorException { | ||
| PresentNoteAddParam param = new PresentNoteAddParam(orderId, note); | ||
| String resJson = shopService.post(PRESENT_NOTE_ADD_URL, param); | ||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public PresentSubOrderResponse getPresentSubOrders(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(PRESENT_SUB_ORDER_GET_URL, param); | ||
| return ResponseUtils.decode(resJson, PresentSubOrderResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public PreShipmentChangeSkuResponse getPreShipmentChangeSku(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_GET_URL, param); | ||
| return ResponseUtils.decode(resJson, PreShipmentChangeSkuResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse approvePreShipmentChangeSku(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL, param); | ||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse rejectPreShipmentChangeSku(String orderId, String rejectReason) | ||
| throws WxErrorException { | ||
| PreShipmentChangeSkuRejectParam param = new PreShipmentChangeSkuRejectParam(orderId, rejectReason); | ||
| String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_REJECT_URL, param); | ||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse applyRealNumber(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(REAL_NUMBER_APPLY_URL, param); | ||
|
Comment on lines
+241
to
+243
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The real-number application API requires a merchant-supplied reason in addition to Useful? React with 👍 / 👎. |
||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public RealNumberViewAuditResponse getRealNumberViewAudit(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(REAL_NUMBER_VIEW_AUDIT_GET_URL, param); | ||
| return ResponseUtils.decode(resJson, RealNumberViewAuditResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse applyVirtualNumberAgain(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(VIRTUAL_NUMBER_APPLY_AGAIN_URL, param); | ||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse delayVirtualNumber(String orderId) throws WxErrorException { | ||
| OrderIdParam param = new OrderIdParam(orderId); | ||
| String resJson = shopService.post(VIRTUAL_NUMBER_DELAY_URL, param); | ||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse addPrivatePhone(String phone) throws WxErrorException { | ||
| PrivateNumberAddPhoneParam param = new PrivateNumberAddPhoneParam(phone); | ||
| String resJson = shopService.post(ADD_PHONE_URL, param); | ||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse sendPrivatePhoneVerifyCode(String phone) throws WxErrorException { | ||
| PrivateNumberSendVerifyCodeParam param = new PrivateNumberSendVerifyCodeParam(phone); | ||
| String resJson = shopService.post(SEND_VERIFY_CODE_URL, param); | ||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public PrivateNumberGetPhoneResponse getPrivatePhone() throws WxErrorException { | ||
| String resJson = shopService.post(GET_PHONE_URL, "{}"); | ||
| return ResponseUtils.decode(resJson, PrivateNumberGetPhoneResponse.class); | ||
| } | ||
|
|
||
| @Override | ||
| public WxChannelBaseResponse compensationDelivery(OrderCompensationDeliveryParam param) | ||
| throws WxErrorException { | ||
| String resJson = shopService.post(DELIVERY_COMPENSATION_URL, param); | ||
| return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package me.chanjar.weixin.channel.bean.order; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.io.Serializable; | ||
| import java.util.List; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
| import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo; | ||
|
|
||
| /** | ||
| * 订单补发货 请求参数 | ||
| * | ||
| * @author GitHub Copilot | ||
| */ | ||
| @Data | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @JsonInclude(Include.NON_NULL) | ||
| public class OrderCompensationDeliveryParam implements Serializable { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** 订单ID */ | ||
| @JsonProperty("order_id") | ||
| private String orderId; | ||
|
|
||
| /** 物流信息列表 */ | ||
| @JsonProperty("delivery_list") | ||
| private List<DeliveryInfo> deliveryList; | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package me.chanjar.weixin.channel.bean.order; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.io.Serializable; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| /** | ||
| * 拒绝待发货前更换SKU请求 请求参数 | ||
| * | ||
| * @author GitHub Copilot | ||
| */ | ||
| @Data | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @JsonInclude(Include.NON_NULL) | ||
| public class PreShipmentChangeSkuRejectParam implements Serializable { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** 订单ID */ | ||
| @JsonProperty("order_id") | ||
| private String orderId; | ||
|
|
||
| /** 拒绝原因 */ | ||
| @JsonProperty("reject_reason") | ||
| private String rejectReason; | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package me.chanjar.weixin.channel.bean.order; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.NoArgsConstructor; | ||
| import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; | ||
|
|
||
| /** | ||
| * 获取待发货前更换SKU待处理请求 响应 | ||
| * | ||
| * @author GitHub Copilot | ||
| */ | ||
| @Data | ||
| @NoArgsConstructor | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class PreShipmentChangeSkuResponse extends WxChannelBaseResponse { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** 更换SKU信息 */ | ||
| @JsonProperty("change_sku_info") | ||
| private ChangeSkuInfo changeSkuInfo; | ||
|
|
||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving a pre-shipment SKU change requires identifying the specific change request with
sku_change_idas well as the order, but this implementation posts onlyorder_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 👍 / 👎.