生活服务交易系统->核销->核销工具->查询用户券列表

This commit is contained in:
353259576 2024-09-19 15:10:54 +08:00
parent 416bca033c
commit 1c2b2653e1
12 changed files with 643 additions and 0 deletions

View File

@ -2226,6 +2226,14 @@ public class DyAppletClient extends BaseClient {
return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).closeOrder(body);
}
/**
* 生活服务交易系统->核销->核销工具->查询用户券列表
* @param body
*/
public DataAndExtraVo<QueryUserCertificatesVo> queryUserCertificates(QueryUserCertificatesQuery body){
return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryUserCertificates(body);
}
/**
* 获取抖音号绑定所需的资质模版列表
*

View File

@ -167,4 +167,11 @@ public interface IndustryTransactionClient {
*/
@Post(value = "closeOrder", interceptor = ClientTokenInterceptor.class)
DataAndExtraVo<Void> closeOrder(@JSONBody CloseOrderQuery body);
/**
* 生活服务交易系统->核销->核销工具->查询用户券列表
* @param body
*/
@Post(value = "queryUserCertificates", interceptor = ClientTokenInterceptor.class)
DataAndExtraVo<QueryUserCertificatesVo> queryUserCertificates(@JSONBody QueryUserCertificatesQuery body);
}

View File

@ -0,0 +1,103 @@
package com.dyj.applet.domain;
public class CertificatesInfo {
/**
* 券ID
*/
private String certificate_id;
/**
* 券相关的sku商品信息详见下方sku_info参数字段说明
*/
private CertificatesSkuInfo sku_info;
/**
* 券相关金额信息详见下方amount参数字段说明
*/
private UserCertificatesAmount amount;
/**
* 券有效时间秒级
*/
private Long expire_time;
/**
* 券有效开始时间秒级
*/
private Long start_time;
/**
* 三方码则返回明文code抖音码不返回
* 选填
*/
private String code;
/**
* 次卡信息详见下方times_card_info参数字段说明
*/
private TimesCardInfo times_card_info;
public String getCertificate_id() {
return certificate_id;
}
public CertificatesInfo setCertificate_id(String certificate_id) {
this.certificate_id = certificate_id;
return this;
}
public CertificatesSkuInfo getSku_info() {
return sku_info;
}
public CertificatesInfo setSku_info(CertificatesSkuInfo sku_info) {
this.sku_info = sku_info;
return this;
}
public UserCertificatesAmount getAmount() {
return amount;
}
public CertificatesInfo setAmount(UserCertificatesAmount amount) {
this.amount = amount;
return this;
}
public Long getExpire_time() {
return expire_time;
}
public CertificatesInfo setExpire_time(Long expire_time) {
this.expire_time = expire_time;
return this;
}
public Long getStart_time() {
return start_time;
}
public CertificatesInfo setStart_time(Long start_time) {
this.start_time = start_time;
return this;
}
public String getCode() {
return code;
}
public CertificatesInfo setCode(String code) {
this.code = code;
return this;
}
public TimesCardInfo getTimes_card_info() {
return times_card_info;
}
public CertificatesInfo setTimes_card_info(TimesCardInfo times_card_info) {
this.times_card_info = times_card_info;
return this;
}
}

View File

@ -0,0 +1,136 @@
package com.dyj.applet.domain;
public class CertificatesSkuInfo {
/**
* sku商品id
*/
private String sku_id;
/**
* 商品名称
*/
private String title;
/**
* 商品类型
* 1 团购券
* 2 代金券
* 3 次卡
*/
private Integer groupon_type;
/**
* 团购市场价单位分
*/
private Long market_price;
/**
* 团购售卖开始时间时间戳单位秒
*/
private Long sold_start_time;
/**
* 商家系统第三方团购id
* 选填
*/
private String third_sku_id;
/**
* 商家团购账号id
*/
private String account_id;
/**
* 商品spu_id
* 选填
*/
private String spu_id;
/**
* 外部商品id
* 选填
*/
private String out_id;
public String getSku_id() {
return sku_id;
}
public CertificatesSkuInfo setSku_id(String sku_id) {
this.sku_id = sku_id;
return this;
}
public String getTitle() {
return title;
}
public CertificatesSkuInfo setTitle(String title) {
this.title = title;
return this;
}
public Integer getGroupon_type() {
return groupon_type;
}
public CertificatesSkuInfo setGroupon_type(Integer groupon_type) {
this.groupon_type = groupon_type;
return this;
}
public Long getMarket_price() {
return market_price;
}
public CertificatesSkuInfo setMarket_price(Long market_price) {
this.market_price = market_price;
return this;
}
public Long getSold_start_time() {
return sold_start_time;
}
public CertificatesSkuInfo setSold_start_time(Long sold_start_time) {
this.sold_start_time = sold_start_time;
return this;
}
public String getThird_sku_id() {
return third_sku_id;
}
public CertificatesSkuInfo setThird_sku_id(String third_sku_id) {
this.third_sku_id = third_sku_id;
return this;
}
public String getAccount_id() {
return account_id;
}
public CertificatesSkuInfo setAccount_id(String account_id) {
this.account_id = account_id;
return this;
}
public String getSpu_id() {
return spu_id;
}
public CertificatesSkuInfo setSpu_id(String spu_id) {
this.spu_id = spu_id;
return this;
}
public String getOut_id() {
return out_id;
}
public CertificatesSkuInfo setOut_id(String out_id) {
this.out_id = out_id;
return this;
}
}

View File

@ -0,0 +1,48 @@
package com.dyj.applet.domain;
import java.util.List;
public class QueryCertificatesOrderInfo {
/**
* 抖音内部交易订单号长度<64byte
*/
private String order_id;
/**
* 此订单的券信息
*/
private List<CertificatesInfo> certificates;
/**
* 是否可用
*/
private Boolean can_use;
public String getOrder_id() {
return order_id;
}
public QueryCertificatesOrderInfo setOrder_id(String order_id) {
this.order_id = order_id;
return this;
}
public List<CertificatesInfo> getCertificates() {
return certificates;
}
public QueryCertificatesOrderInfo setCertificates(List<CertificatesInfo> certificates) {
this.certificates = certificates;
return this;
}
public Boolean getCan_use() {
return can_use;
}
public QueryCertificatesOrderInfo setCan_use(Boolean can_use) {
this.can_use = can_use;
return this;
}
}

View File

@ -0,0 +1,35 @@
package com.dyj.applet.domain;
/**
* 次卡信息
*/
public class TimesCardInfo {
/**
* 总次数
*/
private Long total_times;
/**
* 可用次数
*/
private Long usable_times;
public Long getTotal_times() {
return total_times;
}
public TimesCardInfo setTotal_times(Long total_times) {
this.total_times = total_times;
return this;
}
public Long getUsable_times() {
return usable_times;
}
public TimesCardInfo setUsable_times(Long usable_times) {
this.usable_times = usable_times;
return this;
}
}

View File

@ -0,0 +1,92 @@
package com.dyj.applet.domain;
public class UserCertificatesAmount {
/**
* 券原始金额单位分
*/
private Integer original_amount;
/**
* 用户实付金额单位分
*/
private Integer pay_amount;
/**
* 商家营销金额单位分
* 选填
*/
private Integer merchant_ticket_amount;
/**
* 支付优惠金额单位分
* 选填
*/
private Integer payment_discount_amount;
/**
* 券实付金额=用户实付金额+支付优惠金额单位分
* 选填
*/
private Integer coupon_pay_amount;
/**
* 平台补贴金额单位分
* 选填
*/
private Integer platform_ticket_amount;
public Integer getOriginal_amount() {
return original_amount;
}
public UserCertificatesAmount setOriginal_amount(Integer original_amount) {
this.original_amount = original_amount;
return this;
}
public Integer getPay_amount() {
return pay_amount;
}
public UserCertificatesAmount setPay_amount(Integer pay_amount) {
this.pay_amount = pay_amount;
return this;
}
public Integer getMerchant_ticket_amount() {
return merchant_ticket_amount;
}
public UserCertificatesAmount setMerchant_ticket_amount(Integer merchant_ticket_amount) {
this.merchant_ticket_amount = merchant_ticket_amount;
return this;
}
public Integer getPayment_discount_amount() {
return payment_discount_amount;
}
public UserCertificatesAmount setPayment_discount_amount(Integer payment_discount_amount) {
this.payment_discount_amount = payment_discount_amount;
return this;
}
public Integer getCoupon_pay_amount() {
return coupon_pay_amount;
}
public UserCertificatesAmount setCoupon_pay_amount(Integer coupon_pay_amount) {
this.coupon_pay_amount = coupon_pay_amount;
return this;
}
public Integer getPlatform_ticket_amount() {
return platform_ticket_amount;
}
public UserCertificatesAmount setPlatform_ticket_amount(Integer platform_ticket_amount) {
this.platform_ticket_amount = platform_ticket_amount;
return this;
}
}

View File

@ -0,0 +1,152 @@
package com.dyj.applet.domain.query;
import com.dyj.common.domain.query.UserInfoQuery;
public class QueryUserCertificatesQuery extends UserInfoQuery {
/**
* 商家团购账号id抖音来客账号id需要先有此商家授权关系才能获取到
*/
private String account_id;
/**
* 适用门店poi_id
* 选填
*/
private String poi_id;
/**
* 分页展示用户券起始页默认1
* 选填
*/
private Integer page;
/**
*
* 分页查询订单数量 page_size <= 50默认50
* 选填
*/
private Integer page_size;
/**
* 1 核销工具(默认) 2混合双开
* 选填
*/
private Integer biz_type;
public String getAccount_id() {
return account_id;
}
public QueryUserCertificatesQuery setAccount_id(String account_id) {
this.account_id = account_id;
return this;
}
public String getPoi_id() {
return poi_id;
}
public QueryUserCertificatesQuery setPoi_id(String poi_id) {
this.poi_id = poi_id;
return this;
}
public Integer getPage() {
return page;
}
public QueryUserCertificatesQuery setPage(Integer page) {
this.page = page;
return this;
}
public Integer getPage_size() {
return page_size;
}
public QueryUserCertificatesQuery setPage_size(Integer page_size) {
this.page_size = page_size;
return this;
}
public Integer getBiz_type() {
return biz_type;
}
public QueryUserCertificatesQuery setBiz_type(Integer biz_type) {
this.biz_type = biz_type;
return this;
}
public static QueryUserCertificatesQueryBuilder builder() {
return new QueryUserCertificatesQueryBuilder();
}
public static final class QueryUserCertificatesQueryBuilder {
private String account_id;
private String poi_id;
private Integer page;
private Integer page_size;
private Integer biz_type;
private String open_id;
private Integer tenantId;
private String clientKey;
private QueryUserCertificatesQueryBuilder() {
}
public QueryUserCertificatesQueryBuilder accountId(String accountId) {
this.account_id = accountId;
return this;
}
public QueryUserCertificatesQueryBuilder poiId(String poiId) {
this.poi_id = poiId;
return this;
}
public QueryUserCertificatesQueryBuilder page(Integer page) {
this.page = page;
return this;
}
public QueryUserCertificatesQueryBuilder pageSize(Integer pageSize) {
this.page_size = pageSize;
return this;
}
public QueryUserCertificatesQueryBuilder bizType(Integer bizType) {
this.biz_type = bizType;
return this;
}
public QueryUserCertificatesQueryBuilder openId(String openId) {
this.open_id = openId;
return this;
}
public QueryUserCertificatesQueryBuilder tenantId(Integer tenantId) {
this.tenantId = tenantId;
return this;
}
public QueryUserCertificatesQueryBuilder clientKey(String clientKey) {
this.clientKey = clientKey;
return this;
}
public QueryUserCertificatesQuery build() {
QueryUserCertificatesQuery queryUserCertificatesQuery = new QueryUserCertificatesQuery();
queryUserCertificatesQuery.setAccount_id(account_id);
queryUserCertificatesQuery.setPoi_id(poi_id);
queryUserCertificatesQuery.setPage(page);
queryUserCertificatesQuery.setPage_size(page_size);
queryUserCertificatesQuery.setBiz_type(biz_type);
queryUserCertificatesQuery.setOpen_id(open_id);
queryUserCertificatesQuery.setTenantId(tenantId);
queryUserCertificatesQuery.setClientKey(clientKey);
return queryUserCertificatesQuery;
}
}
}

View File

@ -0,0 +1,36 @@
package com.dyj.applet.domain.vo;
import com.dyj.applet.domain.QueryCertificatesOrderInfo;
import java.util.List;
public class QueryUserCertificatesVo {
/**
* 抖音订单列表
*/
private List<QueryCertificatesOrderInfo> orders;
/**
* 该用户待使用订单总数
*/
private Long total;
public List<QueryCertificatesOrderInfo> getOrders() {
return orders;
}
public QueryUserCertificatesVo setOrders(List<QueryCertificatesOrderInfo> orders) {
this.orders = orders;
return this;
}
public Long getTotal() {
return total;
}
public QueryUserCertificatesVo setTotal(Long total) {
this.total = total;
return this;
}
}

View File

@ -208,4 +208,13 @@ public class IndustryTransactionHandler extends AbstractAppletHandler{
baseQuery(body);
return getIndustryOpenTransactionClient().closeOrder(body);
}
/**
* 生活服务交易系统->核销->核销工具->查询用户券列表
* @param body
*/
public DataAndExtraVo<QueryUserCertificatesVo> queryUserCertificates(QueryUserCertificatesQuery body){
baseQuery(body);
return getIndustryOpenTransactionClient().queryUserCertificates(body);
}
}

View File

@ -563,6 +563,10 @@ public enum DyAppletUrlPathEnum {
*/
CLOSE_ORDER("closeOrder","/api/apps/trade/v2/order/close_order"),
/**
* 生活服务交易系统->核销->核销工具->查询用户券列表
*/
QUERY_USER_CERTIFICATES("queryUserCertificates","/api/trade/v2/fulfillment/query_user_certificates")
;

View File

@ -598,4 +598,17 @@ public class TransactionTest {
);
}
/**
* 生活服务交易系统->核销->核销工具->查询用户券列表
*/
@Test
public void queryUserCertificates(){
DyAppletClient dyAppletClient = new DyAppletClient();
System.out.println(
JSON.toJSONString(
dyAppletClient.queryUserCertificates(QueryUserCertificatesQuery.builder().build())
)
);
}
}