Merge branch 'dev-feature-20250923-json' into 'feature-20250923'
Dev feature 20250923 json See merge request nsc/chinavolvoaidrives/ai-analytic-center!49
This commit is contained in:
@@ -21,7 +21,6 @@ import com.volvo.ai.analytic.center.mapper.AiAnalyticWarrantyAuditMapper;
|
|||||||
import com.volvo.ai.analytic.center.mapper.TmClaimVerificationPartHoursMappingMapper;
|
import com.volvo.ai.analytic.center.mapper.TmClaimVerificationPartHoursMappingMapper;
|
||||||
import com.volvo.ai.analytic.center.service.DataMaskingRuleService;
|
import com.volvo.ai.analytic.center.service.DataMaskingRuleService;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.text.StringEscapeUtils;
|
|
||||||
import com.volvo.ai.analytic.center.feign.DiFyFeign;
|
import com.volvo.ai.analytic.center.feign.DiFyFeign;
|
||||||
import com.volvo.ai.analytic.center.mapper.AiAnalysisRequestLogsMapper;
|
import com.volvo.ai.analytic.center.mapper.AiAnalysisRequestLogsMapper;
|
||||||
import com.volvo.ai.analytic.center.mapper.AiAnalyticBusinessConfigMapper;
|
import com.volvo.ai.analytic.center.mapper.AiAnalyticBusinessConfigMapper;
|
||||||
@@ -145,7 +144,7 @@ public class ClaimVerificationServiceImpl implements ClaimVerificationService {
|
|||||||
diFyObject = (JSONObject) diFyService.getDiFyObject(diFyReq);
|
diFyObject = (JSONObject) diFyService.getDiFyObject(diFyReq);
|
||||||
//处理结果并推送MQ
|
//处理结果并推送MQ
|
||||||
if (diFyObject == null) {
|
if (diFyObject == null) {
|
||||||
log.error(" 售后索赔检核文件分析dify返回结果为空");
|
log.error("售后索赔检核文件分析dify返回结果为空");
|
||||||
saveException("售后索赔检核文件分析dify返回结果为空", aiAnalysisRequestId, null);
|
saveException("售后索赔检核文件分析dify返回结果为空", aiAnalysisRequestId, null);
|
||||||
} else {
|
} else {
|
||||||
//解析dify返回结果
|
//解析dify返回结果
|
||||||
@@ -372,16 +371,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);
|
if(toAfter == null || toAfter.isEmpty()){
|
||||||
} else {
|
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user