From 2b2a5acc6c6af5e266f05d66e2f99f3a375087e6 Mon Sep 17 00:00:00 2001 From: zren25 Date: Tue, 8 Apr 2025 11:54:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9json=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IntelligentCustomerServiceImpl.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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 11bbf1c..12752ba 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 @@ -108,21 +108,16 @@ public class IntelligentCustomerServiceImpl implements IntelligentCustomerServic String message = null; try { JSONObject outputsJson = execDifyFlow.getJSONObject("outputs"); - JSONObject textJsonObject =outputsJson.getJSONObject("text"); - if(textJsonObject.containsKey("answer")){ - textJsonObject = textJsonObject.getJSONObject("answer"); // 投诉 - } + // 咨询 + JSONObject textJsonObject =outputsJson.getJSONObject("text").getJSONObject("consult"); ConsultDTO consultDTO = new ConsultDTO(); consultDTO.setOrderType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.CONSULT.getCode(),textJsonObject.getString("工单类别"))); consultDTO.setProblemDescription(textJsonObject.getString("问题描述")); consultDTO.setContactSex(textJsonObject.getString("工单联系人性别")); consultDTO.setContactName(textJsonObject.getString("工单联系人姓名")); consultDTO.setContactTelephone(textJsonObject.getString("工单联系电话")); - - JSONObject complainObject = outputsJson.getJSONObject("text1"); - if(complainObject.containsKey("answer")){ - complainObject = complainObject.getJSONObject("answer"); // 投诉 - } + // 投诉 + JSONObject complainObject = outputsJson.getJSONObject("text1").getJSONObject("complain"); ComplainDTO complainDTO = new ComplainDTO(); complainDTO.setComplainType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.CONSULT_TYPE.getCode(),complainObject.getString("投诉类型"))); complainDTO.setOrderType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.COMPLAIN.getCode(),complainObject.getString("工单类别")));