jinpengyong
2021-09-01 7607bab6e868a51609164ce111c9d5e1046cd11f
screen-job/src/main/java/com/moral/api/service/impl/HistoryHourlyServiceImpl.java
@@ -2,7 +2,6 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.moral.api.entity.HistoryHourly;
import com.moral.api.entity.Sensor;
import com.moral.api.mapper.HistoryHourlyMapper;
import com.moral.api.mapper.HistoryMinutelyMapper;
@@ -116,14 +115,14 @@
                .collect(Collectors.groupingBy(o -> (String) o.get("mac")));
        //存入数据库的结果集
        List<HistoryHourly> insertData = new ArrayList<>();
        List<Map<String, Object>> insertData = new ArrayList<>();
        data.forEach((key, value) -> {
            HistoryHourly historyHourly = new HistoryHourly();
            historyHourly.setMac(key);
            historyHourly.setTime(end);
            Map<String, Object> jsonMap = new HashMap<>();
            Map<String, Object> historyHourly = new HashMap<>();
            historyHourly.put("mac", key);
            historyHourly.put("time", end);
            Map<String, Object> jsonMap = new HashMap<>();
            Map<String, Object> map = new HashMap<>();
            map.put("data", value);
            map.put("type", "hour");
@@ -211,8 +210,8 @@
                    }
                }
            });
            historyHourly.setValue(JSONObject.toJSONString(jsonMap));
            historyHourly.setVersion((Integer) value.get(0).get("version"));
            historyHourly.put("version", value.get(0).get("version"));
            historyHourly.put("value", JSONObject.toJSONString(jsonMap));
            insertData.add(historyHourly);
        });