Browse Source

/*大模型接口增加meter类型处理逻辑,后续需要完善现场实际调用。*/

master
htjcAdmin 4 months ago
parent
commit
16fbbf7ef3
2 changed files with 33 additions and 0 deletions
  1. +17
    -0
      src/main/java/com/inspect/simulator/service/impl/AlgorithmServiceImpl.java
  2. +16
    -0
      src/main/java/com/inspect/simulator/utils/MiscUtils.java

+ 17
- 0
src/main/java/com/inspect/simulator/service/impl/AlgorithmServiceImpl.java View File

@ -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<Object> call = analysisRemoteService.picAnalyseRetNotify(analyseResult);
Response<Object> 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));


+ 16
- 0
src/main/java/com/inspect/simulator/utils/MiscUtils.java View File

@ -17,6 +17,10 @@ public class MiscUtils {
AlgConstants.INFRA_CAMERA_REVERSE
));
private static final Set<String> METER_TYPES = new HashSet<>(Arrays.asList(
AlgConstants.METER
));
public static boolean checkInfraredType(List<String> 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;
}
}

Loading…
Cancel
Save