Merge branch 'v1.0.0.0'

This commit is contained in:
danmo 2024-08-30 10:44:25 +08:00
commit 95930baf0b
10 changed files with 629 additions and 6 deletions

View File

@ -2148,6 +2148,35 @@ public class DyAppletClient extends BaseClient {
return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).industryQuerySettle(body);
}
/**
* 生活服务交易系统->退货退款->开发者发起退款
* @param body
* @return
*/
public DataAndExtraVo<DeveloperCreateRefundVo> developerCreateRefund(DeveloperCreateRefundQuery body){
return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).developerCreateRefund(body);
}
/**
* 生活服务交易系统->退货退款->同步退款审核结果
* @param body 同步退款审核结果请求值
* @return
*/
public DataAndExtraVo<BaseVo> refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery body){
return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).refundMerchantAuditCallback(body);
}
/**
* 生活服务交易系统->退货退款->查询退款
* @param body
* @return
*/
public DataAndExtraVo<IndustryQueryRefundVo> industryQueryRefund(QueryRefundQuery body){
return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).industryQueryRefund(body);
}
/**
* 获取抖音号绑定所需的资质模版列表
*

View File

@ -9,9 +9,7 @@ import com.dyj.applet.domain.vo.*;
import com.dyj.common.domain.DataAndExtraVo;
import com.dyj.common.domain.DySimpleResult;
import com.dyj.common.domain.vo.BaseVo;
import com.dyj.common.interceptor.ClientQueryTokenInterceptor;
import com.dyj.common.interceptor.ClientTokenInterceptor;
import com.dyj.common.interceptor.TokenHeaderInterceptor;
import java.util.List;
@ -102,4 +100,28 @@ public interface IndustryTransactionClient {
*/
@Post(value = "${industryQuerySettle}", interceptor = ClientTokenInterceptor.class)
DataAndExtraVo<List<IndustryQuerySettleVo>> industryQuerySettle(@JSONBody IndustryQuerySettleQuery body);
/**
* 生活服务交易系统->退货退款->开发者发起退款
* @param body
* @return
*/
@Post(value = "${developerCreateRefund}", interceptor = ClientTokenInterceptor.class)
DataAndExtraVo<DeveloperCreateRefundVo> developerCreateRefund(@JSONBody DeveloperCreateRefundQuery body);
/**
* 生活服务交易系统->退货退款->同步退款审核结果
* @param body 同步退款审核结果请求值
* @return
*/
@Post(value = "${refundMerchantAuditCallback}", interceptor = ClientTokenInterceptor.class)
DataAndExtraVo<BaseVo> refundMerchantAuditCallback(@JSONBody RefundMerchantAuditCallbackQuery body);
/**
* 生活服务交易系统->退货退款->查询退款
* @param body
* @return
*/
@Post(value = "${queryRefund}", interceptor = ClientTokenInterceptor.class)
DataAndExtraVo<IndustryQueryRefundVo> industryQueryRefund(@JSONBody QueryRefundQuery body);
}

View File

@ -0,0 +1,21 @@
package com.dyj.applet.domain;
/**
* 次卡退款类型
*/
public class CreateRefundTimesCardRefundType {
/**
* 次卡退款类型,1-退剩余次数,2-全部退
*/
private Long times_card_refund_type;
public Long getTimes_card_refund_type() {
return times_card_refund_type;
}
public CreateRefundTimesCardRefundType setTimes_card_refund_type(Long times_card_refund_type) {
this.times_card_refund_type = times_card_refund_type;
return this;
}
}

View File

@ -0,0 +1,189 @@
package com.dyj.applet.domain.query;
import com.dyj.applet.domain.CreateRefundTimesCardRefundType;
import com.dyj.applet.domain.RefundItemOrderDetail;
import com.dyj.applet.domain.RefundOrderEntrySchema;
import com.dyj.common.domain.query.BaseQuery;
import java.util.List;
/**
* 生活服务交易系统->退货退款->开发者发起退款请求值
*/
public class DeveloperCreateRefundQuery extends BaseQuery {
/**
* 开发者侧订单号长度 <= 64 byte
*/
private String out_order_no;
/**
* 开发者侧退款单号长度 <= 64 byte
*/
private String out_refund_no;
/**
* 开发者自定义透传字段不支持二进制长度 <= 2048 byte
*/
private String cp_extra;
/**
* <p>退款单的跳转的schema参考<a href="/docs/resource/zh-CN/mini-app/develop/server/trade-system/general/common-param" target="_blank" rel="nofollow" class="syl-link" elementtiming="element-timing">通用参数-关于 xxx_entry_schema 的前置说明</a></p>
*/
private RefundOrderEntrySchema order_entry_schema;
/**
* <p>退款结果通知地址必须是 HTTPS 类型 长度 &lt;= 512 byte 若不填则默认使用在解决方案配置-消息通知中指定的回调地址配置方式参考<a href="/docs/resource/zh-CN/mini-app/open-capacity/Industry/industry_mode/guide/" target="_blank" rel="nofollow" class="syl-link" elementtiming="element-timing">解决方案配置文档</a></p> 选填
*/
private String notify_url;
/**
* 需要发起退款的商品单信息 选填
*/
private List<RefundItemOrderDetail> item_order_detail;
/**
* 次卡退款必填 选填
*/
private CreateRefundTimesCardRefundType times_card_refund_param;
public String getOut_order_no() {
return out_order_no;
}
public DeveloperCreateRefundQuery setOut_order_no(String out_order_no) {
this.out_order_no = out_order_no;
return this;
}
public String getOut_refund_no() {
return out_refund_no;
}
public DeveloperCreateRefundQuery setOut_refund_no(String out_refund_no) {
this.out_refund_no = out_refund_no;
return this;
}
public String getCp_extra() {
return cp_extra;
}
public DeveloperCreateRefundQuery setCp_extra(String cp_extra) {
this.cp_extra = cp_extra;
return this;
}
public RefundOrderEntrySchema getOrder_entry_schema() {
return order_entry_schema;
}
public DeveloperCreateRefundQuery setOrder_entry_schema(RefundOrderEntrySchema order_entry_schema) {
this.order_entry_schema = order_entry_schema;
return this;
}
public String getNotify_url() {
return notify_url;
}
public DeveloperCreateRefundQuery setNotify_url(String notify_url) {
this.notify_url = notify_url;
return this;
}
public List<RefundItemOrderDetail> getItem_order_detail() {
return item_order_detail;
}
public DeveloperCreateRefundQuery setItem_order_detail(List<RefundItemOrderDetail> item_order_detail) {
this.item_order_detail = item_order_detail;
return this;
}
public CreateRefundTimesCardRefundType getTimes_card_refund_param() {
return times_card_refund_param;
}
public DeveloperCreateRefundQuery setTimes_card_refund_param(CreateRefundTimesCardRefundType times_card_refund_param) {
this.times_card_refund_param = times_card_refund_param;
return this;
}
public static DeveloperCreateRefundQueryBuilder builder() {
return new DeveloperCreateRefundQueryBuilder();
}
public static final class DeveloperCreateRefundQueryBuilder {
private String out_order_no;
private String out_refund_no;
private String cp_extra;
private RefundOrderEntrySchema order_entry_schema;
private String notify_url;
private List<RefundItemOrderDetail> item_order_detail;
private CreateRefundTimesCardRefundType times_card_refund_param;
private Integer tenantId;
private String clientKey;
private DeveloperCreateRefundQueryBuilder() {
}
public DeveloperCreateRefundQueryBuilder outOrderNo(String outOrderNo) {
this.out_order_no = outOrderNo;
return this;
}
public DeveloperCreateRefundQueryBuilder outRefundNo(String outRefundNo) {
this.out_refund_no = outRefundNo;
return this;
}
public DeveloperCreateRefundQueryBuilder cpExtra(String cpExtra) {
this.cp_extra = cpExtra;
return this;
}
public DeveloperCreateRefundQueryBuilder orderEntrySchema(RefundOrderEntrySchema orderEntrySchema) {
this.order_entry_schema = orderEntrySchema;
return this;
}
public DeveloperCreateRefundQueryBuilder notifyUrl(String notifyUrl) {
this.notify_url = notifyUrl;
return this;
}
public DeveloperCreateRefundQueryBuilder itemOrderDetail(List<RefundItemOrderDetail> itemOrderDetail) {
this.item_order_detail = itemOrderDetail;
return this;
}
public DeveloperCreateRefundQueryBuilder timesCardRefundParam(CreateRefundTimesCardRefundType timesCardRefundParam) {
this.times_card_refund_param = timesCardRefundParam;
return this;
}
public DeveloperCreateRefundQueryBuilder tenantId(Integer tenantId) {
this.tenantId = tenantId;
return this;
}
public DeveloperCreateRefundQueryBuilder clientKey(String clientKey) {
this.clientKey = clientKey;
return this;
}
public DeveloperCreateRefundQuery build() {
DeveloperCreateRefundQuery developerCreateRefundQuery = new DeveloperCreateRefundQuery();
developerCreateRefundQuery.setOut_order_no(out_order_no);
developerCreateRefundQuery.setOut_refund_no(out_refund_no);
developerCreateRefundQuery.setCp_extra(cp_extra);
developerCreateRefundQuery.setOrder_entry_schema(order_entry_schema);
developerCreateRefundQuery.setNotify_url(notify_url);
developerCreateRefundQuery.setItem_order_detail(item_order_detail);
developerCreateRefundQuery.setTimes_card_refund_param(times_card_refund_param);
developerCreateRefundQuery.setTenantId(tenantId);
developerCreateRefundQuery.setClientKey(clientKey);
return developerCreateRefundQuery;
}
}
}

View File

@ -0,0 +1,100 @@
package com.dyj.applet.domain.query;
import com.dyj.common.domain.query.BaseQuery;
/**
* 生活服务交易系统->退货退款->同步退款审核结果请求值
*/
public class RefundMerchantAuditCallbackQuery extends BaseQuery {
/**
* 不同意退款信息(不同意退款时必填)长度 <= 512 byte 选填
*/
private String deny_message;
/**
* 开发者侧退款单号长度 <= 64 byte
*/
private String out_refund_no;
/**
* 审核状态
*/
private Byte refund_audit_status;
public String getDeny_message() {
return deny_message;
}
public RefundMerchantAuditCallbackQuery setDeny_message(String deny_message) {
this.deny_message = deny_message;
return this;
}
public String getOut_refund_no() {
return out_refund_no;
}
public RefundMerchantAuditCallbackQuery setOut_refund_no(String out_refund_no) {
this.out_refund_no = out_refund_no;
return this;
}
public Byte getRefund_audit_status() {
return refund_audit_status;
}
public RefundMerchantAuditCallbackQuery setRefund_audit_status(Byte refund_audit_status) {
this.refund_audit_status = refund_audit_status;
return this;
}
public static RefundMerchantAuditCallbackQueryBuilder builder() {
return new RefundMerchantAuditCallbackQueryBuilder();
}
public static final class RefundMerchantAuditCallbackQueryBuilder {
private String deny_message;
private String out_refund_no;
private Byte refund_audit_status;
private Integer tenantId;
private String clientKey;
private RefundMerchantAuditCallbackQueryBuilder() {
}
public RefundMerchantAuditCallbackQueryBuilder denyMessage(String denyMessage) {
this.deny_message = denyMessage;
return this;
}
public RefundMerchantAuditCallbackQueryBuilder outRefundNo(String outRefundNo) {
this.out_refund_no = outRefundNo;
return this;
}
public RefundMerchantAuditCallbackQueryBuilder refundAuditStatus(Byte refundAuditStatus) {
this.refund_audit_status = refundAuditStatus;
return this;
}
public RefundMerchantAuditCallbackQueryBuilder tenantId(Integer tenantId) {
this.tenantId = tenantId;
return this;
}
public RefundMerchantAuditCallbackQueryBuilder clientKey(String clientKey) {
this.clientKey = clientKey;
return this;
}
public RefundMerchantAuditCallbackQuery build() {
RefundMerchantAuditCallbackQuery refundMerchantAuditCallbackQuery = new RefundMerchantAuditCallbackQuery();
refundMerchantAuditCallbackQuery.setDeny_message(deny_message);
refundMerchantAuditCallbackQuery.setOut_refund_no(out_refund_no);
refundMerchantAuditCallbackQuery.setRefund_audit_status(refund_audit_status);
refundMerchantAuditCallbackQuery.setTenantId(tenantId);
refundMerchantAuditCallbackQuery.setClientKey(clientKey);
return refundMerchantAuditCallbackQuery;
}
}
}

View File

@ -0,0 +1,23 @@
package com.dyj.applet.domain.vo;
import com.dyj.common.domain.vo.BaseVo;
/**
* 生活服务交易系统->退货退款->开发者发起退款 相应值
*/
public class DeveloperCreateRefundVo extends BaseVo {
/**
* 抖音开放平台交易系统内部退款单号
*/
private String refund_id;
public String getRefund_id() {
return refund_id;
}
public DeveloperCreateRefundVo setRefund_id(String refund_id) {
this.refund_id = refund_id;
return this;
}
}

View File

@ -0,0 +1,158 @@
package com.dyj.applet.domain.vo;
import com.dyj.applet.domain.QueryRefundResult;
import com.dyj.applet.domain.RefundItemOrderDetail;
import com.dyj.applet.domain.RefundMerchantAuditDetail;
import com.dyj.common.domain.vo.BaseVo;
import java.util.List;
public class IndustryQueryRefundVo extends BaseVo {
/**
* 退款创建时间13位毫秒时间戳
*/
private Long create_at;
/**
* 退款结果信息可以通过该字段了解退款失败原因 选填
*/
private String message;
/**
* 系统订单信息开放平台生成的订单号
*/
private String order_id;
/**
* 开发者系统生成的退款单号与抖音开平退款单号唯一关联 选填
*/
private String out_refund_no;
/**
* 退款时间13位毫秒时间戳只有已退款才有退款时间 选填
*/
private Long refund_at;
/**
* 系统退款单号开放平台生成的退款单号
*/
private String refund_id;
/**
* <ul><li>退款状态:退款中-PROCESSING</li><li>已退款-SUCCESS</li><li>退款失败-FAIL</li></ul>
*/
private String refund_status;
/**
* 退款金额单位[]
*/
private Long refund_total_amount;
/**
* 系统订单信息开放平台生成的订单号 选填
*/
private List<RefundItemOrderDetail> item_order_detail;
/**
* 退款审核信息 选填
*/
private RefundMerchantAuditDetail merchant_audit_detail;
/**
* 退款查询结果列表最多返回50条
* (建议开发者用这个字段)
*/
private List<QueryRefundResult> refund_list;
public Long getCreate_at() {
return create_at;
}
public IndustryQueryRefundVo setCreate_at(Long create_at) {
this.create_at = create_at;
return this;
}
public String getMessage() {
return message;
}
public IndustryQueryRefundVo setMessage(String message) {
this.message = message;
return this;
}
public String getOrder_id() {
return order_id;
}
public IndustryQueryRefundVo setOrder_id(String order_id) {
this.order_id = order_id;
return this;
}
public String getOut_refund_no() {
return out_refund_no;
}
public IndustryQueryRefundVo setOut_refund_no(String out_refund_no) {
this.out_refund_no = out_refund_no;
return this;
}
public Long getRefund_at() {
return refund_at;
}
public IndustryQueryRefundVo setRefund_at(Long refund_at) {
this.refund_at = refund_at;
return this;
}
public String getRefund_id() {
return refund_id;
}
public IndustryQueryRefundVo setRefund_id(String refund_id) {
this.refund_id = refund_id;
return this;
}
public String getRefund_status() {
return refund_status;
}
public IndustryQueryRefundVo setRefund_status(String refund_status) {
this.refund_status = refund_status;
return this;
}
public Long getRefund_total_amount() {
return refund_total_amount;
}
public IndustryQueryRefundVo setRefund_total_amount(Long refund_total_amount) {
this.refund_total_amount = refund_total_amount;
return this;
}
public List<RefundItemOrderDetail> getItem_order_detail() {
return item_order_detail;
}
public IndustryQueryRefundVo setItem_order_detail(List<RefundItemOrderDetail> item_order_detail) {
this.item_order_detail = item_order_detail;
return this;
}
public RefundMerchantAuditDetail getMerchant_audit_detail() {
return merchant_audit_detail;
}
public IndustryQueryRefundVo setMerchant_audit_detail(RefundMerchantAuditDetail merchant_audit_detail) {
this.merchant_audit_detail = merchant_audit_detail;
return this;
}
public List<QueryRefundResult> getRefund_list() {
return refund_list;
}
public IndustryQueryRefundVo setRefund_list(List<QueryRefundResult> refund_list) {
this.refund_list = refund_list;
return this;
}
}

View File

@ -1,7 +1,5 @@
package com.dyj.applet.handler;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import com.dyj.applet.domain.QueryAndCalculateMarketingResult;
import com.dyj.applet.domain.query.*;
import com.dyj.applet.domain.vo.*;
@ -9,7 +7,6 @@ import com.dyj.common.config.AgentConfiguration;
import com.dyj.common.domain.DataAndExtraVo;
import com.dyj.common.domain.DySimpleResult;
import com.dyj.common.domain.vo.BaseVo;
import com.dyj.common.interceptor.ClientTokenInterceptor;
import java.util.List;
@ -122,4 +119,34 @@ public class IndustryTransactionHandler extends AbstractAppletHandler{
baseQuery(body);
return getIndustryOpenTransactionClient().industryQuerySettle(body);
}
/**
* 生活服务交易系统->退货退款->开发者发起退款
* @param body
* @return
*/
public DataAndExtraVo<DeveloperCreateRefundVo> developerCreateRefund(DeveloperCreateRefundQuery body){
baseQuery(body);
return getIndustryOpenTransactionClient().developerCreateRefund(body);
}
/**
* 生活服务交易系统->退货退款->同步退款审核结果
* @param body 同步退款审核结果请求值
* @return
*/
public DataAndExtraVo<BaseVo> refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery body){
baseQuery(body);
return getIndustryOpenTransactionClient().refundMerchantAuditCallback(body);
}
/**
* 生活服务交易系统->退货退款->查询退款
* @param body
* @return
*/
public DataAndExtraVo<IndustryQueryRefundVo> industryQueryRefund(QueryRefundQuery body){
baseQuery(body);
return getIndustryOpenTransactionClient().industryQueryRefund(body);
}
}

View File

@ -516,7 +516,22 @@ public enum DyAppletUrlPathEnum {
/**
* 生活服务交易系统->分账->查询分账
*/
INDUSTRY_QUERY_SETTLE("industryQuerySettle", "/api/apps/trade/v2/settle/query_settle")
INDUSTRY_QUERY_SETTLE("industryQuerySettle", "/api/apps/trade/v2/settle/query_settle"),
/**
* 生活服务交易系统->退货退款->开发者发起退款
*/
DEVELOPER_CREATE_REFUND("developerCreateRefund","/api/apps/trade/v2/refund/create_refund"),
/**
* 生活服务交易系统->退货退款->同步退款审核结果
*/
REFUND_MERCHANT_AUDIT_CALLBACK("refundMerchantAuditCallback","/api/apps/trade/v2/refund/merchant_audit_callback"),
/**
* 生活服务交易系统->退货退款->查询退款
*/
QUERY_REFUND("queryRefund","/api/apps/trade/v2/refund/query_refund"),
;

View File

@ -481,4 +481,43 @@ public class TransactionTest {
);
}
/**
* 生活服务交易系统->退货退款->开发者发起退款
*/
@Test
public void developerCreateRefund(){
DyAppletClient dyAppletClient = new DyAppletClient();
System.out.println(
JSON.toJSONString(
dyAppletClient.developerCreateRefund(DeveloperCreateRefundQuery.builder().build())
)
);
}
/**
* 生活服务交易系统->退货退款->同步退款审核结果
*/
@Test
public void refundMerchantAuditCallback(){
DyAppletClient dyAppletClient = new DyAppletClient();
System.out.println(
JSON.toJSONString(
dyAppletClient.refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery.builder().build())
)
);
}
/**
* 生活服务交易系统->退货退款->查询退款
*/
@Test
public void industryQueryRefund(){
DyAppletClient dyAppletClient = new DyAppletClient();
System.out.println(
JSON.toJSONString(
dyAppletClient.industryQueryRefund(QueryRefundQuery.builder().build())
)
);
}
}