From 2811d0d6ffdc20b3e070deaebd2e79f9cb898356 Mon Sep 17 00:00:00 2001 From: yinhuaiwei Date: Fri, 15 May 2026 15:30:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BA=A2=E5=A4=96=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=B8=A9=E5=BA=A6=E5=A4=B1=E8=B4=A5=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=BF=94=E5=9B=9E=E5=88=86=E6=9E=90=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?code2002?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AlgorithmServiceImpl.java | 14 ++++++++++++-- .../service/impl/HikVisionServiceImpl.java | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/inspect/simulator/service/impl/AlgorithmServiceImpl.java b/src/main/java/com/inspect/simulator/service/impl/AlgorithmServiceImpl.java index 6c5a634..759171a 100644 --- a/src/main/java/com/inspect/simulator/service/impl/AlgorithmServiceImpl.java +++ b/src/main/java/com/inspect/simulator/service/impl/AlgorithmServiceImpl.java @@ -132,6 +132,7 @@ public class AlgorithmServiceImpl implements AlgorithmService { List analyseResItems = new ArrayList<>(); analyseResItems.add(analyseResItem); analyseResult.setResultList(analyseResItems); + // 红外算法且配备了红外分析地址 if (MiscUtils.checkInfraredType(typeList) && !"null".equals(infraredPath)) { if (testMode) { try { @@ -162,6 +163,7 @@ public class AlgorithmServiceImpl implements AlgorithmService { log.error("BIG_MODEL_INFRARED continue to call infrared EXCEPTION: {}", e.getMessage()); } } + // 表计算法且配备了表计分析地址 } else if (MiscUtils.checkMeterType(typeList) && !"null".equals(meterPath)) { if (testMode) { try { @@ -184,6 +186,7 @@ public class AlgorithmServiceImpl implements AlgorithmService { log.error("BIG_MODEL_METER continue to call meter EXCEPTION: {}", e.getMessage()); } } + // 其他情况 } else { try { log.info(Color.MAGENTA + "BIG_MODEL_COMMON filterPicAnalyse: nacos file.infraredPath not config, feedback to caller, analyseResult={}" + Color.END, new Gson().toJson(analyseResult)); @@ -274,10 +277,17 @@ public class AlgorithmServiceImpl implements AlgorithmService { // analyseResPoint.setValue("1");//失败 // } // analyseResPoint.setConf(String.format("%.2f", (double) infraredInfo.getFrameMax())); - analyseResPoint.setValue(String.format("%.2f", (double) infraredInfo.getFrameMax())); analyseResPoint.setResImageUrl(infraredInfo.getOutPath()); analyseResPoint.setType(typeListStr); - analyseResPoint.setCode("2000"); + if (infraredInfo.getFrameMax() == -1 && infraredInfo.getFrameMin() == -1) { + analyseResPoint.setCode("2002"); + analyseResPoint.setValue("--"); + analyseResPoint.setDesc("分析失败"); + } else { + analyseResPoint.setCode("2000"); + analyseResPoint.setDesc("正常"); + analyseResPoint.setValue(String.format("%.2f", (double) infraredInfo.getFrameMax())); + } if (StringUtils.isNotBlank(analyseResPoint.getImageNormalUrlPath())) { String imageNormalUrlPath = resultAnalysisMapper.selectImg(patrolPointId); if (StringUtils.isBlank(imageNormalUrlPath)) { diff --git a/src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java b/src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java index cfdea38..43cc7af 100644 --- a/src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java +++ b/src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java @@ -1542,7 +1542,7 @@ public class HikVisionServiceImpl implements HikVisionService { //画框标注 String s = ImageOverlays(infraPictureInfo, infraredInfo); infraredInfo.setOutPath(s); - log.info("计算过后最高温{}",infraredInfo.getFrameMax()); + log.info("计算过后最高温{}",infraredInfo.getFrameMax(), infraredInfo.getFrameMin()); log.info("计算过后最高温 ->是否等于0.0f{}",infraredInfo.getFrameMax() == 0.0f); //温度未取到 if(StringUtils.isNull(maxTemperature)){