From df99e46312fdd5ee830f1451e478f6658e09f9ed Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期一, 16 十二月 2024 13:41:41 +0800
Subject: [PATCH] 导出测点数据 修改

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java
index 7bd1223..99455b0 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java
@@ -75,7 +75,10 @@
             resultJson.setId(UUID.randomUUID().toString());
             resultJson.setOutputid(entry.getKey());
             resultJson.setPredicttime(predictTime);
-            resultJson.setJsonvalue(JSONArray.toJSONString(entry.getValue()));
+            List<Double> jsonValueList = entry.getValue().stream().map(valueVO -> {
+                return valueVO.getDataValue();
+            }).collect(Collectors.toList());
+            resultJson.setJsonvalue(JSONArray.toJSONString(jsonValueList));
             Map<String, Object> map4 = new HashMap(2);
             map4.put("TABLENAME", "T_MM_ITEM_RESULT_JSON");
             map4.put("entity", resultJson);
@@ -117,7 +120,7 @@
     }
 
     @Override
-    public List<Object[]> getData(String outputid, Date startTime, Date endTime) {
+    public List<Object[]> getData(String outputid, Date startTime, Date endTime, String timeFormat) {
         List<Object[]> result = new ArrayList<>();
         QueryWrapper<MmItemResultEntity> queryWrapper = new QueryWrapper<MmItemResultEntity>()
                 .eq("outputid", outputid)
@@ -129,7 +132,7 @@
         }
         list.forEach(item -> {
             Object[] dataItem = new Object[2];
-            dataItem[0] = DateUtils.format(item.getDatatime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND);
+            dataItem[0] = DateUtils.format(item.getDatatime(), timeFormat);
             dataItem[1] = item.getDatavalue().setScale(2, BigDecimal.ROUND_HALF_UP);
             result.add(dataItem);
         });

--
Gitblit v1.9.3