| | |
| | | @GetMapping("/listAll") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入equipment") |
| | | public R<List<EquipmentVO>> listAll(Equipment equipment, Query query) throws ParseException { |
| | | List<EquipmentVO> pages = equipmentService.listAll(); |
| | | public R<List<EquipmentVO>> listAll(EquipmentVO equipment, Query query) throws ParseException { |
| | | List<EquipmentVO> pages = equipmentService.listAll(equipment); |
| | | |
| | | for (int j = 0; j < pages.size(); j++) { |
| | | String expireTime = pages.get(j).getExpireTime(); |
| | |
| | | pages.get(j).setType(0); |
| | | } |
| | | } |
| | | |
| | | |
| | | //判断设备是否在线 |
| | | String Heartbeat = pages.get(j).getHeartbeat(); |
| | | if (Heartbeat != null){ |
| | | long st = sim.parse(Heartbeat).getTime(); |
| | | long en = sim.parse(end).getTime(); |
| | | if ((en - st) >= (60 * 60 * 24 * 1000)){ |
| | | pages.get(j).setOnlineStatus("0"); |
| | | }else{ |
| | | pages.get(j).setOnlineStatus("1"); |
| | | } |
| | | }else{ |
| | | pages.get(j).setOnlineStatus("0"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |