From 819124be8f16794d409a67f58d5257aef37d9b64 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期四, 17 九月 2026 14:26:14 +0800
Subject: [PATCH] chore(导游端): 更新应用配置与图标素材

---
 backend/src/main/java/com/tourguide/common/huifu/DouGongNotifyController.java |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/backend/src/main/java/com/tourguide/common/huifu/DouGongNotifyController.java b/backend/src/main/java/com/tourguide/common/huifu/DouGongNotifyController.java
index 86252cd..97ec2cf 100644
--- a/backend/src/main/java/com/tourguide/common/huifu/DouGongNotifyController.java
+++ b/backend/src/main/java/com/tourguide/common/huifu/DouGongNotifyController.java
@@ -3,6 +3,7 @@
 import com.alibaba.fastjson.JSONObject;
 import com.tourguide.modules.order.service.HuifuPaymentCallbackService;
 import com.tourguide.modules.order.service.HuifuRefundCallbackService;
+import com.tourguide.modules.finance.service.GuideWithdrawalService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -16,20 +17,23 @@
  * 备注:该控制器只做参数校验、验签和日志记录,订单状态落库应在后续服务层按 req_seq_id 幂等处理。
  */
 @RestController
-@RequestMapping("/base/dougong")
+@RequestMapping({"/base/dougong", "/api/base/dougong"})
 public class DouGongNotifyController {
     private static final Logger log = LoggerFactory.getLogger(DouGongNotifyController.class);
 
     private final HuifuCallbackVerifier callbackVerifier;
     private final HuifuPaymentCallbackService paymentCallbackService;
     private final HuifuRefundCallbackService refundCallbackService;
+    private final GuideWithdrawalService withdrawalService;
 
     public DouGongNotifyController(HuifuCallbackVerifier callbackVerifier,
                                    HuifuPaymentCallbackService paymentCallbackService,
-                                   HuifuRefundCallbackService refundCallbackService) {
+                                   HuifuRefundCallbackService refundCallbackService,
+                                   GuideWithdrawalService withdrawalService) {
         this.callbackVerifier = callbackVerifier;
         this.paymentCallbackService = paymentCallbackService;
         this.refundCallbackService = refundCallbackService;
+        this.withdrawalService = withdrawalService;
     }
 
     @PostMapping("/pay-notify")
@@ -73,7 +77,14 @@
     @PostMapping("/encashment")
     public String encashment(@RequestParam(value = "sign", required = false) String sign,
                              @RequestParam(value = "resp_data", required = false) String respData) {
-        return handleNotify("dougong-encashment", sign, respData);
+        try {
+            JSONObject body = callbackVerifier.verify(sign, respData);
+            withdrawalService.handleCallback(body);
+            return "200";
+        } catch (Exception exception) {
+            log.warn("dougong-encashment callback failed: {}", exception.getMessage());
+            return "FAIL";
+        }
     }
 
     private String handleNotify(String bizName, String sign, String respData) {

--
Gitblit v1.7.1