From 5a223da6b9584ef16a7112bb6889774195cd7b65 Mon Sep 17 00:00:00 2001 From: zren25 Date: Mon, 7 Apr 2025 11:19:38 +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 | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 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 a04e77d..aeb071f 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 @@ -105,22 +105,19 @@ public class IntelligentCustomerServiceImpl implements IntelligentCustomerServic if(null != execDifyFlow && execDifyFlow.get("status").equals("succeeded")){ JSONObject textJsonObject = execDifyFlow.getJSONObject("outputs").getJSONObject("text"); - JSONObject consult = textJsonObject.getJSONObject("answer"); // 咨询 ConsultDTO consultDTO = new ConsultDTO(); - consultDTO.setOrderType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.CONSULT.getCode(),consult.getString("工单类别"))); - consultDTO.setProblemDescription(consult.getString("问题描述")); - consultDTO.setContactSex(consult.getString("工单联系人性别")); - consultDTO.setContactName(consult.getString("工单联系人姓名")); - consultDTO.setContactTelephone(consult.getString("工单联系电话")); + 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 = execDifyFlow.getJSONObject("outputs").getJSONObject("text1"); - - JSONObject complain = complainObject.getJSONObject("complain"); // 投诉 ComplainDTO complainDTO = new ComplainDTO(); - complainDTO.setComplainType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.CONSULT_TYPE.getCode(),complain.getString("投诉类型"))); - complainDTO.setOrderType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.COMPLAIN.getCode(),complain.getString("工单类别"))); - complainDTO.setComplainTitle(complain.getString("投诉主题")); - complainDTO.setProblemDescription(complain.getString("问题描述")); + complainDTO.setComplainType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.CONSULT_TYPE.getCode(),complainObject.getString("投诉类型"))); + complainDTO.setOrderType(fourInOneMqServiceFilter(IntelligentCustomerTypeEnum.COMPLAIN.getCode(),complainObject.getString("工单类别"))); + complainDTO.setComplainTitle(complainObject.getString("投诉主题")); + complainDTO.setProblemDescription(complainObject.getString("问题描述")); complainDTO.setContactSex(consultDTO.getContactSex()); complainDTO.setContactName(consultDTO.getContactName()); complainDTO.setContactTelephone(consultDTO.getContactTelephone());