From 077f6864ba2c9e141be36beebffbb6ae2339cfab Mon Sep 17 00:00:00 2001 From: 353259576 <1048058229@qq.com> Date: Fri, 9 Aug 2024 14:20:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=B4=BB=E6=9C=8D=E5=8A=A1=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E7=B3=BB=E7=BB=9F->=E6=A0=B8=E9=94=80->=E6=8A=96?= =?UTF-8?q?=E9=9F=B3=E7=A0=81->=E6=92=A4=E9=94=80=E6=A0=B8=E9=94=80?= 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 | 9 ++ .../domain/query/VerifyCancelQuery.java | 99 +++++++++++++++++++ .../handler/IndustryTransactionHandler.java | 11 +++ .../dyj/common/enums/DyAppletUrlPathEnum.java | 7 +- .../dyj/examples/applet/TransactionTest.java | 13 +++ 6 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 dy-java-applet/src/main/java/com/dyj/applet/domain/query/VerifyCancelQuery.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 bfefbdf..712c394 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 @@ -2117,6 +2117,15 @@ public class DyAppletClient extends BaseClient { return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).deliveryVerify(body); } + /** + * 生活服务交易系统->核销->抖音码->撤销核销 + * @param body 撤销核销请求值 + * @return + */ + public DataAndExtraVo verifyCancel(VerifyCancelQuery body){ + return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).verifyCancel(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 57fab14..112a77c 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 @@ -8,6 +8,7 @@ import com.dyj.applet.domain.query.*; 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; @@ -74,4 +75,12 @@ public interface IndustryTransactionClient { */ @Post(value = "${deliveryVerify}", interceptor = ClientTokenInterceptor.class) DataAndExtraVo deliveryVerify(@JSONBody DeliveryVerifyQuery body); + + /** + * 生活服务交易系统->核销->抖音码->撤销核销 + * @param body 撤销核销请求值 + * @return + */ + @Post(value = "${verifyCancel}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo verifyCancel(@JSONBody VerifyCancelQuery body); } diff --git a/dy-java-applet/src/main/java/com/dyj/applet/domain/query/VerifyCancelQuery.java b/dy-java-applet/src/main/java/com/dyj/applet/domain/query/VerifyCancelQuery.java new file mode 100644 index 0000000..6eb0901 --- /dev/null +++ b/dy-java-applet/src/main/java/com/dyj/applet/domain/query/VerifyCancelQuery.java @@ -0,0 +1,99 @@ +package com.dyj.applet.domain.query; + +import com.dyj.common.domain.query.BaseQuery; + +/** + * 撤销核销请求值 + */ +public class VerifyCancelQuery extends BaseQuery { + + /** + * 代表一张券码的标识 + */ + private String certificate_id; + /** + * 需要撤销的certificate_id所属的订单id + */ + private String order_id; + /** + * 代表券码一次核销的唯一标识(验券时返回) + */ + private String verify_id; + + public String getCertificate_id() { + return certificate_id; + } + + public VerifyCancelQuery setCertificate_id(String certificate_id) { + this.certificate_id = certificate_id; + return this; + } + + public String getOrder_id() { + return order_id; + } + + public VerifyCancelQuery setOrder_id(String order_id) { + this.order_id = order_id; + return this; + } + + public String getVerify_id() { + return verify_id; + } + + public VerifyCancelQuery setVerify_id(String verify_id) { + this.verify_id = verify_id; + return this; + } + + public static VerifyCancelQueryBuilder builder() { + return new VerifyCancelQueryBuilder(); + } + + public static final class VerifyCancelQueryBuilder { + private String certificate_id; + private String order_id; + private String verify_id; + private Integer tenantId; + private String clientKey; + + private VerifyCancelQueryBuilder() { + } + + public VerifyCancelQueryBuilder certificateId(String certificateId) { + this.certificate_id = certificateId; + return this; + } + + public VerifyCancelQueryBuilder orderId(String orderId) { + this.order_id = orderId; + return this; + } + + public VerifyCancelQueryBuilder verifyId(String verifyId) { + this.verify_id = verifyId; + return this; + } + + public VerifyCancelQueryBuilder tenantId(Integer tenantId) { + this.tenantId = tenantId; + return this; + } + + public VerifyCancelQueryBuilder clientKey(String clientKey) { + this.clientKey = clientKey; + return this; + } + + public VerifyCancelQuery build() { + VerifyCancelQuery verifyCancelQuery = new VerifyCancelQuery(); + verifyCancelQuery.setCertificate_id(certificate_id); + verifyCancelQuery.setOrder_id(order_id); + verifyCancelQuery.setVerify_id(verify_id); + verifyCancelQuery.setTenantId(tenantId); + verifyCancelQuery.setClientKey(clientKey); + return verifyCancelQuery; + } + } +} 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 2d58e58..1398076 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 @@ -8,6 +8,7 @@ import com.dyj.applet.domain.vo.*; 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; /** @@ -88,4 +89,14 @@ public class IndustryTransactionHandler extends AbstractAppletHandler{ baseQuery(body); return getIndustryOpenTransactionClient().deliveryVerify(body); } + + /** + * 生活服务交易系统->核销->抖音码->撤销核销 + * @param body 撤销核销请求值 + * @return + */ + public DataAndExtraVo verifyCancel(VerifyCancelQuery body){ + baseQuery(body); + return getIndustryOpenTransactionClient().verifyCancel(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 09cac75..46fb35d 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 @@ -498,9 +498,14 @@ public enum DyAppletUrlPathEnum { DELIVERY_PREPARE("deliveryPrepare", "/api/apps/trade/v2/fulfillment/delivery_prepare"), /** - * 验券 + * 生活服务交易系统->核销->抖音码->验券 */ DELIVERY_VERIFY("deliveryVerify", "/api/apps/trade/v2/fulfillment/delivery_verify"), + + /** + * 生活服务交易系统->核销->抖音码->撤销核销 + */ + VERIFY_CANCEL("verifyCancel", "/api/trade/v2/fulfillment/verify_cancel") ; 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 70edc04..c2bc122 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 @@ -441,4 +441,17 @@ public class TransactionTest { ); } + /** + * 生活服务交易系统->核销->抖音码->撤销核销 + */ + @Test + public void verifyCancel(){ + DyAppletClient dyAppletClient = new DyAppletClient(); + System.out.println( + JSON.toJSONString( + dyAppletClient.verifyCancel(VerifyCancelQuery.builder().build()) + ) + ); + } + }