From 4cbcadc4f0300740cbb893e475c897e45cae3e98 Mon Sep 17 00:00:00 2001 From: wangguangyuan Date: Fri, 11 Jul 2025 16:10:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=89=E6=98=8E=E5=A4=A7=E6=A8=A1=E5=9E=8B=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/controller/PatrolTaskController.java | 95 ++++++++++++++++++- .../com/inspect/task/domain/PatrolData.java | 27 +++++- 2 files changed, 118 insertions(+), 4 deletions(-) diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java index 2be1bf0..e1091cb 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java @@ -232,6 +232,9 @@ public class PatrolTaskController extends BaseController { long t2 = System.currentTimeMillis(); // 大模型数据 List newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); + // 光明大模型数据 + resultAnalysis.setFilter("2"); + List brightNewList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); // logger.info("----------------[TASK] query newList {}", newList); // if (newList == null) { // return getDataTable(2, new ArrayList<>(), new ArrayList<>()); @@ -250,6 +253,7 @@ public class PatrolTaskController extends BaseController { }).findFirst().get().getAlgSubtypeName() : "" ); if ("0".equals(item.getFilter())) { + // 初筛数据 List filterDatas = filterList.stream().filter((data) -> { return data.getObjectId().equals(item.getObjectId()) && data.getAlgType().equals(item.getAlgType()); }).collect(Collectors.toList()); @@ -258,6 +262,15 @@ public class PatrolTaskController extends BaseController { item.setFilterDesc((filterDatas.get(0)).getDesc()); filterList.remove(filterDatas.get(0)); } + // 光明大模型数据 + List brightDatas = brightNewList.stream().filter((bright) -> { + return bright.getObjectId().equals(item.getObjectId()) && bright.getAlgType().equals(item.getAlgType()); + }).collect(Collectors.toList()); + if (!brightDatas.isEmpty()) { + item.setBrightDesc(brightDatas.get(0).getDesc()); + item.setBrightResStatus(brightDatas.get(0).getResStatus()); + brightNewList.remove(brightDatas.get(0)); + } } AlgValue algValue = new AlgValue(); @@ -271,6 +284,15 @@ public class PatrolTaskController extends BaseController { } } for (PatrolData item : filterList) { + // 光明大模型数据 + List brightDatas = brightNewList.stream().filter((bright) -> { + return bright.getObjectId().equals(item.getObjectId()) && bright.getAlgType().equals(item.getAlgType()); + }).collect(Collectors.toList()); + if (!brightDatas.isEmpty()) { + item.setBrightDesc(brightDatas.get(0).getDesc()); + item.setBrightResStatus(brightDatas.get(0).getResStatus()); + brightNewList.remove(brightDatas.get(0)); + } item.setAlgName( algInfos.stream().anyMatch((alg) -> { return alg.getAlgSubtypeCode().equals(item.getAlgType()); @@ -291,7 +313,30 @@ public class PatrolTaskController extends BaseController { item.setFilterDesc(item.getDesc()); item.setDesc(""); } + for (PatrolData item : brightNewList) { + item.setAlgName( + algInfos.stream().anyMatch((alg) -> { + return alg.getAlgSubtypeCode().equals(item.getAlgType()); + }) ? + algInfos.stream().filter((alg) -> { + return alg.getAlgSubtypeCode().equals(item.getAlgType()); + }).findFirst().get().getAlgSubtypeName() : "" + ); + AlgValue algValue = new AlgValue(); + if (item.getResValue() != null) { + String str = algValue.formatValue(item.getResValue()); + if ("meter".equals(item.getAlgType())) { + if (str.equals("-1")) { + item.setResValue("空值"); + } + } + } + item.setBrightDesc(item.getDesc()); + item.setBrightResStatus(item.getResStatus()); + item.setDesc(""); + } newList.addAll(filterList); + newList.addAll(brightNewList); if (StringUtils.isNotEmpty(resultAnalysis.getAlgName())) { newList = newList.stream().filter((element) -> { return resultAnalysis.getAlgName().equals(element.getAlgName()); @@ -2378,6 +2423,9 @@ public class PatrolTaskController extends BaseController { List algInfos = patrolResultService.selectAlgInfo(new PatrolResult()); resultAnalysis.setFilter("0"); List newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); + // 光明大模型数据 + resultAnalysis.setFilter("2"); + List brightNewList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); int maxNum = Integer.parseInt(patrolTaskService.selectConfigByKey("MAX_NUM")); for (PatrolData item : newList) { item.setAlgName( @@ -2397,6 +2445,15 @@ public class PatrolTaskController extends BaseController { item.setFilterDesc((filterDatas.get(0)).getDesc()); filterList.remove(filterDatas.get(0)); } + // 光明大模型数据 + List brightDatas = brightNewList.stream().filter((bright) -> { + return bright.getObjectId().equals(item.getObjectId()) && bright.getAlgType().equals(item.getAlgType()); + }).collect(Collectors.toList()); + if (!brightDatas.isEmpty()) { + item.setBrightDesc(brightDatas.get(0).getDesc()); + item.setBrightResStatus(brightDatas.get(0).getResStatus()); + brightNewList.remove(brightDatas.get(0)); + } } AlgValue algValue = new AlgValue(); @@ -2410,6 +2467,15 @@ public class PatrolTaskController extends BaseController { } } for (PatrolData item : filterList) { + // 光明大模型数据 + List brightDatas = brightNewList.stream().filter((bright) -> { + return bright.getObjectId().equals(item.getObjectId()) && bright.getAlgType().equals(item.getAlgType()); + }).collect(Collectors.toList()); + if (!brightDatas.isEmpty()) { + item.setBrightDesc(brightDatas.get(0).getDesc()); + item.setBrightResStatus(brightDatas.get(0).getResStatus()); + brightNewList.remove(brightDatas.get(0)); + } item.setAlgName( algInfos.stream().anyMatch((alg) -> { return alg.getAlgSubtypeCode().equals(item.getAlgType()); @@ -2430,8 +2496,30 @@ public class PatrolTaskController extends BaseController { item.setFilterDesc(item.getDesc()); item.setDesc(""); } + for (PatrolData item : brightNewList) { + item.setAlgName( + algInfos.stream().anyMatch((alg) -> { + return alg.getAlgSubtypeCode().equals(item.getAlgType()); + }) ? + algInfos.stream().filter((alg) -> { + return alg.getAlgSubtypeCode().equals(item.getAlgType()); + }).findFirst().get().getAlgSubtypeName() : "" + ); + AlgValue algValue = new AlgValue(); + if (item.getResValue() != null) { + String str = algValue.formatValue(item.getResValue()); + if ("meter".equals(item.getAlgType())) { + if (str.equals("-1")) { + item.setResValue("空值"); + } + } + } + item.setBrightDesc(item.getDesc()); + item.setBrightResStatus(item.getResStatus()); + item.setDesc(""); + } newList.addAll(filterList); - + newList.addAll(brightNewList); if (StringUtils.isNotEmpty(resultAnalysis.getAlgName())) { newList = newList.stream().filter((element) -> resultAnalysis.getAlgName().equals(element.getAlgName())).collect(Collectors.toList()); } @@ -2546,7 +2634,8 @@ public class PatrolTaskController extends BaseController { private void createHeaderRow(Sheet sheet) { String[] headers = { "编号", "设备", "相机名", "系统", "点位id", "点位名称", "状态", - "算法名称", "读数", "初筛图片", "初筛结果", "分析图片", "分析结果" + "算法名称", "读数", "初筛图片", "初筛结果", "分析图片", "分析结果", + "缺陷类型", "描述信息" }; Row headerRow = sheet.createRow(0); @@ -2582,6 +2671,8 @@ public class PatrolTaskController extends BaseController { // 文本信息 row.createCell(10).setCellValue(item.getFilterDesc()); // 筛选结果 row.createCell(12).setCellValue(item.getDesc()); // 分析结果 + row.createCell(13).setCellValue(item.getBrightResStatus()); // 缺陷类型 + row.createCell(14).setCellValue(item.getBrightDesc()); // 描述信息 } private void insertImages(SXSSFWorkbook workbook, Drawing drawing, Sheet sheet, diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/task/domain/PatrolData.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/task/domain/PatrolData.java index a587ba9..862ba3e 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/task/domain/PatrolData.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/task/domain/PatrolData.java @@ -45,6 +45,11 @@ public class PatrolData implements Comparable { name = "初筛结果" ) private String filterDesc; + + @Excel( + name = "光明大模型结果" + ) + private String brightDesc; @Excel( name = "分析图片" ) @@ -61,6 +66,8 @@ public class PatrolData implements Comparable { private String filter; private String requestId; private String resStatus; + + private String brightResStatus; private String areaName; private String algType; private String objectId; @@ -154,6 +161,10 @@ public class PatrolData implements Comparable { return this.filterDesc; } + public String getBrightDesc() { + return this.brightDesc; + } + public String getImgAnalyse() { return this.imgAnalyse; } @@ -193,6 +204,9 @@ public class PatrolData implements Comparable { public String getResStatus() { return this.resStatus; } + public String getBrightResStatus() { + return this.brightResStatus; + } public String getAreaName() { return this.areaName; @@ -252,6 +266,10 @@ public class PatrolData implements Comparable { this.filterDesc = filterDesc; } + public void setBrightDesc(String brightDesc) { + this.brightDesc = brightDesc; + } + public void setImgAnalyse(String imgAnalyse) { this.imgAnalyse = imgAnalyse; } @@ -291,6 +309,9 @@ public class PatrolData implements Comparable { public void setResStatus(String resStatus) { this.resStatus = resStatus; } + public void setBrightResStatus(String brightResStatus) { + this.brightResStatus = brightResStatus; + } public void setAreaName(String areaName) { this.areaName = areaName; @@ -324,12 +345,12 @@ public class PatrolData implements Comparable { if (this == object) return true; if (object == null || getClass() != object.getClass()) return false; PatrolData that = (PatrolData) object; - return Objects.equals(deviceName, that.deviceName) && Objects.equals(channelName, that.channelName) && Objects.equals(deviceSource, that.deviceSource) && Objects.equals(pointName, that.pointName) && Objects.equals(pointId, that.pointId) && Objects.equals(warnStatus, that.warnStatus) && Objects.equals(algName, that.algName) && Objects.equals(resValue, that.resValue) && Objects.equals(img, that.img) && Objects.equals(filterDesc, that.filterDesc) && Objects.equals(imgAnalyse, that.imgAnalyse) && Objects.equals(desc, that.desc) && Objects.equals(lineId, that.lineId) && Objects.equals(patrolTime, that.patrolTime) && Objects.equals(pointStatus, that.pointStatus) && Objects.equals(imgType, that.imgType) && Objects.equals(dataType, that.dataType) && Objects.equals(filter, that.filter) && Objects.equals(requestId, that.requestId) && Objects.equals(resStatus, that.resStatus) && Objects.equals(areaName, that.areaName) && Objects.equals(algType, that.algType) && Objects.equals(objectId, that.objectId) && Objects.equals(imageNormalUrlPath, that.imageNormalUrlPath) && Objects.equals(suggestion, that.suggestion); + return Objects.equals(deviceName, that.deviceName) && Objects.equals(channelName, that.channelName) && Objects.equals(deviceSource, that.deviceSource) && Objects.equals(pointName, that.pointName) && Objects.equals(pointId, that.pointId) && Objects.equals(warnStatus, that.warnStatus) && Objects.equals(algName, that.algName) && Objects.equals(resValue, that.resValue) && Objects.equals(img, that.img) && Objects.equals(filterDesc, that.filterDesc) && Objects.equals(brightDesc, that.brightDesc) && Objects.equals(imgAnalyse, that.imgAnalyse) && Objects.equals(desc, that.desc) && Objects.equals(lineId, that.lineId) && Objects.equals(patrolTime, that.patrolTime) && Objects.equals(pointStatus, that.pointStatus) && Objects.equals(imgType, that.imgType) && Objects.equals(dataType, that.dataType) && Objects.equals(filter, that.filter) && Objects.equals(requestId, that.requestId) && Objects.equals(resStatus, that.resStatus) && Objects.equals(brightResStatus, that.brightResStatus) && Objects.equals(areaName, that.areaName) && Objects.equals(algType, that.algType) && Objects.equals(objectId, that.objectId) && Objects.equals(imageNormalUrlPath, that.imageNormalUrlPath) && Objects.equals(suggestion, that.suggestion); } @Override public int hashCode() { - return Objects.hash(deviceName, channelName, deviceSource, pointName, pointId, warnStatus, algName, resValue, img, filterDesc, imgAnalyse, desc, lineId, patrolTime, pointStatus, imgType, dataType, filter, requestId, resStatus, areaName, algType, objectId, imageNormalUrlPath, suggestion); + return Objects.hash(deviceName, channelName, deviceSource, pointName, pointId, warnStatus, algName, resValue, img, filterDesc, brightDesc, imgAnalyse, desc, lineId, patrolTime, pointStatus, imgType, dataType, filter, requestId, resStatus, brightResStatus, areaName, algType, objectId, imageNormalUrlPath, suggestion); } @Override @@ -345,6 +366,7 @@ public class PatrolData implements Comparable { ", resValue='" + resValue + '\'' + ", img='" + img + '\'' + ", filterDesc='" + filterDesc + '\'' + + ", brightDesc='" + brightDesc + '\'' + ", imgAnalyse='" + imgAnalyse + '\'' + ", desc='" + desc + '\'' + ", lineId='" + lineId + '\'' + @@ -355,6 +377,7 @@ public class PatrolData implements Comparable { ", filter='" + filter + '\'' + ", requestId='" + requestId + '\'' + ", resStatus='" + resStatus + '\'' + + ", brightResStatus='" + brightResStatus + '\'' + ", areaName='" + areaName + '\'' + ", algType='" + algType + '\'' + ", objectId='" + objectId + '\'' +