| | |
| | | import com.ycl.platform.domain.result.UY.MonitorQualifyResult; |
| | | import com.ycl.platform.domain.result.UY.OsdCheckResult; |
| | | import com.ycl.platform.domain.result.UY.RecordMetaDSumResult; |
| | | import com.ycl.platform.domain.vo.DynamicColumnVO; |
| | | import com.ycl.platform.domain.vo.TMonitorVO; |
| | | import com.ycl.platform.domain.vo.WorkOrderVO; |
| | | import com.ycl.platform.domain.vo.home.BaseHomeVO; |
| | |
| | | import com.ycl.platform.domain.vo.home.HomeVideoVO; |
| | | import com.ycl.platform.domain.vo.screen.MonitorRateVO; |
| | | import com.ycl.platform.domain.vo.screen.MonitorTotalVO; |
| | | import com.ycl.platform.mapper.DynamicColumnMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.mapper.WorkOrderMapper; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | |
| | | private WorkOrderMapper workOrderMapper; |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | | @Autowired |
| | | private DynamicColumnMapper dynamicColumnMapper; |
| | | |
| | | /** |
| | | * 查询设备资产 |
| | |
| | | if (!CollectionUtils.isEmpty(onlines)) { |
| | | videoExp.setTotal(onlines.size()); |
| | | videoExp.setOnline(Integer.valueOf(onlines.stream() |
| | | .filter(TMonitorResult::getOnline) |
| | | .filter(TMonitorResult::getPingOnline) |
| | | .count() + "")); |
| | | videoExp.setOffline(videoExp.getTotal() - videoExp.getOnline()); |
| | | } |
| | |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video + "")); |
| | | VideoExportForm.convertTags(exportForm); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(exportForm); |
| | | //获取动态列数据 |
| | | List<Integer> pointIds = tMonitorResults.stream().map(TMonitorResult::getPointId).collect(Collectors.toList()); |
| | | List<DynamicColumnVO> dynamics = dynamicColumnMapper.getDynamicsByIds("t_yw_point", pointIds); |
| | | //补充动态列数据 |
| | | if(!CollectionUtils.isEmpty(dynamics)) { |
| | | Map<Integer, List<DynamicColumnVO>> map = dynamics.stream().collect(Collectors.groupingBy(DynamicColumnVO::getRefId)); |
| | | for (TMonitorResult tMonitorResult : tMonitorResults) { |
| | | Integer pointId = tMonitorResult.getPointId(); |
| | | tMonitorResult.setDynamicColumnList(map.get(pointId)); |
| | | } |
| | | } |
| | | List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList()); |
| | | Query query = getQuery(deviceIds, exportForm.getMonth()); |
| | | //月份每日在线数据 |
| | |
| | | videoDailyExp.setSerialNumber(result.getNo()); |
| | | videoDailyExp.setDeviceName(result.getName()); |
| | | videoDailyExp.setArea(areaDeptEnum == null ? "未知" : areaDeptEnum.getName()); |
| | | String tag = "" + (result.getProvinceTag() ? "省厅、" : "") + (result.getImportantTag() ? "重点点位、" : "") + (result.getImportantCommandImageTag() ? "重点指挥图像、" : "") + (result.getDeptTag() ? "部级、" : ""); |
| | | // 删除字符串末尾的“、” |
| | | if (tag.endsWith("、")) { |
| | | tag = tag.substring(0, tag.length() - 1); |
| | | StringBuilder tag = new StringBuilder("" + (result.getProvinceTag() ? "省厅、" : "") + (result.getImportantTag() ? "重点点位、" : "") + (result.getImportantCommandImageTag() ? "重点指挥图像、" : "") + (result.getDeptTag() ? "部级、" : "")); |
| | | //动态列处理加在标签里 |
| | | if(!CollectionUtils.isEmpty(result.getDynamicColumnList())){ |
| | | List<DynamicColumnVO> dynamicColumnList = result.getDynamicColumnList(); |
| | | for (DynamicColumnVO dynamicColumnVO : dynamicColumnList) { |
| | | tag.append(dynamicColumnVO.getColumnValue()).append("、"); |
| | | } |
| | | } |
| | | videoDailyExp.setTag(tag); |
| | | // 删除字符串末尾的“、” |
| | | if (tag.toString().endsWith("、")) { |
| | | tag = new StringBuilder(tag.substring(0, tag.length() - 1)); |
| | | } |
| | | videoDailyExp.setTag(tag.toString()); |
| | | setOnlineDaily(videoDailyExp, result, onlines); |
| | | videoDailyExps.add(videoDailyExp); |
| | | //全量表 |
| | |
| | | for (TMonitorResult monitorResult : onlineResult) { |
| | | int dayOfMonth = monitorResult.getMongoCreateTime().getDayOfMonth(); |
| | | String online = ""; |
| | | online += monitorResult.getOnline() ? "在线" : "离线"; |
| | | online += monitorResult.getPingOnline() ? "在线" : "离线"; |
| | | //反射赋值,字段统一定义为day+1,2,3... |
| | | Field field = videoDailyExp.getClass().getDeclaredField("day" + dayOfMonth); |
| | | field.setAccessible(true); |