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; + } }