From 9d5878687df1a39293c171a93b8f57f2fb4559a5 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 09 八月 2024 09:16:43 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ycl-server/src/main/java/com/ycl/calculate/VideoUsabilityCalculation.java | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/calculate/VideoUsabilityCalculation.java b/ycl-server/src/main/java/com/ycl/calculate/VideoUsabilityCalculation.java index 954343f..1e30c0e 100644 --- a/ycl-server/src/main/java/com/ycl/calculate/VideoUsabilityCalculation.java +++ b/ycl-server/src/main/java/com/ycl/calculate/VideoUsabilityCalculation.java @@ -5,7 +5,9 @@ import com.ycl.platform.domain.entity.TMonitor; import com.ycl.platform.domain.param.UY.RecordMetaDSumParam; import com.ycl.platform.domain.result.UY.QueryVqdResult; +import com.ycl.platform.domain.vo.TMonitorVO; import com.ycl.platform.mapper.CheckIndexVideoMapper; +import com.ycl.platform.mapper.TMonitorMapper; import com.ycl.platform.service.ICheckIndexVideoService; import com.ycl.platform.service.ITMonitorService; import constant.ApiConstants; @@ -34,7 +36,7 @@ @Autowired private CheckIndexVideoMapper checkIndexVideoMapper; @Autowired - private ITMonitorService monitorService; + private TMonitorMapper monitorMapper; @Autowired private ICheckIndexVideoService checkIndexVideoService; @@ -53,9 +55,8 @@ } //鑾峰緱鍥芥爣鐮佷负key鐨勮澶噈ap - Map<String, TMonitor> monitorMap = monitorService.list(new QueryWrapper<TMonitor>() - .in("serial_number", list.stream().map(RecordMetaDSumParam::getDeviceId).collect(Collectors.toList()))) - .stream().collect(Collectors.toMap(TMonitor::getSerialNumber, Function.identity())); + Map<String, TMonitorVO> monitorMap = monitorMapper.selectListByIds(list.stream().map(RecordMetaDSumParam::getDeviceId).collect(Collectors.toList())) + .stream().collect(Collectors.toMap(TMonitorVO::getSerialNumber, Function.identity())); //鑾峰彇鐪佸巺鍥芥爣鐮侀泦鍚� List<String> provinceIds = getProvince(); //閲嶇偣鐐逛綅闆嗗悎 @@ -63,7 +64,7 @@ Map<String, AreaStats> areaStatsMap = new HashMap<>(); for (RecordMetaDSumParam result : list) { - TMonitor monitor = monitorMap.get(result.getDeviceId()); + TMonitorVO monitor = monitorMap.get(result.getDeviceId()); if (monitor == null) continue; String deptId = monitor.getDeptId().toString(); @@ -81,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); } } }); @@ -113,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; -- Gitblit v1.8.0