From 72c8e506e13f3b35476bfd65bfe07c22bf23c755 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期二, 25 三月 2025 07:15:48 +0800
Subject: [PATCH] 氧气调度 调整速率

---
 shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SaveIndDataToPointDataTask.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SaveIndDataToPointDataTask.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SaveIndDataToPointDataTask.java
index 8dc0654..ff6db1b 100644
--- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SaveIndDataToPointDataTask.java
+++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/SaveIndDataToPointDataTask.java
@@ -54,15 +54,26 @@
             YearMonth yearMonth = YearMonth.of(today.getYear(), today.getMonthValue());
             int lengthOfMonth = yearMonth.lengthOfMonth();
             List<ChartParamDTO> chartParamList = mcsApi.getChartParamList(params);
+            logger.info("当前月天数:" + lengthOfMonth);
             chartParamList.forEach(chartParam -> {
+                logger.info("指标编码:" + chartParam.getParamCode());
                 List<ApiIndItemValueDTO> indItemlist = indItemApi.queryIndItemDefaultValue(chartParam.getParamCode());
+                logger.info("查询到的指标值:" + indItemlist);
                 if (indItemlist != null && indItemlist.size() > 0) {
-                    ApiPointValueWriteDTO apiPointValueWriteDTO = new ApiPointValueWriteDTO();
-                    apiPointValueWriteDTO.setPointNo(chartParam.getParamValue());
-                    BigDecimal indValue = (BigDecimal) indItemlist.get(0).getDataValue();
-                    BigDecimal pointValue = indValue.divide(new BigDecimal(lengthOfMonth), 3, RoundingMode.HALF_UP);
-                    apiPointValueWriteDTO.setValue(pointValue);
-                    dataPointApi.writePointRealValue(apiPointValueWriteDTO);
+                    try {
+                        ApiPointValueWriteDTO apiPointValueWriteDTO = new ApiPointValueWriteDTO();
+                        apiPointValueWriteDTO.setPointNo(chartParam.getParamValue());
+                        BigDecimal indValue = BigDecimal.valueOf((Double) indItemlist.get(0).getDataValue());
+                        logger.info("指标值:" + indValue);
+                        BigDecimal pointValue = indValue.divide(new BigDecimal(lengthOfMonth), 3, RoundingMode.HALF_UP);
+                        logger.info("测点值:" + pointValue);
+                        apiPointValueWriteDTO.setValue(pointValue);
+                        logger.info("写入测点值:" + apiPointValueWriteDTO);
+                        dataPointApi.writePointRealValue(apiPointValueWriteDTO);
+                    }catch (Exception ex){
+                        logger.error("SaveIndDataToPointDataTask运行异常" + ex);
+                        ex.printStackTrace();
+                    }
                 }
             });
 

--
Gitblit v1.9.3