|
|
|
@ -2,6 +2,7 @@ package com.inspect.analysis.controller; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.inspect.analysis.domain.*; |
|
|
|
import com.inspect.analysis.service.IResultAnalysisService; |
|
|
|
import com.inspect.base.core.constant.Color; |
|
|
|
@ -10,7 +11,9 @@ import com.inspect.base.core.utils.StringUtils; |
|
|
|
import com.inspect.base.core.utils.poi.ExcelUtil; |
|
|
|
import com.inspect.base.core.web.controller.BaseController; |
|
|
|
import com.inspect.base.core.web.domain.AjaxResult; |
|
|
|
import com.inspect.base.core.web.page.PageDomain; |
|
|
|
import com.inspect.base.core.web.page.TableDataInfo; |
|
|
|
import com.inspect.base.core.web.page.TableSupport; |
|
|
|
import com.inspect.common.log.annotation.Log; |
|
|
|
import com.inspect.common.log.enums.BizType; |
|
|
|
import com.inspect.message.MessageUtils; |
|
|
|
@ -641,8 +644,90 @@ public class ResultAnalysisController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
Collections.sort(filterList); |
|
|
|
return getDataTable(filterList); |
|
|
|
Map<GroupKey, List<PatrolData>> groupedFilterList = filterList.stream().collect(Collectors.groupingBy( |
|
|
|
item -> new GroupKey(item.getObjectId(), item.getAlgType()) |
|
|
|
)); |
|
|
|
List<PatrolData> resultList = new ArrayList<>(); |
|
|
|
groupedFilterList.forEach((key, value) -> { |
|
|
|
PatrolData patrolData = new PatrolData(); |
|
|
|
patrolData.setObjectId(key.objectId); |
|
|
|
patrolData.setAlgType(key.algType); |
|
|
|
patrolData.setDesc(value.stream().map(PatrolData::getDesc).distinct().collect(Collectors.joining(","))); |
|
|
|
for (PatrolData data : value) { |
|
|
|
// 初筛有缺陷 展示初筛结果图片 |
|
|
|
if ("1".equals(data.getFilter()) && StringUtils.isEmpty(patrolData.getImgAnalyse())) { |
|
|
|
patrolData.setImgAnalyse(data.getImgAnalyse()); |
|
|
|
} |
|
|
|
// 大模型有缺陷 展示大模型结果图片 |
|
|
|
if ("0".equals(data.getFilter())) { |
|
|
|
patrolData.setImgAnalyse(data.getImgAnalyse()); |
|
|
|
} |
|
|
|
} |
|
|
|
patrolData.setImageNormalUrlPath(value.stream().map(item -> item.getImageNormalUrlPath() != null ? item.getImageNormalUrlPath() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setAlgName(value.stream().map(item -> item.getAlgName() != null ? item.getAlgName() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setAreaName(value.stream().map(item -> item.getAreaName() != null ? item.getAreaName() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setBrightDesc(value.stream().map(item -> item.getBrightDesc() != null ? item.getBrightDesc() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setBrightImgAnalyse(value.stream().map(item -> item.getBrightImgAnalyse() != null ? item.getBrightImgAnalyse() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setBrightResStatus(value.stream().map(item -> item.getBrightResStatus() != null ? item.getBrightResStatus() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setChannelName(value.stream().map(item -> item.getChannelName() != null ? item.getChannelName() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setDataType(value.stream().map(item -> item.getDataType() != null ? item.getDataType() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setDeviceName(value.stream().map(item -> item.getDeviceName() != null ? item.getDeviceName() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setDeviceSource(value.stream().map(item -> item.getDeviceSource() != null ? item.getDeviceSource() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setImgType(value.stream().map(item -> item.getImgType() != null ? item.getImgType() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setLineId(value.stream().map(item -> item.getLineId() != null ? item.getLineId() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setPatrolTime(value.stream().map(item -> item.getPatrolTime() != null ? item.getPatrolTime() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setPointId(value.stream().map(item -> item.getPointId() != null ? item.getPointId() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setPointName(value.stream().map(item -> item.getPointName() != null ? item.getPointName() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setPointStatus(value.stream().map(item -> item.getPointStatus() != null ? item.getPointStatus() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setRequestId(value.stream().map(item -> item.getRequestId() != null ? item.getRequestId() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setResValue(value.stream().map(item -> item.getResValue() != null ? item.getResValue() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setResStatus(value.stream().map(item -> item.getResStatus() != null ? item.getResStatus() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setSuggestion(value.stream().map(item -> item.getSuggestion() != null ? item.getSuggestion() : "").distinct().findFirst().orElse("")); |
|
|
|
patrolData.setWarnStatus(value.stream().map(item -> item.getWarnStatus() != null ? item.getWarnStatus() : "").distinct().findFirst().orElse("")); |
|
|
|
|
|
|
|
resultList.add(patrolData); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
Collections.sort(resultList); |
|
|
|
|
|
|
|
PageDomain pageDomain = TableSupport.buildPageRequest(); |
|
|
|
int pageNum = pageDomain.getPageNum(); |
|
|
|
int pageSize = pageDomain.getPageSize(); |
|
|
|
int toNum = Math.min(resultList.size(), pageNum * pageSize); |
|
|
|
List<PatrolData> pageList = resultList.subList((pageNum - 1) * pageSize, toNum); |
|
|
|
|
|
|
|
TableDataInfo rspData = new TableDataInfo(); |
|
|
|
rspData.setCode(200); |
|
|
|
rspData.setRows(pageList); |
|
|
|
rspData.setMsg("查询成功"); |
|
|
|
rspData.setTotal((new PageInfo<>(resultList)).getTotal()); |
|
|
|
|
|
|
|
return rspData; |
|
|
|
} |
|
|
|
|
|
|
|
private static class GroupKey { |
|
|
|
private final String objectId; |
|
|
|
private final String algType; |
|
|
|
|
|
|
|
public GroupKey(String objectId, String algType) { |
|
|
|
this.objectId = objectId; |
|
|
|
this.algType = algType; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean equals(Object o) { |
|
|
|
if (this == o) return true; |
|
|
|
if (o == null || getClass() != o.getClass()) return false; |
|
|
|
GroupKey groupKey = (GroupKey) o; |
|
|
|
return Objects.equals(objectId, groupKey.objectId) && Objects.equals(algType, groupKey.algType); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public int hashCode() { |
|
|
|
return Objects.hash(objectId, algType); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping({"/list_v3"}) |
|
|
|
|