| | |
| | | } |
| | | } |
| | | List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList()); |
| | | Query query = getQuery(deviceIds, exportForm.getMonth()); |
| | | // 将年月字符串解析为YearMonth对象 |
| | | YearMonth yearMonth = YearMonth.parse(exportForm.getMonth()); |
| | | // 获取当月的第一天 |
| | | LocalDate start = yearMonth.atDay(1); |
| | | // 获取下个月的第一天(通过加上1个月并设置日为1) |
| | | YearMonth nextMonth = yearMonth.plusMonths(1); |
| | | LocalDate end = nextMonth.atDay(1); |
| | | //获取这个月份的部门数据,录像由于是前一天的所以不用createTime字段 |
| | | Query query = new Query(Criteria.where("statTime").gte(start).lt(end)); |
| | | query.addCriteria(Criteria.where("no").in(deviceIds)); |
| | | //月份每日录像线数据 |
| | | List<RecordMetaDSumResult> recordResult = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | //全量表 |
| | |
| | | } |
| | | } |
| | | List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList()); |
| | | Query query = getQuery(deviceIds, exportForm.getMonth()); |
| | | // 将年月字符串解析为YearMonth对象 |
| | | YearMonth yearMonth = YearMonth.parse(exportForm.getMonth()); |
| | | // 获取当月的第一天 |
| | | LocalDate start = yearMonth.atDay(1); |
| | | // 获取下个月的第一天(通过加上1个月并设置日为1) |
| | | YearMonth nextMonth = yearMonth.plusMonths(1); |
| | | LocalDate end = nextMonth.atDay(1); |
| | | //获取这个月份的部门数据,录像由于是前一天的所以不用createTime字段 |
| | | Query query = new Query(Criteria.where("statTime").gte(start).lt(end)); |
| | | query.addCriteria(Criteria.where("no").in(deviceIds)); |
| | | //月份每日录像线数据 |
| | | List<RecordMetaDSumResult> recordResult = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | //全量表 |
| | |
| | | monitor.setTag(tag.toString()); |
| | | }); |
| | | ExcelUtil<TMonitorExp> util = new ExcelUtil<>(TMonitorExp.class); |
| | | util.exportExcel(response, monitors, "2".equals(tMonitor.getCameraFunType()) ? "车辆" : "人脸"); |
| | | String sheetName = ""; |
| | | if("1".equals(tMonitor.getCameraFunType())){ |
| | | sheetName = "视频"; |
| | | }else if("2".equals(tMonitor.getCameraFunType())){ |
| | | sheetName = "车辆"; |
| | | }else if("3".equals(tMonitor.getCameraFunType())){ |
| | | sheetName = "人脸"; |
| | | } |
| | | util.exportExcel(response, monitors,sheetName); |
| | | } |
| | | |
| | | |
| | |
| | | //一个设备当月在线情况 |
| | | List<RecordMetaDSumResult> recordResults = records.stream().filter(online -> online.getNo().equals(result.getNo())).collect(Collectors.toList()); |
| | | for (RecordMetaDSumResult recordResult : recordResults) { |
| | | int dayOfMonth = recordResult.getMongoCreateTime().getDayOfMonth(); |
| | | int dayOfMonth = DateUtils.getDayOfMonth(recordResult.getStatTime()); |
| | | Integer status = recordResult.getRecordStatus(); |
| | | String text = ""; |
| | | if (ApiConstants.UY_RecordStatus_Interval.equals(status)) { |
| | |
| | | //一个设备当月在线情况 |
| | | List<RecordMetaDSumResult> recordResults = records.stream().filter(online -> online.getNo().equals(result.getNo())).collect(Collectors.toList()); |
| | | for (RecordMetaDSumResult recordResult : recordResults) { |
| | | int dayOfMonth = recordResult.getMongoCreateTime().getDayOfMonth(); |
| | | int dayOfMonth = DateUtils.getDayOfMonth(recordResult.getStatTime()); |
| | | //反射赋值,字段统一定义为day+1,2,3... |
| | | Field field = videoDailyExp.getClass().getDeclaredField("day" + dayOfMonth); |
| | | field.setAccessible(true); |