mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-29 01:18:36 +08:00
🎨 #3337 【视频号小店】 订单详情字段补充、售后新特性补充
This commit is contained in:
@ -4,6 +4,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.AfterSaleListResponse;
|
||||
import me.chanjar.weixin.channel.bean.after.AfterSaleReasonResponse;
|
||||
import me.chanjar.weixin.channel.bean.after.AfterSaleRejectReasonResponse;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.complaint.ComplaintOrderResponse;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
@ -39,26 +41,31 @@ public interface WxChannelAfterSaleService {
|
||||
AfterSaleInfoResponse get(String afterSaleOrderId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 同意退款
|
||||
* 同意售后
|
||||
* 文档地址 https://developers.weixin.qq.com/doc/channels/API/aftersale/acceptapply.html
|
||||
*
|
||||
* @param afterSaleOrderId 售后单号
|
||||
* @param addressId 同意退货时传入地址id
|
||||
* @param acceptType 1. 同意退货退款,并通知用户退货; 2. 确认收到货并退款给用户。 如果不填则将根据当前的售后单状态自动选择相应操作。对于仅退款的情况,由于只存在一种同意的场景,无需填写此字段。
|
||||
* @return BaseResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse accept(String afterSaleOrderId, String addressId) throws WxErrorException;
|
||||
WxChannelBaseResponse accept(String afterSaleOrderId, String addressId, Integer acceptType) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 拒绝售后
|
||||
* 文档地址 https://developers.weixin.qq.com/doc/channels/API/aftersale/rejectapply.html
|
||||
*
|
||||
* @param afterSaleOrderId 售后单号
|
||||
* @param rejectReason 拒绝原因
|
||||
* @param rejectReasonType 拒绝原因枚举值
|
||||
* @see #getRejectReason()
|
||||
* @return BaseResponse
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason) throws WxErrorException;
|
||||
WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason, Integer rejectReasonType) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 上传退款凭证
|
||||
@ -108,4 +115,25 @@ public interface WxChannelAfterSaleService {
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
ComplaintOrderResponse getComplaint(String complaintId) throws WxErrorException;
|
||||
|
||||
|
||||
/**
|
||||
* 获取全量售后原因
|
||||
* 文档地址:https://developers.weixin.qq.com/doc/channels/API/aftersale/getaftersalereason.html
|
||||
*
|
||||
* @return 售后原因
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
AfterSaleReasonResponse getAllReason() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取拒绝售后原因
|
||||
* 文档地址:https://developers.weixin.qq.com/doc/channels/API/aftersale/getrejectreason.html
|
||||
*
|
||||
* @return 拒绝售后原因
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException;
|
||||
}
|
||||
|
||||
@ -1,30 +1,19 @@
|
||||
package me.chanjar.weixin.channel.api.impl;
|
||||
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_ACCEPT_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_GET_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_LIST_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_REJECT_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_UPLOAD_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Complaint.ADD_COMPLAINT_MATERIAL_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Complaint.ADD_COMPLAINT_PROOF_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Complaint.GET_COMPLAINT_ORDER_URL;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.api.WxChannelAfterSaleService;
|
||||
import me.chanjar.weixin.channel.bean.after.AfterSaleAcceptParam;
|
||||
import me.chanjar.weixin.channel.bean.after.AfterSaleIdParam;
|
||||
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.AfterSaleRejectParam;
|
||||
import me.chanjar.weixin.channel.bean.after.RefundEvidenceParam;
|
||||
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.channel.bean.complaint.ComplaintParam;
|
||||
import me.chanjar.weixin.channel.util.ResponseUtils;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.*;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Complaint.*;
|
||||
|
||||
/**
|
||||
* 视频号小店 售后服务实现
|
||||
*
|
||||
@ -56,15 +45,15 @@ public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse accept(String afterSaleOrderId, String addressId) throws WxErrorException {
|
||||
AfterSaleAcceptParam param = new AfterSaleAcceptParam(afterSaleOrderId, addressId);
|
||||
public WxChannelBaseResponse accept(String afterSaleOrderId, String addressId, Integer acceptType) throws WxErrorException {
|
||||
AfterSaleAcceptParam param = new AfterSaleAcceptParam(afterSaleOrderId, addressId, acceptType);
|
||||
String resJson = shopService.post(AFTER_SALE_ACCEPT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason) throws WxErrorException {
|
||||
AfterSaleRejectParam param = new AfterSaleRejectParam(afterSaleOrderId, rejectReason);
|
||||
public WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason, Integer rejectReasonType) throws WxErrorException {
|
||||
AfterSaleRejectParam param = new AfterSaleRejectParam(afterSaleOrderId, rejectReason, rejectReasonType);
|
||||
String resJson = shopService.post(AFTER_SALE_REJECT_URL, param);
|
||||
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
|
||||
}
|
||||
@ -100,4 +89,16 @@ public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService
|
||||
String resJson = shopService.post(GET_COMPLAINT_ORDER_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, ComplaintOrderResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AfterSaleReasonResponse getAllReason() throws WxErrorException {
|
||||
String resJson = shopService.post(AFTER_SALE_REASON_GET_URL, "{}");
|
||||
return ResponseUtils.decode(resJson, AfterSaleReasonResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException {
|
||||
String resJson = shopService.post(AFTER_SALE_REJECT_REASON_GET_URL, "{}");
|
||||
return ResponseUtils.decode(resJson, AfterSaleRejectReasonResponse.class);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,10 @@ public class AfterSaleAcceptParam extends AfterSaleIdParam {
|
||||
@JsonProperty("address_id")
|
||||
private String addressId;
|
||||
|
||||
/** 针对退货退款同意售后的阶段: 1. 同意退货退款,并通知用户退货; 2. 确认收到货并退款给用户。 如果不填则将根据当前的售后单状态自动选择相应操作。对于仅退款的情况,由于只存在一种同意的场景,无需填写此字段。*/
|
||||
@JsonProperty("accept_type")
|
||||
private Integer acceptType;
|
||||
|
||||
public AfterSaleAcceptParam() {
|
||||
}
|
||||
|
||||
@ -26,4 +30,10 @@ public class AfterSaleAcceptParam extends AfterSaleIdParam {
|
||||
super(afterSaleOrderId);
|
||||
this.addressId = addressId;
|
||||
}
|
||||
|
||||
public AfterSaleAcceptParam(String afterSaleOrderId, String addressId, Integer acceptType) {
|
||||
super(afterSaleOrderId);
|
||||
this.addressId = addressId;
|
||||
this.acceptType = acceptType;
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,4 +82,8 @@ public class AfterSaleInfo implements Serializable {
|
||||
/** 纠纷id,该字段可用于获取纠纷信息 */
|
||||
@JsonProperty("complaint_id")
|
||||
private String complaintId;
|
||||
|
||||
/** 仅在待商家审核退款退货申请或收货期间返回,表示操作剩余时间(秒数)*/
|
||||
@JsonProperty("deadline")
|
||||
private Long deadline;
|
||||
}
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package me.chanjar.weixin.channel.bean.after;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 全量售后原因
|
||||
*
|
||||
* @author lizhengwu
|
||||
* @date 2024/7/24
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class AfterSaleReason implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3674527884494606230L;
|
||||
|
||||
/**
|
||||
* 售后原因枚举
|
||||
*/
|
||||
@JsonProperty("reason")
|
||||
private Integer reason;
|
||||
|
||||
/**
|
||||
* 售后原因说明
|
||||
*/
|
||||
@JsonProperty("reason_text")
|
||||
private String reasonText;
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package me.chanjar.weixin.channel.bean.after;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 售后原因
|
||||
*
|
||||
*
|
||||
* @author lizhengwu
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class AfterSaleReasonResponse extends WxChannelBaseResponse {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -580378623915041396L;
|
||||
|
||||
@JsonProperty("reason_list")
|
||||
private List<AfterSaleReason> reasonList;
|
||||
|
||||
}
|
||||
@ -15,10 +15,18 @@ import lombok.Data;
|
||||
public class AfterSaleRejectParam extends AfterSaleIdParam {
|
||||
|
||||
private static final long serialVersionUID = -7507483859864253314L;
|
||||
/** 拒绝原因 */
|
||||
/**
|
||||
* 拒绝原因
|
||||
*/
|
||||
@JsonProperty("reject_reason")
|
||||
private String rejectReason;
|
||||
|
||||
/**
|
||||
* 拒绝原因枚举值
|
||||
*/
|
||||
@JsonProperty("reject_reason_type")
|
||||
private Integer rejectReasonType;
|
||||
|
||||
public AfterSaleRejectParam() {
|
||||
}
|
||||
|
||||
@ -26,4 +34,10 @@ public class AfterSaleRejectParam extends AfterSaleIdParam {
|
||||
super(afterSaleOrderId);
|
||||
this.rejectReason = rejectReason;
|
||||
}
|
||||
|
||||
public AfterSaleRejectParam(String afterSaleOrderId, String rejectReason, Integer rejectReasonType) {
|
||||
super(afterSaleOrderId);
|
||||
this.rejectReason = rejectReason;
|
||||
this.rejectReasonType = rejectReasonType;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
package me.chanjar.weixin.channel.bean.after;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 拒绝售后原因
|
||||
*
|
||||
* @author lizhengwu
|
||||
* @date 2024/7/24
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class AfterSaleRejectReason implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3672834150982780L;
|
||||
|
||||
/**
|
||||
* 售后拒绝原因枚举
|
||||
*/
|
||||
@JsonProperty("reject_reason_type")
|
||||
private Integer rejectReasonType;
|
||||
|
||||
/**
|
||||
* 售后拒绝原因说明
|
||||
*/
|
||||
@JsonProperty("reject_reason_type_text")
|
||||
private String rejectReasonTypeText;
|
||||
|
||||
/**
|
||||
* 售后拒绝原因默认描述
|
||||
*/
|
||||
@JsonProperty("reject_reason")
|
||||
private String rejectReason;
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package me.chanjar.weixin.channel.bean.after;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 售后原因
|
||||
*
|
||||
* @author lizhengwu
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class AfterSaleRejectReasonResponse extends WxChannelBaseResponse {
|
||||
|
||||
private static final long serialVersionUID = -7946679037747710613L;
|
||||
|
||||
/**
|
||||
* 售后原因列表
|
||||
*/
|
||||
@JsonProperty("reject_reason_list")
|
||||
private List<AfterSaleRejectReason> rejectReasonList;
|
||||
|
||||
}
|
||||
@ -18,4 +18,8 @@ public class RefundInfo implements Serializable {
|
||||
/** 退款金额(分) */
|
||||
@JsonProperty("amount")
|
||||
private Integer amount;
|
||||
|
||||
/** 标明售后单退款直接原因, 枚举值详情请参考 {@link me.chanjar.weixin.channel.enums.RefundReason} */
|
||||
@JsonProperty("refund_reason")
|
||||
private Integer refundReason;
|
||||
}
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单备注信息
|
||||
*
|
||||
@ -15,12 +16,39 @@ import lombok.NoArgsConstructor;
|
||||
public class OrderExtInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4568097877621455429L;
|
||||
/** 用户备注 */
|
||||
/**
|
||||
* 用户备注
|
||||
*/
|
||||
@JsonProperty("customer_notes")
|
||||
private String customerNotes;
|
||||
|
||||
/** 商家备注 */
|
||||
/**
|
||||
* 商家备注
|
||||
*/
|
||||
@JsonProperty("merchant_notes")
|
||||
private String merchantNotes;
|
||||
|
||||
/**
|
||||
* 确认收货时间,包括用户主动确认收货和超时自动确认收货
|
||||
*/
|
||||
@JsonProperty("confirm_receipt_time")
|
||||
private Long confirmReceiptTime;
|
||||
|
||||
/**
|
||||
* 视频号id
|
||||
*/
|
||||
@JsonProperty("finder_id")
|
||||
private String finderId;
|
||||
|
||||
/**
|
||||
* 直播id
|
||||
*/
|
||||
@JsonProperty("live_id")
|
||||
private String liveId;
|
||||
|
||||
/**
|
||||
* 下单场景,枚举值见 {@link me.chanjar.weixin.channel.enums.OrderScene}
|
||||
*/
|
||||
@JsonProperty("order_scene")
|
||||
private Integer orderScene;
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.channel.bean.base.AttrInfo;
|
||||
@ -17,96 +19,153 @@ import me.chanjar.weixin.channel.bean.base.AttrInfo;
|
||||
public class OrderProductInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2193536732955185928L;
|
||||
/** 商品spu id */
|
||||
/**
|
||||
* 商品spu id
|
||||
*/
|
||||
@JsonProperty("product_id")
|
||||
private String productId;
|
||||
|
||||
/** sku_id */
|
||||
/**
|
||||
* sku_id
|
||||
*/
|
||||
@JsonProperty("sku_id")
|
||||
private String skuId;
|
||||
|
||||
/** sku小图 */
|
||||
/**
|
||||
* sku小图
|
||||
*/
|
||||
@JsonProperty("thumb_img")
|
||||
private String thumbImg;
|
||||
|
||||
/** sku数量 */
|
||||
/**
|
||||
* sku数量
|
||||
*/
|
||||
@JsonProperty("sku_cnt")
|
||||
private Integer skuCnt;
|
||||
|
||||
/** 售卖价格(单位:分) */
|
||||
/**
|
||||
* 售卖价格(单位:分)
|
||||
*/
|
||||
@JsonProperty("sale_price")
|
||||
private Integer salePrice;
|
||||
|
||||
/** 商品标题 */
|
||||
/**
|
||||
* 商品标题
|
||||
*/
|
||||
@JsonProperty("title")
|
||||
private String title;
|
||||
|
||||
/** 正在售后/退款流程中的 sku 数量 */
|
||||
/**
|
||||
* 正在售后/退款流程中的 sku 数量
|
||||
*/
|
||||
@JsonProperty("on_aftersale_sku_cnt")
|
||||
private Integer onAfterSaleSkuCnt;
|
||||
|
||||
/** 完成售后/退款的 sku 数量 */
|
||||
/**
|
||||
* 完成售后/退款的 sku 数量
|
||||
*/
|
||||
@JsonProperty("finish_aftersale_sku_cnt")
|
||||
private Integer finishAfterSaleSkuCnt;
|
||||
|
||||
/** 商品编码 */
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
@JsonProperty("sku_code")
|
||||
private String skuCode;
|
||||
|
||||
/** 市场价格(单位:分) */
|
||||
/**
|
||||
* 市场价格(单位:分)
|
||||
*/
|
||||
@JsonProperty("market_price")
|
||||
private Integer marketPrice;
|
||||
|
||||
/** sku属性 */
|
||||
/**
|
||||
* sku属性
|
||||
*/
|
||||
@JsonProperty("sku_attrs")
|
||||
private List<AttrInfo> skuAttrs;
|
||||
|
||||
/** sku实付价格 */
|
||||
/**
|
||||
* sku实付价格
|
||||
*/
|
||||
@JsonProperty("real_price")
|
||||
private Integer realPrice;
|
||||
|
||||
/** 商品外部spu id */
|
||||
/**
|
||||
* 商品外部spu id
|
||||
*/
|
||||
@JsonProperty("out_product_id")
|
||||
private String outProductId;
|
||||
|
||||
/** 商品外部sku id */
|
||||
/**
|
||||
* 商品外部sku id
|
||||
*/
|
||||
@JsonProperty("out_sku_id")
|
||||
private String outSkuId;
|
||||
|
||||
/** 是否有优惠金额,非必填,默认为false */
|
||||
/**
|
||||
* 是否有优惠金额,非必填,默认为false
|
||||
*/
|
||||
@JsonProperty("is_discounted")
|
||||
private Boolean isDiscounted;
|
||||
|
||||
/** 优惠后 sku 价格,非必填,is_discounted为 true 时有值 */
|
||||
/**
|
||||
* 优惠后 sku 价格,非必填,is_discounted为 true 时有值
|
||||
*/
|
||||
@JsonProperty("estimate_price")
|
||||
private Integer estimatePrice;
|
||||
|
||||
/** 是否修改过价格,非必填,默认为false */
|
||||
/**
|
||||
* 是否修改过价格,非必填,默认为false
|
||||
*/
|
||||
@JsonProperty("is_change_price")
|
||||
private Boolean changePriced;
|
||||
|
||||
/** 改价后 sku 价格,非必填,is_change_price为 true 时有值 */
|
||||
/**
|
||||
* 改价后 sku 价格,非必填,is_change_price为 true 时有值
|
||||
*/
|
||||
@JsonProperty("change_price")
|
||||
private Integer changePrice;
|
||||
|
||||
/** 区域库存id */
|
||||
/**
|
||||
* 区域库存id
|
||||
*/
|
||||
@JsonProperty("out_warehouse_id")
|
||||
private String outWarehouseId;
|
||||
|
||||
/** 商品发货信息 */
|
||||
/**
|
||||
* 商品发货信息
|
||||
*/
|
||||
@JsonProperty("sku_deliver_info")
|
||||
private OrderSkuDeliverInfo skuDeliverInfo;
|
||||
|
||||
/** 商品额外服务信息 */
|
||||
/**
|
||||
* 商品额外服务信息
|
||||
*/
|
||||
@JsonProperty("extra_service")
|
||||
private OrderProductExtraService extraService;
|
||||
|
||||
/** 是否使用了会员积分抵扣 */
|
||||
/**
|
||||
* 是否使用了会员积分抵扣
|
||||
*/
|
||||
@JsonProperty("use_deduction")
|
||||
private Boolean useDeduction;
|
||||
|
||||
/** 会员积分抵扣金额,单位为分 */
|
||||
/**
|
||||
* 会员积分抵扣金额,单位为分
|
||||
*/
|
||||
@JsonProperty("deduction_price")
|
||||
private Integer deductionPrice;
|
||||
|
||||
/**
|
||||
* 商品优惠券信息,具体结构请参考OrderProductCouponInfo结构体,逐步替换 order.order_detail.coupon_info
|
||||
*/
|
||||
@JsonProperty("order_product_coupon_info_list")
|
||||
private List<OrderCouponInfo> orderProductCouponInfoList;
|
||||
|
||||
/**
|
||||
* 商品发货时效,超时此时间未发货即为发货超时
|
||||
*/
|
||||
@JsonProperty("delivery_deadline")
|
||||
private Long deliveryDeadline;
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ -15,12 +17,33 @@ import lombok.NoArgsConstructor;
|
||||
public class OrderSettleInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2140632631448343656L;
|
||||
/** 预计技术服务费(单位为分) */
|
||||
/**
|
||||
* 预计技术服务费(单位为分)
|
||||
*/
|
||||
@JsonProperty("predict_commission_fee")
|
||||
private Integer predictCommissionFee;
|
||||
|
||||
/** 实际技术服务费(单位为分)(未结算时本字段为空) */
|
||||
/**
|
||||
* 实际技术服务费(单位为分)(未结算时本字段为空)
|
||||
*/
|
||||
@JsonProperty("commission_fee")
|
||||
private Integer commissionFee;
|
||||
|
||||
/**
|
||||
* 预计人气卡返佣金额,单位为分(未发起结算时本字段为空)
|
||||
*/
|
||||
@JsonProperty("predict_wecoin_commission")
|
||||
private Integer predictWecoinCommission;
|
||||
|
||||
/**
|
||||
* 实际人气卡返佣金额,单位为分(未结算时本字段为空)
|
||||
*/
|
||||
@JsonProperty("wecoin_commission")
|
||||
private Integer wecoinCommission;
|
||||
|
||||
/**
|
||||
* 商家结算时间
|
||||
*/
|
||||
@JsonProperty("settle_time")
|
||||
private Long settleTime;
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ -15,19 +17,33 @@ import lombok.NoArgsConstructor;
|
||||
public class OrderSharerInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7183259072254660971L;
|
||||
/** 分享员openid */
|
||||
/**
|
||||
* 分享员openid
|
||||
*/
|
||||
@JsonProperty("sharer_openid")
|
||||
private String sharerOpenid;
|
||||
|
||||
/** 分享员unionid */
|
||||
/**
|
||||
* 分享员unionid
|
||||
*/
|
||||
@JsonProperty("sharer_unionid")
|
||||
private String sharerUnionid;
|
||||
|
||||
/** 分享员类型,0:普通分享员,1:店铺分享员 */
|
||||
/**
|
||||
* 分享员类型,0:普通分享员,1:店铺分享员
|
||||
*/
|
||||
@JsonProperty("sharer_type")
|
||||
private Integer sharerType;
|
||||
|
||||
/** 分享场景 {@link me.chanjar.weixin.channel.enums.ShareScene} */
|
||||
/**
|
||||
* 分享场景 {@link me.chanjar.weixin.channel.enums.ShareScene}
|
||||
*/
|
||||
@JsonProperty("share_scene")
|
||||
private Integer shareScene;
|
||||
|
||||
/**
|
||||
* 分享员数据是否已经解析完成【1:解析完成 0:解析中】
|
||||
*/
|
||||
@JsonProperty("handling_progress")
|
||||
private Integer handlingProgress;
|
||||
}
|
||||
|
||||
@ -170,6 +170,10 @@ public class WxChannelApiUrlConstants {
|
||||
String AFTER_SALE_REJECT_URL = "https://api.weixin.qq.com/channels/ec/aftersale/rejectapply";
|
||||
/** 上传退款凭证 */
|
||||
String AFTER_SALE_UPLOAD_URL = "https://api.weixin.qq.com/channels/ec/aftersale/uploadrefundcertificate";
|
||||
/** 获取全量售后原因*/
|
||||
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";
|
||||
}
|
||||
|
||||
/** 纠纷相关接口 */
|
||||
|
||||
@ -39,6 +39,10 @@ public enum AfterSaleStatus {
|
||||
MERCHANT_REFUND_RETRY_FAIL("MERCHANT_REFUND_RETRY_FAIL", "商家打款失败,客服关闭售后"),
|
||||
/** 售后关闭 */
|
||||
MERCHANT_FAIL("MERCHANT_FAIL", "售后关闭"),
|
||||
/** 待用户处理商家协商 */
|
||||
USER_WAIT_CONFIRM_UPDATE("USER_WAIT_CONFIRM_UPDATE", "待用户处理商家协商"),
|
||||
/** 待用户处理商家代发起的售后申请 */
|
||||
USER_WAIT_HANDLE_MERCHANT_AFTER_SALE("USER_WAIT_HANDLE_MERCHANT_AFTER_SALE", "待用户处理商家代发起的售后申请"),
|
||||
;
|
||||
|
||||
private final String key;
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
package me.chanjar.weixin.channel.enums;
|
||||
|
||||
/**
|
||||
* 下单场景
|
||||
*
|
||||
* @author lizhengwu
|
||||
* @description
|
||||
*/
|
||||
public enum OrderScene {
|
||||
/**
|
||||
* 其他
|
||||
*/
|
||||
OTHER(1, "其他"),
|
||||
/**
|
||||
* 直播间下单
|
||||
*/
|
||||
LIVE(2, "直播间"),
|
||||
/**
|
||||
* 短视频
|
||||
*/
|
||||
VIDEO(3, "短视频"),
|
||||
/**
|
||||
* 商品分享
|
||||
*/
|
||||
SHARE(4, "商品分享"),
|
||||
/**
|
||||
* 商品橱窗主页
|
||||
*/
|
||||
SHOW_CASE(5, "商品橱窗主页"),
|
||||
/**
|
||||
* 公众号文章商品卡片
|
||||
*/
|
||||
ARTICLE_CARD(6, "公众号文章商品卡片"),
|
||||
;
|
||||
|
||||
private final int key;
|
||||
private final String value;
|
||||
|
||||
OrderScene(int key, String value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package me.chanjar.weixin.channel.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 售后单退款直接原因
|
||||
*
|
||||
* @author lizhengwu
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum RefundReason {
|
||||
/** 1 商家通过店铺管理页或者小助手发起退款 */
|
||||
MERCHANT_INITIATED_REFUND(1, "商家通过店铺管理页或者小助手发起退款"),
|
||||
/** 2 退货退款场景,商家同意买家未上传物流单号情况下确认收货并退款,该场景限于订单无运费险 */
|
||||
MERCHANT_AGREES_NO_TRACKING_REFUND(2, "退货退款场景,商家同意买家未上传物流单号情况下确认收货并退款,该场景限于订单无运费险"),
|
||||
/** 3 商家通过后台api发起退款 */
|
||||
MERCHANT_API_INITIATED_REFUND(3, "商家通过后台api发起退款"),
|
||||
/** 4 未发货售后平台自动同意 */
|
||||
PRE_SHIPMENT_AUTOMATIC_REFUND(4, "未发货售后平台自动同意"),
|
||||
/** 5 平台介入纠纷退款 */
|
||||
PLATFORM_INTERVENED_DISPUTE_REFUND(5, "平台介入纠纷退款"),
|
||||
/** 6 特殊场景下平台强制退款 */
|
||||
PLATFORM_FORCED_REFUND(6, "特殊场景下平台强制退款"),
|
||||
/** 7 退货退款场景,买家同意没有上传物流单号情况下,商家确认收货并退款,该场景限于订单包含运费险,并无法理赔 */
|
||||
BUYER_AGREES_NO_TRACKING_REFUND(7, "退货退款场景,买家同意没有上传物流单号情况下,商家确认收货并退款,该场景限于订单包含运费险,并无法理赔"),
|
||||
/** 8 商家发货超时,平台退款 */
|
||||
LATE_SHIPMENT_PLATFORM_REFUND(8, "商家发货超时,平台退款"),
|
||||
/** 9 商家处理买家售后申请超时,平台自动同意退款 */
|
||||
MERCHANT_OVERDUE_AUTO_REFUND(9, "商家处理买家售后申请超时,平台自动同意退款"),
|
||||
/** 10 用户确认收货超时,平台退款 */
|
||||
BUYER_OVERDUE_AUTO_REFUND(10, "用户确认收货超时,平台退款"),
|
||||
/** 11 商家确认收货超时,平台退款 */
|
||||
MERCHANT_OVERDUE_CONFIRMATION_REFUND(11, "商家确认收货超时,平台退款"),
|
||||
;
|
||||
|
||||
private final int key;
|
||||
private final String value;
|
||||
|
||||
RefundReason(int key, String value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,8 @@ import me.chanjar.weixin.channel.api.WxChannelAfterSaleService;
|
||||
import me.chanjar.weixin.channel.api.WxChannelService;
|
||||
import me.chanjar.weixin.channel.bean.after.AfterSaleInfoResponse;
|
||||
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.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.complaint.ComplaintOrderResponse;
|
||||
import me.chanjar.weixin.channel.test.ApiTestModule;
|
||||
@ -52,8 +54,8 @@ public class WxChannelAfterSaleServiceImplTest {
|
||||
public void testAccept() throws WxErrorException {
|
||||
WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService();
|
||||
String afterSaleOrderId = "";
|
||||
String addressId = "123";
|
||||
WxChannelBaseResponse response = afterSaleService.accept(afterSaleOrderId, addressId);
|
||||
String addressId = null;
|
||||
WxChannelBaseResponse response = afterSaleService.accept(afterSaleOrderId, addressId, 2);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
}
|
||||
@ -62,8 +64,8 @@ public class WxChannelAfterSaleServiceImplTest {
|
||||
public void testReject() throws WxErrorException {
|
||||
WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService();
|
||||
String afterSaleOrderId = "";
|
||||
String rejectReason = "123";
|
||||
WxChannelBaseResponse response = afterSaleService.reject(afterSaleOrderId, rejectReason);
|
||||
String rejectReason = null;
|
||||
WxChannelBaseResponse response = afterSaleService.reject(afterSaleOrderId, rejectReason,1);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
}
|
||||
@ -109,4 +111,21 @@ public class WxChannelAfterSaleServiceImplTest {
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testGetAllReason() throws WxErrorException {
|
||||
WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService();
|
||||
AfterSaleReasonResponse allReason = afterSaleService.getAllReason();
|
||||
assertNotNull(allReason);
|
||||
assertTrue(allReason.isSuccess());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRejectReason() throws WxErrorException {
|
||||
WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService();
|
||||
AfterSaleRejectReasonResponse rejectReason = afterSaleService.getRejectReason();
|
||||
assertNotNull(rejectReason);
|
||||
assertTrue(rejectReason.isSuccess());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user