| | |
| | | import org.springblade.jfpt.equipment.service.IEquipmentService; |
| | | import org.springblade.jfpt.equipment.vo.EquipmentVO; |
| | | import org.springblade.jfpt.equipment.vo.EquipmentVOS; |
| | | import org.springblade.system.cache.SysCache; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | return page.setRecords(baseMapper.selectEquipmentPage(page,equipment,null)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public IPage<EquipmentVO> selectDeptPages(IPage<EquipmentVO> page, EquipmentVO equipment,String pid) { |
| | | |
| | | List deptIdList; |
| | | if (!pid.equals("")){ |
| | | deptIdList = SysCache.getDeptChildIds(Long.valueOf(pid)); |
| | | }else{ |
| | | deptIdList = SysCache.getDeptChildIds(null); |
| | | } |
| | | return page.setRecords(baseMapper.selectDeptPages(page,equipment,deptIdList)); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<EquipmentVOS> tree() { |
| | |
| | | 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); |
| | | } |
| | | } |