Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加 微信小商店 标准版 接口 #2756

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.chanjar.weixin.common.bean.result;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import lombok.Data;
Expand All @@ -25,8 +26,12 @@ public static WxMinishopImageUploadResult fromJson(String json) {
if (result.getErrcode().equals("0")) {
WxMinishopPicFileResult picFileResult = new WxMinishopPicFileResult();
JsonObject picObject = jsonObject.get("pic_file").getAsJsonObject();
picFileResult.setMediaId(picObject.get("media_id").getAsString());
picFileResult.setPayMediaId(picObject.get("pay_media_id").getAsString());
JsonElement mediaId = picObject.get("media_id");
picFileResult.setMediaId(mediaId==null ? "" : mediaId.getAsString());
JsonElement payMediaId = picObject.get("pay_media_id");
picFileResult.setPayMediaId(payMediaId==null ? "" : payMediaId.getAsString());
JsonElement tempImgUrl = picObject.get("temp_img_url");
picFileResult.setTempImgUrl(tempImgUrl==null ? "" : tempImgUrl.getAsString());
result.setPicFile(picFileResult);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
public class WxMinishopPicFileResult implements Serializable {
private String mediaId;
private String payMediaId;
private String tempImgUrl;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package cn.binarywang.wx.miniapp.api;

import cn.binarywang.wx.miniapp.bean.product.WxMiniBatchGetAfterSaleOrderResponse;
import cn.binarywang.wx.miniapp.bean.product.WxMiniGetAfterSaleOrderResponse;
import cn.binarywang.wx.miniapp.bean.product.WxMiniOrderDeliveryRequest;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopOrderDetailResponse;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopOrderListResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopBaseResponse;
import java.util.List;
import me.chanjar.weixin.common.error.WxErrorException;

/**
* 小程序交易组件-标准版-商品服务
*
* @author boris
*/
public interface WxMaProductOrderService {


/**
* 获取订单列表
*
* @param startCreateTime 否(未填更新时间范围时必填)
* @param endCreateTime 否(未填更新时间范围时必填)
* @param startUpdateTime 否(未填创建时间范围时必填)
* @param endUpdateTime 否(未填创建时间范围时必填)
* @param status 订单状态,枚举值见RequestOrderStatus
* @param page 第几页(最小填1)
* @param pageSize 每页数量(不超过10,000)
* @param source 1:小商店,2:CPS带货
* @return
* @throws WxErrorException
*/
WxMinishopOrderListResponse getOrderList(
String startCreateTime,
String endCreateTime,
String startUpdateTime,
String endUpdateTime,
Integer status,
Integer page,
Integer pageSize,
Integer source
) throws WxErrorException;


/**
* 获取订单详情
*
* @param orderId 订单ID,可从获取订单列表中获得
* @return
*/
WxMinishopOrderDetailResponse getOrderDetail(Long orderId) throws WxErrorException;


/**
* 修改订单备注
* @param orderId 订单id
* @param merchantNotes 备注内容
*/
void changeMerchantNotes(Long orderId,String merchantNotes) throws WxErrorException;

WxMaShopBaseResponse deliverySend(WxMiniOrderDeliveryRequest request)
throws WxErrorException;

WxMiniGetAfterSaleOrderResponse getAfterSaleOrder(Long afterSaleOrderId)
throws WxErrorException;

WxMiniBatchGetAfterSaleOrderResponse batchGetAfterSaleOrder(List<Long> afterSaleOrderIdList)
throws WxErrorException;

WxMaShopBaseResponse afterSaleAccept(Long orderId, Long addressId)
throws WxErrorException;

WxMaShopBaseResponse afterSaleReject(Long afterSaleOrderId, String rejectReason)
throws WxErrorException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

import cn.binarywang.wx.miniapp.bean.product.WxMinishopAddGoodsSkuData;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopAddGoodsSpuData;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopGetBrandResponse;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopGetCategoryResponse;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopGetFrightTemplateResponse;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopOrderListResponse;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopResult;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopSku;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopSkuListResponse;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopSpu;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopSpuGet;
import cn.binarywang.wx.miniapp.bean.product.WxMinishopSpuGetResponse;
Expand All @@ -13,7 +17,9 @@
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopSpuPageRequest;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopBaseResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopGetSpuListResponse;
import java.io.File;
import java.util.List;
import me.chanjar.weixin.common.bean.result.WxMinishopImageUploadResult;
import me.chanjar.weixin.common.error.WxErrorException;

/**
Expand All @@ -22,7 +28,18 @@
* @author boris
*/
public interface WxMaProductService {
WxMinishopResult addSpu(WxMinishopSpu spuInfo) throws WxErrorException;

WxMinishopImageUploadResult uploadImg(File file, Integer respType, Integer width, Integer height) throws WxErrorException;

WxMinishopImageUploadResult uploadImg(String imgUrl, Integer respType) throws WxErrorException;

WxMinishopGetCategoryResponse getCategory(Integer fCatId) throws WxErrorException;

WxMinishopGetBrandResponse getBrand() throws WxErrorException;

WxMinishopGetFrightTemplateResponse getFreightTemplate() throws WxErrorException;

WxMinishopResult<WxMinishopAddGoodsSpuData> addSpu(WxMinishopSpu spuInfo) throws WxErrorException;

WxMaShopBaseResponse deleteSpu(Integer productId, String outProductId) throws WxErrorException;

Expand All @@ -40,6 +57,9 @@ WxMaShopBaseResponse listingSpu(Integer productId, String outProductId)
WxMaShopBaseResponse delistingSpu(Integer productId, String outProductId)
throws WxErrorException;

WxMinishopSkuListResponse getSkuList(Long productId, Integer needRealStock, Integer needEditSku)
throws WxErrorException;

/**
* 小商店新增sku信息
*
Expand Down Expand Up @@ -96,7 +116,7 @@ WxMaShopBaseResponse delistingSpu(Integer productId, String outProductId)
* @throws WxErrorException
*/
WxMinishopResult<WxMinishopUpdateGoodsSkuData> minishopGoodsUpdateSkuPrice(Long productId,
Long outProductId, String outSkuId, Long skuId, Long salePrice, Long marketPrice) throws WxErrorException;
String outProductId, String outSkuId, Long skuId, Long salePrice, Long marketPrice) throws WxErrorException;


/**
Expand All @@ -112,8 +132,6 @@ WxMinishopResult<WxMinishopUpdateGoodsSkuData> minishopGoodsUpdateSkuPrice(Long
* @throws WxErrorException
*/
WxMinishopResult<WxMinishopUpdateGoodsSkuData> minishopGoodsUpdateSkuStock(Long productId,
Long outProductId, String outSkuId, Long skuId, Integer type, Integer stockNum) throws WxErrorException;
String outProductId, String outSkuId, Long skuId, Integer type, Integer stockNum) throws WxErrorException;

WxMinishopOrderListResponse minishopOrderGetList(String startCreateTime, String endCreateTime,
Integer status, Integer page, Integer pageSize, Integer source) throws WxErrorException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,25 @@ public interface WxMaService extends WxService {

/**
* 分享人接口
* @return
* @return WxMaShopSharerService
*/
WxMaShopSharerService getShopSharerService();

/**
* 标准交易组件接口
* @return
* @return WxMaProductService
*/
WxMaProductService getProductService();

/**
* 小商店-标准交易组件-订单服务
* @return getProductOrderService
*/
WxMaProductOrderService getProductOrderService();

/**
* 小商店-标准交易组件-优惠券
* @return getWxMaShopCouponService
*/
WxMaShopCouponService getWxMaShopCouponService();
}
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
@@ -0,0 +1,40 @@
package cn.binarywang.wx.miniapp.api;

import cn.binarywang.wx.miniapp.bean.shop.WxMaShopCouponInfo;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopBaseResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopCouponListResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopCouponResponse;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopUserCouponListResponse;
import me.chanjar.weixin.common.error.WxErrorException;

/**
* @author leiin
* @date 2022/7/1 2:49 下午
*/
public interface WxMaShopCouponService {

WxMaShopBaseResponse addCoupon(WxMaShopCouponInfo couponInfo) throws WxErrorException;

WxMaShopCouponResponse getCoupon(String outCouponId) throws WxErrorException;

WxMaShopCouponListResponse getCouponList(Integer pageSize,
Integer offset) throws WxErrorException;

WxMaShopBaseResponse updateCoupon(WxMaShopCouponInfo couponInfo) throws WxErrorException;

WxMaShopBaseResponse updateCouponStatus(String outCouponId,
Integer status) throws WxErrorException;

WxMaShopBaseResponse updateCouponStock(String outCouponId, Integer isUsedNum, Integer receiveNum) throws WxErrorException;

WxMaShopBaseResponse addUserCoupon(String openid, String outUserCouponId,
String outCouponId, Integer status, Long recvTime) throws WxErrorException;

WxMaShopUserCouponListResponse getUserCouponList(Integer pageSize, Integer offset, String openid) throws WxErrorException;

WxMaShopBaseResponse updateUserCoupon(String openid, String outUserCouponId,
String outCouponId, Long useTime, Long recvTime) throws WxErrorException;

WxMaShopBaseResponse updateUserCouponStatus(String openid, String outUserCouponId,
String outCouponId, Integer status) throws WxErrorException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public abstract class BaseWxMaServiceImpl<H, P> implements WxMaService, RequestH
private final WxMaSafetyRiskControlService safetyRiskControlService = new WxMaSafetyRiskControlServiceImpl(this);
private final WxMaShopSharerService shopSharerService = new WxMaShopSharerServiceImpl(this);
private final WxMaProductService productService = new WxMaProductServiceImpl(this);
private final WxMaProductOrderService productOrderService = new WxMaProductOrderServiceImpl(this);
private final WxMaShopCouponService wxMaShopCouponService = new WxMaShopCouponServiceImpl(this);
private Map<String, WxMaConfig> configMap;
private int retrySleepMillis = 1000;
private int maxRetryTimes = 5;
Expand Down Expand Up @@ -600,4 +602,14 @@ public WxMaImmediateDeliveryService getWxMaImmediateDeliveryService() {
@Override
public WxMaProductService getProductService() { return this.productService; }

@Override
public WxMaProductOrderService getProductOrderService() {
return this.productOrderService;
}

@Override
public WxMaShopCouponService getWxMaShopCouponService() {
return this.wxMaShopCouponService;
}

}
Loading