| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | if (!CollectionUtils.isEmpty(hourlyDataList)) { |
| | | if(!(hourlyDataList.size()==macList.size())){ |
| | | List<String> macList_copy = macList; |
| | | String mac_Splicing = null; |
| | | if (hourlyDataList.size()<macList.size()){ |
| | | int i = 0; |
| | | for (Map hourData: hourlyDataList) { |
| | | if (!hourData.get("mac").toString().equals(macList_copy.get(i))){ |
| | | mac_Splicing = mac_Splicing+hourData.get("mac")+","; |
| | | i=i-1; |
| | | for (int k=0;k<macList_copy.size();k++){ |
| | | if (hourData.get("mac").equals(macList_copy.get(k))){ |
| | | macList_copy.remove(k); |
| | | } |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | AlarmUtils_2.sendMail("276999030@qq.com","离线警报",mac_Splicing+"设备或许离线!"); |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | 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("276999030@qq.com,1vv_zkk6ji3kln@dingtalk.com,liumiao_love@126.com","离线警报",de.toString()+"设备或许离线!"); |
| | | } |
| | | } |
| | | for (Map<String, Object> deviceData : hourlyDataList) { |
| | | if (!ObjectUtils.isEmpty(deviceData)) { |