From 874dd8d939b4ae61efbb799855c9ddf328722972 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 25 十二月 2024 18:08:08 +0800
Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat

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

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java
index ab3a581..8520d31 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java
@@ -3,6 +3,7 @@
 import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.iailab.framework.common.service.impl.BaseServiceImpl;
+import com.iailab.framework.common.util.date.DateUtils;
 import com.iailab.module.model.mcs.pre.dao.MmItemResultJsonDao;
 import com.iailab.module.model.mcs.pre.entity.MmItemResultJsonEntity;
 import com.iailab.module.model.mcs.pre.service.MmItemResultJsonService;
@@ -25,11 +26,11 @@
         implements MmItemResultJsonService {
 
     @Override
-    public List<Object[]> getData(String outputId, Date predictTime) {
+    public List<Object[]> getData(String outputId, Date predictTime, String timeFormat) {
         List<Object[]> result = new ArrayList<>();
         QueryWrapper<MmItemResultJsonEntity> wrapper = new QueryWrapper<>();
         wrapper.eq("outputid", outputId)
-                .eq("predicttime", predictTime);
+                .eq("predicttime", DateUtils.format(predictTime,timeFormat));
         MmItemResultJsonEntity data = baseDao.selectOne(wrapper);
         if (data == null || StringUtils.isBlank(data.getJsonvalue())) {
             return result;
@@ -41,10 +42,19 @@
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(predictTime);
         valueList.forEach(value -> {
-            Object[] dv = { calendar.getTime(), value};
+            Object[] dv = {DateUtils.format(calendar.getTime(), timeFormat), value};
             calendar.add(Calendar.MINUTE, 1);
             result.add(dv);
         });
         return result;
     }
+
+    @Override
+    public String getDoubleData(String outputId, Date predictTime) {
+        QueryWrapper<MmItemResultJsonEntity> wrapper = new QueryWrapper<>();
+        wrapper.eq("outputid", outputId)
+                .eq("predicttime", predictTime);
+        MmItemResultJsonEntity mmItemResultJsonEntity = baseDao.selectOne(wrapper);
+        return null == mmItemResultJsonEntity ? null : mmItemResultJsonEntity.getCumulant();
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3