| | |
| | | import com.mongodb.client.MongoCollection; |
| | | import com.mongodb.client.MongoDatabase; |
| | | import com.ycl.platform.domain.entity.TMonitor; |
| | | import com.ycl.platform.domain.excel.TMonitorExp; |
| | | import com.ycl.platform.domain.excel.VideoDailyExp; |
| | | import com.ycl.platform.domain.excel.VideoTotalExp; |
| | | import com.ycl.platform.domain.form.VideoExportForm; |
| | |
| | | import com.ycl.system.service.ISysConfigService; |
| | | import com.ycl.utils.DateUtils; |
| | | import com.ycl.utils.StringUtils; |
| | | import com.ycl.utils.poi.ExcelUtil; |
| | | import constant.ApiConstants; |
| | | import constant.CheckConstants; |
| | | import enumeration.general.AreaDeptEnum; |
| | |
| | | return resultMap; |
| | | } |
| | | |
| | | /** |
| | | * 列表导出 |
| | | * |
| | | * @param response |
| | | * @param tMonitor |
| | | */ |
| | | @Override |
| | | public void export(HttpServletResponse response, TMonitorVO tMonitor) { |
| | | List<TMonitorExp> monitors = tMonitorMapper.exportTMonitorList(tMonitor); |
| | | //获取动态列数据 |
| | | List<Integer> pointIds = monitors.stream().map(TMonitorExp::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 (TMonitorExp tMonitorResult : monitors) { |
| | | Integer pointId = tMonitorResult.getPointId(); |
| | | tMonitorResult.setDynamicColumnList(map.get(pointId)); |
| | | } |
| | | } |
| | | monitors.forEach(monitor -> { |
| | | String cameraFunType = monitor.getCameraFunType(); |
| | | if (!StringUtils.isEmpty(cameraFunType)) { |
| | | String video = cameraFunType.replaceAll("1", "视频"); |
| | | String car = video.replaceAll("2", "车辆"); |
| | | String type = car.replaceAll("3", "人脸"); |
| | | monitor.setCameraFunType(type); |
| | | } |
| | | StringBuilder tag = new StringBuilder("" + (monitor.getProvinceTag() ? "省厅、" : "") + (monitor.getImportantTag() ? "重点点位、" : "") + (monitor.getImportantCommandImageTag() ? "重点指挥图像、" : "") + (monitor.getDeptTag() ? "部级、" : "")); |
| | | //动态列处理加在标签里 |
| | | if (!CollectionUtils.isEmpty(monitor.getDynamicColumnList())) { |
| | | List<DynamicColumnVO> dynamicColumnList = monitor.getDynamicColumnList(); |
| | | for (DynamicColumnVO dynamicColumnVO : dynamicColumnList) { |
| | | tag.append(dynamicColumnVO.getColumnValue()).append("、"); |
| | | } |
| | | } |
| | | // 删除字符串末尾的“、” |
| | | if (tag.toString().endsWith("、")) { |
| | | tag = new StringBuilder(tag.substring(0, tag.length() - 1)); |
| | | } |
| | | monitor.setTag(tag.toString()); |
| | | }); |
| | | ExcelUtil<TMonitorExp> util = new ExcelUtil<>(TMonitorExp.class); |
| | | util.exportExcel(response, monitors, "2".equals(tMonitor.getCameraFunType()) ? "车辆" : "人脸"); |
| | | } |
| | | |
| | | |
| | | //首页车辆报表 |
| | | @Override |