From 411fa85361e5f4d4094f25a2eaeb0f619f475fce Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Thu, 23 Sep 2021 11:16:53 +0800
Subject: [PATCH] 日数据定时任务update
---
screen-job/src/main/java/com/moral/api/service/impl/HistoryDailyServiceImpl.java | 12 +++---------
screen-job/src/main/resources/mapper/HistoryHourlyMapper.xml | 4 ++--
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/screen-job/src/main/java/com/moral/api/service/impl/HistoryDailyServiceImpl.java b/screen-job/src/main/java/com/moral/api/service/impl/HistoryDailyServiceImpl.java
index a3d4154..fa7187f 100644
--- a/screen-job/src/main/java/com/moral/api/service/impl/HistoryDailyServiceImpl.java
+++ b/screen-job/src/main/java/com/moral/api/service/impl/HistoryDailyServiceImpl.java
@@ -79,18 +79,17 @@
//���������������������������
List<Map<String, Object>> insertData = new ArrayList<>();
- data.forEach((key, value) -> {
+ data.forEach((mac, value) -> {
Map<String, Object> dataMap = new HashMap<>();
Map<String, Object> jsonMap = new HashMap<>();
- dataMap.put("mac", key);
+ dataMap.put("mac", mac);
dataMap.put("time", start);
//���������������������������������������������������
List<Map<String, Object>> tempValue = new ArrayList<>(value);
- //������������������������0������������O3������������������������������1���-8���
+ //������������������������0������������O3������������������������������1���-8���
value.removeIf(map -> ((Date) map.get("time")).getTime() == start.getTime());
-
Map<String, Object> params = new HashMap<>();
params.put("data", value);
params.put("type", "day");
@@ -158,7 +157,6 @@
}
if (ObjectUtils.isEmpty(sensorValue)) {
- System.out.println(456);
return null;
}
@@ -179,10 +177,6 @@
return null;
}
}
- if ("a00e12".equals(sensorCode)) {
- System.out.println(key + "==" + sensorCode + "==" + v.get("time") + "==" + aDouble);
- }
-
return DoubleStream.of(aDouble);
}).average();
if (optionalDouble.isPresent()) {
diff --git a/screen-job/src/main/resources/mapper/HistoryHourlyMapper.xml b/screen-job/src/main/resources/mapper/HistoryHourlyMapper.xml
index 6b4558a..88153ae 100644
--- a/screen-job/src/main/resources/mapper/HistoryHourlyMapper.xml
+++ b/screen-job/src/main/resources/mapper/HistoryHourlyMapper.xml
@@ -27,9 +27,9 @@
</select>
<select id="selectDailyData" resultType="java.util.Map">
- SELECT mac, `value`
+ SELECT mac, `time`, `value`
FROM history_hourly_${timeUnits}
WHERE `time` <![CDATA[>=]]> #{start}
- AND `time` <![CDATA[<]]> #{end}
+ AND `time` <![CDATA[<=]]> #{end}
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0