From 8cd9885418c811542c28434da5b1805a4a690092 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 08 八月 2024 20:47:38 +0800 Subject: [PATCH] 视频点位在线接口 --- ycl-server/src/main/java/com/ycl/task/VideoTask.java | 35 ++++++++++++++++++++++++++++++++--- 1 files changed, 32 insertions(+), 3 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/task/VideoTask.java b/ycl-server/src/main/java/com/ycl/task/VideoTask.java index 1fbec55..827d57a 100644 --- a/ycl-server/src/main/java/com/ycl/task/VideoTask.java +++ b/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) -> { +// +// }); + } } -- Gitblit v1.8.0