1
0
mirror of synced 2025-12-20 07:38:27 +08:00

🆕 #3770 【视频号】新增售后单商家协商、换货发货与拒绝发货等接口

This commit is contained in:
chu
2025-11-27 14:57:33 +00:00
committed by Binary Wang
parent 8e46da5003
commit 1bd50d4d2f
11 changed files with 230 additions and 13 deletions

View File

@@ -2,11 +2,8 @@ package me.chanjar.weixin.channel.api;
import java.util.List;
import me.chanjar.weixin.channel.bean.after.AfterSaleInfoResponse;
import me.chanjar.weixin.channel.bean.after.AfterSaleListParam;
import me.chanjar.weixin.channel.bean.after.AfterSaleListResponse;
import me.chanjar.weixin.channel.bean.after.AfterSaleReasonResponse;
import me.chanjar.weixin.channel.bean.after.AfterSaleRejectReasonResponse;
import me.chanjar.weixin.channel.bean.after.*;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
import me.chanjar.weixin.channel.bean.complaint.ComplaintOrderResponse;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -149,4 +146,41 @@ public interface WxChannelAfterSaleService {
* @throws WxErrorException 异常
*/
AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException;
/**
* 换货发货
* 文档地址https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_acceptexchangereship.html
*
* @param afterSaleOrderId 售后单号
* @param waybillId 快递单号
* @param deliveryId 快递公司id
* @return BaseResponse
*
* @throws WxErrorException 异常
*/
WxChannelBaseResponse acceptExchangeReship(String afterSaleOrderId, String waybillId, String deliveryId) throws WxErrorException;
/**
* 换货拒绝发货
* 文档地址https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_rejectexchangereship.html
*
* @param afterSaleOrderId 售后单号
* @param rejectReason 拒绝原因具体描述 ,可使用默认描述,也可以自定义描述
* @param rejectReasonType 拒绝原因枚举值
* @param rejectCertificates 退款凭证可使用图片上传接口获取media_id数据类型填0
* @return BaseResponse
*
* @throws WxErrorException 异常
*/
WxChannelBaseResponse rejectExchangeReship(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List<String> rejectCertificates) throws WxErrorException;
/**
* 商家协商
* 文档地址https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_merchantupdateaftersale.html
* @param param 参数
* @return BaseResponse
*
* @throws WxErrorException 异常
*/
WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdateParam param) throws WxErrorException;
}

View File

@@ -22,7 +22,9 @@ import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Compla
@Slf4j
public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService {
/** 微信商店服务 */
/**
* 微信商店服务
*/
private final BaseWxChannelServiceImpl<?, ?> shopService;
public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl<?, ?> shopService) {
@@ -107,4 +109,25 @@ public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService
String resJson = shopService.post(AFTER_SALE_REJECT_REASON_GET_URL, "{}");
return ResponseUtils.decode(resJson, AfterSaleRejectReasonResponse.class);
}
@Override
public WxChannelBaseResponse acceptExchangeReship(String afterSaleOrderId, String waybillId, String deliveryId) throws WxErrorException {
AfterSaleAcceptExchangeReshipParam param = new AfterSaleAcceptExchangeReshipParam(afterSaleOrderId, waybillId, deliveryId);
String resJson = shopService.post(AFTER_SALE_ACCEPT_EXCHANGE_RESHIP_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse rejectExchangeReship(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List<String> rejectCertificates) throws WxErrorException {
AfterSaleRejectExchangeReshipParam param = new AfterSaleRejectExchangeReshipParam(afterSaleOrderId, rejectReason, rejectReasonType, rejectCertificates);
String resJson = shopService.post(AFTER_SALE_REJECT_EXCHANGE_RESHIP_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdateParam param) throws WxErrorException {
String resJson = shopService.post(AFTER_SALE_MERCHANT_UPDATE_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
}

View File

@@ -0,0 +1,35 @@
package me.chanjar.weixin.channel.bean.after;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
* 售后单换货发货信息
*
* @author <a href="https://gitee.com/cchengg">Chu</a>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AfterSaleAcceptExchangeReshipParam extends AfterSaleIdParam {
private static final long serialVersionUID = -7946679037747710613L;
/** 快递单号*/
@JsonProperty("waybill_id")
private String waybillId;
/** 快递公司id通过获取快递公司列表接口获得非主流快递公司可以填OTHER*/
@JsonProperty("delivery_id")
private String deliveryId;
public AfterSaleAcceptExchangeReshipParam() {
}
public AfterSaleAcceptExchangeReshipParam(String afterSaleOrderId, String waybillId, String deliveryId) {
super(afterSaleOrderId);
this.waybillId = waybillId;
this.deliveryId = deliveryId;
}
}

View File

@@ -31,4 +31,12 @@ public class AfterSaleExchangeProductInfo implements Serializable {
/** 数量 */
@JsonProperty("product_cnt")
private String productCnt;
/** 旧商品价格 */
@JsonProperty("old_sku_price")
private Integer oldSkuPrice;
/** 新商品价格 */
@JsonProperty("new_sku_price")
private Integer newSkuPrice;
}

View File

@@ -0,0 +1,57 @@
package me.chanjar.weixin.channel.bean.after;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
/**
* 售后单商家协商信息
*
* @author <a href="https://gitee.com/cchengg">Chu</a>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AfterSaleMerchantUpdateParam extends AfterSaleIdParam {
private static final long serialVersionUID = -3672834150982780L;
/** 协商修改把售后单修改成该售后类型。1:退款2:退货退款*/
@JsonProperty("type")
private Integer type;
/** 金额(单位:分)*/
@JsonProperty("amount")
private Integer amount;
/** 协商描述*/
@JsonProperty("merchant_update_desc")
private String merchantUpdateDesc;
/** 协商原因*/
@JsonProperty("update_reason_type")
private Integer updateReasonType;
/** 1:已协商一致,邀请买家取消售后; 2:邀请买家核实与补充凭证; 3:修改买家售后申请*/
@JsonProperty("merchant_update_type")
private Integer merchantUpdateType;
/** 协商凭证id列表可使用图片上传接口获取media_id数据类型填0当update_reason_type对应的need_image为1时必填*/
@JsonProperty("media_ids")
private List<String> mediaIds;
public AfterSaleMerchantUpdateParam() {
}
public AfterSaleMerchantUpdateParam(String afterSaleOrderId, Integer type, Integer updateReasonType, Integer merchantUpdateType
, Integer amount, String merchantUpdateDesc, List<String> mediaIds) {
super(afterSaleOrderId);
this.type = type;
this.updateReasonType = updateReasonType;
this.merchantUpdateType = merchantUpdateType;
this.amount = amount;
this.merchantUpdateDesc = merchantUpdateDesc;
this.mediaIds = mediaIds;
}
}

View File

@@ -0,0 +1,41 @@
package me.chanjar.weixin.channel.bean.after;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
/**
* 售后单换货拒绝发货信息
*
* @author <a href="https://gitee.com/cchengg">Chu</a>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AfterSaleRejectExchangeReshipParam extends AfterSaleIdParam {
private static final long serialVersionUID = -7946679037747710613L;
/** 拒绝原因具体描述 ,可使用默认描述,也可以自定义描述*/
@JsonProperty("reject_reason")
private String rejectReason;
/** 拒绝原因枚举 */
@JsonProperty("reject_reason_type")
private Integer rejectReasonType;
/** 退款凭证可使用图片上传接口获取media_id数据类型填0*/
@JsonProperty("reject_certificates")
private List<String> rejectCertificates;
public AfterSaleRejectExchangeReshipParam() {
}
public AfterSaleRejectExchangeReshipParam(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List<String> rejectCertificates) {
super(afterSaleOrderId);
this.rejectReason = rejectReason;
this.rejectReasonType = rejectReasonType;
this.rejectCertificates = rejectCertificates;
}
}

View File

@@ -36,4 +36,9 @@ public class AfterSaleRejectReason implements Serializable {
@JsonProperty("reject_reason")
private String rejectReason;
/**
* 售后拒绝原因适用场景
*/
@JsonProperty("reject_scene")
private Integer rejectScene;
}

View File

@@ -26,7 +26,7 @@ public class ComplaintHistory implements Serializable {
/** 用户联系电话 */
@JsonProperty("phone_number")
private Integer phoneNumber;
private String phoneNumber;
/** 相关文本内容 */
@JsonProperty("content")

View File

@@ -16,12 +16,8 @@ public class OrderPayInfo implements Serializable {
private static final long serialVersionUID = -5085386252699113948L;
/** 预支付id */
@JsonProperty("prepayId")
private String prepayId;
/** 预支付时间,秒级时间戳 */
@JsonProperty("prepay_time")
private Long prepayTime;
@JsonProperty("payment_method")
private Integer paymentMethod;
/** 支付时间,秒级时间戳 */
@JsonProperty("pay_time")

View File

@@ -139,4 +139,16 @@ public class SpuInfo extends SpuSimpleInfo {
/** 尺码表信息 */
@JsonProperty("size_chart")
private SpuSizeChart sizeChart;
/** 短标题 */
@JsonProperty("short_title")
private String shortTitle;
/** 销量 */
@JsonProperty("total_sold_num")
private Integer totalSoldNum;
/** 发布模式0: 普通模式1: 极简模式 */
@JsonProperty("release_mode")
private Integer releaseMode;
}

View File

@@ -232,6 +232,12 @@ public class WxChannelApiUrlConstants {
String AFTER_SALE_REASON_GET_URL = "https://api.weixin.qq.com/channels/ec/aftersale/reason/get";
/** 获取拒绝售后原因*/
String AFTER_SALE_REJECT_REASON_GET_URL = "https://api.weixin.qq.com/channels/ec/aftersale/rejectreason/get";
/** 换货发货*/
String AFTER_SALE_ACCEPT_EXCHANGE_RESHIP_URL = "https://api.weixin.qq.com/channels/ec/aftersale/acceptexchangereship";
/** 换货拒绝发货*/
String AFTER_SALE_REJECT_EXCHANGE_RESHIP_URL = "https://api.weixin.qq.com/channels/ec/aftersale/rejectexchangereship";
/** 商家协商*/
String AFTER_SALE_MERCHANT_UPDATE_URL = "https://api.weixin.qq.com/channels/ec/aftersale/merchantupdateaftersale";
}
/** 纠纷相关接口 */