| | |
| | | package com.ycl.task; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.mongodb.client.result.DeleteResult; |
| | | import com.ycl.platform.domain.param.UY.OnlineParam; |
| | | import com.ycl.platform.domain.param.UY.QueryVqdParam; |
| | | import com.ycl.platform.domain.result.HK.PicAccessResult; |
| | | import com.ycl.platform.domain.result.UY.QueryVqdResult; |
| | | import com.ycl.platform.service.IYwThresholdService; |
| | | import com.ycl.feign.UYClient; |
| | | import com.ycl.utils.DateUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | 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.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Slf4j |
| | |
| | | @Autowired |
| | | private IYwThresholdService ywThresholdService; |
| | | |
| | | private final static Integer pageNo = 1; |
| | | private final static Integer pageSize = 5000; |
| | | //成功状态码 |
| | | private final static String successCode = "0"; |
| | | |
| | | //车辆设备全检指标监测结果 |
| | | public void VehicleDeviceInspectionTask() { |
| | | log.info("开始执行车辆设备全检指标监测结果数据同步"); |
| | | |
| | | log.info("结束车辆设备全检指标监测结果数据同步"); |
| | | } |
| | | |
| | | |
| | | public void FaceDeviceInspectionTask() { |
| | | log.info("开始执行人脸设备全检指标监测结果数据同步"); |
| | | |
| | | log.info("结束人脸设备全检指标监测结果数据同步"); |
| | | } |
| | | @Value("${youYun.tenantId}") |
| | | private String tenantId; |
| | | |
| | | //一机一档 |
| | | public void task1() { |
| | | public void monitorTask() { |
| | | log.info("开始执行一机一档数据同步"); |
| | | //一机一档合格率 |
| | | // 一机一档注册率 |
| | | // 档案考核比 |
| | | log.info("结束执行一机一档数据同步"); |
| | | } |
| | | |
| | | //图像监测诊断结果 |
| | | public void task2() { |
| | | public void queryVqdResultTask() { |
| | | //点位在线率 |
| | | log.info("开始执行图像监测诊断结果数据同步"); |
| | | QueryVqdParam param = new QueryVqdParam(); |
| | | param.setTenantId(tenantId); |
| | | JSONObject jsonObject = uyClient.queryVqdResult(param); |
| | | if (jsonObject != null) { |
| | | JSONObject cameraList = jsonObject.getJSONObject("CameraList"); |
| | | if (cameraList != null) { |
| | | List<QueryVqdResult> data = cameraList.getList("data", QueryVqdResult.class); |
| | | if (!CollectionUtils.isEmpty(data)) { |
| | | //如果今天存在之前的数据先删除 |
| | | Query query = new Query(Criteria |
| | | .where("createTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, PicAccessResult.class); |
| | | //存放在mongo中 |
| | | mongoTemplate.insert(data); |
| | | } else { |
| | | log.error("图像监测诊断结果数据为空{}", cameraList); |
| | | } |
| | | } else { |
| | | log.error("图像监测诊断结果数据为空{}", jsonObject); |
| | | } |
| | | } else { |
| | | log.error("图像监测诊断结果数据为空"); |
| | | } |
| | | |
| | | log.info("结束执行图像监测诊断结果数据同步"); |
| | | } |
| | | |
| | | //录像可用 |
| | |
| | | //录像可用率 |
| | | } |
| | | |
| | | private String getToday() { |
| | | Date date = new Date(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String today = sdf.format(date); |
| | | return today; |
| | | //视频图像质量 |
| | | public void task4() { |
| | | //录像可用率 |
| | | } |
| | | } |