Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
332e892
微信客服 接待人员管理,会话分配与消息收发,基础信息获取等
Jan 26, 2022
8a4c58d
素材上传
Jan 26, 2022
7a4efe3
序列化注解
Feb 10, 2022
163da81
Merge branch 'develop' of github.com:Wechat-Group/WxJava into develop
Apr 1, 2022
c86852b
增加微信小程序 物流服务中的查询组件接口
Apr 1, 2022
ead9972
修改类型错误
Apr 2, 2022
0c31b53
修改字段
Apr 2, 2022
318b76b
增加微信小程序 物流服务中的查询组件接口
Apr 1, 2022
a91a0d4
修改类型错误
Apr 2, 2022
bf098f5
修改字段
Apr 2, 2022
575f3fb
Merge remote-tracking branch 'origin/develop' into develop
Apr 2, 2022
aa33ad9
物流查询服务
Apr 3, 2022
6c48307
序列化注解
Apr 5, 2022
9e21001
交易组件补充字段
Apr 5, 2022
36071f8
客服升级服务接口
Apr 26, 2022
db26bf6
内部类修改
Apr 26, 2022
1249dff
视频号分享人接口
Jun 18, 2022
029661e
视频号分享人接口
Jun 18, 2022
272c8c5
Merge branch 'develop' of github.com:Wechat-Group/WxJava into develop
Jun 19, 2022
35c3004
fix
Jun 20, 2022
e0b0680
标准交易组件
Jun 20, 2022
debcb4c
分享员订单结构修复
Jun 21, 2022
dbdba96
补充字段
Jun 24, 2022
547f889
售后单接口补全
Jun 28, 2022
52f64b1
自定义交易组件下单字段补全
Jun 29, 2022
b15379a
字段错误修复
Jun 29, 2022
bd32832
自定义交易组件优惠券接口
Jul 1, 2022
268972e
交易组件接口补充
Jul 8, 2022
362f1ea
添加 小程序交易组件-标准版--订单相关服务
Jul 8, 2022
4e75379
交易组件上传图片
Jul 8, 2022
33e224c
修复字段类型
Jul 9, 2022
09cad8b
common
Jul 11, 2022
aa18a48
修复npe
Jul 11, 2022
f69a253
售后接口
Jul 11, 2022
f5a1d44
交易组件订单服务
Jul 12, 2022
b023ae9
交易组件订单服务
Jul 12, 2022
2b20113
交易组件订单服务
Jul 12, 2022
3baaa41
获取sku列表
Jul 13, 2022
bb5dedf
sku字段补全
Jul 13, 2022
37a4ba9
sku返回值修复
Jul 13, 2022
ebdf03f
sku返回值修复
Jul 13, 2022
24daf64
售后单列表
Jul 14, 2022
b97b726
请求发货
Jul 14, 2022
2117030
Merge branch 'develop' of github.com:Wechat-Group/WxJava into develop
Jul 26, 2022
edde6b8
fix 属性
Jul 26, 2022
494c5fb
修改 接口注释
Jul 26, 2022
fd0077e
修改 接口注释
Jul 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
售后单接口补全
Signed-off-by: wanglei <lei.wang@xianbb.cn>
  • Loading branch information
wanglei committed Jun 28, 2022
commit 547f889101777b1436bf3aedee4d4b7576f3be75
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package cn.binarywang.wx.miniapp.api;

import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAcceptReturnRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleAddRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleGetRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleListRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleUpdateRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleUploadReturnInfoRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopUploadCerficatesRequest;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAfterSaleAddResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAfterSaleGetResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAfterSaleListResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopBaseResponse;
import me.chanjar.weixin.common.error.WxErrorException;

Expand All @@ -21,7 +27,7 @@ public interface WxMaShopAfterSaleService {
* @return WxMaShopBaseResponse
* @throws WxErrorException
*/
WxMaShopBaseResponse add(WxMaShopAfterSaleAddRequest request) throws WxErrorException;
WxMaShopAfterSaleAddResponse add(WxMaShopAfterSaleAddRequest request) throws WxErrorException;

/**
* 获取订单下售后单
Expand All @@ -41,4 +47,81 @@ public interface WxMaShopAfterSaleService {
*/
WxMaShopBaseResponse update(WxMaShopAfterSaleUpdateRequest request) throws WxErrorException;

/**
* 用户取消售后申请
* @param outAfterSaleId 商家自定义订单ID
* @param afterSaleId 与out_aftersale_id二选一
* @param openId 用户openid
* @return
* @throws WxErrorException
*/
WxMaShopBaseResponse cancel(String outAfterSaleId, Long afterSaleId, String openId)
throws WxErrorException;

/**
* 用户上传退货物流
* @param request
* @return
* @throws WxErrorException
*/
WxMaShopBaseResponse uploadReturnInfo(WxMaShopAfterSaleUploadReturnInfoRequest request)
throws WxErrorException;

/**
* 商家同意退款
* @param outAfterSaleId
* @param afterSaleId
* @return
* @throws WxErrorException
*/
WxMaShopBaseResponse acceptRefund(String outAfterSaleId, Long afterSaleId)
throws WxErrorException;

/**
* 商家同意退货
* @param request
* @return
* @throws WxErrorException
*/
WxMaShopBaseResponse acceptReturn(WxMaShopAcceptReturnRequest request)
throws WxErrorException;

/**
* 商家拒绝售后
* @param outAfterSaleId
* @param afterSaleId
* @return
* @throws WxErrorException
*/
WxMaShopBaseResponse reject(String outAfterSaleId, Long afterSaleId)
throws WxErrorException;

/**
* 商家上传退款凭证
* @param request
* @return
* @throws WxErrorException
*/
WxMaShopBaseResponse uploadCertificates(WxMaShopUploadCerficatesRequest request)
throws WxErrorException;

/**
* 商家更新订单售后期
* @param outOrderId
* @param orderId
* @param openid
* @param afterSaleDeadline
* @return
* @throws WxErrorException
*/
WxMaShopBaseResponse updateDeadline(String outOrderId, Long orderId, String openid,
Long afterSaleDeadline) throws WxErrorException;

/**
* 获取售后单详情
* @param request
* @return
* @throws WxErrorException
*/
WxMaShopAfterSaleListResponse list(WxMaShopAfterSaleListRequest request) throws WxErrorException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.WxMaShopAfterSaleService;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAcceptReturnRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleAddRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleGetRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleListRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleUpdateRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopAfterSaleUploadReturnInfoRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopUploadCerficatesRequest;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAfterSaleAddResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAfterSaleGetResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopAfterSaleListResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopBaseResponse;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.JsonObject;
Expand All @@ -14,6 +20,7 @@
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.json.GsonHelper;
import me.chanjar.weixin.common.util.json.GsonParser;

import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Aftersale.*;
Expand All @@ -37,13 +44,13 @@ public class WxMaShopAfterSaleServiceImpl implements WxMaShopAfterSaleService {
* @throws WxErrorException
*/
@Override
public WxMaShopBaseResponse add(WxMaShopAfterSaleAddRequest request) throws WxErrorException {
public WxMaShopAfterSaleAddResponse add(WxMaShopAfterSaleAddRequest request) throws WxErrorException {
String responseContent = this.wxMaService.post(AFTERSALE_ADD, request);
JsonObject jsonObject = GsonParser.parse(responseContent);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopBaseResponse.class);
return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopAfterSaleAddResponse.class);
}

/**
Expand Down Expand Up @@ -79,4 +86,154 @@ public WxMaShopBaseResponse update(WxMaShopAfterSaleUpdateRequest request) throw
}
return WxMaGsonBuilder.create().fromJson(responseContent, WxMaShopBaseResponse.class);
}

/**
* 用户取消售后申请
* @param outAfterSaleId 商家自定义订单ID
* @param afterSaleId 与out_aftersale_id二选一
* @param openId 用户openid
* @return
* @throws WxErrorException
*/
@Override
public WxMaShopBaseResponse cancel(String outAfterSaleId, Long afterSaleId, String openId)
throws WxErrorException {
JsonObject request = GsonHelper.buildJsonObject("out_aftersale_id", outAfterSaleId,
"aftersale_id", afterSaleId, "openid", openId);
String resp = this.wxMaService.post(AFTERSALE_CANCEL, request);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(resp, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(resp, WxMaShopBaseResponse.class);
}

/**
* 用户上传退货物流
* @param request
* @return
* @throws WxErrorException
*/
@Override
public WxMaShopBaseResponse uploadReturnInfo(WxMaShopAfterSaleUploadReturnInfoRequest request)
throws WxErrorException {
String resp = this.wxMaService.post(AFTERSALE_UPLOAD_RETURN_INFO, request);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(resp, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(resp, WxMaShopBaseResponse.class);
}

/**
* 商家同意退款
* @param outAfterSaleId
* @param afterSaleId
* @return
* @throws WxErrorException
*/
@Override
public WxMaShopBaseResponse acceptRefund(String outAfterSaleId, Long afterSaleId)
throws WxErrorException {
JsonObject request = GsonHelper.buildJsonObject("out_aftersale_id", outAfterSaleId,
"aftersale_id", afterSaleId);
String resp = this.wxMaService.post(AFTERSALE_ACCEPT_REFUND, request);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(resp, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(resp, WxMaShopBaseResponse.class);
}

/**
* 商家同意退货
* @param request
* @return
* @throws WxErrorException
*/
@Override
public WxMaShopBaseResponse acceptReturn(WxMaShopAcceptReturnRequest request)
throws WxErrorException {
String resp = this.wxMaService.post(AFTERSALE_ACCEPT_RETURN, request);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(resp, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(resp, WxMaShopBaseResponse.class);
}

/**
* 商家拒绝售后
* @param outAfterSaleId
* @param afterSaleId
* @return
* @throws WxErrorException
*/
@Override
public WxMaShopBaseResponse reject(String outAfterSaleId, Long afterSaleId)
throws WxErrorException {
JsonObject request = GsonHelper.buildJsonObject("out_aftersale_id", outAfterSaleId,
"aftersale_id", afterSaleId);
String resp = this.wxMaService.post(AFTERSALE_REJECT, request);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(resp, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(resp, WxMaShopBaseResponse.class);
}

/**
* 商家上传退款凭证
* @param request
* @return
* @throws WxErrorException
*/
@Override
public WxMaShopBaseResponse uploadCertificates(WxMaShopUploadCerficatesRequest request)
throws WxErrorException {
String resp = this.wxMaService.post(AFTERSALE_UPLOAD_CERTIFICATES, request);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(resp, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(resp, WxMaShopBaseResponse.class);
}

/**
* 商家更新订单售后期
* @param outOrderId
* @param orderId
* @param openid
* @param afterSaleDeadline
* @return
* @throws WxErrorException
*/
@Override
public WxMaShopBaseResponse updateDeadline(String outOrderId, Long orderId, String openid,
Long afterSaleDeadline) throws WxErrorException {
JsonObject request = GsonHelper.buildJsonObject("out_order_id", outOrderId,
"order_id", orderId, "openid", openid, "after_sale_deadline", afterSaleDeadline);
String resp = this.wxMaService.post(AFTERSALE_UPLOAD_DEADLINE, request);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(resp, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(resp, WxMaShopBaseResponse.class);
}

/**
* 获取售后单详情
* @param request
* @return
* @throws WxErrorException
*/
@Override
public WxMaShopAfterSaleListResponse list(WxMaShopAfterSaleListRequest request) throws WxErrorException {
String resp = this.wxMaService.post(AFTERSALE_GET_LIST, request);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get(ERRCODE).getAsInt() != 0) {
throw new WxErrorException(WxError.fromJson(resp, WxType.MiniApp));
}
return WxMaGsonBuilder.create().fromJson(resp, WxMaShopAfterSaleListResponse.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package cn.binarywang.wx.miniapp.bean.shop.request;

import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @author leiin
* @date 2022/6/28 11:39 上午
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WxMaShopAcceptReturnRequest implements Serializable {
@SerializedName("out_aftersale_id")
private String outAftersaleId;
@SerializedName("aftersale_id")
private Long aftersaleId;
@SerializedName("address_info")
private RefundAddressInfo addressInfo;

@Data
public static class RefundAddressInfo {
@SerializedName("receiver_name")
private String receiverName;
@SerializedName("detailed_address")
private String detailedAddress;
@SerializedName("tel_number")
private String telNumber;
@SerializedName("country")
private String country;
@SerializedName("province")
private String province;
@SerializedName("city")
private String city;
@SerializedName("town")
private String town;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class WxMaShopAfterSaleAddRequest implements Serializable {
* product_infos : [{"out_product_id":"234245","out_sku_id":"23424","product_cnt":5}]
*/

@SerializedName("order_id")
private Long orderId;
@SerializedName("out_order_id")
private String outOrderId;
@SerializedName("out_aftersale_id")
Expand All @@ -41,8 +43,14 @@ public class WxMaShopAfterSaleAddRequest implements Serializable {
private String openid;
@SerializedName("type")
private Integer type;
@SerializedName("create_time")
private String createTime;
@SerializedName("product_info")
private List<ProductInfosBean> productInfos;
@SerializedName("orderamt")
private Long orderamt;
@SerializedName("refund_reason")
private String refundReason;
@SerializedName("refund_reason_type")
private Integer refundReasonType;
@SerializedName("status")
private Integer status;
@SerializedName("finish_all_aftersale")
Expand All @@ -51,8 +59,8 @@ public class WxMaShopAfterSaleAddRequest implements Serializable {
private String path;
@SerializedName("refund")
private Long refund;
@SerializedName("product_infos")
private List<ProductInfosBean> productInfos;
@SerializedName("media_list")
private UploadMediaList mediaList;

@Data
@Builder
Expand All @@ -72,4 +80,12 @@ public static class ProductInfosBean implements Serializable {
@SerializedName("product_cnt")
private Integer productCnt;
}

@Data
public static class UploadMediaList {
private Integer type;
private String url;
@SerializedName("thumb_url")
private String thumbUrl;
}
}
Loading