From 09cac40350dfb6f31f6e7fb7bab4360a342112ed Mon Sep 17 00:00:00 2001 From: 353259576 <1048058229@qq.com> Date: Mon, 18 Nov 2024 09:25:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=8C=E4=B8=9A?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E7=B3=BB=E7=BB=9F=E6=8E=A5=E5=8F=A3=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E4=B8=BAdeveloper.toutiao.com=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dyj/applet/DyAppletClient.java | 52 ++-- .../client/IndustryTransactionClient.java | 207 +------------- .../dyj/applet/client/TransactionClient.java | 203 +++++++++++++- .../handler/IndustryTransactionHandler.java | 250 ----------------- .../applet/handler/TransactionHandler.java | 253 ++++++++++++++++++ .../query/BaseTransactionMerchantQuery.java | 2 + 6 files changed, 485 insertions(+), 482 deletions(-) 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 7e2ab14..9dd4f36 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 @@ -2054,7 +2054,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo queryIndustryOrder(QueryIndustryOrderQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryIndustryOrder(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryIndustryOrder(body); } /** @@ -2064,7 +2064,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo queryIndustryItemOrderInfo(QueryIndustryItemOrderInfoQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryIndustryItemOrderInfo(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryIndustryItemOrderInfo(body); } @@ -2075,7 +2075,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo queryIndustryOrderCps(QueryIndustryOrderCpsQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryIndustryOrderCps(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryIndustryOrderCps(body); } /** @@ -2085,7 +2085,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DySimpleResult preCreateIndustryOrder(PreCreateIndustryOrderQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).preCreateIndustryOrder(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).preCreateIndustryOrder(body); } @@ -2095,7 +2095,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DySimpleResult queryAndCalculateMarketing(QueryAndCalculateMarketingQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryAndCalculateMarketing(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryAndCalculateMarketing(body); } @@ -2106,7 +2106,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo deliveryPrepare(DeliveryPrepareQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).deliveryPrepare(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).deliveryPrepare(body); } /** @@ -2115,7 +2115,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo deliveryVerify(DeliveryVerifyQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).deliveryVerify(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).deliveryVerify(body); } /** @@ -2125,7 +2125,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo verifyCancel(VerifyCancelQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).verifyCancel(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).verifyCancel(body); } @@ -2136,7 +2136,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo pushDelivery(PushDeliveryQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).pushDelivery(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).pushDelivery(body); } /** @@ -2145,7 +2145,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo> industryQuerySettle(IndustryQuerySettleQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).industryQuerySettle(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).industryQuerySettle(body); } /** @@ -2154,7 +2154,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo developerCreateRefund(DeveloperCreateRefundQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).developerCreateRefund(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).developerCreateRefund(body); } /** @@ -2163,7 +2163,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).refundMerchantAuditCallback(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).refundMerchantAuditCallback(body); } @@ -2174,7 +2174,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo industryQueryRefund(QueryRefundQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).industryQueryRefund(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).industryQueryRefund(body); } /** @@ -2183,7 +2183,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo createBook(CreateBookQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).createBook(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).createBook(body); } /** @@ -2191,7 +2191,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DataAndExtraVo bookResultCallback(BookResultCallbackQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).bookResultCallback(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).bookResultCallback(body); } /** @@ -2199,7 +2199,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DataAndExtraVo merchantCancelBook(MerchantCancelBookQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).merchantCancelBook(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).merchantCancelBook(body); } @@ -2208,14 +2208,14 @@ public class DyAppletClient extends BaseClient { * @param body */ public DataAndExtraVo userCancelBook(UserCancelBookQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).userCancelBook(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).userCancelBook(body); } /** * 生活服务交易系统->预约->查询预约单信息 */ public DataAndExtraVo> queryBook(QueryBookQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryBook(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryBook(body); } /** @@ -2223,7 +2223,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo closeOrder(CloseOrderQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).closeOrder(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).closeOrder(body); } /** @@ -2231,7 +2231,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DataAndExtraVo queryUserCertificates(QueryUserCertificatesQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryUserCertificates(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).queryUserCertificates(body); } @@ -2240,7 +2240,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DataAndExtraVo orderCanUse(OrderCanUseQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).orderCanUse(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).orderCanUse(body); } @@ -2249,7 +2249,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DySimpleResult updateMerchantConf(UpdateMerchantConfQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).updateMerchantConf(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).updateMerchantConf(body); } /** @@ -2257,7 +2257,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DySimpleResult tradeToolkitQueryText(TradeToolkitQueryTextQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).tradeToolkitQueryText(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).tradeToolkitQueryText(body); } /** @@ -2265,7 +2265,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DySimpleResult buttonWhiteSetting(ButtonWhiteSettingQuery body){ - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).buttonWhiteSetting(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).buttonWhiteSetting(body); } /** @@ -2273,7 +2273,7 @@ public class DyAppletClient extends BaseClient { * @param body */ public DySimpleResult updateMerchantPath(UpdateMerchantPathQuery body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).updateMerchantPath(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).updateMerchantPath(body); } /** @@ -2282,7 +2282,7 @@ public class DyAppletClient extends BaseClient { * @return */ public DataAndExtraVo createSettleV2(CreateSettleV2Query body) { - return new IndustryTransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).createSettleV2(body); + return new TransactionHandler(configuration().getAgentByTenantId(tenantId, clientKey)).createSettleV2(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 e1c9bde..8cb868f 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 @@ -3,223 +3,20 @@ package com.dyj.applet.client; import com.dtflys.forest.annotation.BaseRequest; import com.dtflys.forest.annotation.JSONBody; import com.dtflys.forest.annotation.Post; -import com.dyj.applet.domain.QueryAndCalculateMarketingResult; -import com.dyj.applet.domain.QueryCertificatesOrderInfo; import com.dyj.applet.domain.QueryIndustryItemOrderInfo; 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.ClientTokenInterceptor; import java.util.List; /** - * 交易系统 生活服务交易系统 + * 行业交易系统 */ -@BaseRequest(baseURL = "${domain}") +@BaseRequest(baseURL = "${ttDomain}") public interface IndustryTransactionClient { - - /** - * 查询订单基本信息。 - * @param body 查询订单基本信息。请求值 - * @return - */ - @Post(value = "${queryIndustryOrder}", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo queryIndustryOrder(@JSONBody QueryIndustryOrderQuery body); - - /** - * 查询券状态信息 - * @param body 查询券状态信息请求值 - * @return - */ - @Post(value = "${queryIndustryItemOrderInfo}", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo queryIndustryItemOrderInfo(@JSONBody QueryIndustryItemOrderInfoQuery body); - - /** - * 生活服务交易系统->查询 CPS 信息 - * @param body 查询 CPS 信息请求值 - * @return - */ - @Post(value = "${queryIndustryOrderCps}", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo queryIndustryOrderCps(@JSONBody QueryIndustryOrderCpsQuery body); - - /** - * 生活服务交易系统->预下单->开发者发起下单 - * @param body - * @return - */ - @Post(value = "${preCreateIndustryOrder}", interceptor = ClientTokenInterceptor.class) - DySimpleResult preCreateIndustryOrder(@JSONBody PreCreateIndustryOrderQuery body); - - /** - * 生活服务交易系统->营销算价->查询营销算价 - * @param body - */ - @Post(value = "${queryAndCalculateMarketing}",interceptor = ClientTokenInterceptor.class) - DySimpleResult queryAndCalculateMarketing(@JSONBody QueryAndCalculateMarketingQuery body); - - /** - * 生活服务交易系统->核销->抖音码->验券准备 - * @param body 验券准备请求值 - * @return - */ - @Post(value = "${deliveryPrepare}", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo deliveryPrepare(@JSONBody DeliveryPrepareQuery body); - - - /** - * 生活服务交易系统->核销->抖音码->验券 - * @param body 验券请求值 - * @return - */ - @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); - - /** - * 生活服务交易系统->核销->三方码->推送核销状态 - * @param body 推送核销状态请求值 - * @return - */ - @Post(value = "${pushDelivery}", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo pushDelivery(@JSONBody PushDeliveryQuery body); - - /** - * 生活服务交易系统->分账->查询分账 - * @param body 查询分账请求值 - * @return - */ - @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); - - /** - * 生活服务交易系统->退货退款->同步退款审核结果 - * @param body 同步退款审核结果请求值 - * @return - */ - @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); - - /** - * 生活服务交易系统->预约->创建预约单 - * @param body - * @return - */ - @Post(value = "createBook", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo createBook(@JSONBody CreateBookQuery body); - - /** - * 生活服务交易系统->预约->预约接单结果回调 - * @param body - */ - @Post(value = "bookResultCallback", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo bookResultCallback(@JSONBody BookResultCallbackQuery body); - - /** - * 生活服务交易系统->预约->商家取消预约 - * @param body - */ - @Post(value = "merchantCancelBook", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo merchantCancelBook(@JSONBody MerchantCancelBookQuery body); - - /** - * 生活服务交易系统->预约->用户取消预约 - * @param body - */ - @Post(value = "userCancelBook", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo userCancelBook(@JSONBody UserCancelBookQuery body); - - /** - * 生活服务交易系统->预约->查询预约单信息 - */ - @Post(value = "queryBook", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo> queryBook(@JSONBody QueryBookQuery body); - - /** - * 生活服务交易系统->预下单->关闭订单 - * @return - */ - @Post(value = "closeOrder", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo closeOrder(@JSONBody CloseOrderQuery body); - - /** - * 生活服务交易系统->核销->核销工具->查询用户券列表 - * @param body - */ - @Post(value = "queryUserCertificates", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo queryUserCertificates(@JSONBody QueryUserCertificatesQuery body); - - /** - * 生活服务交易系统->核销->核销工具->查询订单可用门店 - * @param body - */ - @Post(value = "orderCanUse", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo orderCanUse(@JSONBody OrderCanUseQuery body); - - /** - * 生活服务交易系统->核销->核销工具->设置商家展示信息 - * @param body - */ - @Post(value = "updateMerchantConf", interceptor = ClientTokenInterceptor.class) - DySimpleResult updateMerchantConf(@JSONBody UpdateMerchantConfQuery body); - - /** - * 生活服务交易系统->核销->核销工具->查询商家配置文案 - * @param body - */ - @Post(value = "tradeToolkitQueryText", interceptor = ClientTokenInterceptor.class) - DySimpleResult tradeToolkitQueryText(@JSONBody TradeToolkitQueryTextQuery body); - - /** - * 生活服务交易系统->核销->核销工具->设置订单详情页按钮白名单接口 - * @param body - */ - @Post(value = "buttonWhiteSetting", interceptor = ClientTokenInterceptor.class) - DySimpleResult buttonWhiteSetting(@JSONBody ButtonWhiteSettingQuery body); - - /** - * 生活服务交易系统->核销->核销工具->设置小程序跳转path - * @param body - */ - @Post(value = "updateMerchantPath", interceptor = ClientTokenInterceptor.class) - DySimpleResult updateMerchantPath(@JSONBody UpdateMerchantPathQuery body); - - - /** - * 生活服务交易系统->分账->发起分账 - * @param body 发起分账请求值 - * @return - */ - @Post(value = "${createSettleV2}", interceptor = ClientTokenInterceptor.class) - DataAndExtraVo createSettleV2(@JSONBody CreateSettleV2Query body); - /** * 行业交易系统->预下单->查询 CPS 信息 * @param body 查询 CPS 信息请求值 diff --git a/dy-java-applet/src/main/java/com/dyj/applet/client/TransactionClient.java b/dy-java-applet/src/main/java/com/dyj/applet/client/TransactionClient.java index 6c69309..943fa32 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/client/TransactionClient.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/client/TransactionClient.java @@ -8,6 +8,7 @@ import com.dyj.applet.domain.vo.*; import com.dyj.common.domain.DataAndExtraVo; import com.dyj.common.domain.DySimpleResult; import com.dyj.common.domain.query.BaseTransactionMerchantQuery; +import com.dyj.common.domain.vo.BaseVo; import com.dyj.common.interceptor.ClientTokenInterceptor; import com.dyj.common.interceptor.TransactionMerchantTokenInterceptor; @@ -15,7 +16,7 @@ import java.io.InputStream; import java.util.List; /** - * 交易系统 通用交易系统 + * 交易系统 通用交易系统 生活服务交易系统(全融合版) 生活服务交易系统(账号融合版) */ @BaseRequest(baseURL = "${domain}") public interface TransactionClient { @@ -222,4 +223,204 @@ public interface TransactionClient { @Post(value = "${getBill}", interceptor = ClientTokenInterceptor.class) DySimpleResult getBill(@JSONBody GetBillQuery body); + + + + /** + * 查询订单基本信息。 + * @param body 查询订单基本信息。请求值 + * @return + */ + @Post(value = "${queryIndustryOrder}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo queryIndustryOrder(@JSONBody QueryIndustryOrderQuery body); + + /** + * 查询券状态信息 + * @param body 查询券状态信息请求值 + * @return + */ + @Post(value = "${queryIndustryItemOrderInfo}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo queryIndustryItemOrderInfo(@JSONBody QueryIndustryItemOrderInfoQuery body); + + /** + * 生活服务交易系统->查询 CPS 信息 + * @param body 查询 CPS 信息请求值 + * @return + */ + @Post(value = "${queryIndustryOrderCps}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo queryIndustryOrderCps(@JSONBody QueryIndustryOrderCpsQuery body); + + /** + * 生活服务交易系统->预下单->开发者发起下单 + * @param body + * @return + */ + @Post(value = "${preCreateIndustryOrder}", interceptor = ClientTokenInterceptor.class) + DySimpleResult preCreateIndustryOrder(@JSONBody PreCreateIndustryOrderQuery body); + + /** + * 生活服务交易系统->营销算价->查询营销算价 + * @param body + */ + @Post(value = "${queryAndCalculateMarketing}",interceptor = ClientTokenInterceptor.class) + DySimpleResult queryAndCalculateMarketing(@JSONBody QueryAndCalculateMarketingQuery body); + + /** + * 生活服务交易系统->核销->抖音码->验券准备 + * @param body 验券准备请求值 + * @return + */ + @Post(value = "${deliveryPrepare}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo deliveryPrepare(@JSONBody DeliveryPrepareQuery body); + + + /** + * 生活服务交易系统->核销->抖音码->验券 + * @param body 验券请求值 + * @return + */ + @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); + + /** + * 生活服务交易系统->核销->三方码->推送核销状态 + * @param body 推送核销状态请求值 + * @return + */ + @Post(value = "${pushDelivery}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo pushDelivery(@JSONBody PushDeliveryQuery body); + + /** + * 生活服务交易系统->分账->查询分账 + * @param body 查询分账请求值 + * @return + */ + @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); + + /** + * 生活服务交易系统->退货退款->同步退款审核结果 + * @param body 同步退款审核结果请求值 + * @return + */ + @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); + + /** + * 生活服务交易系统->预约->创建预约单 + * @param body + * @return + */ + @Post(value = "createBook", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo createBook(@JSONBody CreateBookQuery body); + + /** + * 生活服务交易系统->预约->预约接单结果回调 + * @param body + */ + @Post(value = "bookResultCallback", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo bookResultCallback(@JSONBody BookResultCallbackQuery body); + + /** + * 生活服务交易系统->预约->商家取消预约 + * @param body + */ + @Post(value = "merchantCancelBook", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo merchantCancelBook(@JSONBody MerchantCancelBookQuery body); + + /** + * 生活服务交易系统->预约->用户取消预约 + * @param body + */ + @Post(value = "userCancelBook", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo userCancelBook(@JSONBody UserCancelBookQuery body); + + /** + * 生活服务交易系统->预约->查询预约单信息 + */ + @Post(value = "queryBook", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo> queryBook(@JSONBody QueryBookQuery body); + + /** + * 生活服务交易系统->预下单->关闭订单 + * @return + */ + @Post(value = "closeOrder", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo closeOrder(@JSONBody CloseOrderQuery body); + + /** + * 生活服务交易系统->核销->核销工具->查询用户券列表 + * @param body + */ + @Post(value = "queryUserCertificates", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo queryUserCertificates(@JSONBody QueryUserCertificatesQuery body); + + /** + * 生活服务交易系统->核销->核销工具->查询订单可用门店 + * @param body + */ + @Post(value = "orderCanUse", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo orderCanUse(@JSONBody OrderCanUseQuery body); + + /** + * 生活服务交易系统->核销->核销工具->设置商家展示信息 + * @param body + */ + @Post(value = "updateMerchantConf", interceptor = ClientTokenInterceptor.class) + DySimpleResult updateMerchantConf(@JSONBody UpdateMerchantConfQuery body); + + /** + * 生活服务交易系统->核销->核销工具->查询商家配置文案 + * @param body + */ + @Post(value = "tradeToolkitQueryText", interceptor = ClientTokenInterceptor.class) + DySimpleResult tradeToolkitQueryText(@JSONBody TradeToolkitQueryTextQuery body); + + /** + * 生活服务交易系统->核销->核销工具->设置订单详情页按钮白名单接口 + * @param body + */ + @Post(value = "buttonWhiteSetting", interceptor = ClientTokenInterceptor.class) + DySimpleResult buttonWhiteSetting(@JSONBody ButtonWhiteSettingQuery body); + + /** + * 生活服务交易系统->核销->核销工具->设置小程序跳转path + * @param body + */ + @Post(value = "updateMerchantPath", interceptor = ClientTokenInterceptor.class) + DySimpleResult updateMerchantPath(@JSONBody UpdateMerchantPathQuery body); + + + /** + * 生活服务交易系统->分账->发起分账 + * @param body 发起分账请求值 + * @return + */ + @Post(value = "${createSettleV2}", interceptor = ClientTokenInterceptor.class) + DataAndExtraVo createSettleV2(@JSONBody CreateSettleV2Query body); } 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 0adee7a..218c270 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 @@ -24,257 +24,7 @@ public class IndustryTransactionHandler extends AbstractAppletHandler{ } - /** - * 查询订单基本信息。 - * @param body 查询订单基本信息。请求值 - * @return - */ - public DataAndExtraVo queryIndustryOrder(QueryIndustryOrderQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().queryIndustryOrder(body); - } - /** - * 查询券状态信息 - * @param body 查询券状态信息请求值 - * @return - */ - public DataAndExtraVo queryIndustryItemOrderInfo(QueryIndustryItemOrderInfoQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().queryIndustryItemOrderInfo(body); - } - - /** - * 生活服务交易系统->查询 CPS 信息 - * @param body 查询 CPS 信息请求值 - * @return - */ - public DataAndExtraVo queryIndustryOrderCps(QueryIndustryOrderCpsQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().queryIndustryOrderCps(body); - } - - - /** - * 生活服务交易系统->预下单->开发者发起下单 - * @param body - * @return - */ - public DySimpleResult preCreateIndustryOrder(PreCreateIndustryOrderQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().preCreateIndustryOrder(body); - } - - /** - * 生活服务交易系统->营销算价->查询营销算价 - * @param body - */ - public DySimpleResult queryAndCalculateMarketing(QueryAndCalculateMarketingQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().queryAndCalculateMarketing(body); - } - - /** - * 生活服务交易系统->核销->抖音码->验券准备 - * @param body 验券准备请求值 - * @return - */ - public DataAndExtraVo deliveryPrepare(DeliveryPrepareQuery body) { - baseQuery(body); - return getIndustryOpenTransactionClient().deliveryPrepare(body); - } - - /** - * 生活服务交易系统->核销->抖音码->验券 - * @param body 验券请求值 - * @return - */ - public DataAndExtraVo deliveryVerify(DeliveryVerifyQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().deliveryVerify(body); - } - - /** - * 生活服务交易系统->核销->抖音码->撤销核销 - * 生活服务交易系统->核销->三方码->撤销核销 - * @param body 撤销核销请求值 - * @return - */ - public DataAndExtraVo verifyCancel(VerifyCancelQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().verifyCancel(body); - } - - /** - * 生活服务交易系统->核销->三方码->推送核销状态 - * @param body 推送核销状态请求值 - * @return - */ - public DataAndExtraVo pushDelivery(PushDeliveryQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().pushDelivery(body); - } - - /** - * 生活服务交易系统->分账->查询分账 - * @param body 查询分账请求值 - * @return - */ - public DataAndExtraVo> industryQuerySettle(IndustryQuerySettleQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().industryQuerySettle(body); - } - - /** - * 生活服务交易系统->退货退款->开发者发起退款 - * @param body - * @return - */ - public DataAndExtraVo developerCreateRefund(DeveloperCreateRefundQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().developerCreateRefund(body); - } - - /** - * 生活服务交易系统->退货退款->同步退款审核结果 - * @param body 同步退款审核结果请求值 - * @return - */ - public DataAndExtraVo refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().refundMerchantAuditCallback(body); - } - - /** - * 生活服务交易系统->退货退款->查询退款 - * @param body - * @return - */ - public DataAndExtraVo industryQueryRefund(QueryRefundQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().industryQueryRefund(body); - } - - /** - * 生活服务交易系统->预约->创建预约单 - * @param body - * @return - */ - public DataAndExtraVo createBook(CreateBookQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().createBook(body); - } - - /** - * 生活服务交易系统->预约->预约接单结果回调 - * @param body - */ - public DataAndExtraVo bookResultCallback(BookResultCallbackQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().bookResultCallback(body); - } - - - /** - * 生活服务交易系统->预约->商家取消预约 - * @param body - */ - public DataAndExtraVo merchantCancelBook(MerchantCancelBookQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().merchantCancelBook(body); - } - - - /** - * 生活服务交易系统->预约->用户取消预约 - * @param body - */ - public DataAndExtraVo userCancelBook(UserCancelBookQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().userCancelBook(body); - } - - /** - * 生活服务交易系统->预约->查询预约单信息 - */ - public DataAndExtraVo> queryBook(QueryBookQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().queryBook(body); - } - - /** - * 生活服务交易系统->预下单->关闭订单 - * @return - */ - public DataAndExtraVo closeOrder(CloseOrderQuery body) { - baseQuery(body); - return getIndustryOpenTransactionClient().closeOrder(body); - } - - /** - * 生活服务交易系统->核销->核销工具->查询用户券列表 - * @param body - */ - public DataAndExtraVo queryUserCertificates(QueryUserCertificatesQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().queryUserCertificates(body); - } - - - /** - * 生活服务交易系统->核销->核销工具->查询订单可用门店 - * @param body - */ - public DataAndExtraVo orderCanUse(OrderCanUseQuery body) { - baseQuery(body); - return getIndustryOpenTransactionClient().orderCanUse(body); - } - - /** - * 生活服务交易系统->核销->核销工具->设置商家展示信息 - * @param body - */ - public DySimpleResult updateMerchantConf(UpdateMerchantConfQuery body) { - baseQuery(body); - return getIndustryOpenTransactionClient().updateMerchantConf(body); - } - - /** - * 生活服务交易系统->核销->核销工具->查询商家配置文案 - * @param body - */ - public DySimpleResult tradeToolkitQueryText(TradeToolkitQueryTextQuery body) { - baseQuery(body); - return getIndustryOpenTransactionClient().tradeToolkitQueryText(body); - } - - /** - * 生活服务交易系统->核销->核销工具->设置订单详情页按钮白名单接口 - * @param body - */ - public DySimpleResult buttonWhiteSetting(ButtonWhiteSettingQuery body){ - baseQuery(body); - return getIndustryOpenTransactionClient().buttonWhiteSetting(body); - } - - /** - * 生活服务交易系统->核销->核销工具->设置小程序跳转path - * @param body - */ - public DySimpleResult updateMerchantPath(UpdateMerchantPathQuery body) { - baseQuery(body); - return getIndustryOpenTransactionClient().updateMerchantPath(body); - } - - /** - * 生活服务交易系统->分账->发起分账 - * @param body 发起分账请求值 - * @return - */ - public DataAndExtraVo createSettleV2(CreateSettleV2Query body) { - baseQuery(body); - return getIndustryOpenTransactionClient().createSettleV2(body); - } /** * 行业交易系统->预下单->查询 CPS 信息 diff --git a/dy-java-applet/src/main/java/com/dyj/applet/handler/TransactionHandler.java b/dy-java-applet/src/main/java/com/dyj/applet/handler/TransactionHandler.java index c9df641..845ff12 100644 --- a/dy-java-applet/src/main/java/com/dyj/applet/handler/TransactionHandler.java +++ b/dy-java-applet/src/main/java/com/dyj/applet/handler/TransactionHandler.java @@ -7,6 +7,7 @@ import com.dyj.common.config.AgentConfiguration; import com.dyj.common.domain.DataAndExtraVo; import com.dyj.common.domain.DySimpleResult; import com.dyj.common.domain.query.BaseTransactionMerchantQuery; +import com.dyj.common.domain.vo.BaseVo; import java.io.InputStream; import java.util.List; @@ -271,4 +272,256 @@ public class TransactionHandler extends AbstractAppletHandler{ baseQuery(body); return getTransactionClient().getBill(body); } + + /** + * 查询订单基本信息。 + * @param body 查询订单基本信息。请求值 + * @return + */ + public DataAndExtraVo queryIndustryOrder(QueryIndustryOrderQuery body){ + baseQuery(body); + return getTransactionClient().queryIndustryOrder(body); + } + + /** + * 查询券状态信息 + * @param body 查询券状态信息请求值 + * @return + */ + public DataAndExtraVo queryIndustryItemOrderInfo(QueryIndustryItemOrderInfoQuery body){ + baseQuery(body); + return getTransactionClient().queryIndustryItemOrderInfo(body); + } + + /** + * 生活服务交易系统->查询 CPS 信息 + * @param body 查询 CPS 信息请求值 + * @return + */ + public DataAndExtraVo queryIndustryOrderCps(QueryIndustryOrderCpsQuery body){ + baseQuery(body); + return getTransactionClient().queryIndustryOrderCps(body); + } + + + /** + * 生活服务交易系统->预下单->开发者发起下单 + * @param body + * @return + */ + public DySimpleResult preCreateIndustryOrder(PreCreateIndustryOrderQuery body){ + baseQuery(body); + return getTransactionClient().preCreateIndustryOrder(body); + } + + /** + * 生活服务交易系统->营销算价->查询营销算价 + * @param body + */ + public DySimpleResult queryAndCalculateMarketing(QueryAndCalculateMarketingQuery body){ + baseQuery(body); + return getTransactionClient().queryAndCalculateMarketing(body); + } + + /** + * 生活服务交易系统->核销->抖音码->验券准备 + * @param body 验券准备请求值 + * @return + */ + public DataAndExtraVo deliveryPrepare(DeliveryPrepareQuery body) { + baseQuery(body); + return getTransactionClient().deliveryPrepare(body); + } + + /** + * 生活服务交易系统->核销->抖音码->验券 + * @param body 验券请求值 + * @return + */ + public DataAndExtraVo deliveryVerify(DeliveryVerifyQuery body){ + baseQuery(body); + return getTransactionClient().deliveryVerify(body); + } + + /** + * 生活服务交易系统->核销->抖音码->撤销核销 + * 生活服务交易系统->核销->三方码->撤销核销 + * @param body 撤销核销请求值 + * @return + */ + public DataAndExtraVo verifyCancel(VerifyCancelQuery body){ + baseQuery(body); + return getTransactionClient().verifyCancel(body); + } + + /** + * 生活服务交易系统->核销->三方码->推送核销状态 + * @param body 推送核销状态请求值 + * @return + */ + public DataAndExtraVo pushDelivery(PushDeliveryQuery body){ + baseQuery(body); + return getTransactionClient().pushDelivery(body); + } + + /** + * 生活服务交易系统->分账->查询分账 + * @param body 查询分账请求值 + * @return + */ + public DataAndExtraVo> industryQuerySettle(IndustryQuerySettleQuery body){ + baseQuery(body); + return getTransactionClient().industryQuerySettle(body); + } + + /** + * 生活服务交易系统->退货退款->开发者发起退款 + * @param body + * @return + */ + public DataAndExtraVo developerCreateRefund(DeveloperCreateRefundQuery body){ + baseQuery(body); + return getTransactionClient().developerCreateRefund(body); + } + + /** + * 生活服务交易系统->退货退款->同步退款审核结果 + * @param body 同步退款审核结果请求值 + * @return + */ + public DataAndExtraVo refundMerchantAuditCallback(RefundMerchantAuditCallbackQuery body){ + baseQuery(body); + return getTransactionClient().refundMerchantAuditCallback(body); + } + + /** + * 生活服务交易系统->退货退款->查询退款 + * @param body + * @return + */ + public DataAndExtraVo industryQueryRefund(QueryRefundQuery body){ + baseQuery(body); + return getTransactionClient().industryQueryRefund(body); + } + + /** + * 生活服务交易系统->预约->创建预约单 + * @param body + * @return + */ + public DataAndExtraVo createBook(CreateBookQuery body){ + baseQuery(body); + return getTransactionClient().createBook(body); + } + + /** + * 生活服务交易系统->预约->预约接单结果回调 + * @param body + */ + public DataAndExtraVo bookResultCallback(BookResultCallbackQuery body){ + baseQuery(body); + return getTransactionClient().bookResultCallback(body); + } + + + /** + * 生活服务交易系统->预约->商家取消预约 + * @param body + */ + public DataAndExtraVo merchantCancelBook(MerchantCancelBookQuery body){ + baseQuery(body); + return getTransactionClient().merchantCancelBook(body); + } + + + /** + * 生活服务交易系统->预约->用户取消预约 + * @param body + */ + public DataAndExtraVo userCancelBook(UserCancelBookQuery body){ + baseQuery(body); + return getTransactionClient().userCancelBook(body); + } + + /** + * 生活服务交易系统->预约->查询预约单信息 + */ + public DataAndExtraVo> queryBook(QueryBookQuery body){ + baseQuery(body); + return getTransactionClient().queryBook(body); + } + + /** + * 生活服务交易系统->预下单->关闭订单 + * @return + */ + public DataAndExtraVo closeOrder(CloseOrderQuery body) { + baseQuery(body); + return getTransactionClient().closeOrder(body); + } + + /** + * 生活服务交易系统->核销->核销工具->查询用户券列表 + * @param body + */ + public DataAndExtraVo queryUserCertificates(QueryUserCertificatesQuery body){ + baseQuery(body); + return getTransactionClient().queryUserCertificates(body); + } + + + /** + * 生活服务交易系统->核销->核销工具->查询订单可用门店 + * @param body + */ + public DataAndExtraVo orderCanUse(OrderCanUseQuery body) { + baseQuery(body); + return getTransactionClient().orderCanUse(body); + } + + /** + * 生活服务交易系统->核销->核销工具->设置商家展示信息 + * @param body + */ + public DySimpleResult updateMerchantConf(UpdateMerchantConfQuery body) { + baseQuery(body); + return getTransactionClient().updateMerchantConf(body); + } + + /** + * 生活服务交易系统->核销->核销工具->查询商家配置文案 + * @param body + */ + public DySimpleResult tradeToolkitQueryText(TradeToolkitQueryTextQuery body) { + baseQuery(body); + return getTransactionClient().tradeToolkitQueryText(body); + } + + /** + * 生活服务交易系统->核销->核销工具->设置订单详情页按钮白名单接口 + * @param body + */ + public DySimpleResult buttonWhiteSetting(ButtonWhiteSettingQuery body){ + baseQuery(body); + return getTransactionClient().buttonWhiteSetting(body); + } + + /** + * 生活服务交易系统->核销->核销工具->设置小程序跳转path + * @param body + */ + public DySimpleResult updateMerchantPath(UpdateMerchantPathQuery body) { + baseQuery(body); + return getTransactionClient().updateMerchantPath(body); + } + + /** + * 生活服务交易系统->分账->发起分账 + * @param body 发起分账请求值 + * @return + */ + public DataAndExtraVo createSettleV2(CreateSettleV2Query body) { + baseQuery(body); + return getTransactionClient().createSettleV2(body); + } } diff --git a/dy-java-common/src/main/java/com/dyj/common/domain/query/BaseTransactionMerchantQuery.java b/dy-java-common/src/main/java/com/dyj/common/domain/query/BaseTransactionMerchantQuery.java index 02e9734..fc325c6 100644 --- a/dy-java-common/src/main/java/com/dyj/common/domain/query/BaseTransactionMerchantQuery.java +++ b/dy-java-common/src/main/java/com/dyj/common/domain/query/BaseTransactionMerchantQuery.java @@ -1,5 +1,6 @@ package com.dyj.common.domain.query; +import com.alibaba.fastjson.annotation.JSONField; import com.dyj.common.enums.TransactionMerchantTokenTypeEnum; /** @@ -12,6 +13,7 @@ public class BaseTransactionMerchantQuery extends BaseQuery{ */ private TransactionMerchantTokenTypeEnum transactionMerchantTokenType = TransactionMerchantTokenTypeEnum.CLIENT_TOKEN; + @JSONField(serialize = false) public TransactionMerchantTokenTypeEnum getTransactionMerchantTokenType() { return transactionMerchantTokenType; } From b4c2a6a7028862083ad669da02a0e3e183408742 Mon Sep 17 00:00:00 2001 From: 353259576 <1048058229@qq.com> Date: Mon, 18 Nov 2024 09:52:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=80=9A=E7=94=A8=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F->=E8=BF=9B=E4=BB=B6=20token=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/TransactionMerchantTokenTypeEnum.java | 2 +- .../TransactionMerchantTokenInterceptor.java | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dy-java-common/src/main/java/com/dyj/common/enums/TransactionMerchantTokenTypeEnum.java b/dy-java-common/src/main/java/com/dyj/common/enums/TransactionMerchantTokenTypeEnum.java index b40256e..46f3d69 100644 --- a/dy-java-common/src/main/java/com/dyj/common/enums/TransactionMerchantTokenTypeEnum.java +++ b/dy-java-common/src/main/java/com/dyj/common/enums/TransactionMerchantTokenTypeEnum.java @@ -7,7 +7,7 @@ public enum TransactionMerchantTokenTypeEnum { /** * 服务商身份获取token链接 */ - COMPONENT_ACCESS_TOKEN, + TP_THIRD_V2_TOKEN, /** * 非服务商身份获取token链接 diff --git a/dy-java-common/src/main/java/com/dyj/common/interceptor/TransactionMerchantTokenInterceptor.java b/dy-java-common/src/main/java/com/dyj/common/interceptor/TransactionMerchantTokenInterceptor.java index 49ea0a8..b2abf55 100644 --- a/dy-java-common/src/main/java/com/dyj/common/interceptor/TransactionMerchantTokenInterceptor.java +++ b/dy-java-common/src/main/java/com/dyj/common/interceptor/TransactionMerchantTokenInterceptor.java @@ -11,12 +11,14 @@ import com.dyj.common.domain.ClientTokenInfo; import com.dyj.common.domain.query.BaseTransactionMerchantQuery; import com.dyj.common.domain.query.ClientTokenQuery; import com.dyj.common.domain.vo.ClientTokenVo; +import com.dyj.common.domain.vo.TpThirdV2TokenVo; import com.dyj.common.enums.TransactionMerchantTokenTypeEnum; import com.dyj.common.service.IAgentTokenService; import com.dyj.common.utils.DyConfigUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; import javax.annotation.Resource; import java.util.Objects; @@ -45,8 +47,21 @@ public class TransactionMerchantTokenInterceptor implements Interceptor transactionMerchantTokenTypeEnum = query.getTransactionMerchantTokenType(); } } - if (TransactionMerchantTokenTypeEnum.COMPONENT_ACCESS_TOKEN.equals(transactionMerchantTokenTypeEnum)){ + if (TransactionMerchantTokenTypeEnum.TP_THIRD_V2_TOKEN.equals(transactionMerchantTokenTypeEnum)){ //处理服务商token + TpThirdV2TokenVo tpThirdV2Token = DyConfigUtils.getAgentTokenService().getTpThirdV2Token(tenantId, clientKey); + if (Objects.isNull(tpThirdV2Token)) { + AgentConfiguration agent = DyConfigUtils.getAgent(tenantId, clientKey); + tpThirdV2Token = authClient.tpThirdV2Token(agent.getClientKey(), agent.getClientSecret(), agent.getTicket()); + if (Objects.nonNull(tpThirdV2Token) && StringUtils.hasLength(tpThirdV2Token.getComponent_access_token())) { + DyConfigUtils.getAgentTokenService().setTpThirdV2Token(tenantId, clientKey, tpThirdV2Token); + } + } + + if (Objects.isNull(tpThirdV2Token)) { + throw new RuntimeException("component_access_token is null"); + } + request.addHeader("access-token", tpThirdV2Token.getComponent_access_token()); }else { //处理非服务商获取token IAgentTokenService agentTokenService = DyConfigUtils.getAgentTokenService();