| | |
| | | |
| | | @Autowired |
| | | private WorkOrderWhiteMapper workOrderWhiteMapper; |
| | | |
| | | /** |
| | | * 查询运维阈值 |
| | | * |
| | |
| | | } |
| | | WorkOrder workOrder = new WorkOrder(); |
| | | //检查时钟准确率 |
| | | if (result.getSnapClock() != null) { |
| | | Float clockPercent = result.getSnapClock().getClockPercent(); |
| | | check(YwThreadConstants.Face_ClockPercent, clockPercent, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.LESS_THAN_EQ, ErrorType.CLOCK_RIGHT.getValue()); |
| | | } |
| | | //检查数据及时率 |
| | | if (result.getSnapTimely() != null) { |
| | | Float timelyPercent = result.getSnapTimely().getTimelyPercent(); |
| | | check(YwThreadConstants.Face_TimelyPercent, timelyPercent, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.LESS_THAN_EQ, ErrorType.DATA_TIMELY_ERROR.getValue()); |
| | | } |
| | | //检查持续无数据天数 |
| | | if (result.getContinueNoDataCount() != null) { |
| | | Integer continueNoDataCount = result.getContinueNoDataCount(); |
| | | check(YwThreadConstants.Face_ContinueNoDataCount, continueNoDataCount, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.LONG_DAY_NO_DATA.getValue()); |
| | | } |
| | | //检查不唯一数据量 |
| | | if (result.getSnapUnique() != null) { |
| | | Integer nouniqueCount = result.getSnapUnique().getNouniqueCount(); |
| | | check(YwThreadConstants.Face_NouniqueCount, nouniqueCount, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.NOT_UNIQUE_DATA_VOLUME.getValue()); |
| | | } |
| | | //检查人脸低评分率 |
| | | if (result.getSnapValidity() != null) { |
| | | Float lowScorePercent = result.getSnapValidity().getLowScorePercent(); |
| | | check(YwThreadConstants.Face_LowScorePercent, lowScorePercent, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.FACE_LOW.getValue()); |
| | | } |
| | | //检查建模失败率 |
| | | if (result.getSnapValidity() != null) { |
| | | Float failPercent = result.getSnapValidity().getFailPercent(); |
| | | check(YwThreadConstants.Face_FailPercent, failPercent, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.MODELING_FAIL.getValue()); |
| | | } |
| | | // 点位在线率 |
| | | if (2 == result.getSnapResult()) { |
| | | workOrder.setSerialNumber(result.getExternalIndexCode()); |
| | |
| | | Integer continueNoDataCount = result.getContinueNoDataCount(); |
| | | check(YwThreadConstants.Car_ContinueNoDataCount, continueNoDataCount, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.LONG_DAY_NO_DATA.getValue()); |
| | | //检查时钟准确率 |
| | | if (result.getSnapClock() != null) { |
| | | Float clockPercent = result.getSnapClock().getClockPercent(); |
| | | check(YwThreadConstants.Car_ClockPercent, clockPercent, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.LESS_THAN_EQ, ErrorType.CLOCK_RIGHT.getValue()); |
| | | } |
| | | //检查数据及时率 |
| | | if (result.getSnapTimely() != null) { |
| | | Float timelyPercentResult = result.getSnapTimely().getTimelyPercent(); |
| | | check(YwThreadConstants.Car_TimelyPercent, timelyPercentResult, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.LESS_THAN_EQ, ErrorType.DATA_TIMELY_ERROR.getValue()); |
| | | } |
| | | //检查不唯一数据量 |
| | | if (result.getSnapUnique() != null) { |
| | | Integer nouniqueCountResult = result.getSnapUnique().getNouniqueCount(); |
| | | check(YwThreadConstants.Car_NouniqueCount, nouniqueCountResult, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.NOT_UNIQUE_DATA_VOLUME.getValue()); |
| | | } |
| | | //检查白天未识别量 |
| | | if (result.getSnapPlate() != null) { |
| | | Integer dayNoNumberCountResult = result.getSnapPlate().getDayNoNumberCount(); |
| | | check(YwThreadConstants.Car_DayNoNumberCount, dayNoNumberCountResult, result.getExternalIndexCode(), thresholdMap, workOrder, CompareType.MORE_THAN_EQ, ErrorType.UNRECOGNIZED_DAY_VOLUME.getValue()); |
| | | } |
| | | //车辆主要属性一致率 |
| | | if (result.getIntegrity() != null) { |
| | | Integer noIntegrityCountResult = result.getIntegrity().getMainNoIntegrityCount(); |
| | | 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()); |
| | |
| | | |
| | | /** |
| | | * 白名单详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | workOrderWhite.setErrorTypeList(errorTypeList); |
| | | return Result.ok().data(workOrderWhite); |
| | | } |
| | | |
| | | /** |
| | | * 工单白名单列表 |
| | | * |
| | |
| | | return Result.ok(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改工单白名单 |
| | | * |
| | |
| | | workOrderWhiteMapper.batchDelete(ids); |
| | | return Result.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 白名单导出 |
| | | * |
| | | * @param response |
| | | * @throws IOException |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 导入工单白名单 |
| | | * |
| | | * @param file |
| | | * @return |
| | | */ |
| | |
| | | // 将读取到的每一行存入reportDetails集合中 |
| | | dataList.add(excel); |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) {} |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | } |
| | | }).sheet().doRead(); |
| | | |
| | | if (CollectionUtils.isEmpty(dataList)) { |
| | |
| | | //把中文转换为数据库存储格式 |
| | | String errorText = ErrorType.getValueByDescription(desc); |
| | | //找不到抛出异常 |
| | | if(errorText == null) throw new RuntimeException("国标码为"+item.getSerialNumber()+"的设备故障类型有误"); |
| | | if (errorText == null) |
| | | throw new RuntimeException("国标码为" + item.getSerialNumber() + "的设备故障类型有误"); |
| | | errorDataList.add(errorText); |
| | | }); |
| | | white.setErrorType(String.join(",", errorDataList)); |
| | |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改白名单 |
| | | * |
| | |
| | | //把中文转换为数据库存储格式 |
| | | String errorText = ErrorType.getValueByDescription(desc); |
| | | //找不到抛出异常 |
| | | if(errorText == null) throw new RuntimeException("国标码为"+item.getSerialNumber()+"的设备故障类型有误"); |
| | | if (errorText == null) |
| | | throw new RuntimeException("国标码为" + item.getSerialNumber() + "的设备故障类型有误"); |
| | | errorDataList.add(errorText); |
| | | }); |
| | | white.setErrorType(String.join(",", errorDataList)); |
| | |
| | | * @param <T> |
| | | */ |
| | | @Override |
| | | public <T extends Comparable<T>> void check(String key, T value, String serialNumber, Map<String, YwThreshold> thresholds, WorkOrder workOrder, CompareType compareType,String errorType) { |
| | | public <T extends Comparable<T>> void check(String key, T value, String |
| | | serialNumber, Map<String, YwThreshold> thresholds, WorkOrder workOrder, CompareType compareType, String |
| | | errorType) { |
| | | Optional.ofNullable(value).ifPresentOrElse( |
| | | v -> { |
| | | YwThreshold ywThreshold = thresholds.get(key); |