| | |
| | | int equipmentCount = 0; |
| | | long hearbeat = 0; |
| | | //遍历集合数据,对比心跳时间,得出在线的设备数量 |
| | | if (status==0){ |
| | | if (status==0 && equipmentVOS.size()>0){ |
| | | for (EquipmentVO e:equipmentVOS) { |
| | | try { |
| | | hearbeat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(e.getHeartbeat()).getTime(); |
| | | if(null!=e.getHeartbeat()) { |
| | | hearbeat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(e.getHeartbeat()).getTime(); |
| | | } |
| | | } catch (ParseException parseException) { |
| | | parseException.printStackTrace(); |
| | | } |
| | |
| | | //返回数据 |
| | | return equipmentCount; |
| | | } |
| | | |
| | | @Override |
| | | public void updateexpireTime(String expireTime, String deviceNumber) { |
| | | baseMapper.updateexpireTime(expireTime,deviceNumber); |
| | | } |
| | | |
| | | @Override |
| | | public void updateExstate(String state, String reason, String deviceNumber) { |
| | | baseMapper.updateExstate(state, reason, deviceNumber); |
| | | } |
| | | } |