From ea4b6749adbd7dae4ccff32f9f7bd5fcdc0ab3b2 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期二, 10 三月 2026 11:39:02 +0800
Subject: [PATCH] 还款提醒添加日志输出,方便查看记录

---
 fzzy-igdss-inte/src/main/java/com/fzzy/igds/api/v1/ApiV1Controller.java |   93 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 90 insertions(+), 3 deletions(-)

diff --git a/fzzy-igdss-inte/src/main/java/com/fzzy/igds/api/v1/ApiV1Controller.java b/fzzy-igdss-inte/src/main/java/com/fzzy/igds/api/v1/ApiV1Controller.java
index 9309e97..9ca74d6 100644
--- a/fzzy-igdss-inte/src/main/java/com/fzzy/igds/api/v1/ApiV1Controller.java
+++ b/fzzy-igdss-inte/src/main/java/com/fzzy/igds/api/v1/ApiV1Controller.java
@@ -2,6 +2,7 @@
 
 import com.fzzy.igds.api.v1.data.ApiV1Req;
 import com.fzzy.igds.api.v1.data.ApiV1Resp;
+import com.fzzy.igds.api.v1.data.Param3030;
 import com.fzzy.igds.api.v1.service.*;
 import com.fzzy.igds.api.v1.util.ApiV1Constant;
 import com.fzzy.igds.constant.Constant;
@@ -11,12 +12,16 @@
 import lombok.extern.slf4j.Slf4j;
 import com.ruoyi.common.utils.StringUtils;
 import org.springframework.stereotype.Controller;
+import org.springframework.util.StreamUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 
 /**
  * @Description 鐩戠鎺ュ彛瑙f瀽鍏ュ彛
@@ -37,16 +42,21 @@
     @Resource
     private ApiV1Service3021 apiV1Service3021;
     @Resource
+    private ApiV1Service3022 apiV1Service3022;
+    @Resource
     private ApiV1Service3030 apiV1Service3030;
     @Resource
     private ApiV1Service3031 apiV1Service3031;
-
+    @Resource
+    private ApiV1Service3032 apiV1Service3032;
+    @Resource
+    private ApiV1Service3033 apiV1Service3033;
 
     @PostMapping
     @ResponseBody
-    public ApiV1Resp<Object> gateway(@RequestBody ApiV1Req<JSONObject> req) {
+    public ApiV1Resp<Object> gateway(@RequestBody ApiV1Req<Object> req) {
 
-        log.info("璐ㄦ娂鐩戠鎺ュ彛V1锛屾敹鍒板簱鍖虹綉鍏充俊鎭�={}", req);
+        log.debug("璐ㄦ娂鐩戠鎺ュ彛V1锛屾敹鍒板簱鍖虹綉鍏充俊鎭�={}", req.getFunctionId());
         try {
 
             //鍙傛暟鏍¢獙
@@ -77,10 +87,16 @@
                     return apiV1Service3020.analysis(req, gatewaySer);
                 case ApiV1Constant.API_FUNCTION_3021:
                     return apiV1Service3021.analysis(req, gatewaySer);
+                case ApiV1Constant.API_FUNCTION_3022:
+                    return apiV1Service3022.analysis(req, gatewaySer);
                 case ApiV1Constant.API_FUNCTION_3030:
                     return apiV1Service3030.analysis(req, gatewaySer);
                 case ApiV1Constant.API_FUNCTION_3031:
                     return apiV1Service3031.analysis(req, gatewaySer);
+                case ApiV1Constant.API_FUNCTION_3032:
+                    return apiV1Service3032.analysis(req, gatewaySer);
+                case ApiV1Constant.API_FUNCTION_3033:
+                    return apiV1Service3033.analysis(req, gatewaySer);
             }
 
             return ApiV1Resp.error("鎺ュ彛缂栫爜<" + functionId + ">涓嶅瓨鍦紝璇锋牳鏌ワ紒", req);
@@ -94,4 +110,75 @@
 
     }
 
+    //    @PostMapping
+//    @ResponseBody
+//    public ApiV1Resp<Object> receiveRawRequest(HttpServletRequest request) throws IOException {
+//        // 璇诲彇鍘熷璇锋眰浣�
+//        String rawJson = StreamUtils.copyToString(request.getInputStream(), StandardCharsets.UTF_8);
+//        System.out.println("鍘熷璇锋眰JSON锛�" + rawJson);
+////        System.out.println("绗�92鍒楀瓧绗︼細" + (rawJson.length() >= 92 ? rawJson.charAt(91) : "闀垮害涓嶈冻"));
+//        rawJson = cleanInvalidUtf8(rawJson);
+//        ApiV1Req<Object> req = JSONObject.parseObject(rawJson, ApiV1Req.class);
+//
+//
+//        log.debug("璐ㄦ娂鐩戠鎺ュ彛V1锛屾敹鍒板簱鍖虹綉鍏充俊鎭�={}", req.getFunctionId());
+//        try {
+//
+//            //鍙傛暟鏍¢獙
+//            if (req == null) {
+//                return ApiV1Resp.error("鍙傛暟鏈夎锛�", req);
+//            }
+//
+//            //鏍¢獙鎺ュ彛缂栫爜鍜岀綉鍏砈N
+//            if (StringUtils.isEmpty(req.getFunctionId()) || StringUtils.isEmpty(req.getSn())) {
+//                return ApiV1Resp.error("鍙傛暟鏈夎锛�", req);
+//            }
+//
+//            //鏍¢獙缃戝叧鏄惁瀛樺湪
+//            GatewaySer gatewaySer = gatewaySerService.getCacheSerById(null, req.getSn());
+//            if (null == gatewaySer) {
+//                return ApiV1Resp.error("褰撳墠缃戝叧<SN=" + req.getSn() + ">鏆傛湭娣诲姞锛岃鏍告煡锛�", req);
+//            }
+//
+//            //寮傛鏇存柊缃戝叧鐘舵��
+//            gatewaySerService.updateStatus(gatewaySer, Constant.YN_Y, ApiV1Constant.API_FUNCTION_3010.equals(req.getFunctionId()));
+//
+//            //瑙f瀽
+//            String functionId = req.getFunctionId();
+//            switch (functionId) {
+//                case ApiV1Constant.API_FUNCTION_3010:
+//                    return apiV1Service3010.analysis(req, gatewaySer);
+//                case ApiV1Constant.API_FUNCTION_3020:
+//                    return apiV1Service3020.analysis(req, gatewaySer);
+//                case ApiV1Constant.API_FUNCTION_3021:
+//                    return apiV1Service3021.analysis(req, gatewaySer);
+//                case ApiV1Constant.API_FUNCTION_3022:
+//                    return apiV1Service3022.analysis(req, gatewaySer);
+//                case ApiV1Constant.API_FUNCTION_3030:
+//                    return apiV1Service3030.analysis(req, gatewaySer);
+//                case ApiV1Constant.API_FUNCTION_3031:
+//                    return apiV1Service3031.analysis(req, gatewaySer);
+//                case ApiV1Constant.API_FUNCTION_3032:
+//                    return apiV1Service3032.analysis(req, gatewaySer);
+//            }
+//
+//            return ApiV1Resp.error("鎺ュ彛缂栫爜<" + functionId + ">涓嶅瓨鍦紝璇锋牳鏌ワ紒", req);
+//
+//        } catch (Exception e) {
+//
+//            log.info("璐ㄦ娂鐩戠鎺ュ彛V1锛屾帴鍙hВ鏋愬紓甯�={}", e.toString());
+//
+//            return ApiV1Resp.error("瑙f瀽寮傚父锛�", req);
+//        }
+////        // 鍚庣画閫昏緫...
+////        return "success";
+//    }
+
+    // 娓呯悊鏃犳晥UTF-8瀛楃鍜屾帶鍒跺瓧绗�
+    public static String cleanInvalidUtf8(String json) {
+        if (json == null) return null;
+        // 绉婚櫎鏃犳晥UTF-8瀛楄妭鍜屾帶鍒跺瓧绗︼紙闄や簡鎹㈣銆佸洖杞︺�佸埗琛ㄧ锛�
+        return json.replaceAll("[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x9F\\xC1]", "");
+    }
+
 }

--
Gitblit v1.9.3