Browse Source

任务详情新增光明大模型信息

master
wangguangyuan 5 months ago
parent
commit
4cbcadc4f0
2 changed files with 118 additions and 4 deletions
  1. +93
    -2
      inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java
  2. +25
    -2
      inspect-main/inspect-main-task/src/main/java/com/inspect/task/domain/PatrolData.java

+ 93
- 2
inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java View File

@ -232,6 +232,9 @@ public class PatrolTaskController extends BaseController {
long t2 = System.currentTimeMillis(); long t2 = System.currentTimeMillis();
// 大模型数据 // 大模型数据
List<PatrolData> newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); List<PatrolData> newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
// 光明大模型数据
resultAnalysis.setFilter("2");
List<PatrolData> brightNewList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
// logger.info("----------------[TASK] query newList {}", newList); // logger.info("----------------[TASK] query newList {}", newList);
// if (newList == null) { // if (newList == null) {
// return getDataTable(2, new ArrayList<>(), new ArrayList<>()); // return getDataTable(2, new ArrayList<>(), new ArrayList<>());
@ -250,6 +253,7 @@ public class PatrolTaskController extends BaseController {
}).findFirst().get().getAlgSubtypeName() : "" }).findFirst().get().getAlgSubtypeName() : ""
); );
if ("0".equals(item.getFilter())) { if ("0".equals(item.getFilter())) {
// 初筛数据
List<PatrolData> filterDatas = filterList.stream().filter((data) -> { List<PatrolData> filterDatas = filterList.stream().filter((data) -> {
return data.getObjectId().equals(item.getObjectId()) && data.getAlgType().equals(item.getAlgType()); return data.getObjectId().equals(item.getObjectId()) && data.getAlgType().equals(item.getAlgType());
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -258,6 +262,15 @@ public class PatrolTaskController extends BaseController {
item.setFilterDesc((filterDatas.get(0)).getDesc()); item.setFilterDesc((filterDatas.get(0)).getDesc());
filterList.remove(filterDatas.get(0)); filterList.remove(filterDatas.get(0));
} }
// 光明大模型数据
List<PatrolData> 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(); AlgValue algValue = new AlgValue();
@ -271,6 +284,15 @@ public class PatrolTaskController extends BaseController {
} }
} }
for (PatrolData item : filterList) { for (PatrolData item : filterList) {
// 光明大模型数据
List<PatrolData> 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( item.setAlgName(
algInfos.stream().anyMatch((alg) -> { algInfos.stream().anyMatch((alg) -> {
return alg.getAlgSubtypeCode().equals(item.getAlgType()); return alg.getAlgSubtypeCode().equals(item.getAlgType());
@ -291,7 +313,30 @@ public class PatrolTaskController extends BaseController {
item.setFilterDesc(item.getDesc()); item.setFilterDesc(item.getDesc());
item.setDesc(""); 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(filterList);
newList.addAll(brightNewList);
if (StringUtils.isNotEmpty(resultAnalysis.getAlgName())) { if (StringUtils.isNotEmpty(resultAnalysis.getAlgName())) {
newList = newList.stream().filter((element) -> { newList = newList.stream().filter((element) -> {
return resultAnalysis.getAlgName().equals(element.getAlgName()); return resultAnalysis.getAlgName().equals(element.getAlgName());
@ -2378,6 +2423,9 @@ public class PatrolTaskController extends BaseController {
List<AlgInfo> algInfos = patrolResultService.selectAlgInfo(new PatrolResult()); List<AlgInfo> algInfos = patrolResultService.selectAlgInfo(new PatrolResult());
resultAnalysis.setFilter("0"); resultAnalysis.setFilter("0");
List<PatrolData> newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis); List<PatrolData> newList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
// 光明大模型数据
resultAnalysis.setFilter("2");
List<PatrolData> brightNewList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
int maxNum = Integer.parseInt(patrolTaskService.selectConfigByKey("MAX_NUM")); int maxNum = Integer.parseInt(patrolTaskService.selectConfigByKey("MAX_NUM"));
for (PatrolData item : newList) { for (PatrolData item : newList) {
item.setAlgName( item.setAlgName(
@ -2397,6 +2445,15 @@ public class PatrolTaskController extends BaseController {
item.setFilterDesc((filterDatas.get(0)).getDesc()); item.setFilterDesc((filterDatas.get(0)).getDesc());
filterList.remove(filterDatas.get(0)); filterList.remove(filterDatas.get(0));
} }
// 光明大模型数据
List<PatrolData> 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(); AlgValue algValue = new AlgValue();
@ -2410,6 +2467,15 @@ public class PatrolTaskController extends BaseController {
} }
} }
for (PatrolData item : filterList) { for (PatrolData item : filterList) {
// 光明大模型数据
List<PatrolData> 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( item.setAlgName(
algInfos.stream().anyMatch((alg) -> { algInfos.stream().anyMatch((alg) -> {
return alg.getAlgSubtypeCode().equals(item.getAlgType()); return alg.getAlgSubtypeCode().equals(item.getAlgType());
@ -2430,8 +2496,30 @@ public class PatrolTaskController extends BaseController {
item.setFilterDesc(item.getDesc()); item.setFilterDesc(item.getDesc());
item.setDesc(""); 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(filterList);
newList.addAll(brightNewList);
if (StringUtils.isNotEmpty(resultAnalysis.getAlgName())) { if (StringUtils.isNotEmpty(resultAnalysis.getAlgName())) {
newList = newList.stream().filter((element) -> resultAnalysis.getAlgName().equals(element.getAlgName())).collect(Collectors.toList()); 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) { private void createHeaderRow(Sheet sheet) {
String[] headers = { String[] headers = {
"编号", "设备", "相机名", "系统", "点位id", "点位名称", "状态", "编号", "设备", "相机名", "系统", "点位id", "点位名称", "状态",
"算法名称", "读数", "初筛图片", "初筛结果", "分析图片", "分析结果"
"算法名称", "读数", "初筛图片", "初筛结果", "分析图片", "分析结果",
"缺陷类型", "描述信息"
}; };
Row headerRow = sheet.createRow(0); Row headerRow = sheet.createRow(0);
@ -2582,6 +2671,8 @@ public class PatrolTaskController extends BaseController {
// 文本信息 // 文本信息
row.createCell(10).setCellValue(item.getFilterDesc()); // 筛选结果 row.createCell(10).setCellValue(item.getFilterDesc()); // 筛选结果
row.createCell(12).setCellValue(item.getDesc()); // 分析结果 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, private void insertImages(SXSSFWorkbook workbook, Drawing<?> drawing, Sheet sheet,


+ 25
- 2
inspect-main/inspect-main-task/src/main/java/com/inspect/task/domain/PatrolData.java View File

@ -45,6 +45,11 @@ public class PatrolData implements Comparable<PatrolData> {
name = "初筛结果" name = "初筛结果"
) )
private String filterDesc; private String filterDesc;
@Excel(
name = "光明大模型结果"
)
private String brightDesc;
@Excel( @Excel(
name = "分析图片" name = "分析图片"
) )
@ -61,6 +66,8 @@ public class PatrolData implements Comparable<PatrolData> {
private String filter; private String filter;
private String requestId; private String requestId;
private String resStatus; private String resStatus;
private String brightResStatus;
private String areaName; private String areaName;
private String algType; private String algType;
private String objectId; private String objectId;
@ -154,6 +161,10 @@ public class PatrolData implements Comparable<PatrolData> {
return this.filterDesc; return this.filterDesc;
} }
public String getBrightDesc() {
return this.brightDesc;
}
public String getImgAnalyse() { public String getImgAnalyse() {
return this.imgAnalyse; return this.imgAnalyse;
} }
@ -193,6 +204,9 @@ public class PatrolData implements Comparable<PatrolData> {
public String getResStatus() { public String getResStatus() {
return this.resStatus; return this.resStatus;
} }
public String getBrightResStatus() {
return this.brightResStatus;
}
public String getAreaName() { public String getAreaName() {
return this.areaName; return this.areaName;
@ -252,6 +266,10 @@ public class PatrolData implements Comparable<PatrolData> {
this.filterDesc = filterDesc; this.filterDesc = filterDesc;
} }
public void setBrightDesc(String brightDesc) {
this.brightDesc = brightDesc;
}
public void setImgAnalyse(String imgAnalyse) { public void setImgAnalyse(String imgAnalyse) {
this.imgAnalyse = imgAnalyse; this.imgAnalyse = imgAnalyse;
} }
@ -291,6 +309,9 @@ public class PatrolData implements Comparable<PatrolData> {
public void setResStatus(String resStatus) { public void setResStatus(String resStatus) {
this.resStatus = resStatus; this.resStatus = resStatus;
} }
public void setBrightResStatus(String brightResStatus) {
this.brightResStatus = brightResStatus;
}
public void setAreaName(String areaName) { public void setAreaName(String areaName) {
this.areaName = areaName; this.areaName = areaName;
@ -324,12 +345,12 @@ public class PatrolData implements Comparable<PatrolData> {
if (this == object) return true; if (this == object) return true;
if (object == null || getClass() != object.getClass()) return false; if (object == null || getClass() != object.getClass()) return false;
PatrolData that = (PatrolData) object; 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 @Override
public int hashCode() { 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 @Override
@ -345,6 +366,7 @@ public class PatrolData implements Comparable<PatrolData> {
", resValue='" + resValue + '\'' + ", resValue='" + resValue + '\'' +
", img='" + img + '\'' + ", img='" + img + '\'' +
", filterDesc='" + filterDesc + '\'' + ", filterDesc='" + filterDesc + '\'' +
", brightDesc='" + brightDesc + '\'' +
", imgAnalyse='" + imgAnalyse + '\'' + ", imgAnalyse='" + imgAnalyse + '\'' +
", desc='" + desc + '\'' + ", desc='" + desc + '\'' +
", lineId='" + lineId + '\'' + ", lineId='" + lineId + '\'' +
@ -355,6 +377,7 @@ public class PatrolData implements Comparable<PatrolData> {
", filter='" + filter + '\'' + ", filter='" + filter + '\'' +
", requestId='" + requestId + '\'' + ", requestId='" + requestId + '\'' +
", resStatus='" + resStatus + '\'' + ", resStatus='" + resStatus + '\'' +
", brightResStatus='" + brightResStatus + '\'' +
", areaName='" + areaName + '\'' + ", areaName='" + areaName + '\'' +
", algType='" + algType + '\'' + ", algType='" + algType + '\'' +
", objectId='" + objectId + '\'' + ", objectId='" + objectId + '\'' +


Loading…
Cancel
Save