From 3c8343535bec2a53855956e25598e2271fc84c0d Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期日, 07 七月 2024 10:28:21 +0800
Subject: [PATCH] 更新测试管理搜索功能

---
 src/main/java/com/zy/asrs/utils/PostMesDataUtils.java |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/PostMesDataUtils.java b/src/main/java/com/zy/asrs/utils/PostMesDataUtils.java
index 981975b..dad036d 100644
--- a/src/main/java/com/zy/asrs/utils/PostMesDataUtils.java
+++ b/src/main/java/com/zy/asrs/utils/PostMesDataUtils.java
@@ -2,6 +2,7 @@
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
 import com.zy.asrs.service.ApiLogService;
 import com.zy.asrs.service.impl.ApiLogServiceImpl;
@@ -15,9 +16,11 @@
 @Slf4j
 public class PostMesDataUtils extends AbstractHandler<String> {
 
-    private ApiLogService apiLogService = new ApiLogServiceImpl();
-
     public ReturnT<String> postMesData(String name,String URL,String mesPath, Object combParam){
+//        if (true){
+//            System.out.println("name:"+name+",URL:"+URL+",mesPath:"+mesPath+",combParam:"+combParam);
+//            return SUCCESS;
+//        }
         if(combParam != null){
             String response = "";
             boolean success = false;
@@ -31,7 +34,9 @@
                         .setJson(JSON.toJSONString(combParam))
                         .build()
                         .doPost();
+                System.out.println("response:"+response);
                 JSONObject jsonObject = JSON.parseObject(response);
+
                 if (jsonObject.getInteger("code").equals(200)) {
                     success = true;
                 } else {
@@ -39,12 +44,13 @@
                     throw new CoolException("涓婃姤"+name);
                 }
             } catch (Exception e) {
-                log.error("涓婃姤澶辫触");
+                log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", URL+"/"+mesPath, JSON.toJSONString(combParam), response);
 //                      TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return FAIL.setMsg(e.getMessage());
             } finally {
                 try {
                     // 淇濆瓨鎺ュ彛鏃ュ織
+                    ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class);
                     apiLogService.save(
                             "涓婃姤"+name,
                             URL +"/"+ mesPath,
@@ -54,7 +60,8 @@
                             response,
                             success
                     );
-                } catch (Exception e) { log.error("", e); }
+                } catch (Exception e) {
+                    log.error("", e); }
             }
         }
         return SUCCESS;

--
Gitblit v1.9.1