运行监控导出
(cherry picked from commit 5dfb6f1236099c3f1d0a792500d70ce6ba8d96bd)
New file |
| | |
| | | package com.ycl.platform.domain.excel; |
| | | |
| | | import annotation.Excel; |
| | | import com.ycl.platform.domain.vo.DynamicColumnVO; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class TMonitorExp { |
| | | /** |
| | | * 设备编码 |
| | | */ |
| | | @Excel(name = "设备编码") |
| | | private String serialNumber; |
| | | |
| | | /** |
| | | * 设备名称 |
| | | */ |
| | | @Excel(name = "设备名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 摄像机IPV4或IPV6地址 |
| | | */ |
| | | @Excel(name = "IP") |
| | | private String ip; |
| | | |
| | | /** |
| | | * 摄像机功能类型[1.视频监控;2.车辆识别;3.人员识别;] 数据格式[填入多个值并以/隔开。例如 1/2] |
| | | */ |
| | | @Excel(name = "摄像机功能类型") |
| | | private String cameraFunType; |
| | | |
| | | /** |
| | | * 设备状态 |
| | | */ |
| | | @Excel(name = "状态", readConverterExp = "-1=离线,1=在线,0=未知") |
| | | private Integer onState; |
| | | /** |
| | | * 行政区域 |
| | | */ |
| | | @Excel(name = "行政区域") |
| | | private String deptName; |
| | | |
| | | /** |
| | | * 管理单位 |
| | | */ |
| | | @Excel(name = "管理单位") |
| | | private String managementUnit; |
| | | /** |
| | | * 标签 |
| | | */ |
| | | @Excel(name = "标签") |
| | | private String tag; |
| | | private Boolean provinceTag; |
| | | private Boolean deptTag; |
| | | private Boolean importantTag; |
| | | private Boolean importantCommandImageTag; |
| | | |
| | | private Integer pointId; |
| | | /** |
| | | * 动态列 |
| | | */ |
| | | private List<DynamicColumnVO> dynamicColumnList; |
| | | } |
| | |
| | | { |
| | | return success(tMonitorService.recoveryException(monitor)); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:monitor:export')") |
| | | @Log(title = "导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response,TMonitorVO tMonitor) throws IOException, NoSuchFieldException, IllegalAccessException { |
| | | tMonitorService.export(response,tMonitor); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.platform.domain.entity.TMonitor; |
| | | import com.ycl.platform.domain.excel.TMonitorExp; |
| | | import com.ycl.platform.domain.form.VideoExportForm; |
| | | import com.ycl.platform.domain.query.DashboardQuery; |
| | | import com.ycl.platform.domain.query.DataCenterQuery; |
| | |
| | | void batchUpdateOnline(@Param("ipList")List<String> ipList,@Param("date") Date date,@Param("online")Integer online); |
| | | |
| | | List<TMonitor> selectCarOrFace(); |
| | | |
| | | List<TMonitorExp> exportTMonitorList(TMonitorVO tMonitor); |
| | | } |
| | |
| | | Map<String, Object> carHome(HomeQuery monitorQuery) throws ParseException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException; |
| | | |
| | | Map<String, Object> videoHome(HomeQuery monitorQuery) throws ParseException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException; |
| | | |
| | | void export(HttpServletResponse response, TMonitorVO tMonitor); |
| | | } |
| | |
| | | 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 |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="exportTMonitorList" resultType="com.ycl.platform.domain.excel.TMonitorExp"> |
| | | select m.id, m.serial_number, name, ip, camera_fun_type,p.online as onState, |
| | | d.dept_name, p.id as pointId,p.province_tag,p.dept_tag,p.important_tag,p.important_command_image_tag,u.unit_name as managementUnit |
| | | from t_monitor m |
| | | left join t_yw_point p on m.serial_number = p.serial_number and p.deleted = 0 |
| | | left join sys_dept d on p.dept_id = d.dept_id and d.del_flag = 0 |
| | | left join t_yw_unit u on p.unit_id = u.id and u.deleted = 0 |
| | | <where> |
| | | p.examine_status = 1 |
| | | <if test="serialNumber != null and serialNumber != ''">and m.serial_number = #{serialNumber}</if> |
| | | <if test="name != null and name != ''"> |
| | | and (name like concat('%', #{name}, '%') |
| | | or m.ip like concat('%', #{name}, '%') |
| | | or m.serial_number like concat('%', #{name}, '%') |
| | | or u.unit_name like concat('%', #{name}, '%')) |
| | | </if> |
| | | <if test="provinceTag != null ">and p.province_tag = #{provinceTag}</if> |
| | | <if test="deptTag != null ">and p.dept_tag = #{deptTag}</if> |
| | | <if test="cameraFunType != null and cameraFunType != ''">and camera_fun_type like concat('%', |
| | | #{cameraFunType}, '%') |
| | | </if> |
| | | <if test="onState != null ">and p.online = #{onState}</if> |
| | | <if test="civilCode != null and civilCode != ''">and civil_code = #{civilCode}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectMonitorVOList" resultType="com.ycl.platform.domain.vo.TMonitorVO"> |
| | | select m.id, m.serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude, |
| | | camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working, |