|
|
@ -45,8 +45,10 @@ public class PatrolResultServiceImpl implements PatrolResultService { |
|
|
private String voltLevel; |
|
|
private String voltLevel; |
|
|
private static String token; |
|
|
private static String token; |
|
|
|
|
|
|
|
|
|
|
|
// 大模型 |
|
|
private static final String MLLM_FILTER = "0"; |
|
|
private static final String MLLM_FILTER = "0"; |
|
|
|
|
|
|
|
|
|
|
|
// 初筛 |
|
|
private static final String FITLER_FILTER = "1"; |
|
|
private static final String FITLER_FILTER = "1"; |
|
|
|
|
|
|
|
|
private static final Set<String> VALID_RESULT_CODES = new HashSet<>(Arrays.asList("0", "1")); |
|
|
private static final Set<String> VALID_RESULT_CODES = new HashSet<>(Arrays.asList("0", "1")); |
|
|
@ -114,7 +116,7 @@ public class PatrolResultServiceImpl implements PatrolResultService { |
|
|
log.info("[{}] [{}] sendPatrolResultToUpperSystem", threadId, execTime); |
|
|
log.info("[{}] [{}] sendPatrolResultToUpperSystem", threadId, execTime); |
|
|
// 查询当天的巡检结果 |
|
|
// 查询当天的巡检结果 |
|
|
String createTimeStr = DateUtils.parseDateToStr("yyyy-MM-dd", date); |
|
|
String createTimeStr = DateUtils.parseDateToStr("yyyy-MM-dd", date); |
|
|
|
|
|
|
|
|
|
|
|
// String createTimeStr = jsonObject.getString("createTime"); |
|
|
// createTimeStr = "2025-03-27"; |
|
|
// createTimeStr = "2025-03-27"; |
|
|
List<PatrolResult> patrolResults = patrolResultMapper.selectCurrentPatrolResultList(createTimeStr); |
|
|
List<PatrolResult> patrolResults = patrolResultMapper.selectCurrentPatrolResultList(createTimeStr); |
|
|
if (patrolResults == null || patrolResults.size() <= 0) { |
|
|
if (patrolResults == null || patrolResults.size() <= 0) { |
|
|
@ -248,9 +250,26 @@ public class PatrolResultServiceImpl implements PatrolResultService { |
|
|
sample.setSampleRaw(firstPr.getFilePath()); |
|
|
sample.setSampleRaw(firstPr.getFilePath()); |
|
|
sample.setAlgorithmsName(firstPr.getAlgorithmsName()); |
|
|
sample.setAlgorithmsName(firstPr.getAlgorithmsName()); |
|
|
sample.setAlgorithmsType(firstPr.getAlgorithmsType()); |
|
|
sample.setAlgorithmsType(firstPr.getAlgorithmsType()); |
|
|
// 此处暂时写死为0,后续根据实际情况调整 |
|
|
|
|
|
sample.setHasCoordinates("0"); |
|
|
sample.setHasCoordinates("0"); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(firstPr.getAlgorithmsType()) && firstPr.getAlgorithmsType().contains("infra")) { |
|
|
|
|
|
sample.setInfraredProtocol("DLT664-2016"); |
|
|
|
|
|
sample.setInfraredPathRaw(firstPr.getFilePath()); |
|
|
|
|
|
String meterType = firstPr.getMeterType(); |
|
|
|
|
|
if (!StringUtils.isEmpty(meterType)) { |
|
|
|
|
|
String[] split = meterType.split(","); |
|
|
|
|
|
if (split.length == 6) { |
|
|
|
|
|
// 有坐标信息 |
|
|
|
|
|
sample.setHasCoordinates("1"); |
|
|
|
|
|
sample.setX1(split[0]); |
|
|
|
|
|
sample.setY1(split[1]); |
|
|
|
|
|
sample.setX2(split[2]); |
|
|
|
|
|
sample.setY2(split[3]); |
|
|
|
|
|
sample.setHeight(split[4]); |
|
|
|
|
|
sample.setWidth(split[5]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 处理同一分组内的不同filter结果 |
|
|
// 处理同一分组内的不同filter结果 |
|
|
group.forEach(pr -> { |
|
|
group.forEach(pr -> { |
|
|
// result type是检测出来有缺陷的 0是缺陷 1是正常 2是异常(异常不算是缺陷比如图片抓拍失败为空算是异常,或者是大模型服务挂掉分析失败也是异常,这种的不算是缺陷) |
|
|
// result type是检测出来有缺陷的 0是缺陷 1是正常 2是异常(异常不算是缺陷比如图片抓拍失败为空算是异常,或者是大模型服务挂掉分析失败也是异常,这种的不算是缺陷) |
|
|
@ -267,6 +286,10 @@ public class PatrolResultServiceImpl implements PatrolResultService { |
|
|
if (MLLM_FILTER.equals(filter)) { |
|
|
if (MLLM_FILTER.equals(filter)) { |
|
|
sample.setMllmDefect(pr.getResImgUrl()); |
|
|
sample.setMllmDefect(pr.getResImgUrl()); |
|
|
sample.setMllmResultCode(resultType); |
|
|
sample.setMllmResultCode(resultType); |
|
|
|
|
|
if (StringUtils.isNotEmpty(firstPr.getAlgorithmsType()) && firstPr.getAlgorithmsType().contains("infra")) { |
|
|
|
|
|
sample.setInfraredResValue(pr.getResValue()); |
|
|
|
|
|
sample.setInfraredPathAnnotated(pr.getResImgUrl()); |
|
|
|
|
|
} |
|
|
} else if (FITLER_FILTER.equals(filter)) { |
|
|
} else if (FITLER_FILTER.equals(filter)) { |
|
|
sample.setFitlerDefect(pr.getResImgUrl()); |
|
|
sample.setFitlerDefect(pr.getResImgUrl()); |
|
|
sample.setFitlerDiffBase(pr.getImageNormalUrlPath()); |
|
|
sample.setFitlerDiffBase(pr.getImageNormalUrlPath()); |
|
|
|