| | |
| | | /** |
| | | * 人脸合格性相关数据 |
| | | */ |
| | | //TODO:参数名修改看接口是否有参数 |
| | | private FaceEligibility faceEligibility; |
| | | |
| | | // 内嵌对象定义 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 车辆信息采集正确率 |
| | | * 车辆数据完整 |
| | | */ |
| | | private CheckIndexCar createOrUpdateCheckIndexCar(String key, AreaStats stats, List<CheckIndexCar> checkIndexCarList) { |
| | | CheckIndexCar checkIndexCar = getCheckIndex(key, checkIndexCarList, CheckIndexCar.class); |
| | |
| | | return null; |
| | | } |
| | | //调用计算方法 |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("totalSites", stats.totalSites); |
| | | param.put("importantTotalSites", stats.importantTotalSites); |
| | | param.put("integritySites", stats.integritySites); |
| | | param.put("importantIntegritySites", stats.importantIntegritySites); |
| | | BigDecimal dataIntegrity = dataIntegrity(param); |
| | | checkIndexCar.setVehicleCaptureIntegrity(dataIntegrity); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("totalSites", stats.totalSites); |
| | | param.put("importantTotalSites", stats.importantTotalSites); |
| | | param.put("integritySites", stats.integritySites); |
| | | param.put("importantIntegritySites", stats.importantIntegritySites); |
| | | BigDecimal dataIntegrity = dataIntegrity(param); |
| | | checkIndexCar.setVehicleCaptureIntegrity(dataIntegrity); |
| | | return checkIndexCar; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 车辆信息采集正确率、url可用性、大图可用性 |
| | | * 车辆抓拍数据准确性、url可用性、大图可用性 |
| | | */ |
| | | private CheckIndexCar createOrUpdateCheckIndexCar(String key, AreaStats stats, List<CheckIndexCar> checkIndexCarList) { |
| | | CheckIndexCar checkIndexCar = getCheckIndex(key, checkIndexCarList, CheckIndexCar.class); |
| | | if (checkIndexCar == null) { |
| | | return null; |
| | | } |
| | | //调用信息采集正确率计算方法 |
| | | log.info("key:{},车辆抓拍数据准确性:totalSites:{},importantTotalSites:{},accuracySites:{},importantAccuracySites:{}",key,stats.totalSites,stats.importantTotalSites,stats.accuracySites,stats.importantAccuracySites); |
| | | //调用车辆抓拍数据准确性计算方法 |
| | | Map<String, Object> accuracyParam = new HashMap<>(); |
| | | accuracyParam.put("totalSites", stats.totalSites); |
| | | accuracyParam.put("importantTotalSites", stats.importantTotalSites); |
| | |
| | | accuracyParam.put("importantAccuracySites", stats.importantAccuracySites); |
| | | BigDecimal dataAccuracy = dataAccuracy(accuracyParam); |
| | | checkIndexCar.setVehicleCaptureAccuracy(dataAccuracy); |
| | | log.info("url可用性: totalSites:{},urlQualifySites:{}",stats.totalSites,stats.urlUsabilitySites); |
| | | //调用url可用性计算方法 |
| | | Map<String, Object> urlParam = new HashMap<>(); |
| | | urlParam.put("totalSites", stats.totalSites); |
| | | urlParam.put("urlQualifySites", stats.urlUsabilitySites); |
| | | BigDecimal urlUsability = urlUsability(urlParam); |
| | | checkIndexCar.setVehicleUrlAvailability(urlUsability); |
| | | log.info("大图可用性: totalSites:{},picUsabilitySites:{}",stats.totalSites,stats.picUsabilitySites); |
| | | //调用大图可用性计算方法 |
| | | Map<String, Object> usabilityParam = new HashMap<>(); |
| | | usabilityParam.put("totalSites", stats.totalSites); |
| | |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | //TODD:系统配置里的区分人脸和车辆、累加次数的概念、区县不少于40路,不达标市州的当月该项成绩不能得分。 |
| | | public class FaceSnapshotDataCalculation extends IndexCalculationServe implements CalculationStrategy<SnapshotDataMonitorResult> { |
| | | @Autowired |
| | | private CheckIndexFaceMapper checkIndexFaceMapper; |
| | |
| | | public BigDecimal monitorQualify(Map<String, Object> param) { |
| | | BigDecimal totalMonitors = new BigDecimal((Integer) param.get("totalMonitors")); |
| | | BigDecimal qualifyMonitor = new BigDecimal((Integer) param.get("qualifyMonitor")); |
| | | return qualifyMonitor.divide(totalMonitors, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalMonitors) == 0 ? BigDecimal.ZERO : qualifyMonitor.divide(totalMonitors, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //一机一档注册率率 |
| | |
| | | BigDecimal totalSites = new BigDecimal((Integer) param.get("totalSites")); |
| | | //正在用的档案数 |
| | | BigDecimal useSites = new BigDecimal((Integer) param.get("totalSites") - (Integer) param.get("newSites")); |
| | | return useSites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSites) == 0 ? BigDecimal.ZERO : useSites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //档案考核比 |
| | | public BigDecimal archivesRate(Map<String, Object> param) { |
| | | BigDecimal allFiles = new BigDecimal((Integer) param.get("allFiles")); |
| | | BigDecimal todayFiles = new BigDecimal((Integer) param.get("todayFiles")); |
| | | return todayFiles.divide(allFiles, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(todayFiles) == 0 ? BigDecimal.ZERO : todayFiles.divide(allFiles, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //点位在线率 |
| | | public BigDecimal siteOnline(Map<String, Object> param) { |
| | | BigDecimal totalSites = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal onlineSites = new BigDecimal((Integer) param.get("onlineSites")); |
| | | return onlineSites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSites) == 0 ? BigDecimal.ZERO : onlineSites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //视频Osd准确率 |
| | | public BigDecimal osdAccuracy(Map<String, Object> param) { |
| | | BigDecimal totalSites = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal osdAccuracySites = new BigDecimal((Integer) param.get("osdAccuracySites")); |
| | | return osdAccuracySites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSites) == 0 ? BigDecimal.ZERO : osdAccuracySites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //视频时间合格率 |
| | | public BigDecimal osdTimeAccuracy(Map<String, Object> param) { |
| | | BigDecimal totalSites = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal timeAccuracySites = new BigDecimal((Integer) param.get("timeAccuracySites")); |
| | | return timeAccuracySites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSites) == 0 ? BigDecimal.ZERO : timeAccuracySites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //目录一致率,每超过百分之1扣10% |
| | |
| | | // 计算newSites占totalSites的百分比倍数 |
| | | BigDecimal percentage = newSites.divide(totalSites, 2, RoundingMode.DOWN).multiply(BigDecimal.valueOf(100)); |
| | | BigDecimal result = BigDecimal.ONE; |
| | | //超过百分之1没,超过了才扣分 |
| | | if (BigDecimal.ONE.compareTo(percentage) <= 0) { |
| | | result = result.subtract(percentage.multiply(new BigDecimal("0.1"))); |
| | | } |
| | |
| | | public BigDecimal viewConnectStability(Map<String, Object> param) { |
| | | BigDecimal totalDataSum = new BigDecimal((Integer) param.get("totalDataSum")); |
| | | BigDecimal avgCount = (BigDecimal) param.get("avgCount"); |
| | | return avgCount.divide(totalDataSum, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalDataSum) == 0 ? BigDecimal.ZERO : avgCount.divide(totalDataSum, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //标注正确率 |
| | | public BigDecimal infoAccuracy(Map<String, Object> param) { |
| | | BigDecimal totalSitesCount = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal qualifySiteCount = new BigDecimal((Integer) param.get("qualifySite")); |
| | | return qualifySiteCount.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSitesCount) == 0 ? BigDecimal.ZERO : qualifySiteCount.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //数据上传及时性 |
| | |
| | | BigDecimal delayCount1 = new BigDecimal((Integer) param.get("delayCount1")); |
| | | BigDecimal delayCount2 = new BigDecimal((Integer) param.get("delayCount2")); |
| | | BigDecimal delayCount3 = new BigDecimal((Integer) param.get("delayCount3")); |
| | | |
| | | BigDecimal result = BigDecimal.ONE.subtract(delayCount1.divide(totalCount, 10, RoundingMode.HALF_UP).multiply(BigDecimal.ONE) |
| | | BigDecimal result = BigDecimal.ZERO.compareTo(totalCount) == 0 ? BigDecimal.ZERO : delayCount1.divide(totalCount, 10, RoundingMode.HALF_UP).multiply(BigDecimal.ONE) |
| | | .add(delayCount2.divide(totalCount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("0.8"))) |
| | | .add(delayCount3.divide(totalCount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("0.6")))); |
| | | .add(delayCount3.divide(totalCount, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("0.6"))); |
| | | return result.setScale(4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | |
| | | public BigDecimal clockAccuracy(Map<String, Object> param) { |
| | | BigDecimal totalSitesCount = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal accuracySites = new BigDecimal((Integer) param.get("accuracySites")); |
| | | return accuracySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSitesCount) == 0 ? BigDecimal.ZERO : accuracySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //url可用性 |
| | | public BigDecimal urlUsability(Map<String, Object> param) { |
| | | BigDecimal totalSitesCount = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal urlQualifySites = new BigDecimal((Integer) param.get("urlQualifySites")); |
| | | return urlQualifySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSitesCount) == 0 ? BigDecimal.ZERO : urlQualifySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //大图可用性 |
| | | public BigDecimal picUsability(Map<String, Object> param) { |
| | | BigDecimal totalSitesCount = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal picUsabilitySites = new BigDecimal((Integer) param.get("picUsabilitySites")); |
| | | return picUsabilitySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSitesCount) == 0 ? BigDecimal.ZERO : picUsabilitySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //图片合格率 |
| | | public BigDecimal dataQualify(Map<String, Object> param) { |
| | | BigDecimal totalSitesCount = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal picQualifySites = new BigDecimal((Integer) param.get("picQualifySites")); |
| | | return picQualifySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSitesCount) == 0 ? BigDecimal.ZERO : picQualifySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //录像可用率 |
| | | public BigDecimal videoUsability(Map<String, Object> param) { |
| | | BigDecimal totalSites = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal usabilitySites = new BigDecimal((Integer) param.get("usabilitySites")); |
| | | return usabilitySites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | return BigDecimal.ZERO.compareTo(totalSites) == 0 ? BigDecimal.ZERO : usabilitySites.divide(totalSites, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //返回省厅国标码集合 |
| | |
| | | return CollectionUtils.isEmpty(commandImages) ? new ArrayList<>() : commandImages.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); |
| | | } |
| | | |
| | | //返回重点指挥图像集合 |
| | | //返回部级点位集合 |
| | | public List<String> getDeptTag() { |
| | | List<YwPoint> commandImages = pointMapper.selectByTag(null, null, null, Boolean.TRUE); |
| | | return CollectionUtils.isEmpty(commandImages) ? new ArrayList<>() : commandImages.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); |
| | |
| | | import com.ycl.system.mapper.SysDeptMapper; |
| | | import constant.ApiConstants; |
| | | import constant.CheckConstants; |
| | | import enumeration.general.AreaDeptEnum; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | private ICheckIndexVideoService checkIndexVideoService; |
| | | |
| | | @Override |
| | | //TODO:分区域 |
| | | public void calculate(List<PlatformOnlineVO> list) { |
| | | Map<String,Double> map = new HashMap<>(); |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | //总离线时长 |
| | | int time = list.stream().map(PlatformOnlineVO::getTodayOutlineSed).reduce(0, Integer::sum); |
| | | //离线时长转换位分钟然后取模 |
| | | int num = (time / 60) % 30; |
| | | double score = Math.max(1 - num * 0.1, 0); |
| | | for (PlatformOnlineVO platformOnlineVO : list) { |
| | | String[] areas = platformOnlineVO.getArea().split(","); |
| | | for (String area : areas) { |
| | | Integer deptId = AreaDeptEnum.fromCode(area).getDeptId(); |
| | | //离线时长 |
| | | Integer time = platformOnlineVO.getTodayOutlineSed(); |
| | | //离线时长转换位分钟 |
| | | int num = (time / 60) / 30; |
| | | double score = Math.max(1 - num * 0.1, 0); |
| | | map.put(deptId+"",score); |
| | | map.put(ApiConstants.Province + deptId,score); |
| | | } |
| | | } |
| | | |
| | | //是否已经存在当日数据 |
| | | List<CheckIndexVideo> checkIndexVideos = videoMapper.selectToday(DateUtils.getDate()); |
| | | //所有区域部门 |
| | | List<Long> deptIds = deptMapper.selectByParentId(207L); |
| | | List<String> keys = new ArrayList<>(); |
| | | //准备区分省厅、区域的deptId list |
| | | for (Long deptId : deptIds) { |
| | | keys.add(deptId + ""); |
| | | keys.add(ApiConstants.Province + deptId); |
| | | } |
| | | |
| | | List<CheckIndexVideo> videos = new ArrayList<>(); |
| | | keys.forEach(key -> { |
| | | map.forEach((key,score) -> { |
| | | //如果不存在就新增如果存在则复用 |
| | | CheckIndexVideo checkIndex = getCheckIndex(key, checkIndexVideos, CheckIndexVideo.class); |
| | | if (checkIndex != null) { |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 计算视频设备点位在线率、重点点位在线率、重点指挥图像在线率 |
| | | * 计算视频设备点位在线率、重点点位在线率、重点指挥图像在线率、部级点位在线率 |
| | | * 图像监测诊断结果 |
| | | * 获取分省厅、区域的map<k,v> k为deptId或者Province_deptId |
| | | * 循环map计算数据上传及时性 |
| | |
| | | int importantOnlineSites = 0; |
| | | int commandSites = 0; |
| | | int commandOnlineSites =0; |
| | | int deptSites = 0; |
| | | int deptOnlineSites = 0; |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<String> important = getImportant(); |
| | | //重点指挥图像集合 |
| | | List<String> commandImage = getCommandImage(); |
| | | //获取部级点位集合 |
| | | List<String> deptTag = getDeptTag(); |
| | | |
| | | Map<String, AreaStats> areaStatsMap = new HashMap<>(); |
| | | for (VideoOnlineResult result : list) { |
| | |
| | | if (monitor == null) continue; |
| | | |
| | | String deptId = monitor.getDeptId().toString(); |
| | | updateAreaStats(areaStatsMap, deptId, result, important,commandImage); |
| | | updateAreaStats(areaStatsMap, deptId, result, important,commandImage,deptTag); |
| | | |
| | | // 处理省厅数据 |
| | | if (!CollectionUtils.isEmpty(provinceIds) && provinceIds.contains(monitor.getSerialNumber())) { |
| | | String provinceKey = ApiConstants.Province + deptId; |
| | | updateAreaStats(areaStatsMap, provinceKey, result, important,commandImage); |
| | | updateAreaStats(areaStatsMap, provinceKey, result, important,commandImage,deptTag); |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * 累计总点位数、在线点位数、重点点位数、重点点位在线数、指挥图像数、指挥图像在线数 |
| | | */ |
| | | private void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, VideoOnlineResult result, List<String> important, List<String> commandImage) { |
| | | private void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, VideoOnlineResult result, List<String> important, List<String> commandImage,List<String> deptTag) { |
| | | //返回对象的引用,如果不存在会放入新的key,value |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | |
| | | if(commandImage.contains(result.getDeviceId())){ |
| | | stats.commandSites++; |
| | | } |
| | | if(deptTag.contains(result.getDeviceId())){ |
| | | stats.deptSites++; |
| | | } |
| | | if (ApiConstants.UY_OnlineSite_Online.equals(result.getStatus())){ |
| | | stats.onlineSites++; |
| | | if(important.contains(result.getDeviceId())){ |
| | |
| | | } |
| | | if(commandImage.contains(result.getDeviceId())){ |
| | | stats.commandOnlineSites++; |
| | | } |
| | | if(deptTag.contains(result.getDeviceId())){ |
| | | stats.deptOnlineSites++; |
| | | } |
| | | } |
| | | } |
| | |
| | | }else { |
| | | log.info("指挥图像点位数为0"); |
| | | } |
| | | //调用点位在线率计算方法 计算部级点位在线率 |
| | | if(stats.deptSites!=0) { |
| | | Map<String, Object> deptParam = new HashMap<>(); |
| | | deptParam.put("totalSites", stats.deptSites); |
| | | deptParam.put("onlineSites", stats.deptOnlineSites); |
| | | BigDecimal deptOnline = siteOnline(deptParam); |
| | | checkIndexVideo.setMinistrySiteOnline(deptOnline); |
| | | }else { |
| | | log.info("部级点位数为0"); |
| | | } |
| | | return checkIndexVideo; |
| | | } |
| | | } |
| | |
| | | int usabilitySites = 0; |
| | | int importantSites = 0; |
| | | int importantUsabilitySites = 0; |
| | | int deptSite =0; |
| | | int depteUsabilitySites = 0; |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<String> provinceIds = getProvince(); |
| | | //重点点位集合 |
| | | List<String> important = getImportant(); |
| | | |
| | | List<String> deptTag = getDeptTag(); |
| | | Map<String, AreaStats> areaStatsMap = new HashMap<>(); |
| | | for (RecordMetaDSumResult result : list) { |
| | | TMonitorVO monitor = monitorMap.get(result.getDeviceId()); |
| | | if (monitor == null) continue; |
| | | |
| | | String deptId = monitor.getDeptId().toString(); |
| | | updateAreaStats(areaStatsMap, deptId, result, important); |
| | | updateAreaStats(areaStatsMap, deptId, result, important,deptTag); |
| | | |
| | | // 处理省厅数据 |
| | | if (!CollectionUtils.isEmpty(provinceIds) && provinceIds.contains(monitor.getSerialNumber())) { |
| | | String provinceKey = ApiConstants.Province + deptId; |
| | | updateAreaStats(areaStatsMap, provinceKey, result, important); |
| | | updateAreaStats(areaStatsMap, provinceKey, result, important,deptTag); |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * 累计总点位数、在线点位数、重点点位数、重点点位在线数 |
| | | */ |
| | | private void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, RecordMetaDSumResult result, List<String> important) { |
| | | private void updateAreaStats(Map<String, AreaStats> areaStatsMap, String key, RecordMetaDSumResult result, List<String> important,List<String> deptTag) { |
| | | //返回对象的引用,如果不存在会放入新的key,value |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | boolean flag = important.contains(result.getDeviceId()); |
| | | if(flag){ |
| | | if(important.contains(result.getDeviceId())){ |
| | | stats.importantSites++; |
| | | } |
| | | if(deptTag.contains(result.getDeviceId())){ |
| | | stats.deptSite++; |
| | | } |
| | | if (ApiConstants.UY_RecordStatus_Integrity.equals(result.getRecordStatus())){ |
| | | stats.usabilitySites++; |
| | | if(flag){ |
| | | if(important.contains(result.getDeviceId())){ |
| | | stats.importantUsabilitySites++; |
| | | } |
| | | if(deptTag.contains(result.getDeviceId())){ |
| | | stats.depteUsabilitySites++; |
| | | } |
| | | } |
| | | } |
| | |
| | | importantParam.put("usabilitySites", stats.importantUsabilitySites); |
| | | BigDecimal importantVideoUsability = videoUsability(importantParam); |
| | | checkIndexVideo.setKeyVideoAvailable(importantVideoUsability); |
| | | //调用录像可用率计算方法 计算部级录像可用率 |
| | | Map<String, Object> deptParam = new HashMap<>(); |
| | | deptParam.put("totalSites", stats.deptSite); |
| | | deptParam.put("usabilitySites", stats.depteUsabilitySites); |
| | | BigDecimal deptUseability = videoUsability(deptParam); |
| | | checkIndexVideo.setMinistryVideoAvailable(deptUseability); |
| | | return checkIndexVideo; |
| | | } |
| | | } |
| | |
| | | |
| | | // STEP5:组装请求参数 |
| | | String body = JSON.toJSONString(params); |
| | | log.info("请求参数:{}",body); |
| | | // STEP6:调用接口 |
| | | String result = null;// post请求application/json类型参数 |
| | | List<T> dataList = new ArrayList<>(); |
| | |
| | | job.setConcurrent("1"); |
| | | job.setStatus(checkTemplateDTO.getStatus()); |
| | | job.setJobGroup("CHECK"); |
| | | job.setCronExpression("0 0 12 * * ?"); |
| | | job.setCronExpression("0 0 6 * * ?"); |
| | | job.setJobName(checkTemplateDTO.getTemplateName()); |
| | | int i = jobService.insertJob(job); |
| | | return job; |
| | |
| | | for (CalculateRuleVO calculateRuleVO : ruleList) { |
| | | Double max = calculateRuleVO.getMax(); |
| | | Double min = calculateRuleVO.getMin(); |
| | | //判断范围在哪个区间 //TODO:判断单位 |
| | | if (checkRange(min, max, BigDecimal.valueOf(result.getMissDuration()))) { |
| | | //判断范围在哪个区间 单位是小时转换为分钟 |
| | | if (checkRange(min, max, BigDecimal.valueOf(result.getMissDuration()*60))) { |
| | | if (calculateRuleVO.getNum() == null) { |
| | | calculateRuleVO.setNum(1); |
| | | } else { |
| | |
| | | faceParam.setDataType(ApiConstants.HK_DataType_FACE); |
| | | List<SnapshotDataMonitorResult> faceList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/data/snapCountDetail/query", faceParam, SnapshotDataMonitorResult.class); |
| | | if (!CollectionUtils.isEmpty(faceList)) { |
| | | log.info("结果数据大小:{}",faceList.size()); |
| | | //如果今天存在之前的数据先删除 |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date())) |
| | | .and("dataType").is(ApiConstants.HK_DataType_FACE)); |
| | | DeleteResult result = mongoTemplate.remove(query, SnapshotDataMonitorResult.class); |
| | | //存放在mongo中 |
| | | carList.forEach(item -> item.setDataType(ApiConstants.HK_DataType_FACE)); |
| | | faceList.forEach(item -> item.setDataType(ApiConstants.HK_DataType_FACE)); |
| | | mongoTemplate.insertAll(faceList); |
| | | } |
| | | log.info("结束抓拍数据量检测结果数据同步"); |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ycl.platform.mapper.CheckScoreMapper"> |
| | | |
| | | |
| | | <resultMap type="com.ycl.platform.domain.entity.CheckScore" id="CheckScoreResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="score" column="score" /> |
| | |
| | | <if test="deptId != null "> and tcs.dept_id = #{deptId}</if> |
| | | ${params.dataScope} |
| | | </where> |
| | | order by createTime desc; |
| | | </select> |
| | | |
| | | |
| | | <select id="selectCheckScoreById" parameterType="Long" resultMap="CheckScoreResult"> |
| | | <include refid="selectCheckScoreVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertCheckScore" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into t_check_score |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </delete> |
| | | |
| | | <delete id="deleteCheckScoreByIds" parameterType="String"> |
| | | delete from t_check_score where id in |
| | | delete from t_check_score where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | |
| | | ORDER BY score DESC, tcs.dept_id |
| | | </select> |
| | | |
| | | </mapper> |
| | | </mapper> |
| | |
| | | <result column="today_outline_sed" property="todayOutlineSed" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="area" property="area" /> |
| | | </resultMap> |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | |
| | | |
| | | |
| | | <select id="yesterdayData" resultMap="BaseResultMap"> |
| | | select * from t_platform_online |
| | | where create_date between #{startDate} and #{endDate} |
| | | select po.*,p.area from t_platform_online po inner join t_platform p on po.platform_id = p.id |
| | | where po.create_date between #{startDate} and #{endDate} |
| | | </select> |
| | | </mapper> |