From 2bf2a296ee98bf48026e90da5c7a7b5525fb9f67 Mon Sep 17 00:00:00 2001
From: 换个名字嗨起来 <577530412@qq.com>
Date: 星期四, 25 七月 2024 15:53:24 +0800
Subject: [PATCH] 接收返回值捕获异常,打印log

---
 src/main/java/com/ruoyi/doublePrevention/scheduls/ExecCJReportDateSchedule.java |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/ruoyi/doublePrevention/scheduls/ExecCJReportDateSchedule.java b/src/main/java/com/ruoyi/doublePrevention/scheduls/ExecCJReportDateSchedule.java
index bdaab53..008cea5 100644
--- a/src/main/java/com/ruoyi/doublePrevention/scheduls/ExecCJReportDateSchedule.java
+++ b/src/main/java/com/ruoyi/doublePrevention/scheduls/ExecCJReportDateSchedule.java
@@ -95,7 +95,7 @@
     @Transactional
 //    @Scheduled(cron = "0 0 23 * * ?")    //每天晚上23点执行一次0 0 22,23 * * ?
 //    @Scheduled(cron = "0 0 22,23 * * ?")    //每天晚上22、23点执行一次
-    @Scheduled(cron = "0 0/20 * * * ? ")    // 分钟
+    @Scheduled(cron = "0 0/10 * * * ? ")    // 分钟
 //    @Scheduled(cron = "0/30 * * * * ?")
     public void execReportDateSchedule() throws UnsupportedEncodingException {
         logger.info("【####】上报数据开始...");
@@ -588,7 +588,7 @@
 //            System.out.println(Arrays.toString(reportRecordFromTaskList.toArray()));
             //数据加密
             String AESReportRecordFromTask = encrypt(JSONObject.toJSONString(reportRecordFromTaskList), key.getBytes(), iv.getBytes());
-
+            logger.info("【test】数据加密完成,开始上报数据");
             StringBuffer recordFromTaskResultBuffer = null;
             //上报数据
             try {
@@ -631,9 +631,19 @@
                 e.printStackTrace();
             }
 
+            logger.info("【test】接收返回值");
+            CJReportResultData CJRecordFromTaskResult = new CJReportResultData();
+            try {
+                CJRecordFromTaskResult =  JSONObject.parseObject(recordFromTaskResultBuffer.toString(), CJReportResultData.class);
+            }catch (Exception e){
+                e.printStackTrace();
+                logger.info("【test】接收返回值异常");
+            }
+
             //接收返回值,保存返回值
-            CJReportResultData CJRecordFromTaskResult = JSONObject.parseObject(recordFromTaskResultBuffer.toString(), CJReportResultData.class);
+//            CJReportResultData CJRecordFromTaskResult = JSONObject.parseObject(recordFromTaskResultBuffer.toString(), CJReportResultData.class);
             //接收返回值,保存返回值
+            logger.info("【test】保存上报结果");
             List<String> errorIdList= new ArrayList<>();
             Data data = JSONObject.parseObject(CJRecordFromTaskResult.getData(), Data.class);
             //保存失败结果

--
Gitblit v1.9.2