fuliqi
2024-08-08 8cd9885418c811542c28434da5b1805a4a690092
视频点位在线接口
11个文件已修改
3个文件已添加
2个文件已删除
457 ■■■■■ 已修改文件
ycl-common/src/main/java/constant/ApiConstants.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/constant/CheckConstants.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/param/UY/OnlineParam.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/param/UY/VideoOnlineParam.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OnlineResult.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/VideoOnlineResult.java 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/calculate/IndexCalculationServe.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/calculate/PlatformOnlineCalculation.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/calculate/VideoUsabilityCalculation.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/feign/UYClient.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/PlatformOnlineMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/HKTask.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/UYTask.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/VideoTask.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/PlatformOnlineMapper.xml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/constant/ApiConstants.java
@@ -8,8 +8,8 @@
    public final static String HKSuccessCode = "0";
    public final static String UYSuccessCodeStr = "200";
    public final static Integer UYSuccessCode = 200;
    public final static Integer pageNo = 1;
    public final static Integer pageSize = 20000;
    public final static Integer PageNo = 1;
    public final static Integer PageSize = 20000;
    //请求参数dataType-卡口过车
    public final static Integer HK_DataType_CAR = 1;
    //请求参数dataType-人脸数据
@@ -51,4 +51,13 @@
    public final static Integer UY_RecordStatus_Integrity = 1;
    public final static Integer UY_RecordStatus_Interval = 0;
    public final static Integer UY_RecordStatus_Abnormal = -1;
    //优云点位在线状态
    public final static Integer UY_OnlineStatus_All = 2;
    public final static Integer UY_OnlineStatus_Online = 1;
    public final static Integer UY_OnlineStatus_Offline = -1;
    public final static Integer UY_OnlineStatus_Unknown = 0;
    //自贡行政编码
    public final static String AreaNo = "5103";
}
ycl-common/src/main/java/constant/CheckConstants.java
@@ -12,7 +12,7 @@
    public static final Short Rule_Category_Face = 3;
    //省厅
    public static final Short Examine_Tag_City = 0;
    public static final Short Examine_Tag_Province = 0;
    //区县
    public static final Short Examine_Tag_County = 1;
ycl-pojo/src/main/java/com/ycl/platform/domain/param/UY/OnlineParam.java
File was deleted
ycl-pojo/src/main/java/com/ycl/platform/domain/param/UY/VideoOnlineParam.java
New file
@@ -0,0 +1,40 @@
package com.ycl.platform.domain.param.UY;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
/**
 * 点位在线参数
 *
 * @author gonghl
 * @since 2024/7/1 下午 4:52
 */
@Data
@Accessors(chain = true)
public class VideoOnlineParam {
    private Integer pageNum;
    private Integer pageSize;
    /**
     * 行政区划编码
     */
    private String arealayerno;
    /**
     * 在线状态  2/1/-1/0   全部/在线/离线/未知
     */
    private Integer status;
    /**
     * icmp状态  2/1/-1/0   全部/在线/离线/未知
     */
    private Integer icmpStatus;
    private String field;
    private String order;
    private List dynamicCondition;
}
ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OnlineResult.java
File was deleted
ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/VideoOnlineResult.java
New file
@@ -0,0 +1,121 @@
package com.ycl.platform.domain.result.UY;
import com.ycl.platform.domain.result.BaseResult;
import lombok.Data;
import org.springframework.data.mongodb.core.index.TextIndexed;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
import java.util.List;
/**
 * 点位在线率
 *
 * @author gonghl
 * @since 2024-4-19 11:37:30
 */
@Data
@Document(collection = "uy_online")
public class VideoOnlineResult extends BaseResult {
    /**
     * 行政区划编码
     */
    private String arealayerPath;
    /**
     * 行政区划编码
     */
    private String arealayerno;
    /**
     * 行政区划名称
     */
    @TextIndexed
    private String arealayerName;
    /**
     * 解码状态码
     */
    private Integer decodingCode;
    /**
     * 设备id
     */
    private Integer deviceId;
    /**
     * 设备名称
     */
    private String deviceName;
    /**
     * icmp延迟
     */
    private Double icmpDelay;
    /**
     * icmp状态  2/1/-1/0   全部/在线/离线/未知
     */
    private Integer icmpStatus;
    /**
     * 最近icmp时间
     */
    private Date icmpTime;
    /**
     * 关键帧时延
     */
    private Integer ifmDelay;
    /**
     * ip地址
     */
    private String ipAddr;
    /**
     * 最近持续离线故障次数
     */
    private Integer olErrEverduring;
    /**
     *
     */
    private Date olErrEverduringFirstTime;
    /**
     * 累计离线故障次数
     */
    private Integer olErrTotal;
    /**
     * 累计离线故障率
     */
    private String olErrTotalRate;
    /**
     * 巡检次数
     */
    private Integer olTotal;
    /**
     * sip状态码
     */
    private Integer sipCode;
    /**
     * 信令时延
     */
    private Integer sipDelay;
    /**
     * 在线状态  2/1/-1/0   全部/在线/离线/未知
     */
    private Integer status;
    /**
     * 省厅标签
     */
    private String tagStr;
    /**
     * 省厅标签
     */
    private List<String> tags;
    /**
     * 租户id
     */
    private Integer tenantId;
    /**
     * 视频流时延
     */
    private Integer videoDelay;
    /**
     *
     */
    private Date vqdTime;
}
ycl-server/src/main/java/com/ycl/calculate/IndexCalculationServe.java
@@ -136,7 +136,7 @@
        // 检查是否已存在今日数据
        Optional<T> existingIndex = checkIndexList.stream()
                .filter(index -> key.equals(index.getDeptId().toString()) &&
                        (key.startsWith("Province_") ? CheckConstants.Examine_Tag_City.equals(index.getExamineTag())
                        (key.startsWith("Province_") ? CheckConstants.Examine_Tag_Province.equals(index.getExamineTag())
                                : CheckConstants.Examine_Tag_County.equals(index.getExamineTag())))
                .findFirst();
@@ -146,7 +146,7 @@
            try {
                checkIndex = clazz.getDeclaredConstructor().newInstance();
                checkIndex.setDeptId(key.startsWith("Province_") ? Long.parseLong(key.split("_")[1]) : Long.parseLong(key));
                checkIndex.setExamineTag(key.startsWith("Province_") ? CheckConstants.Examine_Tag_City : CheckConstants.Examine_Tag_County);
                checkIndex.setExamineTag(key.startsWith("Province_") ? CheckConstants.Examine_Tag_Province : CheckConstants.Examine_Tag_County);
                checkIndex.setCreateTime(new Date());
            } catch (Exception e) {
                checkIndex = null;
ycl-server/src/main/java/com/ycl/calculate/PlatformOnlineCalculation.java
New file
@@ -0,0 +1,13 @@
package com.ycl.calculate;
import com.ycl.platform.domain.result.UY.QueryVqdResult;
import java.util.List;
public class PlatformOnlineCalculation extends IndexCalculationServe implements CalculationStrategy<QueryVqdResult> {
    @Override
    public void calculate(List<QueryVqdResult> list) {
    }
}
ycl-server/src/main/java/com/ycl/calculate/VideoUsabilityCalculation.java
@@ -82,9 +82,9 @@
        List<CheckIndexVideo> checkIndexVideos = new ArrayList<>();
        areaStatsMap.forEach((deptId, stats) -> {
            if (stats.totalSites > 0) {
                CheckIndexVideo CheckIndexVideo = createOrUpdateCheckIndexFace(deptId, stats, checkIndexVideoList);
                if (CheckIndexVideo != null) {
                    checkIndexVideos.add(CheckIndexVideo);
                CheckIndexVideo checkIndexVideo = createOrUpdateCheckIndexVideo(deptId, stats, checkIndexVideoList);
                if (checkIndexVideo != null) {
                    checkIndexVideos.add(checkIndexVideo);
                }
            }
        });
@@ -114,7 +114,7 @@
    /**
     * 视频点位在线率
     */
    private CheckIndexVideo createOrUpdateCheckIndexFace(String key, AreaStats stats, List<CheckIndexVideo> checkIndexVideoList) {
    private CheckIndexVideo createOrUpdateCheckIndexVideo(String key, AreaStats stats, List<CheckIndexVideo> checkIndexVideoList) {
        CheckIndexVideo checkIndexVideo = getCheckIndex(key, checkIndexVideoList, CheckIndexVideo.class);
        if (checkIndexVideo == null) {
            return null;
ycl-server/src/main/java/com/ycl/feign/UYClient.java
@@ -2,7 +2,6 @@
import com.alibaba.fastjson2.JSONObject;
import com.ycl.platform.domain.param.UY.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
@@ -35,8 +34,8 @@
     * @param onlineParam 请求参数
     * @return 查询在线统计列表
     */
    @GetMapping("/openapi/v1/report/online/list")
    JSONObject onlineList(@SpringQueryMap OnlineParam onlineParam);
    @GetMapping("/videomon/api/v1/app/onlineMonitor/list")
    JSONObject videoOnline(@SpringQueryMap VideoOnlineParam onlineParam);
    /**
     * 录像可用
ycl-server/src/main/java/com/ycl/platform/mapper/PlatformOnlineMapper.java
@@ -10,6 +10,8 @@
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * 平台在线率 Mapper 接口
 *
@@ -31,7 +33,7 @@
    */
    IPage getPage(IPage page, @Param("query") DataCenterQuery query);
    //统计离线时长
    Integer sumOffTime(@Param("startDate")String startDate,@Param("endDate")String endDate);
    //昨日数据
    List<PlatformOnlineVO> sumYesterday(@Param("startDate")String startDate, @Param("endDate")String endDate);
}
ycl-server/src/main/java/com/ycl/task/HKTask.java
@@ -45,7 +45,7 @@
    public void vehicleDeviceInspectionTask() {
        log.info("开始执行车辆设备全检指标监测结果数据同步");
        VehicleDeviceInspectionParam param = new VehicleDeviceInspectionParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate());
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate());
        JSONObject jsonObject = hkClient.vehicleDeviceInspection(param);
        List<VehicleDeviceInspectionResult> list = getDataList(jsonObject, VehicleDeviceInspectionResult.class, "车辆设备全检指标监测结果数据为空");
        if (!CollectionUtils.isEmpty(list)) {
@@ -64,7 +64,7 @@
    public void faceDeviceInspectionTask() {
        log.info("开始执行人脸设备全检指标监测结果数据同步");
        FaceDeviceInspectionParam param = new FaceDeviceInspectionParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate());
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate());
        JSONObject jsonObject = hkClient.faceDeviceInspection(param);
        List<FaceDeviceInspectionResult> list = getDataList(jsonObject, FaceDeviceInspectionResult.class, "人脸设备全检指标监测结果数据为空");
        if (!CollectionUtils.isEmpty(list)) {
@@ -86,7 +86,7 @@
        log.info("开始执行抓拍数据量检测结果数据同步");
        /** 车辆数据 */
        SnapshotDataMonitorParam carParam = new SnapshotDataMonitorParam();
        carParam.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        carParam.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        JSONObject carJsonObject = hkClient.snapshotDataMonitor(carParam);
        List<SnapshotDataMonitorResult> carList = getDataList(carJsonObject, SnapshotDataMonitorResult.class, "车辆抓拍数据量检测结果数据");
        if (!CollectionUtils.isEmpty(carList)) {
@@ -102,7 +102,7 @@
        /** 人脸数据 */
        SnapshotDataMonitorParam faceParam = new SnapshotDataMonitorParam();
        faceParam.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_FACE);
        faceParam.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_FACE);
        JSONObject faceJsonObject = hkClient.snapshotDataMonitor(carParam);
        List<SnapshotDataMonitorResult> faceList = getDataList(faceJsonObject, SnapshotDataMonitorResult.class, "人脸抓拍数据量检测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
@@ -124,7 +124,7 @@
        log.info("开始执行采集设备属性监测结果数据同步");
        //人脸卡口信息采集准确率
        MonitoringDetailParam param = new MonitoringDetailParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate());
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate());
        JSONObject jsonObject = hkClient.monitorDetail(param);
        List<MonitoringDetailResult> faceList = getDataList(jsonObject, MonitoringDetailResult.class, "采集设备属性监测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
@@ -144,7 +144,7 @@
        log.info("开始执行卡口属性监测结果数据同步");
        //车辆卡口信息采集准确率
        CrossDetailParam param = new CrossDetailParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate());
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate());
        JSONObject jsonObject = hkClient.crossDetail(param);
        List<CrossDetailResult> faceList = getDataList(jsonObject, CrossDetailResult.class, "卡口属性监测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
@@ -164,7 +164,7 @@
        log.info("开始执行数据完整性监测结果数据同步");
        //车辆卡口设备抓拍数据完整性
        DataIntegrityMonitoringParam param = new DataIntegrityMonitoringParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        JSONObject jsonObject = hkClient.dataIntegrityMonitoring(param);
        List<DataIntegrityMonitoringResult> faceList = getDataList(jsonObject, DataIntegrityMonitoringResult.class, "数据完整性监测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
@@ -184,7 +184,7 @@
        log.info("开始执行属性识别准确监测结果数据同步");
        //车辆卡口设备抓拍数据准确性
        AttrRecognitionParam param = new AttrRecognitionParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        JSONObject jsonObject = hkClient.attrRecognitionMonitor(param);
        List<AttrRecognitionMonitorResult> faceList = getDataList(jsonObject, AttrRecognitionMonitorResult.class, "属性识别准确监测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
@@ -206,7 +206,7 @@
        //车辆卡口设备抓拍数据上传及时性
        /** 车辆数据 */
        SnapshotDelayMonitorParam carParam = new SnapshotDelayMonitorParam();
        carParam.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        carParam.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        JSONObject carJsonObject = hkClient.snapshotDelayMonitor(carParam);
        List<SnapshotDelayMonitorResult> carList = getDataList(carJsonObject, SnapshotDelayMonitorResult.class, "车辆抓拍数据量检测结果数据");
        if (!CollectionUtils.isEmpty(carList)) {
@@ -222,7 +222,7 @@
        /** 人脸数据 */
        SnapshotDelayMonitorParam faceParam = new SnapshotDelayMonitorParam();
        faceParam.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_FACE);
        faceParam.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_FACE);
        JSONObject faceJsonObject = hkClient.snapshotDelayMonitor(faceParam);
        List<SnapshotDelayMonitorParam> faceList = getDataList(faceJsonObject, SnapshotDelayMonitorParam.class, "人脸抓拍数据量检测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
@@ -244,7 +244,7 @@
        log.info("开始执行图片访问监测结果数据同步");
        //车辆卡口信息采集准确率、车辆卡口设备url可用性
        PicAccessParam param = new PicAccessParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate()).setDataType(ApiConstants.HK_DataType_CAR);
        JSONObject jsonObject = hkClient.picAccessMonitor(param);
        List<PicAccessResult> faceList = getDataList(jsonObject, PicAccessResult.class, "图片访问监测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
@@ -263,7 +263,7 @@
        log.info("开始执行车辆设备抽检指标监测结果数据同步");
        //车辆卡口信息采集准确率、车辆卡口设备url可用性
        VehicleDeviceSamplingParam param = new VehicleDeviceSamplingParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate());
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate());
        JSONObject jsonObject = hkClient.vehicleDeviceSampling(param);
        List<VehicleDeviceSamplingResult> faceList = getDataList(jsonObject, VehicleDeviceSamplingResult.class, "人脸设备抽检指标监测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
@@ -283,7 +283,7 @@
    public void faceDeviceSamplingTask() {
        log.info("开始执行人脸设备抽检指标监测结果数据同步");
        FaceDeviceSamplingParam param = new FaceDeviceSamplingParam();
        param.setPageNO(ApiConstants.pageNo).setPageSize(ApiConstants.pageSize).setDate(DateUtils.getDate());
        param.setPageNO(ApiConstants.PageNo).setPageSize(ApiConstants.PageSize).setDate(DateUtils.getDate());
        JSONObject jsonObject = hkClient.faceDeviceSampling(param);
        List<FaceDeviceSamplingResult> faceList = getDataList(jsonObject, FaceDeviceSamplingResult.class, "人脸设备抽检指标监测结果数据为空");
        if (!CollectionUtils.isEmpty(faceList)) {
ycl-server/src/main/java/com/ycl/task/UYTask.java
@@ -88,8 +88,8 @@
        //一机一档合格率
        log.info("开始执行一机一档合格率数据同步");
        MonitorQualifyParam param = new MonitorQualifyParam();
        param.setPageNum(ApiConstants.pageNo);
        param.setPageSize(ApiConstants.pageSize);
        param.setPageNum(ApiConstants.PageNo);
        param.setPageSize(ApiConstants.PageSize);
        JSONObject jsonObject = uyClient.monitorQualify(param);
        if (jsonObject != null) {
            log.info("数据格式" + jsonObject);
@@ -118,43 +118,44 @@
        log.info("结束一机一档合格率数据同步");
    }
    //图像监测诊断结果
    public void queryVqdResultTask() {
        //点位在线率
    //点位在线率
    public void videoOnlineTask() {
        //视频图像质量
        log.info("开始执行图像监测诊断结果数据同步");
        QueryVqdParam param = new QueryVqdParam();
        param.setTenantId(tenantId);
        param.setApikey(apikey);
        param.setAccesskey(accesskey);
        JSONObject jsonObject = uyClient.queryVqdResult(param);
        log.info("开始执行点位在线数据同步");
        VideoOnlineParam param = new VideoOnlineParam();
        param.setPageNum(ApiConstants.PageNo);
        param.setPageSize(ApiConstants.PageSize);
        param.setArealayerno(ApiConstants.AreaNo);
        param.setStatus(ApiConstants.UY_OnlineStatus_All);
        param.setIcmpStatus(ApiConstants.UY_OnlineStatus_All);
        JSONObject jsonObject = uyClient.videoOnline(param);
        if (jsonObject != null) {
            log.info("数据格式" + jsonObject);
            Integer statusCode = jsonObject.getInteger("statusCode");
            if (ApiConstants.UYSuccessCode.equals(statusCode)) {
                JSONObject data = jsonObject.getJSONObject("data");
                if (data != null) {
                    List<QueryVqdResult> records = data.getList("records", QueryVqdResult.class);
                    List<VideoOnlineResult> records = data.getList("records", VideoOnlineResult.class);
                    if (!CollectionUtils.isEmpty(records)) {
                        //如果今天存在之前的数据先删除
                        Query query = new Query(Criteria
                                .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date())));
                        DeleteResult result = mongoTemplate.remove(query, QueryVqdResult.class);
                        DeleteResult result = mongoTemplate.remove(query, VideoOnlineResult.class);
                        //存放在mongo中
                        mongoTemplate.insertAll(records);
                    } else {
                        log.error("图像监测诊断结果数据为空{}", data);
                        log.error("点位在线结果数据为空{}", data);
                    }
                } else {
                    log.error("图像监测诊断结果数据为空{}", jsonObject);
                    log.error("点位在线结果数据为空{}", jsonObject);
                }
            } else {
                log.error("图像监测诊断结果请求失败{}", jsonObject);
                log.error("点位在线结果请求失败{}", jsonObject);
            }
        } else {
            log.error("图像监测诊断结果数据为空");
            log.error("点位在线结果数据为空");
        }
        log.info("结束执行图像监测诊断结果数据同步");
        log.info("结束执行点位在线数据同步");
    }
    //录像可用
ycl-server/src/main/java/com/ycl/task/VideoTask.java
@@ -3,23 +3,32 @@
import com.ycl.calculate.CalculationStrategy;
import com.ycl.factory.IndexCalculationFactory;
import com.ycl.platform.domain.entity.CheckIndexVideo;
import com.ycl.platform.domain.param.UY.RecordMetaDSumParam;
import com.ycl.platform.domain.result.HK.SnapshotDataMonitorResult;
import com.ycl.platform.domain.result.UY.QueryVqdResult;
import com.ycl.platform.domain.vo.PlatformOnlineVO;
import com.ycl.platform.mapper.CheckIndexVideoMapper;
import com.ycl.platform.mapper.PlatformOnlineMapper;
import com.ycl.platform.service.PlatformOnlineService;
import com.ycl.system.mapper.SysDeptMapper;
import com.ycl.utils.DateUtils;
import constant.ApiConstants;
import constant.CalculationStrategyConstants;
import constant.CheckConstants;
import enumeration.general.AreaDeptEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 视频计算考核指标任务
@@ -32,6 +41,10 @@
    private MongoTemplate mongoTemplate;
    @Autowired
    private PlatformOnlineMapper platformOnlineMapper;
    @Autowired
    private CheckIndexVideoMapper videoMapper;
    @Autowired
    private SysDeptMapper deptMapper;
    public void siteOnlineTask() {
        Date yesterday = DateUtils.addDays(new Date(), -1);
@@ -64,9 +77,25 @@
    public void platformOnlineTask() {
        //计算平台在线率
        //拿到今日离线时长数据
        Integer time = platformOnlineMapper.sumOffTime(DateUtils.getMouthStart(new Date()), DateUtils.getMouthEnd(new Date()));
        int num = (time / 60) % 30;
        double score = Math.max(1 - num * 0.1,0);
        List<PlatformOnlineVO> list = platformOnlineMapper.sumYesterday(DateUtils.getMouthStart(new Date()), DateUtils.getMouthEnd(new Date()));
//        int num = (time / 60) % 30;
//        double score = Math.max(1 - num * 0.1, 0);
//        List<CheckIndexVideo> checkIndexVideos = videoMapper.selectToday(DateUtils.getDate());
//        List<Long> deptIds = deptMapper.selectByParentId(207L);
//        Map<String, CheckIndexVideo> map = new HashMap<>();
//        for (Long deptId : deptIds) {
//            CheckIndexVideo video = new CheckIndexVideo();
//            video.setExamineTag(CheckConstants.Examine_Tag_County);
//            map.put(deptId + "", video);
//            CheckIndexVideo provinceVideo = new CheckIndexVideo();
//            provinceVideo.setExamineTag(CheckConstants.Examine_Tag_Province);
//            map.put("Province_" + deptId, new CheckIndexVideo());
//        }
//        map.forEach((deptId, video) -> {
//
//        });
    }
}
ycl-server/src/main/resources/mapper/zgyw/PlatformOnlineMapper.xml
@@ -12,12 +12,6 @@
        <result column="create_time" property="createTime" />
    </resultMap>
    <select id="getById" resultMap="BaseResultMap">
        SELECT
            TPO.platform_name,
@@ -52,4 +46,9 @@
            </if>
    </select>
    <select id="sumYesterday" resultMap="BaseResultMap">
        select * from t_platform_online
        where create_date between #{startDate} and #{endDate}
    </select>
</mapper>
ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
@@ -92,9 +92,4 @@
            </if>
        </where>
    </select>
    <select id="sumOffTime" resultType="java.lang.Integer">
        select sum(today_outline_sed) from t_platform_online
        where create_date between #{startDate} and #{endDate}
    </select>
</mapper>