| | |
| | | @Override |
| | | public void exportVideoTotal(HttpServletResponse response, VideoExportForm exportForm) throws IOException { |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(CheckConstants.Rule_Category_Video, exportForm.getDeptIds()); |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video+"")); |
| | | VideoExportForm.convertTags(exportForm); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(exportForm); |
| | | List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList()); |
| | | Query query = getQuery(deviceIds, exportForm.getMonth()); |
| | | //月份每日在线数据 |
| | |
| | | @Override |
| | | public void exportVideoOnline(HttpServletResponse response, VideoExportForm exportForm) throws IOException, NoSuchFieldException, IllegalAccessException { |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(CheckConstants.Rule_Category_Video, exportForm.getDeptIds()); |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video+"")); |
| | | VideoExportForm.convertTags(exportForm); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(exportForm); |
| | | List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList()); |
| | | Query query = getQuery(deviceIds, exportForm.getMonth()); |
| | | //月份每日在线数据 |
| | | List<TMonitorResult> onlineResult = mongoTemplate.find(query, TMonitorResult.class); |
| | | //全量表 |
| | | List<VideoDailyExp> totalExps = new ArrayList<>(); |
| | | for (Integer deptId : exportForm.getDeptIds()) { |
| | | List<VideoDailyExp> videoDailyExps = new ArrayList<>(); |
| | | //从数据库集合筛选部门数据 |
| | |
| | | videoDailyExp.setSerialNumber(result.getNo()); |
| | | videoDailyExp.setDeviceName(result.getName()); |
| | | videoDailyExp.setArea(areaDeptEnum == null ? "未知" : areaDeptEnum.getName()); |
| | | videoDailyExp.setTag("" + (result.getProvinceTag() ? "省厅" : "") + (result.getImportantTag() ? "、重点点位" : "") + (result.getImportantCommandImageTag() ? "、重点指挥图像" : "") + (result.getDeptTag() ? "、部级" : "")); |
| | | String tag ="" + (result.getProvinceTag() ? "省厅、" : "") + (result.getImportantTag() ? "重点点位、" : "") + (result.getImportantCommandImageTag() ? "重点指挥图像、" : "") + (result.getDeptTag() ? "部级、" : ""); |
| | | // 删除字符串末尾的“、” |
| | | if (tag.endsWith("、")) { |
| | | tag = tag.substring(0, tag.length() - 1); |
| | | } |
| | | videoDailyExp.setTag(tag); |
| | | setOnlineDaily(videoDailyExp, result, onlines); |
| | | videoDailyExps.add(videoDailyExp); |
| | | //全量表 |
| | | totalExps.add(videoDailyExp); |
| | | } |
| | | ExcelExp excelExp = new ExcelExp(areaDeptEnum == null ? "未知" : areaDeptEnum.getName(), videoDailyExps, VideoDailyExp.class); |
| | | mysheet.add(excelExp); |
| | | } |
| | | ExcelExp excelExp = new ExcelExp("全量", totalExps, VideoDailyExp.class); |
| | | mysheet.add(excelExp); |
| | | ExcelUtilManySheet<List<ExcelExp>> util = new ExcelUtilManySheet<>(mysheet); |
| | | util.exportExcelManySheet(response, mysheet); |
| | | } |
| | |
| | | @Override |
| | | public void exportVideoRecord(HttpServletResponse response, VideoExportForm exportForm) throws IOException, NoSuchFieldException, IllegalAccessException { |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(CheckConstants.Rule_Category_Video, exportForm.getDeptIds()); |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video+"")); |
| | | VideoExportForm.convertTags(exportForm); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(exportForm); |
| | | List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList()); |
| | | Query query = getQuery(deviceIds, exportForm.getMonth()); |
| | | //月份每日录像线数据 |
| | | List<RecordMetaDSumResult> recordResult = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | //全量表 |
| | | List<VideoDailyExp> totalExps = new ArrayList<>(); |
| | | for (Integer deptId : exportForm.getDeptIds()) { |
| | | List<VideoDailyExp> videoDailyExps = new ArrayList<>(); |
| | | //从数据库集合筛选部门数据 |
| | |
| | | videoDailyExp.setSerialNumber(result.getNo()); |
| | | videoDailyExp.setDeviceName(result.getName()); |
| | | videoDailyExp.setArea(areaDeptEnum == null ? "未知" : areaDeptEnum.getName()); |
| | | videoDailyExp.setTag("" + (result.getProvinceTag() ? "省厅" : "") + (result.getImportantTag() ? "、重点点位" : "") + (result.getImportantCommandImageTag() ? "、重点指挥图像" : "") + (result.getDeptTag() ? "、部级" : "")); |
| | | String tag ="" + (result.getProvinceTag() ? "省厅、" : "") + (result.getImportantTag() ? "重点点位、" : "") + (result.getImportantCommandImageTag() ? "重点指挥图像、" : "") + (result.getDeptTag() ? "部级、" : ""); |
| | | // 删除字符串末尾的“、” |
| | | if (tag.endsWith("、")) { |
| | | tag = tag.substring(0, tag.length() - 1); |
| | | } |
| | | videoDailyExp.setTag(tag); |
| | | setRecordDaily(videoDailyExp, result, records); |
| | | //区县表 |
| | | videoDailyExps.add(videoDailyExp); |
| | | //全量表 |
| | | totalExps.add(videoDailyExp); |
| | | } |
| | | ExcelExp excelExp = new ExcelExp(areaDeptEnum == null ? "未知" : areaDeptEnum.getName(), videoDailyExps, VideoDailyExp.class); |
| | | mysheet.add(excelExp); |
| | | } |
| | | ExcelExp excelExp = new ExcelExp("全量", totalExps, VideoDailyExp.class); |
| | | mysheet.add(excelExp); |
| | | ExcelUtilManySheet<List<ExcelExp>> util = new ExcelUtilManySheet<>(mysheet); |
| | | util.exportExcelManySheet(response, mysheet); |
| | | } |
| | |
| | | @Override |
| | | public void exportVideoLoseTime(HttpServletResponse response, VideoExportForm exportForm) throws NoSuchFieldException, IllegalAccessException, IOException { |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(CheckConstants.Rule_Category_Video, exportForm.getDeptIds()); |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video+"")); |
| | | VideoExportForm.convertTags(exportForm); |
| | | List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(exportForm); |
| | | List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList()); |
| | | Query query = getQuery(deviceIds, exportForm.getMonth()); |
| | | //月份每日录像线数据 |
| | | List<RecordMetaDSumResult> recordResult = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | //全量表 |
| | | List<VideoDailyExp> totalExps = new ArrayList<>(); |
| | | for (Integer deptId : exportForm.getDeptIds()) { |
| | | List<VideoDailyExp> videoDailyExps = new ArrayList<>(); |
| | | //从数据库集合筛选部门数据 |
| | |
| | | videoDailyExp.setSerialNumber(result.getNo()); |
| | | videoDailyExp.setDeviceName(result.getName()); |
| | | videoDailyExp.setArea(areaDeptEnum == null ? "未知" : areaDeptEnum.getName()); |
| | | videoDailyExp.setTag("" + (result.getProvinceTag() ? "省厅" : "") + (result.getImportantTag() ? "、重点点位" : "") + (result.getImportantCommandImageTag() ? "、重点指挥图像" : "") + (result.getDeptTag() ? "、部级" : "")); |
| | | String tag ="" + (result.getProvinceTag() ? "省厅、" : "") + (result.getImportantTag() ? "重点点位、" : "") + (result.getImportantCommandImageTag() ? "重点指挥图像、" : "") + (result.getDeptTag() ? "部级、" : ""); |
| | | // 删除字符串末尾的“、” |
| | | if (tag.endsWith("、")) { |
| | | tag = tag.substring(0, tag.length() - 1); |
| | | } |
| | | videoDailyExp.setTag(tag); |
| | | setLoseDaily(videoDailyExp, result, records); |
| | | videoDailyExps.add(videoDailyExp); |
| | | //全量表 |
| | | totalExps.add(videoDailyExp); |
| | | } |
| | | ExcelExp excelExp = new ExcelExp(areaDeptEnum == null ? "未知" : areaDeptEnum.getName(), videoDailyExps, VideoDailyExp.class); |
| | | mysheet.add(excelExp); |
| | | } |
| | | ExcelExp excelExp = new ExcelExp("全量", totalExps, VideoDailyExp.class); |
| | | mysheet.add(excelExp); |
| | | ExcelUtilManySheet<List<ExcelExp>> util = new ExcelUtilManySheet<>(mysheet); |
| | | util.exportExcelManySheet(response, mysheet); |
| | | } |