From cb804c95c84cb9b3d0da79703ab803830968e3e3 Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期四, 23 一月 2025 12:48:27 +0800
Subject: [PATCH] 新增log

---
 shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SyncSegmentedDataTask.java |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SyncSegmentedDataTask.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SyncSegmentedDataTask.java
index 7544dac..d0ba8a1 100644
--- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SyncSegmentedDataTask.java
+++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SyncSegmentedDataTask.java
@@ -73,7 +73,9 @@
             String accessToken = "Bearer " + getAccessToken(requestAccessToken);
             //获取保存后的数据
             List<ElectricityPriceSegmentedDTO> list = getElectricityPriceSegmentedList(accessToken);
+            logger.info("开始保存数据:" + JSON.toJSONString(list));
             mcsApi.createElectricityPrice(list);
+            logger.info("保存数据完成");
         } catch (Exception ex) {
             logger.error("syncSegmentedDataTask运行异常");
             ex.printStackTrace();
@@ -110,11 +112,14 @@
     }
 
     public List<ElectricityPriceSegmentedDTO> getElectricityPriceSegmentedList(String accessToken){
+        logger.info("accessToken: " + accessToken);
         Map<String, String> paramsMap = new HashMap<>();
         LocalDate date = LocalDate.now();  // 获取当前日期的LocalDate实例
         String year = String.valueOf(date.getYear());
         paramsMap.put("clock", year);
+        logger.info("请求参数:" + JSON.toJSONString(paramsMap));
         String resp = HttpUtils.sendPost(QUERY_SEGMENTED_DATA_URL, JSON.toJSONString(paramsMap), accessToken);
+        logger.info("获取分段数据的返回值:" + resp);
         JSONObject jsonObject = JSON.parseObject(resp);
         List<ElectricityPriceSegmentedDTO> list = jsonObject.getJSONArray("data").toJavaList(ElectricityPriceSegmentedDTO.class);
         list.forEach(item -> item.setYear(year));

--
Gitblit v1.9.3