Skip to content

Commit 1bd50d4

Browse files
chuchenggbinarywang
authored andcommitted
🆕 #3770 【视频号】新增售后单商家协商、换货发货与拒绝发货等接口
1 parent 8e46da5 commit 1bd50d4

File tree

11 files changed

+230
-13
lines changed

11 files changed

+230
-13
lines changed

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

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33

44
import java.util.List;
5-
import me.chanjar.weixin.channel.bean.after.AfterSaleInfoResponse;
6-
import me.chanjar.weixin.channel.bean.after.AfterSaleListParam;
7-
import me.chanjar.weixin.channel.bean.after.AfterSaleListResponse;
8-
import me.chanjar.weixin.channel.bean.after.AfterSaleReasonResponse;
9-
import me.chanjar.weixin.channel.bean.after.AfterSaleRejectReasonResponse;
5+
6+
import me.chanjar.weixin.channel.bean.after.*;
107
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
118
import me.chanjar.weixin.channel.bean.complaint.ComplaintOrderResponse;
129
import me.chanjar.weixin.common.error.WxErrorException;
@@ -149,4 +146,41 @@ WxChannelBaseResponse addComplaintEvidence(String complaintId, String content, L
149146
* @throws WxErrorException 异常
150147
*/
151148
AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException;
149+
150+
/**
151+
* 换货发货
152+
* 文档地址:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_acceptexchangereship.html
153+
*
154+
* @param afterSaleOrderId 售后单号
155+
* @param waybillId 快递单号
156+
* @param deliveryId 快递公司id
157+
* @return BaseResponse
158+
*
159+
* @throws WxErrorException 异常
160+
*/
161+
WxChannelBaseResponse acceptExchangeReship(String afterSaleOrderId, String waybillId, String deliveryId) throws WxErrorException;
162+
163+
/**
164+
* 换货拒绝发货
165+
* 文档地址:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_rejectexchangereship.html
166+
*
167+
* @param afterSaleOrderId 售后单号
168+
* @param rejectReason 拒绝原因具体描述 ,可使用默认描述,也可以自定义描述
169+
* @param rejectReasonType 拒绝原因枚举值
170+
* @param rejectCertificates 退款凭证,可使用图片上传接口获取media_id(数据类型填0)
171+
* @return BaseResponse
172+
*
173+
* @throws WxErrorException 异常
174+
*/
175+
WxChannelBaseResponse rejectExchangeReship(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List<String> rejectCertificates) throws WxErrorException;
176+
177+
/**
178+
* 商家协商
179+
* 文档地址:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_merchantupdateaftersale.html
180+
* @param param 参数
181+
* @return BaseResponse
182+
*
183+
* @throws WxErrorException 异常
184+
*/
185+
WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdateParam param) throws WxErrorException;
152186
}

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
@Slf4j
2323
public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService {
2424

25-
/** 微信商店服务 */
25+
/**
26+
* 微信商店服务
27+
*/
2628
private final BaseWxChannelServiceImpl<?, ?> shopService;
2729

2830
public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl<?, ?> shopService) {
@@ -107,4 +109,25 @@ public AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException {
107109
String resJson = shopService.post(AFTER_SALE_REJECT_REASON_GET_URL, "{}");
108110
return ResponseUtils.decode(resJson, AfterSaleRejectReasonResponse.class);
109111
}
112+
113+
@Override
114+
public WxChannelBaseResponse acceptExchangeReship(String afterSaleOrderId, String waybillId, String deliveryId) throws WxErrorException {
115+
AfterSaleAcceptExchangeReshipParam param = new AfterSaleAcceptExchangeReshipParam(afterSaleOrderId, waybillId, deliveryId);
116+
String resJson = shopService.post(AFTER_SALE_ACCEPT_EXCHANGE_RESHIP_URL, param);
117+
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
118+
}
119+
120+
@Override
121+
public WxChannelBaseResponse rejectExchangeReship(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List<String> rejectCertificates) throws WxErrorException {
122+
AfterSaleRejectExchangeReshipParam param = new AfterSaleRejectExchangeReshipParam(afterSaleOrderId, rejectReason, rejectReasonType, rejectCertificates);
123+
String resJson = shopService.post(AFTER_SALE_REJECT_EXCHANGE_RESHIP_URL, param);
124+
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
125+
}
126+
127+
@Override
128+
public WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdateParam param) throws WxErrorException {
129+
String resJson = shopService.post(AFTER_SALE_MERCHANT_UPDATE_URL, param);
130+
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
131+
}
132+
110133
}
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+
}

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleExchangeProductInfo.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,12 @@ public class AfterSaleExchangeProductInfo implements Serializable {
3131
/** 数量 */
3232
@JsonProperty("product_cnt")
3333
private String productCnt;
34+
35+
/** 旧商品价格 */
36+
@JsonProperty("old_sku_price")
37+
private Integer oldSkuPrice;
38+
39+
/** 新商品价格 */
40+
@JsonProperty("new_sku_price")
41+
private Integer newSkuPrice;
3442
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 AfterSaleMerchantUpdateParam extends AfterSaleIdParam {
17+
private static final long serialVersionUID = -3672834150982780L;
18+
19+
/** 协商修改把售后单修改成该售后类型。1:退款;2:退货退款*/
20+
@JsonProperty("type")
21+
private Integer type;
22+
23+
/** 金额(单位:分)*/
24+
@JsonProperty("amount")
25+
private Integer amount;
26+
27+
/** 协商描述*/
28+
@JsonProperty("merchant_update_desc")
29+
private String merchantUpdateDesc;
30+
31+
/** 协商原因*/
32+
@JsonProperty("update_reason_type")
33+
private Integer updateReasonType;
34+
35+
/** 1:已协商一致,邀请买家取消售后; 2:邀请买家核实与补充凭证; 3:修改买家售后申请*/
36+
@JsonProperty("merchant_update_type")
37+
private Integer merchantUpdateType;
38+
39+
/** 协商凭证id列表,可使用图片上传接口获取media_id(数据类型填0),当update_reason_type对应的need_image为1时必填*/
40+
@JsonProperty("media_ids")
41+
private List<String> mediaIds;
42+
43+
public AfterSaleMerchantUpdateParam() {
44+
}
45+
46+
public AfterSaleMerchantUpdateParam(String afterSaleOrderId, Integer type, Integer updateReasonType, Integer merchantUpdateType
47+
, Integer amount, String merchantUpdateDesc, List<String> mediaIds) {
48+
super(afterSaleOrderId);
49+
this.type = type;
50+
this.updateReasonType = updateReasonType;
51+
this.merchantUpdateType = merchantUpdateType;
52+
this.amount = amount;
53+
this.merchantUpdateDesc = merchantUpdateDesc;
54+
this.mediaIds = mediaIds;
55+
}
56+
57+
}
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/bean/after/AfterSaleRejectReason.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,9 @@ public class AfterSaleRejectReason implements Serializable {
3636
@JsonProperty("reject_reason")
3737
private String rejectReason;
3838

39+
/**
40+
* 售后拒绝原因适用场景
41+
*/
42+
@JsonProperty("reject_scene")
43+
private Integer rejectScene;
3944
}

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintHistory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ComplaintHistory implements Serializable {
2626

2727
/** 用户联系电话 */
2828
@JsonProperty("phone_number")
29-
private Integer phoneNumber;
29+
private String phoneNumber;
3030

3131
/** 相关文本内容 */
3232
@JsonProperty("content")

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPayInfo.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@ public class OrderPayInfo implements Serializable {
1616

1717
private static final long serialVersionUID = -5085386252699113948L;
1818
/** 预支付id */
19-
@JsonProperty("prepayId")
20-
private String prepayId;
21-
22-
/** 预支付时间,秒级时间戳 */
23-
@JsonProperty("prepay_time")
24-
private Long prepayTime;
19+
@JsonProperty("payment_method")
20+
private Integer paymentMethod;
2521

2622
/** 支付时间,秒级时间戳 */
2723
@JsonProperty("pay_time")

weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,16 @@ public class SpuInfo extends SpuSimpleInfo {
139139
/** 尺码表信息 */
140140
@JsonProperty("size_chart")
141141
private SpuSizeChart sizeChart;
142+
143+
/** 短标题 */
144+
@JsonProperty("short_title")
145+
private String shortTitle;
146+
147+
/** 销量 */
148+
@JsonProperty("total_sold_num")
149+
private Integer totalSoldNum;
150+
151+
/** 发布模式,0: 普通模式;1: 极简模式 */
152+
@JsonProperty("release_mode")
153+
private Integer releaseMode;
142154
}

0 commit comments

Comments
 (0)