From 656d6f8029f8bf9b2daa9dcc89101a879a70b860 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期三, 03 十二月 2025 23:10:05 +0800
Subject: [PATCH] feat:优先添加执行人

---
 dryad-payment/src/main/java/com/ruoyi/payment/interfaces/controller/PaymentController.java |   96 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 95 insertions(+), 1 deletions(-)

diff --git a/dryad-payment/src/main/java/com/ruoyi/payment/interfaces/controller/PaymentController.java b/dryad-payment/src/main/java/com/ruoyi/payment/interfaces/controller/PaymentController.java
index 311f0bd..e84292f 100644
--- a/dryad-payment/src/main/java/com/ruoyi/payment/interfaces/controller/PaymentController.java
+++ b/dryad-payment/src/main/java/com/ruoyi/payment/interfaces/controller/PaymentController.java
@@ -33,6 +33,7 @@
     /**
      * 鍙戣捣寰俊Native鏀粯
      */
+    @Anonymous()
     @PostMapping("/wechat/native")
     public AjaxResult createWechatNativePayment(@Validated @RequestBody PaymentRequest request) {
         try {
@@ -47,6 +48,7 @@
     /**
      * 鍙戣捣鏀粯瀹濆綋闈粯
      */
+    @Anonymous()
     @PostMapping("/alipay/precreate")
     public AjaxResult createAlipayPrecreate(@Validated @RequestBody PaymentRequest request) {
         try {
@@ -61,6 +63,7 @@
     /**
      * 鍙戣捣鏀粯瀹濆綋闈粯锛堢涓夋柟鎺ュ彛锛�
      */
+    @Anonymous()
     @PostMapping("/alipay/thirdparty/precreate")
     public AjaxResult createAlipayThirdPartyPrecreate(@Validated @RequestBody PaymentRequest request) {
         try {
@@ -75,6 +78,7 @@
     /**
      * 鏌ヨ璁㈠崟
      */
+    @Anonymous()
     @GetMapping("/orders/{orderId}")
     public AjaxResult getOrder(@PathVariable Long orderId) {
         try {
@@ -92,6 +96,7 @@
     /**
      * 鏌ヨ鏈�鏂颁氦鏄�
      */
+    @Anonymous()
     @GetMapping("/orders/{orderId}/transactions/latest")
     public AjaxResult getLatestTransaction(@PathVariable Long orderId) {
         try {
@@ -109,6 +114,7 @@
     /**
      * 鏌ヨ鏀粯瀹濈涓夋柟浜ゆ槗鐘舵��
      */
+    @Anonymous()
     @GetMapping("/alipay/thirdparty/query/{orderId}")
     public AjaxResult queryAlipayThirdPartyTradeStatus(@PathVariable Long orderId) {
         try {
@@ -119,4 +125,92 @@
             return AjaxResult.error("鏌ヨ澶辫触: " + e.getMessage());
         }
     }
-}
+
+    /**
+     * 杞鏌ヨ鏀粯鐘舵�侊紙鐢ㄤ簬鍥炶皟澶辫触鐨勮ˉ鍋挎満鍒讹級
+     * <p>
+     * 杩欎釜鎺ュ彛鐢ㄤ簬鍦ㄦ敮浠樺洖璋冩湭鎴愬姛鏃讹紝涓诲姩杞鏌ヨ鏀粯鐘舵�併��
+     * 鏀寔寰俊鍜屾敮浠樺疂锛堝寘鎷涓夋柟鏀粯瀹濓級銆�
+     * <p>
+     * 杩斿洖缁撴灉鍖呭惈锛�
+     * - orderStatus: 璁㈠崟鐘舵��
+     * - transactionStatus: 浜ゆ槗鐘舵��
+     * - tradeStatus: 绗笁鏂逛氦鏄撶姸鎬�
+     * - needPoll: 鏄惁闇�瑕佺户缁疆璇�
+     * - message: 鎻愮ず淇℃伅
+     * <p>
+     * 寤鸿杞绛栫暐锛�
+     * 1. 棣栨杞锛氱珛鍗宠疆璇�
+     * 2. 鍚庣画杞锛氶棿闅�3-5绉�
+     * 3. 鏈�澶氳疆璇�20娆★紝绾�100绉掑悗鍋滄
+     * 4. 濡傛灉 needPoll=false锛岃〃绀烘敮浠樺凡瀹屾垚鎴栫‘璁ゅけ璐ワ紝鏃犻渶缁х画杞
+     */
+    @Anonymous()
+    @GetMapping("/poll/{orderId}")
+    public AjaxResult pollPaymentStatus(@PathVariable Long orderId) {
+        try {
+            java.util.Map<String, Object> result = paymentService.pollPaymentStatus(orderId);
+            return AjaxResult.success(result);
+        } catch (Exception e) {
+            log.error("杞鏌ヨ鏀粯鐘舵�佸け璐�", e);
+            return AjaxResult.error("鏌ヨ澶辫触: " + e.getMessage());
+        }
+    }
+
+    /**
+     * 鏍规嵁浜ゆ槗鍗曞彿鏌ヨ寰俊鏀粯鐘舵��
+     * <p>
+     * 璇ユ帴鍙g敤浜庨�氳繃鍟嗘埛璁㈠崟鍙凤紙浜ゆ槗鍗曞彿锛夌洿鎺ユ煡璇㈠井淇℃敮浠樼姸鎬併��
+     * <p>
+     * 杩斿洖缁撴灉鍖呭惈锛�
+     * - success: 鏌ヨ鏄惁鎴愬姛
+     * - isPaid: 鏄惁宸叉敮浠�
+     * - tradeState: 浜ゆ槗鐘舵�侊紙SUCCESS-鏀粯鎴愬姛锛孨OTPAY-鏈敮浠橈紝CLOSED-宸插叧闂瓑锛�
+     * - transactionId: 寰俊鏀粯璁㈠崟鍙�
+     * - totalFee: 璁㈠崟閲戦锛堝垎锛�
+     * - timeEnd: 鏀粯瀹屾垚鏃堕棿
+     * - message: 鎻愮ず淇℃伅
+     * 
+     * @param outTradeNo 鍟嗘埛璁㈠崟鍙凤紙浜ゆ槗鍗曞彿锛�
+     */
+    @Anonymous()
+    @GetMapping("/wechat/query/{outTradeNo}")
+    public AjaxResult queryWechatTrade(@PathVariable String outTradeNo) {
+        try {
+            java.util.Map<String, Object> result = paymentService.queryWechatTradeByOutTradeNo(outTradeNo);
+            return AjaxResult.success(result);
+        } catch (Exception e) {
+            log.error("鏌ヨ寰俊浜ゆ槗鐘舵�佸け璐ワ紝浜ゆ槗鍗曞彿: {}", outTradeNo, e);
+            return AjaxResult.error("鏌ヨ澶辫触: " + e.getMessage());
+        }
+    }
+
+    /**
+     * 鏍规嵁浜ゆ槗鍗曞彿鏌ヨ鏀粯瀹濇敮浠樼姸鎬�
+     * <p>
+     * 璇ユ帴鍙g敤浜庨�氳繃鍟嗘埛璁㈠崟鍙凤紙浜ゆ槗鍗曞彿锛夌洿鎺ユ煡璇㈡敮浠樺疂鏀粯鐘舵�併��
+     * <p>
+     * 杩斿洖缁撴灉鍖呭惈锛�
+     * - success: 鏌ヨ鏄惁鎴愬姛
+     * - isPaid: 鏄惁宸叉敮浠�
+     * - tradeStatus: 浜ゆ槗鐘舵�侊紙TRADE_SUCCESS-鏀粯鎴愬姛锛學AIT_BUYER_PAY-绛夊緟浠樻锛孴RADE_CLOSED-宸插叧闂瓑锛�
+     * - tradeNo: 鏀粯瀹濅氦鏄撳彿
+     * - totalAmount: 璁㈠崟閲戦锛堝厓锛�
+     * - sendPayDate: 浜ゆ槗鏀粯鏃堕棿
+     * - buyerLogonId: 涔板鏀粯瀹濊处鍙�
+     * - message: 鎻愮ず淇℃伅
+     * 
+     * @param outTradeNo 鍟嗘埛璁㈠崟鍙凤紙浜ゆ槗鍗曞彿锛�
+     */
+    @Anonymous()
+    @GetMapping("/alipay/query/{outTradeNo}")
+    public AjaxResult queryAlipayTrade(@PathVariable String outTradeNo) {
+        try {
+            java.util.Map<String, Object> result = paymentService.queryAlipayTradeByOutTradeNo(outTradeNo);
+            return AjaxResult.success(result);
+        } catch (Exception e) {
+            log.error("鏌ヨ鏀粯瀹濅氦鏄撶姸鎬佸け璐ワ紝浜ゆ槗鍗曞彿: {}", outTradeNo, e);
+            return AjaxResult.error("鏌ヨ澶辫触: " + e.getMessage());
+        }
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.1