diff --git a/ai-analytic-center-biz/src/main/java/com/volvo/ai/analytic/center/service/impl/IntelligentCustomerServiceImpl.java b/ai-analytic-center-biz/src/main/java/com/volvo/ai/analytic/center/service/impl/IntelligentCustomerServiceImpl.java index 27ff3da..11bbf1c 100644 --- a/ai-analytic-center-biz/src/main/java/com/volvo/ai/analytic/center/service/impl/IntelligentCustomerServiceImpl.java +++ b/ai-analytic-center-biz/src/main/java/com/volvo/ai/analytic/center/service/impl/IntelligentCustomerServiceImpl.java @@ -107,9 +107,10 @@ public class IntelligentCustomerServiceImpl implements IntelligentCustomerServic String aiAnalysisRequestId = null; String message = null; try { - JSONObject textJsonObject = execDifyFlow.getJSONObject("outputs").getJSONObject("text"); + JSONObject outputsJson = execDifyFlow.getJSONObject("outputs"); + JSONObject textJsonObject =outputsJson.getJSONObject("text"); if(textJsonObject.containsKey("answer")){ - textJsonObject = execDifyFlow.getJSONObject("outputs").getJSONObject("text").getJSONObject("answer"); // 投诉 + textJsonObject = textJsonObject.getJSONObject("answer"); // 投诉 } ConsultDTO consultDTO = new ConsultDTO(); consultDTO.setOrderType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.CONSULT.getCode(),textJsonObject.getString("工单类别"))); @@ -118,9 +119,9 @@ public class IntelligentCustomerServiceImpl implements IntelligentCustomerServic consultDTO.setContactName(textJsonObject.getString("工单联系人姓名")); consultDTO.setContactTelephone(textJsonObject.getString("工单联系电话")); - JSONObject complainObject = execDifyFlow.getJSONObject("outputs").getJSONObject("text1"); + JSONObject complainObject = outputsJson.getJSONObject("text1"); if(complainObject.containsKey("answer")){ - complainObject = execDifyFlow.getJSONObject("outputs").getJSONObject("text1").getJSONObject("answer"); // 投诉 + complainObject = complainObject.getJSONObject("answer"); // 投诉 } ComplainDTO complainDTO = new ComplainDTO(); complainDTO.setComplainType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.CONSULT_TYPE.getCode(),complainObject.getString("投诉类型")));