jinpengyong
2024-06-19 32cc13189371ee1e367897a64fbc22f90b53add8
screen-api/src/main/java/com/moral/api/service/impl/HandDeviceServiceImpl.java
@@ -18,6 +18,7 @@
import com.moral.api.entity.HandDevice;
import com.moral.api.entity.HistoryFiveMinutely;
import com.moral.api.entity.HistoryHourly;
import com.moral.api.entity.HistoryMinutely;
import com.moral.api.mapper.DeviceMapper;
import com.moral.api.mapper.HandDeviceMapper;
import com.moral.api.pojo.query.handdevice.HandDevicePageCond;
@@ -158,7 +159,17 @@
                map.put("a21028",ObjectUtils.isEmpty(map.get("a21028"))?0:map.get("a21028"));
                rsMap.add(map);
            }
        }else {
        }else if (type.equals("minute")){
            List<HistoryMinutely> historyMinutelys = historyHourlyService.getHistoryMinutely(mac, startDate, endDate);
            for (HistoryMinutely historyMinutely : historyMinutelys) {
                String value = historyMinutely.getValue();
                Map map = JSON.parseObject(value, Map.class);
                map.put("time",DateUtils.dateToDateString(historyMinutely.getTime()));
                map.put("a21001",ObjectUtils.isEmpty(map.get("a21001"))?0:map.get("a21001"));
                map.put("a21028",ObjectUtils.isEmpty(map.get("a21028"))?0:map.get("a21028"));
                rsMap.add(map);
            }
        }else if (type.equals("minutely")){
            List<HistoryFiveMinutely> historyFiveMinutelies = historyFiveMinutelyService.queryFiveMinutely(mac, startDate, endDate);
            for (HistoryFiveMinutely historyFiveMinutely : historyFiveMinutelies) {
                String value = historyFiveMinutely.getValue();
@@ -198,18 +209,18 @@
                String value = historyHourly.getValue();
                Map map = JSON.parseObject(value, Map.class);
                map1.put("时间",DateUtils.dateToDateString(historyHourly.getTime()));
                map1.put("pm25",ObjectUtils.isEmpty(map.get("a34004"))?0:map.get("a34004"));
                map1.put("pm10",ObjectUtils.isEmpty(map.get("a34002"))?0:map.get("a34002"));
                map1.put("二氧化氮",ObjectUtils.isEmpty(map.get("a21004"))?0:map.get("a21004"));
                map1.put("二氧化硫",ObjectUtils.isEmpty(map.get("a21026"))?0:map.get("a21026"));
                map1.put("一氧化碳",ObjectUtils.isEmpty(map.get("a21005"))?0:map.get("a21005"));
                map1.put("气压",ObjectUtils.isEmpty(map.get("a01006"))?0:map.get("a01006"));
                map1.put("温度",ObjectUtils.isEmpty(map.get("a01001"))?0:map.get("a01001"));
                map1.put("湿度",ObjectUtils.isEmpty(map.get("a01002"))?0:map.get("a01002"));
                map1.put("tvoc",ObjectUtils.isEmpty(map.get("a99054"))?0:map.get("a99054"));
                map1.put("甲醛",ObjectUtils.isEmpty(map.get("a31001"))?0:map.get("a31001"));
                map1.put("硫化氢",ObjectUtils.isEmpty(map.get("a21028"))?0:map.get("a21028"));
                map1.put("氨气",ObjectUtils.isEmpty(map.get("a21001"))?0:map.get("a21001"));
                map1.put("pm25ug/m³",ObjectUtils.isEmpty(map.get("a34004"))?0:map.get("a34004"));
                map1.put("pm10ug/m³",ObjectUtils.isEmpty(map.get("a34002"))?0:map.get("a34002"));
                map1.put("二氧化氮ug/m³",ObjectUtils.isEmpty(map.get("a21004"))?0:map.get("a21004"));
                map1.put("二氧化硫ug/m³",ObjectUtils.isEmpty(map.get("a21026"))?0:map.get("a21026"));
                map1.put("一氧化碳ug/m³",ObjectUtils.isEmpty(map.get("a21005"))?0:map.get("a21005"));
                map1.put("气压hpa",ObjectUtils.isEmpty(map.get("a01006"))?0:map.get("a01006"));
                map1.put("温度℃",ObjectUtils.isEmpty(map.get("a01001"))?0:map.get("a01001"));
                map1.put("湿度%",ObjectUtils.isEmpty(map.get("a01002"))?0:map.get("a01002"));
                map1.put("tvocmg/m³",ObjectUtils.isEmpty(map.get("a99054"))?0:map.get("a99054"));
                map1.put("甲醛mg/m³",ObjectUtils.isEmpty(map.get("a31001"))?0:map.get("a31001"));
                map1.put("硫化氢ppm",ObjectUtils.isEmpty(map.get("a21028"))?0:map.get("a21028"));
                map1.put("氨气ug/m³",ObjectUtils.isEmpty(map.get("a21001"))?0:map.get("a21001"));
                rsMap.add(map1);
            }
        }else {
@@ -219,18 +230,18 @@
                String value = historyFiveMinutely.getValue();
                Map map = JSON.parseObject(value, Map.class);
                map1.put("时间",DateUtils.dateToDateString(historyFiveMinutely.getTime()));
                map1.put("pm25",ObjectUtils.isEmpty(map.get("a34004"))?0:map.get("a34004"));
                map1.put("pm10",ObjectUtils.isEmpty(map.get("a34002"))?0:map.get("a34002"));
                map1.put("二氧化氮",ObjectUtils.isEmpty(map.get("a21004"))?0:map.get("a21004"));
                map1.put("二氧化硫",ObjectUtils.isEmpty(map.get("a21026"))?0:map.get("a21026"));
                map1.put("一氧化碳",ObjectUtils.isEmpty(map.get("a21005"))?0:map.get("a21005"));
                map1.put("气压",ObjectUtils.isEmpty(map.get("a01006"))?0:map.get("a01006"));
                map1.put("温度",ObjectUtils.isEmpty(map.get("a01001"))?0:map.get("a01001"));
                map1.put("湿度",ObjectUtils.isEmpty(map.get("a01002"))?0:map.get("a01002"));
                map1.put("tvoc",ObjectUtils.isEmpty(map.get("a99054"))?0:map.get("a99054"));
                map1.put("甲醛",ObjectUtils.isEmpty(map.get("a31001"))?0:map.get("a31001"));
                map1.put("硫化氢",ObjectUtils.isEmpty(map.get("a21028"))?0:map.get("a21028"));
                map1.put("氨气",ObjectUtils.isEmpty(map.get("a21001"))?0:map.get("a21001"));
                map1.put("pm25ug/m³",ObjectUtils.isEmpty(map.get("a34004"))?0:map.get("a34004"));
                map1.put("pm10ug/m³",ObjectUtils.isEmpty(map.get("a34002"))?0:map.get("a34002"));
                map1.put("二氧化氮ug/m³",ObjectUtils.isEmpty(map.get("a21004"))?0:map.get("a21004"));
                map1.put("二氧化硫ug/m³",ObjectUtils.isEmpty(map.get("a21026"))?0:map.get("a21026"));
                map1.put("一氧化碳ug/m³",ObjectUtils.isEmpty(map.get("a21005"))?0:map.get("a21005"));
                map1.put("气压hpa",ObjectUtils.isEmpty(map.get("a01006"))?0:map.get("a01006"));
                map1.put("温度℃",ObjectUtils.isEmpty(map.get("a01001"))?0:map.get("a01001"));
                map1.put("湿度%",ObjectUtils.isEmpty(map.get("a01002"))?0:map.get("a01002"));
                map1.put("tvocmg/m³",ObjectUtils.isEmpty(map.get("a99054"))?0:map.get("a99054"));
                map1.put("甲醛ug/m³",ObjectUtils.isEmpty(map.get("a31001"))?0:map.get("a31001"));
                map1.put("硫化氢ppm",ObjectUtils.isEmpty(map.get("a21028"))?0:map.get("a21028"));
                map1.put("氨气ug/m³",ObjectUtils.isEmpty(map.get("a21001"))?0:map.get("a21001"));
                rsMap.add(map1);
            }
        }