From 16fbbf7ef38bd9f17a02d80d2c4721e2c982a263 Mon Sep 17 00:00:00 2001 From: htjcAdmin Date: Wed, 30 Jul 2025 14:18:14 +0800 Subject: [PATCH] =?UTF-8?q?/*=E5=A4=A7=E6=A8=A1=E5=9E=8B=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0meter=E7=B1=BB=E5=9E=8B=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=90=8E=E7=BB=AD=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=8E=B0=E5=9C=BA=E5=AE=9E=E9=99=85=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E3=80=82*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AlgorithmServiceImpl.java | 17 +++++++++++++++++ .../com/inspect/simulator/utils/MiscUtils.java | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) 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 33be96a..4e05e58 100644 --- a/src/main/java/com/inspect/simulator/service/impl/AlgorithmServiceImpl.java +++ b/src/main/java/com/inspect/simulator/service/impl/AlgorithmServiceImpl.java @@ -44,6 +44,9 @@ public class AlgorithmServiceImpl implements AlgorithmService { @Value("${file.infraredPath:null}") private String infraredPath; + @Value("${file.meterPath:null}") + private String meterPath; + @Value("${test-mode:false}") private boolean testMode; @@ -163,6 +166,20 @@ public class AlgorithmServiceImpl implements AlgorithmService { log.error("BIG_MODEL_INFRARED continue to call infrared EXCEPTION: {}", e.getMessage()); } } + } else if (MiscUtils.checkMeterType(typeList) && !"null".equals(infraredPath)) { + if(testMode) { + try { + log.info(Color.MAGENTA + "BIG_MODEL_METER_TEST analyseResult={}" + Color.END, new Gson().toJson(analyseResult)); + Call call = analysisRemoteService.picAnalyseRetNotify(analyseResult); + Response response = call.execute(); + Object result = response.body(); + System.out.println("result: " + result); + } catch (Exception e) { + log.error("BIG_MODEL_METER_TEST EXCEPTION: {}", e.getMessage()); + } + } else { + // 调用现场表计识别服务器 + } } 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)); diff --git a/src/main/java/com/inspect/simulator/utils/MiscUtils.java b/src/main/java/com/inspect/simulator/utils/MiscUtils.java index 0badc46..55b8455 100644 --- a/src/main/java/com/inspect/simulator/utils/MiscUtils.java +++ b/src/main/java/com/inspect/simulator/utils/MiscUtils.java @@ -17,6 +17,10 @@ public class MiscUtils { AlgConstants.INFRA_CAMERA_REVERSE )); + private static final Set METER_TYPES = new HashSet<>(Arrays.asList( + AlgConstants.METER + )); + public static boolean checkInfraredType(List typeList) { if (typeList == null) { return false; @@ -40,4 +44,16 @@ public class MiscUtils { } return false; } + + public static boolean checkMeterType(String[] typeList) { + if (typeList == null) { + return false; + } + for (String type : typeList) { + if (METER_TYPES.contains(type)) { + return true; + } + } + return false; + } }