From 37ac91cca812683f98ef9d0da697453ebb71b99a Mon Sep 17 00:00:00 2001 From: 353259576 <1048058229@qq.com> Date: Mon, 26 Aug 2024 11:55:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=94=9F=E6=B4=BB=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E7=B3=BB=E7=BB=9F->=E9=80=80=E8=B4=A7?= =?UTF-8?q?=E9=80=80=E6=AC=BE->=E5=BC=80=E5=8F=91=E8=80=85=E5=8F=91?= =?UTF-8?q?=E8=B5=B7=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dyj/applet/DyAppletClient.java | 9 + .../client/IndustryTransactionClient.java | 8 + .../CreateRefundTimesCardRefundType.java | 21 ++ .../query/DeveloperCreateRefundQuery.java | 189 ++++++++++++++++++ .../domain/vo/DeveloperCreateRefundVo.java | 23 +++ .../handler/IndustryTransactionHandler.java | 10 + .../dyj/common/enums/DyAppletUrlPathEnum.java | 7 +- .../dyj/examples/applet/TransactionTest.java | 13 ++ 8 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 dy-java-applet/src/main/java/com/dyj/applet/domain/CreateRefundTimesCardRefundType.java create mode 100644 dy-java-applet/src/main/java/com/dyj/applet/domain/query/DeveloperCreateRefundQuery.java create mode 100644 dy-java-applet/src/main/java/com/dyj/applet/domain/vo/DeveloperCreateRefundVo.java diff --git a/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java b/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java index abb5de8..23db351 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java @@ -2148,6 +2148,15 @@ public class DyAppletClient extends BaseClient { return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).industryQuerySettle(body); } + /** + * 生活服务交易系统->退货退款->开发者发起退款 + * @param body + * @return + */ + public DataAndExtraVo developerCreateRefund(DeveloperCreateRefundQuery body){ + return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).developerCreateRefund(body); + } + /** * 获取抖音号绑定所需的资质模版列表 * diff --git a/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java b/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java index 2146843..fd618d9 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java @@ -102,4 +102,12 @@ public interface IndustryTransactionClient { */ @Post(value = "${industryQuerySettle}", interceptor = ClientTokenInterceptor.class) DataAndExtraVo> industryQuerySettle(@JSONBody IndustryQuerySettleQuery body); + + /** + * 生活服务交易系统->退货退款->开发者发起退款 + * @param body + * @return + */ + @Post(value = "${developerCreateRefund}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo developerCreateRefund(@JSONBody DeveloperCreateRefundQuery body); } diff --git a/dy-java-applet/src/main/java/com/dyj/applet/domain/CreateRefundTimesCardRefundType.java b/dy-java-applet/src/main/java/com/dyj/applet/domain/CreateRefundTimesCardRefundType.java new file mode 100644 index 0000000..3f23a05 --- /dev/null +++ b/dy-java-applet/src/main/java/com/dyj/applet/domain/CreateRefundTimesCardRefundType.java @@ -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; + } +} diff --git a/dy-java-applet/src/main/java/com/dyj/applet/domain/query/DeveloperCreateRefundQuery.java b/dy-java-applet/src/main/java/com/dyj/applet/domain/query/DeveloperCreateRefundQuery.java new file mode 100644 index 0000000..ee1c940 --- /dev/null +++ b/dy-java-applet/src/main/java/com/dyj/applet/domain/query/DeveloperCreateRefundQuery.java @@ -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; + + /** + *

退款单的跳转的schema,参考通用参数-关于 xxx_entry_schema 的前置说明

+ */ + private RefundOrderEntrySchema order_entry_schema; + /** + *

退款结果通知地址,必须是 HTTPS 类型, 长度 <= 512 byte 。若不填,则默认使用在解决方案配置-消息通知中指定的回调地址,配置方式参考解决方案配置文档

选填 + */ + private String notify_url; + + /** + * 需要发起退款的商品单信息 选填 + */ + private List 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 getItem_order_detail() { + return item_order_detail; + } + + public DeveloperCreateRefundQuery setItem_order_detail(List 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 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 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; + } + } +} diff --git a/dy-java-applet/src/main/java/com/dyj/applet/domain/vo/DeveloperCreateRefundVo.java b/dy-java-applet/src/main/java/com/dyj/applet/domain/vo/DeveloperCreateRefundVo.java new file mode 100644 index 0000000..316ea70 --- /dev/null +++ b/dy-java-applet/src/main/java/com/dyj/applet/domain/vo/DeveloperCreateRefundVo.java @@ -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; + } +} diff --git a/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java b/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java index 75ef1ce..75f3099 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java @@ -122,4 +122,14 @@ public class IndustryTransactionHandler extends AbstractAppletHandler{ baseQuery(body); return getIndustryOpenTransactionClient().industryQuerySettle(body); } + + /** + * 生活服务交易系统->退货退款->开发者发起退款 + * @param body + * @return + */ + public DataAndExtraVo developerCreateRefund(DeveloperCreateRefundQuery body){ + baseQuery(body); + return getIndustryOpenTransactionClient().developerCreateRefund(body); + } } diff --git a/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java b/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java index 824e7fd..8d3ecf6 100644 --- a/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java +++ b/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java @@ -516,7 +516,12 @@ 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") ; diff --git a/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java b/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java index f7a1368..07647fa 100644 --- a/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java +++ b/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java @@ -481,4 +481,17 @@ public class TransactionTest { ); } + /** + * 生活服务交易系统->退货退款->开发者发起退款 + */ + @Test + public void developerCreateRefund(){ + DyAppletClient dyAppletClient = new DyAppletClient(); + System.out.println( + JSON.toJSONString( + dyAppletClient.developerCreateRefund(DeveloperCreateRefundQuery.builder().build()) + ) + ); + } + } From f0bef5270ac93bc9a8296ad4da180751f0688340 Mon Sep 17 00:00:00 2001 From: 353259576 <1048058229@qq.com> Date: Mon, 26 Aug 2024 14:27:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=9F=E6=B4=BB=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E7=B3=BB=E7=BB=9F->=E9=80=80=E8=B4=A7?= =?UTF-8?q?=E9=80=80=E6=AC=BE->=E5=90=8C=E6=AD=A5=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dyj/applet/DyAppletClient.java | 9 ++ .../client/IndustryTransactionClient.java | 8 ++ .../RefundMerchantAuditCallbackQuery.java | 100 ++++++++++++++++++ .../handler/IndustryTransactionHandler.java | 13 ++- .../dyj/common/enums/DyAppletUrlPathEnum.java | 7 +- .../dyj/examples/applet/TransactionTest.java | 13 +++ 6 files changed, 146 insertions(+), 4 deletions(-) create mode 100644 dy-java-applet/src/main/java/com/dyj/applet/domain/query/RefundMerchantAuditCallbackQuery.java diff --git a/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java b/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java index 23db351..1552f14 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java @@ -2157,6 +2157,15 @@ public class DyAppletClient extends BaseClient { return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).developerCreateRefund(body); } + /** + * 生活服务交易系统->退货退款->同步退款审核结果 + * @param body 同步退款审核结果请求值 + * @return + */ + public DataAndExtraVo refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery body){ + return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).refundMerchantAuditCallback(body); + } + /** * 获取抖音号绑定所需的资质模版列表 * diff --git a/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java b/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java index fd618d9..b149ad8 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java @@ -110,4 +110,12 @@ public interface IndustryTransactionClient { */ @Post(value = "${developerCreateRefund}", interceptor = ClientTokenInterceptor.class) DataAndExtraVo developerCreateRefund(@JSONBody DeveloperCreateRefundQuery body); + + /** + * 生活服务交易系统->退货退款->同步退款审核结果 + * @param body 同步退款审核结果请求值 + * @return + */ + @Post(value = "${refundMerchantAuditCallback}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo refundMerchantAuditCallback(@JSONBody RefundMerchantAuditCallbackQuery body); } diff --git a/dy-java-applet/src/main/java/com/dyj/applet/domain/query/RefundMerchantAuditCallbackQuery.java b/dy-java-applet/src/main/java/com/dyj/applet/domain/query/RefundMerchantAuditCallbackQuery.java new file mode 100644 index 0000000..6dc3d76 --- /dev/null +++ b/dy-java-applet/src/main/java/com/dyj/applet/domain/query/RefundMerchantAuditCallbackQuery.java @@ -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; + } + } +} diff --git a/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java b/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java index 75f3099..b287035 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java @@ -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; @@ -132,4 +129,14 @@ public class IndustryTransactionHandler extends AbstractAppletHandler{ baseQuery(body); return getIndustryOpenTransactionClient().developerCreateRefund(body); } + + /** + * 生活服务交易系统->退货退款->同步退款审核结果 + * @param body 同步退款审核结果请求值 + * @return + */ + public DataAndExtraVo refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery body){ + baseQuery(body); + return getIndustryOpenTransactionClient().refundMerchantAuditCallback(body); + } } diff --git a/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java b/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java index 8d3ecf6..097c32a 100644 --- a/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java +++ b/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java @@ -521,7 +521,12 @@ public enum DyAppletUrlPathEnum { /** * 生活服务交易系统->退货退款->开发者发起退款 */ - DEVELOPER_CREATE_REFUND("developerCreateRefund","/api/apps/trade/v2/refund/create_refund") + DEVELOPER_CREATE_REFUND("developerCreateRefund","/api/apps/trade/v2/refund/create_refund"), + + /** + * 生活服务交易系统->退货退款->同步退款审核结果 + */ + REFUND_MERCHANT_AUDIT_CALLBACK("refundMerchantAuditCallback","/api/apps/trade/v2/refund/merchant_audit_callback") ; diff --git a/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java b/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java index 07647fa..2facd29 100644 --- a/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java +++ b/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java @@ -494,4 +494,17 @@ public class TransactionTest { ); } + /** + * 生活服务交易系统->退货退款->同步退款审核结果 + */ + @Test + public void refundMerchantAuditCallback(){ + DyAppletClient dyAppletClient = new DyAppletClient(); + System.out.println( + JSON.toJSONString( + dyAppletClient.refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery.builder().build()) + ) + ); + } + } From 181f0fc5b9fa71f40aecc3cb490e44e1e5bfc40b Mon Sep 17 00:00:00 2001 From: 353259576 <1048058229@qq.com> Date: Tue, 27 Aug 2024 11:52:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=94=9F=E6=B4=BB=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E7=B3=BB=E7=BB=9F->=E9=80=80=E8=B4=A7?= =?UTF-8?q?=E9=80=80=E6=AC=BE->=E6=9F=A5=E8=AF=A2=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dyj/applet/DyAppletClient.java | 11 ++ .../client/IndustryTransactionClient.java | 10 +- .../domain/vo/IndustryQueryRefundVo.java | 158 ++++++++++++++++++ .../handler/IndustryTransactionHandler.java | 10 ++ .../dyj/common/enums/DyAppletUrlPathEnum.java | 7 +- .../dyj/examples/applet/TransactionTest.java | 13 ++ 6 files changed, 206 insertions(+), 3 deletions(-) create mode 100644 dy-java-applet/src/main/java/com/dyj/applet/domain/vo/IndustryQueryRefundVo.java diff --git a/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java b/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java index 1552f14..f3b61b6 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/DyAppletClient.java @@ -2166,6 +2166,17 @@ public class DyAppletClient extends BaseClient { return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).refundMerchantAuditCallback(body); } + + + /** + * 生活服务交易系统->退货退款->查询退款 + * @param body + * @return + */ + public DataAndExtraVo industryQueryRefund(QueryRefundQuery body){ + return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).industryQueryRefund(body); + } + /** * 获取抖音号绑定所需的资质模版列表 * diff --git a/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java b/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java index b149ad8..f253b38 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/client/IndustryTransactionClient.java @@ -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; @@ -118,4 +116,12 @@ public interface IndustryTransactionClient { */ @Post(value = "${refundMerchantAuditCallback}", interceptor = ClientTokenInterceptor.class) DataAndExtraVo refundMerchantAuditCallback(@JSONBody RefundMerchantAuditCallbackQuery body); + + /** + * 生活服务交易系统->退货退款->查询退款 + * @param body + * @return + */ + @Post(value = "${queryRefund}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo industryQueryRefund(@JSONBody QueryRefundQuery body); } diff --git a/dy-java-applet/src/main/java/com/dyj/applet/domain/vo/IndustryQueryRefundVo.java b/dy-java-applet/src/main/java/com/dyj/applet/domain/vo/IndustryQueryRefundVo.java new file mode 100644 index 0000000..5553270 --- /dev/null +++ b/dy-java-applet/src/main/java/com/dyj/applet/domain/vo/IndustryQueryRefundVo.java @@ -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; + + /** + *
  • 退款状态:退款中-PROCESSING
  • 已退款-SUCCESS
  • 退款失败-FAIL
+ */ + private String refund_status; + /** + * 退款金额,单位[分] + */ + private Long refund_total_amount; + /** + * 系统订单信息,开放平台生成的订单号 选填 + */ + private List item_order_detail; + /** + * 退款审核信息 选填 + */ + private RefundMerchantAuditDetail merchant_audit_detail; + + /** + * 退款查询结果列表,最多返回50条 + * (建议开发者用这个字段) + */ + private List 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 getItem_order_detail() { + return item_order_detail; + } + + public IndustryQueryRefundVo setItem_order_detail(List 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 getRefund_list() { + return refund_list; + } + + public IndustryQueryRefundVo setRefund_list(List refund_list) { + this.refund_list = refund_list; + return this; + } +} diff --git a/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java b/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java index b287035..484d610 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/handler/IndustryTransactionHandler.java @@ -139,4 +139,14 @@ public class IndustryTransactionHandler extends AbstractAppletHandler{ baseQuery(body); return getIndustryOpenTransactionClient().refundMerchantAuditCallback(body); } + + /** + * 生活服务交易系统->退货退款->查询退款 + * @param body + * @return + */ + public DataAndExtraVo industryQueryRefund(QueryRefundQuery body){ + baseQuery(body); + return getIndustryOpenTransactionClient().industryQueryRefund(body); + } } diff --git a/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java b/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java index 097c32a..c085116 100644 --- a/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java +++ b/dy-java-common/src/main/java/com/dyj/common/enums/DyAppletUrlPathEnum.java @@ -526,7 +526,12 @@ public enum DyAppletUrlPathEnum { /** * 生活服务交易系统->退货退款->同步退款审核结果 */ - REFUND_MERCHANT_AUDIT_CALLBACK("refundMerchantAuditCallback","/api/apps/trade/v2/refund/merchant_audit_callback") + REFUND_MERCHANT_AUDIT_CALLBACK("refundMerchantAuditCallback","/api/apps/trade/v2/refund/merchant_audit_callback"), + + /** + * 生活服务交易系统->退货退款->查询退款 + */ + QUERY_REFUND("queryRefund","/api/apps/trade/v2/refund/query_refund"), ; diff --git a/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java b/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java index 2facd29..22b6c89 100644 --- a/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java +++ b/dy-java-examples/dy-java-examples-springboot/src/test/java/com/dyj/examples/applet/TransactionTest.java @@ -507,4 +507,17 @@ public class TransactionTest { ); } + /** + * 生活服务交易系统->退货退款->查询退款 + */ + @Test + public void industryQueryRefund(){ + DyAppletClient dyAppletClient = new DyAppletClient(); + System.out.println( + JSON.toJSONString( + dyAppletClient.industryQueryRefund(QueryRefundQuery.builder().build()) + ) + ); + } + }