From 0e0643aed8857e9b845ee5dcc56cdec652bc89f2 Mon Sep 17 00:00:00 2001 From: jinpengyong <jpy123456> Date: Mon, 28 Aug 2023 15:59:50 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/wb' into qa --- screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java index 9619dba..bd62813 100644 --- a/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java +++ b/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java @@ -205,6 +205,7 @@ QueryWrapper<Device> queryWrapper = new QueryWrapper<>(); queryWrapper.select("mac", "name").in("mac", macs); + queryWrapper.orderByAsc("dev_num","name","id"); List<Device> devices = deviceMapper.selectList(queryWrapper); Map<String,Object> devicesInfo = new HashMap<>(); for (Device device:devices) { @@ -246,8 +247,8 @@ for (HistoryHourly historyHourly:distinctHistoryHourlies) { Map<String,Object> historyHourlyMap = new HashMap<>(); historyHourlyMap.put("mac",mac); - JSONObject value = JSONObject.parseObject(historyHourly.getValue()); - Double sensorValue = Double.parseDouble(value.get(sensorCode).toString()); + JSONObject value= JSONObject.parseObject(historyHourly.getValue()); + Double sensorValue = Objects.nonNull(value)&&Objects.nonNull(value.get(sensorCode))?Double.parseDouble(value.get(sensorCode).toString()):0d; historyHourlyMap.put(sensorCode,sensorValue); Date time = historyHourly.getTime(); String timeStr = DateUtils.dateToDateString(time, DateUtils.yyyy_MM_dd_HH_EN); -- Gitblit v1.8.0