Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

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;
Expand All @@ -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;

/**
* 获取售后单详情
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,24 @@ WxChannelBaseResponse updatePrice(String orderId, Integer expressFee, List<Chang
WxChannelBaseResponse closeOrder(String orderId);

/**
* 获取快递公司列表
* 获取快递公司列表-旧
*
* @return 快递公司列表
*
* @throws WxErrorException 异常
*/
DeliveryCompanyResponse listDeliveryCompany() throws WxErrorException;

/**
* 获取快递公司列表
*
* @param ewaybillOnly 是否仅返回支持电子面单功能的快递公司
* @return 快递公司列表
*
* @throws WxErrorException 异常
*/
DeliveryCompanyResponse listDeliveryCompany(Boolean ewaybillOnly) throws WxErrorException;

/**
* 订单发货
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl<?, ?> shopService)
@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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -115,6 +139,16 @@ public DeliveryCompanyResponse listDeliveryCompany() throws WxErrorException {
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,31 @@ 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;

/** 更新时间 秒级时间戳 */
@JsonProperty("update_time")
protected Integer updateTime;

}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ public interface Complaint {

/** 物流相关接口 */
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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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;
Expand Down Expand Up @@ -68,6 +69,10 @@ public void testGetOrders() throws WxErrorException {
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());
Expand Down Expand Up @@ -145,7 +150,7 @@ public void testCloseOrder() {
@Test
public void testListDeliveryCompany() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
DeliveryCompanyResponse response = orderService.listDeliveryCompany();
DeliveryCompanyResponse response = orderService.listDeliveryCompany(false);
assertNotNull(response);
assertTrue(response.isSuccess());
}
Expand Down