|
|
@@ -356,6 +356,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Async
|
|
|
public void aiIntentionDegree(Long customerId, String dataJson, Long logId) {
|
|
|
Map<String, Object> stringObjectMap = buildRequestParam(customerId, dataJson);
|
|
|
stringObjectMap.put("modelType","客户意向度");
|
|
|
@@ -368,7 +369,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
// 获取 data.responseData
|
|
|
JSONArray responseData = root.getJSONObject("data").getJSONArray("responseData");
|
|
|
|
|
|
- JSONArray summary = null;
|
|
|
+ String summary = null;
|
|
|
|
|
|
// 遍历 responseData
|
|
|
for (int i = 0; i < responseData.size(); i++) {
|
|
|
@@ -383,7 +384,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
if ("AI".equals(historyItem.getString("obj"))) {
|
|
|
String valueStr = historyItem.getString("value");
|
|
|
JSONObject valueObj = JSON.parseObject(valueStr);
|
|
|
- summary = valueObj.getJSONArray("userContent");
|
|
|
+ summary = valueObj.getString("userIntent");
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -391,7 +392,10 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
if (summary != null) break;
|
|
|
}
|
|
|
if (summary != null) {
|
|
|
- //todo 响应处理
|
|
|
+ CrmCustomerAnalyze crmCustomerAnalyze = new CrmCustomerAnalyze();
|
|
|
+ crmCustomerAnalyze.setCustomerId(customerId);
|
|
|
+ crmCustomerAnalyze.setIntentionDegree(summary);
|
|
|
+ baseMapper.updateCustomerPortrait(crmCustomerAnalyze);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -440,7 +444,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
// 获取 data.responseData
|
|
|
JSONArray responseData = root.getJSONObject("data").getJSONArray("responseData");
|
|
|
|
|
|
- JSONArray summary = null;
|
|
|
+ String summary = null;
|
|
|
|
|
|
// 遍历 responseData
|
|
|
for (int i = 0; i < responseData.size(); i++) {
|
|
|
@@ -455,7 +459,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
if ("AI".equals(historyItem.getString("obj"))) {
|
|
|
String valueStr = historyItem.getString("value");
|
|
|
JSONObject valueObj = JSON.parseObject(valueStr);
|
|
|
- summary = valueObj.getJSONArray("userContent");
|
|
|
+ summary = valueObj.getString("userIntent");
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -463,7 +467,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
if (summary != null) break;
|
|
|
}
|
|
|
if (summary != null) {
|
|
|
- //todo 响应处理
|
|
|
+ return summary;
|
|
|
}
|
|
|
return null;
|
|
|
}
|