| | |
| | | package com.moral.task; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | |
| | | minutelyData.put("timeType", "minutely"); |
| | | for (String key : deviceData.keySet()) { |
| | | if (!key.equals("mac") && !key.startsWith("M")) { |
| | | String date = deviceData.get(key).toString() + "," + deviceData.get("MIN" + key).toString() + "," + deviceData.get("MAX" + key).toString(); |
| | | String date = deviceData.get(key).toString() + "," + new BigDecimal(new String((byte[]) (deviceData.get("MIN" + key)))) + "," + new BigDecimal(new String((byte[]) (deviceData.get("MAX" + key)))); |
| | | minutelyData.put(key, date); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | List<Map<String, Object>> deviceList = deviceService.getAllByMacList(macList_copy); |
| | | List<String> de = new ArrayList<>(); |
| | | for (Map deviceMap:deviceList) { |
| | | de.add(deviceMap.get("name").toString()); |
| | | List<String> ignoreMacList = new ArrayList(); |
| | | ignoreMacList.add("p5dnd7a0392130"); |
| | | for (String ignoreMac:ignoreMacList) { |
| | | for (int d=0;d<macList_copy.size();d++){ |
| | | if (macList_copy.get(d).equals(ignoreMac)){ |
| | | macList_copy.remove(d); |
| | | } |
| | | } |
| | | } |
| | | AlarmUtils_2.sendMail("276999030@qq.com,245285408@qq.com","离线警报",de.toString()+"设备或许离线!"); |
| | | if (macList_copy.size()!=0){ |
| | | List<Map<String, Object>> deviceList = deviceService.getAllByMacList(macList_copy); |
| | | List<String> de = new ArrayList<>(); |
| | | for (Map deviceMap:deviceList) { |
| | | de.add(deviceMap.get("name").toString()); |
| | | } |
| | | AlarmUtils_2.sendMail("chenxi18913261648@163.com,1vv_zkk6ji3kln@dingtalk.com,liumiao_love@126.com","离线警报",de.toString()+"设备或许离线!"); |
| | | } |
| | | } |
| | | for (Map<String, Object> deviceData : hourlyDataList) { |
| | | if (!ObjectUtils.isEmpty(deviceData)) { |