Skip to content

Commit c9ab956

Browse files
committed
feat(channel): 添加换货发货与拒绝发货接口
1 parent a6ee335 commit c9ab956

File tree

5 files changed

+121
-0
lines changed

5 files changed

+121
-0
lines changed

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,31 @@ WxChannelBaseResponse addComplaintEvidence(String complaintId, String content, L
149149
* @throws WxErrorException 异常
150150
*/
151151
AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException;
152+
153+
/**
154+
* 换货发货
155+
* 文档地址:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_acceptexchangereship.html
156+
*
157+
* @param afterSaleOrderId 售后单号
158+
* @param waybillId 快递单号
159+
* @param deliveryId 快递公司id
160+
* @return BaseResponse
161+
*
162+
* @throws WxErrorException 异常
163+
*/
164+
WxChannelBaseResponse acceptExchangeReship(String afterSaleOrderId, String waybillId, String deliveryId) throws WxErrorException;
165+
166+
/**
167+
* 换货拒绝发货
168+
* 文档地址:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_rejectexchangereship.html
169+
*
170+
* @param afterSaleOrderId 售后单号
171+
* @param rejectReason 拒绝原因具体描述 ,可使用默认描述,也可以自定义描述
172+
* @param rejectReasonType 拒绝原因枚举值
173+
* @param rejectCertificates 退款凭证,可使用图片上传接口获取media_id(数据类型填0)
174+
* @return BaseResponse
175+
*
176+
* @throws WxErrorException 异常
177+
*/
178+
WxChannelBaseResponse rejectExchangeReship(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List<String> rejectCertificates) throws WxErrorException;
152179
}

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,18 @@ public AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException {
107107
String resJson = shopService.post(AFTER_SALE_REJECT_REASON_GET_URL, "{}");
108108
return ResponseUtils.decode(resJson, AfterSaleRejectReasonResponse.class);
109109
}
110+
111+
@Override
112+
public WxChannelBaseResponse acceptExchangeReship(String afterSaleOrderId, String waybillId, String deliveryId) throws WxErrorException {
113+
AfterSaleAcceptExchangeReshipParam param = new AfterSaleAcceptExchangeReshipParam(afterSaleOrderId, waybillId, deliveryId);
114+
String resJson = shopService.post(AFTER_SALE_ACCEPT_EXCHANGE_RESHIP_URL, param);
115+
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
116+
}
117+
118+
@Override
119+
public WxChannelBaseResponse rejectExchangeReship(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List<String> rejectCertificates) throws WxErrorException {
120+
AfterSaleRejectExchangeReshipParam param = new AfterSaleRejectExchangeReshipParam(afterSaleOrderId, rejectReason, rejectReasonType, rejectCertificates);
121+
String resJson = shopService.post(AFTER_SALE_REJECT_EXCHANGE_RESHIP_URL, param);
122+
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
123+
}
110124
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package me.chanjar.weixin.channel.bean.after;
2+
3+
import com.fasterxml.jackson.annotation.JsonInclude;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import lombok.Data;
6+
7+
/**
8+
* 售后单同意信息
9+
*
10+
* @author <a href="https://gitee.com/cchengg">Chu</a>
11+
*/
12+
@Data
13+
@JsonInclude(JsonInclude.Include.NON_NULL)
14+
public class AfterSaleAcceptExchangeReshipParam extends AfterSaleIdParam {
15+
private static final long serialVersionUID = -7946679037747710613L;
16+
17+
/** 快递单号*/
18+
@JsonProperty("waybill_id")
19+
private String waybillId;
20+
21+
/** 快递公司id,通过获取快递公司列表接口获得,非主流快递公司可以填OTHER*/
22+
@JsonProperty("delivery_id")
23+
private String deliveryId;
24+
25+
public AfterSaleAcceptExchangeReshipParam() {
26+
27+
}
28+
29+
public AfterSaleAcceptExchangeReshipParam(String afterSaleOrderId, String waybillId, String deliveryId) {
30+
super(afterSaleOrderId);
31+
this.waybillId = waybillId;
32+
this.deliveryId = deliveryId;
33+
}
34+
35+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package me.chanjar.weixin.channel.bean.after;
2+
3+
import com.fasterxml.jackson.annotation.JsonInclude;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import lombok.Data;
6+
7+
import java.util.List;
8+
9+
/**
10+
* 售后单同意信息
11+
*
12+
* @author <a href="https://gitee.com/cchengg">Chu</a>
13+
*/
14+
@Data
15+
@JsonInclude(JsonInclude.Include.NON_NULL)
16+
public class AfterSaleRejectExchangeReshipParam extends AfterSaleIdParam {
17+
private static final long serialVersionUID = -7946679037747710613L;
18+
19+
/** 拒绝原因具体描述 ,可使用默认描述,也可以自定义描述*/
20+
@JsonProperty("reject_reason")
21+
private String rejectReason;
22+
23+
/** 拒绝原因枚举 */
24+
@JsonProperty("reject_reason_type")
25+
private Integer rejectReasonType;
26+
27+
/** 退款凭证,可使用图片上传接口获取media_id(数据类型填0)*/
28+
@JsonProperty("reject_certificates")
29+
private List<String> rejectCertificates;
30+
31+
public AfterSaleRejectExchangeReshipParam() {
32+
}
33+
34+
public AfterSaleRejectExchangeReshipParam(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List<String> rejectCertificates) {
35+
super(afterSaleOrderId);
36+
this.rejectReason = rejectReason;
37+
this.rejectReasonType = rejectReasonType;
38+
this.rejectCertificates = rejectCertificates;
39+
}
40+
41+
}

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ public interface AfterSale {
232232
String AFTER_SALE_REASON_GET_URL = "https://api.weixin.qq.com/channels/ec/aftersale/reason/get";
233233
/** 获取拒绝售后原因*/
234234
String AFTER_SALE_REJECT_REASON_GET_URL = "https://api.weixin.qq.com/channels/ec/aftersale/rejectreason/get";
235+
/** 换货发货*/
236+
String AFTER_SALE_ACCEPT_EXCHANGE_RESHIP_URL = "https://api.weixin.qq.com/channels/ec/aftersale/acceptexchangereship";
237+
/** 换货拒绝发货*/
238+
String AFTER_SALE_REJECT_EXCHANGE_RESHIP_URL = "https://api.weixin.qq.com/channels/ec/aftersale/rejectexchangereship";
235239
}
236240

237241
/** 纠纷相关接口 */

0 commit comments

Comments
 (0)