| | |
| | | AtomicReference<String> end = new AtomicReference<>(""); |
| | | AtomicReference<Date> endDate = new AtomicReference<>(null); // 采集时间 |
| | | serverDeployList.forEach(s -> { |
| | | if (s.getId().equals(in.getServerDeployId()) && s.getCollectTime() != null) { |
| | | start.set(sdf.format(s.getCollectTime())); |
| | | if (s.getId().equals(in.getServerDeployId())) { |
| | | if (s.getCollectTime() != null) { |
| | | start.set(sdf.format(s.getCollectTime())); |
| | | } else { |
| | | start.set(sdf.format(new Date())); |
| | | } |
| | | // 获取当前时间 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 减去一分钟 |
| | |
| | | end.set(formattedTime); |
| | | } |
| | | }); |
| | | if (start.get().equals("")){ |
| | | if (start.get().equals("")) { |
| | | return; |
| | | } |
| | | LocalDateTime startTime = LocalDateTime.parse(start.get(), inputFormatter); |
| | |
| | | // 处理设备状态 |
| | | int lastIndex = table.lastIndexOf('.'); |
| | | String code = table.substring(lastIndex + 1); |
| | | EquipmentLog equipmentLog = equipmentLogService.selectEquipmentOporation(code); |
| | | EquipmentLog equipmentLog = null; |
| | | if (databaseType.equals("SqlServer")) { |
| | | equipmentLog = equipmentLogService.selectEquipmentOporationSqlServer(code); |
| | | } else if (databaseType.equals("MySql")) { |
| | | equipmentLog = equipmentLogService.selectEquipmentOporationMySql(code); |
| | | |
| | | } |
| | | // 设备状态 |
| | | Integer equipmentState = null; |
| | | for (Map.Entry<String, List<Influxdb>> entry : timeListMap.entrySet()) { |