mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-11-24 08:33:19 +08:00
🎨 #3594【视频号】微信小店更新售后、订单详情等返回参数,并修改获取售后单列表和获取快递公司列表等接口的参数
Some checks failed
Publish to Maven Central / build-and-publish (push) Has been cancelled
Some checks failed
Publish to Maven Central / build-and-publish (push) Has been cancelled
This commit is contained in:
@@ -3,6 +3,7 @@ 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;
|
||||
@@ -26,10 +27,22 @@ public interface WxChannelAfterSaleService {
|
||||
* @return 售后单列表
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
* @deprecated 使用 {@link WxChannelAfterSaleService#listIds(AfterSaleListParam)}
|
||||
*/
|
||||
@Deprecated
|
||||
AfterSaleListResponse listIds(Long beginCreateTime, Long endCreateTime, String nextKey)
|
||||
throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取售后单列表
|
||||
*
|
||||
* @param param 参数
|
||||
* @return 售后单列表
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
AfterSaleListResponse listIds(AfterSaleListParam param) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取售后单详情
|
||||
*
|
||||
|
||||
@@ -139,7 +139,7 @@ public interface WxChannelOrderService {
|
||||
WxChannelBaseResponse closeOrder(String orderId);
|
||||
|
||||
/**
|
||||
* 获取快递公司列表
|
||||
* 获取快递公司列表-旧
|
||||
*
|
||||
* @return 快递公司列表
|
||||
*
|
||||
@@ -147,6 +147,16 @@ public interface WxChannelOrderService {
|
||||
*/
|
||||
DeliveryCompanyResponse listDeliveryCompany() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取快递公司列表
|
||||
*
|
||||
* @param ewaybillOnly 是否仅返回支持电子面单功能的快递公司
|
||||
* @return 快递公司列表
|
||||
*
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
DeliveryCompanyResponse listDeliveryCompany(Boolean ewaybillOnly) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 订单发货
|
||||
*
|
||||
|
||||
@@ -32,7 +32,13 @@ public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService
|
||||
@Override
|
||||
public AfterSaleListResponse listIds(Long beginCreateTime, Long endCreateTime, String nextKey)
|
||||
throws WxErrorException {
|
||||
AfterSaleListParam param = new AfterSaleListParam(beginCreateTime, endCreateTime, nextKey);
|
||||
AfterSaleListParam param = new AfterSaleListParam(beginCreateTime, endCreateTime, null, null, nextKey);
|
||||
String resJson = shopService.post(AFTER_SALE_LIST_URL, param);
|
||||
return ResponseUtils.decode(resJson, AfterSaleListResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AfterSaleListResponse listIds(AfterSaleListParam param) throws WxErrorException {
|
||||
String resJson = shopService.post(AFTER_SALE_LIST_URL, param);
|
||||
return ResponseUtils.decode(resJson, AfterSaleListResponse.class);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,44 @@
|
||||
package me.chanjar.weixin.channel.api.impl;
|
||||
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.DELIVERY_SEND_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.GET_DELIVERY_COMPANY_NEW_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.GET_DELIVERY_COMPANY_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.*;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ACCEPT_ADDRESS_MODIFY_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.DECODE_SENSITIVE_INFO_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_GET_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_LIST_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_SEARCH_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REJECT_ADDRESS_MODIFY_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_ADDRESS_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_EXPRESS_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_PRICE_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_REMARK_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPLOAD_FRESH_INSPECT_URL;
|
||||
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_TEL_NUMBER_URL;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.channel.api.WxChannelOrderService;
|
||||
import me.chanjar.weixin.channel.bean.base.AddressInfo;
|
||||
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
|
||||
import me.chanjar.weixin.channel.bean.delivery.PackageAuditInfo;
|
||||
import me.chanjar.weixin.channel.bean.delivery.DeliveryCompanyResponse;
|
||||
import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo;
|
||||
import me.chanjar.weixin.channel.bean.delivery.DeliverySendParam;
|
||||
import me.chanjar.weixin.channel.bean.delivery.FreshInspectParam;
|
||||
import me.chanjar.weixin.channel.bean.order.*;
|
||||
import me.chanjar.weixin.channel.bean.delivery.PackageAuditInfo;
|
||||
import me.chanjar.weixin.channel.bean.order.ChangeOrderInfo;
|
||||
import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderAddressParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderIdParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderInfoParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderInfoResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderListParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderListResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderPriceParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderRemarkParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
|
||||
import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
|
||||
import me.chanjar.weixin.channel.util.ResponseUtils;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
@@ -115,6 +139,16 @@ public class WxChannelOrderServiceImpl implements WxChannelOrderService {
|
||||
return ResponseUtils.decode(resJson, DeliveryCompanyResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeliveryCompanyResponse listDeliveryCompany(Boolean ewaybillOnly) throws WxErrorException {
|
||||
String reqJson = "{}";
|
||||
if (ewaybillOnly != null) {
|
||||
reqJson = "{\"ewaybill_only\":" + ewaybillOnly + "}";
|
||||
}
|
||||
String resJson = shopService.post(GET_DELIVERY_COMPANY_NEW_URL, reqJson);
|
||||
return ResponseUtils.decode(resJson, DeliveryCompanyResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxChannelBaseResponse deliveryOrder(String orderId, List<DeliveryInfo> deliveryList)
|
||||
throws WxErrorException {
|
||||
|
||||
@@ -28,6 +28,14 @@ public class AfterSaleListParam implements Serializable {
|
||||
@JsonProperty("end_create_time")
|
||||
private Long endCreateTime;
|
||||
|
||||
/** 售后单更新起始时间 */
|
||||
@JsonProperty("begin_update_time")
|
||||
private Long beginUpdateTime;
|
||||
|
||||
/** 售后单更新结束时间,end_update_time减去begin_update_time不得大于24小时 */
|
||||
@JsonProperty("end_update_time")
|
||||
private Long endUpdateTime;
|
||||
|
||||
/** 翻页参数,从第二页开始传,来源于上一页的返回值 */
|
||||
@JsonProperty("next_key")
|
||||
private String nextKey;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 商品定制信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class OrderCustomInfo implements Serializable {
|
||||
private static final long serialVersionUID = 6681266835402157651L;
|
||||
|
||||
/** 定制图片,custom_type=2时返回 */
|
||||
@JsonProperty("custom_img_url")
|
||||
private String customImgUrl;
|
||||
|
||||
/** 定制文字,custom_type=1时返回 */
|
||||
@JsonProperty("custom_word")
|
||||
private String customWord;
|
||||
|
||||
/** 定制类型,枚举值请参考CustomType枚举 */
|
||||
@JsonProperty("custom_type")
|
||||
private Integer customType;
|
||||
|
||||
/** 定制预览图片,开启了定制预览时返回 */
|
||||
@JsonProperty("custom_preview_img_url")
|
||||
private String customPreviewImgUrl;
|
||||
}
|
||||
@@ -61,7 +61,18 @@ public class OrderDetailInfo implements Serializable {
|
||||
private OrderAgentInfo agentInfo;
|
||||
|
||||
/** 订单来源信息 */
|
||||
@JsonProperty("source_info")
|
||||
private OrderSourceInfo sourceInfo;
|
||||
@JsonProperty("source_infos")
|
||||
private List<OrderSourceInfo> sourceInfos;
|
||||
|
||||
/** 订单退款信息 */
|
||||
@JsonProperty("refund_info")
|
||||
private OrderSourceInfo refundInfo;
|
||||
|
||||
/** 订单代写商品信息 */
|
||||
@JsonProperty("greeting_card_info")
|
||||
private OrderGreetingCardInfo greetingCardInfo;
|
||||
|
||||
/** 商品定制信息 */
|
||||
@JsonProperty("custom_info")
|
||||
private OrderCustomInfo customInfo;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 订单商品贺卡信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class OrderGreetingCardInfo implements Serializable {
|
||||
private static final long serialVersionUID = -6391443179945240242L;
|
||||
|
||||
/** 贺卡落款,用户选填 */
|
||||
@JsonProperty("giver_name")
|
||||
private String giverName;
|
||||
|
||||
/** 贺卡称谓,用户选填 */
|
||||
@JsonProperty("receiver_name")
|
||||
private String receiverName;
|
||||
|
||||
/** 贺卡内容,用户必填 */
|
||||
@JsonProperty("greeting_message")
|
||||
private String greetingMessage;
|
||||
}
|
||||
@@ -39,6 +39,26 @@ public class OrderInfo implements Serializable {
|
||||
@JsonProperty("aftersale_detail")
|
||||
protected AfterSaleDetail afterSaleDetail;
|
||||
|
||||
/** 是否为礼物订单 */
|
||||
@JsonProperty("is_present")
|
||||
private Boolean present;
|
||||
|
||||
/** 礼物订单ID */
|
||||
@JsonProperty("present_order_id_str")
|
||||
private String presentOrderId;
|
||||
|
||||
/** 礼物订单留言 */
|
||||
@JsonProperty("present_note")
|
||||
private String presentNote;
|
||||
|
||||
/** 礼物订单赠送者openid */
|
||||
@JsonProperty("present_giver_openid")
|
||||
private String presentGiverOpenid;
|
||||
|
||||
/** 礼物订单赠送者unionid */
|
||||
@JsonProperty("present_giver_unionid")
|
||||
private String presentGiverUnionid;
|
||||
|
||||
/** 创建时间 秒级时间戳 */
|
||||
@JsonProperty("create_time")
|
||||
protected Integer createTime;
|
||||
@@ -46,5 +66,4 @@ public class OrderInfo implements Serializable {
|
||||
/** 更新时间 秒级时间戳 */
|
||||
@JsonProperty("update_time")
|
||||
protected Integer updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package me.chanjar.weixin.channel.bean.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 订单退款信息
|
||||
*
|
||||
* @author <a href="https://github.com/lixize">Zeyes</a>
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class OrderRefundInfo implements Serializable {
|
||||
private static final long serialVersionUID = -7257910073388645919L;
|
||||
|
||||
/** 退还运费金额,礼物订单(is_present=true)可能存在 */
|
||||
@JsonProperty("refund_freight")
|
||||
private Integer refundFreight;
|
||||
}
|
||||
@@ -25,6 +25,6 @@ public class OrderSearchParam extends StreamPageParam {
|
||||
private Integer onAfterSaleOrderExist;
|
||||
|
||||
/** 订单状态 {@link me.chanjar.weixin.channel.enums.WxOrderStatus} */
|
||||
@JsonProperty("on_aftersale_order_exist")
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
@@ -23,26 +23,44 @@ public class OrderSourceInfo implements Serializable {
|
||||
private String skuId;
|
||||
|
||||
/**
|
||||
* 带货账户类型,1:视频号,2:公众号,3:小程序
|
||||
* 带货账号类型,1:视频号,2:公众号,3:小程序,4:企业微信,5:带货达人,6:服务号,1000:带货机构
|
||||
*/
|
||||
@JsonProperty("account_type")
|
||||
private Integer accountType;
|
||||
|
||||
/**
|
||||
* 带货账户id,如果带货账户类型是视频号,此id为视频号id; 如果带货类型为 公众号/小程序, 此id 为对应 公众号/小程序 的appid
|
||||
* 带货账号id,取决于带货账号类型(分别为视频号id、公众号appid、小程序appid、企业微信id、带货达人appid、服务号appid、带货机构id)
|
||||
*/
|
||||
@JsonProperty("account_id")
|
||||
private String accountId;
|
||||
|
||||
/**
|
||||
* 销售渠道, 0:关联账号,1:合作账号,100:联盟达人带货
|
||||
* 账号关联类型,0:关联账号,1:合作账号,2:授权号,100:达人带货,101:带货机构推广
|
||||
*/
|
||||
@JsonProperty("sale_channel")
|
||||
private Integer saleChannel;
|
||||
|
||||
/**
|
||||
* 带货账户昵称
|
||||
* 带货账号昵称
|
||||
*/
|
||||
@JsonProperty("account_nickname")
|
||||
private String accountNickname;
|
||||
|
||||
/**
|
||||
* 带货内容类型,1:企微成员转发
|
||||
*/
|
||||
@JsonProperty("content_type")
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* 带货内容id,取决于带货内容类型(企微成员user_id)
|
||||
*/
|
||||
@JsonProperty("content_id")
|
||||
private String contentId;
|
||||
|
||||
/**
|
||||
* 自营推客推广的带货机构id
|
||||
*/
|
||||
@JsonProperty("promoter_head_supplier_id")
|
||||
private String promoterHeadSupplierId;
|
||||
}
|
||||
|
||||
@@ -247,8 +247,9 @@ public class WxChannelApiUrlConstants {
|
||||
|
||||
/** 物流相关接口 */
|
||||
public interface Delivery {
|
||||
|
||||
/** 获取快递公司列表 */
|
||||
String GET_DELIVERY_COMPANY_NEW_URL = "https://api.weixin.qq.com/channels/ec/order/deliverycompanylist/new/get";
|
||||
/** 获取快递公司列表(旧) */
|
||||
String GET_DELIVERY_COMPANY_URL = "https://api.weixin.qq.com/channels/ec/order/deliverycompanylist/get";
|
||||
/** 订单发货 */
|
||||
String DELIVERY_SEND_URL = "https://api.weixin.qq.com/channels/ec/order/delivery/send";
|
||||
|
||||
@@ -20,6 +20,7 @@ import me.chanjar.weixin.channel.bean.order.OrderAddressInfo;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderInfoResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderListParam;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderListResponse;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderSearchCondition;
|
||||
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
|
||||
import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
|
||||
import me.chanjar.weixin.channel.test.ApiTestModule;
|
||||
@@ -68,6 +69,10 @@ public class WxChannelOrderServiceImplTest {
|
||||
public void testSearchOrder() throws WxErrorException {
|
||||
WxChannelOrderService orderService = channelService.getOrderService();
|
||||
OrderSearchParam param = new OrderSearchParam();
|
||||
param.setPageSize(100);
|
||||
OrderSearchCondition searchCondition = new OrderSearchCondition();
|
||||
searchCondition.setTitle("");
|
||||
param.setSearchCondition(searchCondition);
|
||||
OrderListResponse response = orderService.searchOrder(param);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
@@ -145,7 +150,7 @@ public class WxChannelOrderServiceImplTest {
|
||||
@Test
|
||||
public void testListDeliveryCompany() throws WxErrorException {
|
||||
WxChannelOrderService orderService = channelService.getOrderService();
|
||||
DeliveryCompanyResponse response = orderService.listDeliveryCompany();
|
||||
DeliveryCompanyResponse response = orderService.listDeliveryCompany(false);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.isSuccess());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user