fuliqi
2024-10-15 e41c9b8574a217830e987877f729820b2ceedc33
动态列补充两个接口
2个文件已修改
148 ■■■■■ 已修改文件
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
@@ -590,6 +590,17 @@
        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());
        //月份每日录像线数据
@@ -610,12 +621,19 @@
                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());
                setRecordDaily(videoDailyExp, result, records);
                //区县表
                videoDailyExps.add(videoDailyExp);
@@ -648,6 +666,17 @@
        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());
        //月份每日录像线数据
@@ -668,12 +697,19 @@
                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());
                setLoseDaily(videoDailyExp, result, records);
                videoDailyExps.add(videoDailyExp);
                //全量表
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -560,53 +560,51 @@
    </select>
<!--    <select id="assetManagement" resultMap="dyMap">-->
<!--        SELECT-->
<!--            tm.id,-->
<!--            tm.serial_number,-->
<!--               tm.name,-->
<!--               tm.site_type,-->
<!--               tm.mac_addr,-->
<!--               tm.ip,-->
<!--               tm.camera_fun_type,-->
<!--               tm.longitude,-->
<!--               tm.latitude,-->
<!--               tm.camera_capture_area,-->
<!--               tm.on_state,-->
<!--               tm.civil_code,-->
<!--               tm.integrated_device,-->
<!--               tm.camera_brand,-->
<!--               tm.address,-->
<!--               tm.net_working,-->
<!--               tm.public_security,-->
<!--               tm.installed_time,-->
<!--               tm.management_unit,-->
<!--               tm.mu_contact_info,-->
<!--               tm.storage_days,-->
<!--               tm.monitor_azimuth,-->
<!--               tm.scene_photo_addr,-->
<!--               tm.model,-->
<!--               tm.site_vulgo,-->
<!--               tm.camera_type,-->
<!--               tm.camera_light_type,-->
<!--               tm.encoded_format,-->
<!--               tm.camera_dept,-->
<!--               tm.hybm,-->
<!--               tm.lxbm,-->
<!--               't_monitor' as tableName,-->
<!--               #{query.keyword} as keyword-->
<!--        FROM-->
<!--            t_monitor tm-->
<!--                INNER JOIN t_yw_point yp ON yp.serial_number = tm.serial_number-->
<!--        <where>-->
<!--            <if test="query.keyword != null and query.keyword != ''">-->
<!--                AND tm.name like concat('%', #{query.keyword}, '%')-->
<!--            </if>-->
<!--            <if test="query.startTIme != null and query.endTime != null">-->
<!--                AND yp.create_time between #{query.startTime} and #{query.endTime}-->
<!--            </if>-->
<!--        </where>-->
<!--    </select>-->
    <select id="assetManagement" resultType="com.ycl.platform.domain.vo.TMonitorVO">
        SELECT
            tm.id,
            tm.serial_number,
               tm.name,
               tm.site_type,
               tm.mac_addr,
               tm.ip,
               tm.camera_fun_type,
               tm.longitude,
               tm.latitude,
               tm.camera_capture_area,
               tm.on_state,
               tm.civil_code,
               tm.integrated_device,
               tm.camera_brand,
               tm.address,
               tm.net_working,
               tm.public_security,
               tm.installed_time,
               tm.management_unit,
               tm.mu_contact_info,
               tm.storage_days,
               tm.monitor_azimuth,
               tm.scene_photo_addr,
               tm.model,
               tm.site_vulgo,
               tm.camera_type,
               tm.camera_light_type,
               tm.encoded_format,
               tm.camera_dept,
               tm.hybm,
               tm.lxbm
        FROM
            t_monitor tm
                INNER JOIN t_yw_point yp ON yp.serial_number = tm.serial_number
        <where>
            <if test="query.keyword != null and query.keyword != ''">
                AND tm.name like concat('%', #{query.keyword}, '%')
            </if>
            <if test="query.startTIme != null and query.endTime != null">
                AND yp.create_time between #{query.startTime} and #{query.endTime}
            </if>
        </where>
    </select>
<!--    <select id="getDyColumns" resultMap="dynamicColumnMap">-->
<!--        SELECT-->