| | |
| | | package com.ycl.calculate; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ycl.platform.domain.entity.CheckIndexFace; |
| | | import com.ycl.platform.domain.entity.TMonitor; |
| | | import com.ycl.platform.domain.result.HK.FaceDeviceInspectionResult; |
| | | import com.ycl.platform.domain.result.HK.FaceDeviceSamplingResult; |
| | | import com.ycl.platform.domain.vo.TMonitorVO; |
| | | import com.ycl.platform.mapper.CheckIndexFaceMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.service.ICheckIndexFaceService; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | | import constant.ApiConstants; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | * 更新或新增 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class FaceDeviceSampleCalculation extends IndexCalculationServe implements CalculationStrategy<FaceDeviceSamplingResult> { |
| | | @Autowired |
| | | private CheckIndexFaceMapper checkIndexFaceMapper; |
| | |
| | | @Override |
| | | public void calculate(List<FaceDeviceSamplingResult> list) { |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | log.info("数据为空"); |
| | | return; |
| | | } |
| | | //返回以国标码为key的设备map |
| | |
| | | //返回对象的引用,如果不存在会放入新的key,value |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | FaceDeviceSamplingResult.BigUsefulness bigUseful = result.getBigUseful(); |
| | | FaceDeviceSamplingResult.FaceEligibility faceElig = result.getFaceElig(); |
| | | FaceDeviceSamplingResult.FaceEligibility faceElig = result.getFaceEligibility(); |
| | | stats.totalSites++; |
| | | //90%及以上数据合格则此人脸设备被视为图片合格 |
| | | if (faceElig.getFaceEligPercent() >= 0.9) { |
| | | stats.picQualifySites++; |
| | | if (faceElig != null) { |
| | | if (faceElig.getFaceEligPercent() >= 0.9) { |
| | | stats.picQualifySites++; |
| | | } |
| | | } |
| | | //大图可用率大于90%视为合格 |
| | | if (bigUseful.getBigUsefulPercent() >= 0.9) { |
| | | stats.picUsabilitySites++; |
| | | if (bigUseful != null) { |
| | | if (bigUseful.getBigUsefulPercent() >= 0.9) { |
| | | stats.picUsabilitySites++; |
| | | } |
| | | } |
| | | } |
| | | |