|
|
@ -644,14 +644,12 @@ public class ResultAnalysisController extends BaseController { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 缺陷记录(将确认缺陷的数据展示在这) |
|
|
* 缺陷记录(将确认缺陷的数据展示在这) |
|
|
|
|
|
* @param query 查询条件:点位名称、算法名称(下拉,选项见 /defect/algNameOptions)、采集时间范围 |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@GetMapping({"/defect/list"}) |
|
|
@GetMapping({"/defect/list"}) |
|
|
public TableDataInfo defectList() { |
|
|
|
|
|
ResultAnalysis resultAnalysis = new ResultAnalysis(); |
|
|
|
|
|
resultAnalysis.setPointStatusList(Arrays.asList(PointStatusEnum.CONFIRMED.getCode(), PointStatusEnum.TRACKING.getCode())); |
|
|
|
|
|
// 查出全部数据 |
|
|
|
|
|
List<PatrolData> allList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); |
|
|
|
|
|
|
|
|
public TableDataInfo defectList(DefectListQuery query) { |
|
|
|
|
|
List<PatrolData> allList = patrolResultService.selectDefectList(query); |
|
|
|
|
|
|
|
|
Map<String, String> imageNormalMap = allList.parallelStream() |
|
|
Map<String, String> imageNormalMap = allList.parallelStream() |
|
|
.filter(patrolData -> StringUtils.isNotEmpty(patrolData.getImageNormalUrlPath())) |
|
|
.filter(patrolData -> StringUtils.isNotEmpty(patrolData.getImageNormalUrlPath())) |
|
|
@ -742,6 +740,11 @@ public class ResultAnalysisController extends BaseController { |
|
|
|
|
|
|
|
|
resultList.add(patrolData); |
|
|
resultList.add(patrolData); |
|
|
}); |
|
|
}); |
|
|
|
|
|
// 算法名称筛选:algType 属于聚合分组维度,按聚合记录的 algName 精确匹配,命中记录整条保留(多条缺陷描述不会丢失) |
|
|
|
|
|
if (query != null && StringUtils.isNotEmpty(query.getAlgName())) { |
|
|
|
|
|
String selectedAlgName = query.getAlgName(); |
|
|
|
|
|
resultList.removeIf(item -> !selectedAlgName.equals(item.getAlgName())); |
|
|
|
|
|
} |
|
|
// 非 null 的值按降序排列(最新的时间在前),null的在最后面排列 |
|
|
// 非 null 的值按降序排列(最新的时间在前),null的在最后面排列 |
|
|
resultList.sort(Comparator.comparing(PatrolData::getPatrolTime, |
|
|
resultList.sort(Comparator.comparing(PatrolData::getPatrolTime, |
|
|
Comparator.nullsLast(Comparator.reverseOrder()))); |
|
|
Comparator.nullsLast(Comparator.reverseOrder()))); |
|
|
@ -761,6 +764,40 @@ public class ResultAnalysisController extends BaseController { |
|
|
return rspData; |
|
|
return rspData; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 缺陷记录-算法名称下拉选项(返回去重后的 algName 值,供 /defect/list 的算法名称下拉筛选使用) |
|
|
|
|
|
* @param query 查询条件:点位名称、采集时间范围(algName 不参与查询,避免选项被自身过滤) |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping({"/defect/algNameOptions"}) |
|
|
|
|
|
public AjaxResult defectAlgNameOptions(DefectListQuery query) { |
|
|
|
|
|
List<PatrolData> allList = patrolResultService.selectDefectList(query); |
|
|
|
|
|
List<AlgInfo> algInfos = patrolResultService.selectAlgInfo(new PatrolResult()); |
|
|
|
|
|
// 仅取缺陷数据(与 /defect/list 口径一致),按 algType 解析出 algName 后去重、按字典序返回 |
|
|
|
|
|
List<String> algNameOptions = allList.stream() |
|
|
|
|
|
.filter(data -> "0".equals(data.getWarnStatus())) |
|
|
|
|
|
.map(data -> resolveAlgName(algInfos, data.getAlgType())) |
|
|
|
|
|
.filter(StringUtils::isNotEmpty) |
|
|
|
|
|
.distinct() |
|
|
|
|
|
.sorted() |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
return AjaxResult.success(algNameOptions); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 按算法类型解析算法名称,口径与 /defect/list 明细行分配的 algName 一致(未匹配到时返回空串)。 |
|
|
|
|
|
*/ |
|
|
|
|
|
private String resolveAlgName(List<AlgInfo> algInfos, String algType) { |
|
|
|
|
|
if (algInfos == null) { |
|
|
|
|
|
return ""; |
|
|
|
|
|
} |
|
|
|
|
|
return algInfos.stream() |
|
|
|
|
|
.filter(alg -> alg.getAlgSubtypeCode() != null && alg.getAlgSubtypeCode().equals(algType)) |
|
|
|
|
|
.map(AlgInfo::getAlgSubtypeName) |
|
|
|
|
|
.findFirst() |
|
|
|
|
|
.orElse(""); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 新的关系树 |
|
|
* 新的关系树 |
|
|
* @param areaIdS |
|
|
* @param areaIdS |
|
|
|