| | |
| | | @Override |
| | | public void faceCheck(List<FaceDeviceInspectionResult> list) { |
| | | Map<String, YwThreshold> thresholdMap = getYwThresholdMap(BusinessTypeEnum.FACE.name()); |
| | | //准备下发工单集合 |
| | | //准备待下发工单集合 |
| | | List<WorkOrder> distributeList = new ArrayList<>(); |
| | | //准备自动生成工单集合 |
| | | //准备直接下发工单集合 |
| | | List<WorkOrder> workOrderList = new ArrayList<>(); |
| | | //处理接口数据 |
| | | for (FaceDeviceInspectionResult result : list) { |
| | |
| | | //检查白天未识别量 |
| | | Integer dayNoNumberCountResult = result.getSnapPlate().getDayNoNumberCount(); |
| | | check(YwThreadConstants.Car_DayNoNumberCount, dayNoNumberCountResult, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.UNRECOGNIZED_DAY_VOLUME.getValue()); |
| | | //车辆主要属性不完整率 |
| | | //车辆主要属性一致率 |
| | | Integer noIntegrityCountResult = result.getIntegrity().getMainNoIntegrityCount(); |
| | | check(YwThreadConstants.Car_NoIntegrityCount, noIntegrityCountResult, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.CAR_SIX.getValue()); |
| | | Integer dataCount = result.getDataCount(); |
| | | Double integrityRate = ((double)dataCount-noIntegrityCountResult)/dataCount; |
| | | check(YwThreadConstants.Car_NoIntegrityCount, integrityRate, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.LESS_THAN_EQ, ErrorType.CAR_SIX.getValue()); |
| | | // 点位在线率 |
| | | if (2 == result.getSnapResult()) { |
| | | workOrder.setSerialNumber(result.getExternalIndexCode()); |
| | |
| | | /** 添加工单 */ |
| | | workOrderService.innerAddWorkOrder(workOrderList); |
| | | workOrderService.innerAddWorkOrder(distributeList); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | v -> { |
| | | YwThreshold ywThreshold = thresholds.get(key); |
| | | //转换类型 |
| | | T thresholdValue = parseThreshold(ywThreshold.getValueAuto(), value.getClass()); |
| | | T thresholdAutoValue = parseThreshold(ywThreshold.getValue(), value.getClass()); |
| | | //待工单阈值 |
| | | T thresholdAutoValue = parseThreshold(ywThreshold.getValueAuto(), value.getClass()); |
| | | //直接下发工单阈值 |
| | | T thresholdValue = parseThreshold(ywThreshold.getValue(), value.getClass()); |
| | | if("percent".equals(ywThreshold.getCountType())){ |
| | | if (thresholdAutoValue instanceof Float) { |
| | | thresholdAutoValue = (T) Float.valueOf(((Float) thresholdAutoValue) / 100f); |
| | | } |
| | | if (thresholdValue instanceof Float) { |
| | | thresholdValue = (T) Float.valueOf(((Float) thresholdValue) / 100f); |
| | | } |
| | | } |
| | | //比较大小,加入到对应待处理集合 |
| | | if (compareType.compare(v, thresholdAutoValue)) { |
| | | //自动下发工单 |
| | | if (compareType.compare(v, thresholdValue)) { |
| | | //进入工单直接下发 |
| | | workOrder.setSerialNumber(serialNumber); |
| | | workOrder.setStatus(WorkOrderStatusEnum.WAIT_DISTRIBUTE); |
| | | workOrder.setStatus(WorkOrderStatusEnum.DISTRIBUTED); |
| | | if (CollectionUtils.isEmpty(workOrder.getErrorTypeList())) { |
| | | workOrder.setErrorTypeList(new ArrayList<>()); |
| | | workOrder.getErrorTypeList().add(errorType); |
| | | } else { |
| | | workOrder.getErrorTypeList().add(errorType); |
| | | } |
| | | } else if (compareType.compare(v, thresholdValue)) { |
| | | } else if (compareType.compare(v, thresholdAutoValue)) { |
| | | //进入工单代下发 |
| | | workOrder.setSerialNumber(serialNumber); |
| | | workOrder.setStatus(WorkOrderStatusEnum.DISTRIBUTED); |
| | | workOrder.setStatus(WorkOrderStatusEnum.WAIT_DISTRIBUTE); |
| | | if (CollectionUtils.isEmpty(workOrder.getErrorTypeList())) { |
| | | workOrder.setErrorTypeList(new ArrayList<>()); |
| | | workOrder.getErrorTypeList().add(errorType); |