Update ClaimVerificationServiceImpl.java

This commit is contained in:
ama1
2025-09-10 17:40:24 +08:00
parent 53701cdf6b
commit 4ca3c681a1

View File

@@ -372,16 +372,22 @@ public class ClaimVerificationServiceImpl implements ClaimVerificationService {
@NotNull @NotNull
private static JSONObject analyzeParameters(JSONObject diFyObject, ClaimVerificationFileDTO claimVerificationFileAnalysisDTO, String aiAnalysisRequestId) { private static JSONObject analyzeParameters(JSONObject diFyObject, ClaimVerificationFileDTO claimVerificationFileAnalysisDTO, String aiAnalysisRequestId) {
String toAfter = ""; String toAfter = "";
String textDoc = diFyObject.getString("textDoc");
String textImage = diFyObject.getString("textImage"); try {
//判断字符串那个是不为空的然后进行处理 log.info("执行方法analyzeParameters的参数Object为diFyObject{} ClaimVerificationFileDTO{}",diFyObject,claimVerificationFileAnalysisDTO);
if (StringUtils.isNotBlank(textDoc)) { toAfter = diFyObject.getJSONObject("textDoc").toJSONString();
toAfter = StringEscapeUtils.unescapeJava(textDoc); if(toAfter == null || toAfter.isEmpty()){
} else if (StringUtils.isNotBlank(textImage)) { toAfter = diFyObject.getJSONObject("textImage").toJSONString();
toAfter = StringEscapeUtils.unescapeJava(textImage); }
} else { if(toAfter == null || toAfter.isEmpty()){
throw new RuntimeException(" 售后索赔检核文件分析dify返回结果为空"); throw new RuntimeException(" 售后索赔检核文件分析dify返回结果为空");
}
} catch (Exception e) {
log.error("执行方法analyzeParameters发生异常" + e);
} }
JSONObject difyToAfter = JSONObject.parseObject(toAfter); JSONObject difyToAfter = JSONObject.parseObject(toAfter);
if (difyToAfter.containsKey("answer") && !difyToAfter.getJSONObject("answer").isEmpty()) { if (difyToAfter.containsKey("answer") && !difyToAfter.getJSONObject("answer").isEmpty()) {
difyToAfter = diFyObject.getJSONObject("answer"); difyToAfter = diFyObject.getJSONObject("answer");