| | |
| | | import com.ycl.platform.domain.entity.*; |
| | | import com.ycl.platform.domain.query.DataCenterQuery; |
| | | import com.ycl.platform.domain.result.HK.*; |
| | | import com.ycl.platform.domain.result.SYS.TMonitorResult; |
| | | import com.ycl.platform.domain.result.UY.*; |
| | | import com.ycl.platform.domain.vo.PointDetailVO; |
| | | import com.ycl.platform.mapper.ImageResourceSecurityDetailMapper; |
| | |
| | | */ |
| | | @Override |
| | | public Result videoPointOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("name", "no","ip"); |
| | | Query query = MongoUtil.getQuery(params,TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | resultList.forEach(item->{ |
| | | if(null != item.getPingOnline() && item.getPingOnline()){ |
| | | item.setPingOnlineStr("在线"); |
| | | }else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | }); |
| | | params.setDeptTag(-1); |
| | | params.setDeviceType(1); |
| | | IPage<PointDetailVO> page = PageUtil.getPage(params, PointDetailVO.class); |
| | | pointMapper.dataCenterPage(page, params); |
| | | |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(distinctCount + "",this.remove0(onlineRate))); |
| | | map.put("list", page.getRecords()); |
| | | return Result.ok().data(map).total(page.getTotal()); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public Result deptVideoPointOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("name", "no","ip"); |
| | | Query query = MongoUtil.getQuery(params,TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | resultList.forEach(item->{ |
| | | if(null != item.getPingOnline() && item.getPingOnline()){ |
| | | item.setPingOnlineStr("在线"); |
| | | }else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | }); |
| | | // 统计设备数量 |
| | | params.setDeptTag(1); |
| | | params.setDeviceType(1); |
| | | IPage<PointDetailVO> page = PageUtil.getPage(params, PointDetailVO.class); |
| | | pointMapper.dataCenterPage(page, params); |
| | | |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | | Date now = new Date(); |
| | |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate))); |
| | | map.put("list", page.getRecords()); |
| | | return Result.ok().data(map).total(page.getTotal()); |
| | | map.put("list",resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public Result videoImportantPointOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("name", "no","ip"); |
| | | Query query = MongoUtil.getQuery(params,TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | params.setDeptTag(3); |
| | | params.setDeviceType(1); |
| | | IPage<PointDetailVO> page = PageUtil.getPage(params, PointDetailVO.class); |
| | | pointMapper.dataCenterPage(page, params); |
| | | |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | | resultList.forEach(item->{ |
| | | if(null != item.getPingOnline() && item.getPingOnline()){ |
| | | item.setPingOnlineStr("在线"); |
| | | }else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | }); |
| | | Date now = new Date(); |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeySiteOnline) |
| | |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate))); |
| | | map.put("list", page.getRecords()); |
| | | return Result.ok().data(map).total(page.getTotal()); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public Result videoImportantPointImageOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("name", "no","ip"); |
| | | Query query = MongoUtil.getQuery(params,TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | |
| | | params.setDeptTag(4); |
| | | params.setDeviceType(1); |
| | | IPage<PointDetailVO> page = PageUtil.getPage(params, PointDetailVO.class); |
| | | pointMapper.dataCenterPage(page, params); |
| | | |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | | resultList.forEach(item->{ |
| | | if(null != item.getPingOnline() && item.getPingOnline()){ |
| | | item.setPingOnlineStr("在线"); |
| | | }else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | }); |
| | | Date now = new Date(); |
| | | List<CheckIndexVideo> videoList = new LambdaQueryChainWrapper<>(checkIndexVideoService.getBaseMapper()) |
| | | .select(CheckIndexVideo::getKeyCommandImageOnline) |
| | |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate))); |
| | | map.put("list", page.getRecords()); |
| | | return Result.ok().data(map).total(page.getTotal()); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public Result vehiclePointOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("name", "no","ip"); |
| | | Query query = MongoUtil.getQuery(params,TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | //系统ping的结果 |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | //TODO:优云在线结果 |
| | | params.setDeptTag(-1); |
| | | params.setDeviceType(2); |
| | | IPage<PointDetailVO> page = PageUtil.getPage(params, PointDetailVO.class); |
| | | pointMapper.dataCenterPage(page, params); |
| | | |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | | Date now = new Date(); |
| | | resultList.forEach(item->{ |
| | | if(null != item.getPingOnline() && item.getPingOnline()){ |
| | | item.setPingOnlineStr("在线"); |
| | | }else { |
| | | item.setPingOnlineStr("离线"); |
| | | } |
| | | }); |
| | | List<CheckIndexCar> videoList = new LambdaQueryChainWrapper<>(checkIndexCarService.getBaseMapper()) |
| | | .select(CheckIndexCar::getSiteOnline) |
| | | .eq(params.getDataType().equals(1), CheckIndexCar::getExamineTag, CheckConstants.Examine_Tag_Province) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(now), DateUtils.getDayEnd(now)) |
| | | .between(CheckIndexCar::getCreateTime, DateUtils.getDayStart(params.getStartTime()), DateUtils.getDayEnd(params.getEndTime())) |
| | | .list(); |
| | | BigDecimal onlineRate = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(videoList)) { |
| | |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(distinctCount + "", this.remove0(onlineRate))); |
| | | map.put("list", page.getRecords()); |
| | | return Result.ok().data(map).total(page.getTotal()); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public Result facePointOnlineRate(DataCenterQuery params) { |
| | | List<String> likeFileds = Arrays.asList("name", "no","ip"); |
| | | Query query = MongoUtil.getQuery(params,TIME_FIELD, likeFileds, null); |
| | | //分页数量 |
| | | long total = mongoTemplate.count(query, TMonitorResult.class); |
| | | MongoUtil.setPage(query, params, TIME_FIELD); |
| | | List<TMonitorResult> resultList = mongoTemplate.find(query, TMonitorResult.class); |
| | | resultList.forEach(item->{ |
| | | if(null != item.getPingOnline() && item.getPingOnline()){ |
| | | item.setOnlineStr("在线"); |
| | | }else { |
| | | item.setOnlineStr("离线"); |
| | | } |
| | | }); |
| | | params.setDeptTag(-1); |
| | | params.setDeviceType(3); |
| | | IPage<PointDetailVO> page = PageUtil.getPage(params, PointDetailVO.class); |
| | | pointMapper.dataCenterPage(page, params); |
| | | |
| | | // 统计设备数量 |
| | | Integer distinctCount = pointMapper.distinctCount(params); |
| | | |
| | |
| | | rList.add(this.remove0(onlineRate)); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", rList); |
| | | map.put("list", page.getRecords()); |
| | | return Result.ok().data(map).total(page.getTotal()); |
| | | map.put("list", resultList); |
| | | return Result.ok().data(map).total(total); |
| | | } |
| | | |
| | | /** |