|
@@ -5,8 +5,6 @@ import cn.hutool.core.map.MapUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -21,13 +19,11 @@ import com.fs.common.utils.spring.SpringUtils;
|
|
|
import com.fs.crm.domain.*;
|
|
import com.fs.crm.domain.*;
|
|
|
import com.fs.crm.dto.CrmCustomerAiAutoTagVo;
|
|
import com.fs.crm.dto.CrmCustomerAiAutoTagVo;
|
|
|
import com.fs.crm.mapper.CrmCustomerAnalyzeMapper;
|
|
import com.fs.crm.mapper.CrmCustomerAnalyzeMapper;
|
|
|
-import com.fs.crm.mapper.CrmCustomerMapper;
|
|
|
|
|
import com.fs.crm.param.PolishingScriptParam;
|
|
import com.fs.crm.param.PolishingScriptParam;
|
|
|
import com.fs.crm.service.ICrmCustomerAnalyzeService;
|
|
import com.fs.crm.service.ICrmCustomerAnalyzeService;
|
|
|
import com.fs.crm.service.ICrmCustomerPropertyTemplateService;
|
|
import com.fs.crm.service.ICrmCustomerPropertyTemplateService;
|
|
|
import com.fs.crm.utils.CrmCustomerAiTagUtil;
|
|
import com.fs.crm.utils.CrmCustomerAiTagUtil;
|
|
|
-import com.fs.crm.vo.CrmCustomerAiTagVo;
|
|
|
|
|
-import com.fs.crm.vo.QwCustomerAiTagVo;
|
|
|
|
|
|
|
+import com.fs.qw.vo.QwCustomerAiTagVo;
|
|
|
import com.fs.qw.domain.QwExternalAiAnalyze;
|
|
import com.fs.qw.domain.QwExternalAiAnalyze;
|
|
|
import com.fs.qw.mapper.QwCustomerPropertyMapper;
|
|
import com.fs.qw.mapper.QwCustomerPropertyMapper;
|
|
|
import com.fs.qw.mapper.QwExternalAiAnalyzeMapper;
|
|
import com.fs.qw.mapper.QwExternalAiAnalyzeMapper;
|
|
@@ -402,7 +398,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
requestParam.put("userIntent", "");
|
|
requestParam.put("userIntent", "");
|
|
|
long startTime = System.currentTimeMillis();
|
|
long startTime = System.currentTimeMillis();
|
|
|
R aiResponse = CrmCustomerAiTagUtil.callAiService(requestParam, Long.valueOf(param.getChatId()),OTHER_KEY);
|
|
R aiResponse = CrmCustomerAiTagUtil.callAiService(requestParam, Long.valueOf(param.getChatId()),OTHER_KEY);
|
|
|
- System.out.println(aiResponse);
|
|
|
|
|
|
|
+// System.out.println(aiResponse);
|
|
|
String result = "";
|
|
String result = "";
|
|
|
CrmCustomerChatMessage crmCustomerChatMessage = new CrmCustomerChatMessage();
|
|
CrmCustomerChatMessage crmCustomerChatMessage = new CrmCustomerChatMessage();
|
|
|
crmCustomerChatMessage.setContentType(1);
|
|
crmCustomerChatMessage.setContentType(1);
|
|
@@ -550,7 +546,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
// log.info("请求参数:{}", requestParam);
|
|
// log.info("请求参数:{}", requestParam);
|
|
|
|
|
|
|
|
R aiResponse = CrmCustomerAiTagUtil.callAiService(requestParam, chatId,OTHER_KEY);
|
|
R aiResponse = CrmCustomerAiTagUtil.callAiService(requestParam, chatId,OTHER_KEY);
|
|
|
- JSONObject root = JSON.parseObject(JSONUtil.toJsonStr(aiResponse));
|
|
|
|
|
|
|
+// JSONObject root = JSON.parseObject(JSONUtil.toJsonStr(aiResponse));
|
|
|
// System.out.println(aiResponse);
|
|
// System.out.println(aiResponse);
|
|
|
// 获取 data.responseData
|
|
// 获取 data.responseData
|
|
|
String result = "";
|
|
String result = "";
|
|
@@ -598,7 +594,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String aiGeneratedCustomerPortraitQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
public String aiGeneratedCustomerPortraitQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
|
- Map<String, Object> stringObjectMap = buildRequestParamQw(qwExternalAiAnalyze, dataJson);
|
|
|
|
|
|
|
+ Map<String, Object> stringObjectMap = buildRequestParam(qwExternalAiAnalyze, dataJson);
|
|
|
stringObjectMap.put("modelType", "客户画像");
|
|
stringObjectMap.put("modelType", "客户画像");
|
|
|
// log.info("请求参数:{}", stringObjectMap);
|
|
// log.info("请求参数:{}", stringObjectMap);
|
|
|
R aiResponse = CrmCustomerAiTagUtil.callAiService(stringObjectMap, logId, OTHER_KEY);
|
|
R aiResponse = CrmCustomerAiTagUtil.callAiService(stringObjectMap, logId, OTHER_KEY);
|
|
@@ -620,7 +616,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String aiCommunicationSummaryQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
public String aiCommunicationSummaryQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
|
- Map<String, Object> stringObjectMap = buildRequestParamQw(qwExternalAiAnalyze, dataJson);
|
|
|
|
|
|
|
+ Map<String, Object> stringObjectMap = buildRequestParam(qwExternalAiAnalyze, dataJson);
|
|
|
stringObjectMap.put("modelType", "沟通总结");
|
|
stringObjectMap.put("modelType", "沟通总结");
|
|
|
// log.info("请求参数:{}", stringObjectMap);
|
|
// log.info("请求参数:{}", stringObjectMap);
|
|
|
R aiResponse = CrmCustomerAiTagUtil.callAiService(stringObjectMap, logId, OTHER_KEY);
|
|
R aiResponse = CrmCustomerAiTagUtil.callAiService(stringObjectMap, logId, OTHER_KEY);
|
|
@@ -639,7 +635,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String aiCommunicationAbstractQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
public String aiCommunicationAbstractQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
|
- Map<String, Object> stringObjectMap = buildRequestParamQw(qwExternalAiAnalyze, dataJson);
|
|
|
|
|
|
|
+ Map<String, Object> stringObjectMap = buildRequestParam(qwExternalAiAnalyze, dataJson);
|
|
|
stringObjectMap.put("modelType", "沟通摘要");
|
|
stringObjectMap.put("modelType", "沟通摘要");
|
|
|
stringObjectMap.remove("userInfo");
|
|
stringObjectMap.remove("userInfo");
|
|
|
HashMap<String, String> map = MapUtil.of("沟通摘要", "");
|
|
HashMap<String, String> map = MapUtil.of("沟通摘要", "");
|
|
@@ -660,7 +656,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Long aiAttritionLevelQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
public Long aiAttritionLevelQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
|
- Map<String, Object> stringObjectMap = buildRequestParamQw(qwExternalAiAnalyze, dataJson);
|
|
|
|
|
|
|
+ Map<String, Object> stringObjectMap = buildRequestParam(qwExternalAiAnalyze, dataJson);
|
|
|
stringObjectMap.put("modelType","流失风险等级");
|
|
stringObjectMap.put("modelType","流失风险等级");
|
|
|
stringObjectMap.remove("userInfo");
|
|
stringObjectMap.remove("userInfo");
|
|
|
HashMap<String, String> map = MapUtil.of("流失风险等级", "");
|
|
HashMap<String, String> map = MapUtil.of("流失风险等级", "");
|
|
@@ -682,7 +678,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String aiCustomerFocusQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
public String aiCustomerFocusQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
|
- Map<String, Object> stringObjectMap = buildRequestParamQw(qwExternalAiAnalyze, dataJson);
|
|
|
|
|
|
|
+ Map<String, Object> stringObjectMap = buildRequestParam(qwExternalAiAnalyze, dataJson);
|
|
|
stringObjectMap.put("modelType","客户关注点");
|
|
stringObjectMap.put("modelType","客户关注点");
|
|
|
stringObjectMap.remove("userInfo");
|
|
stringObjectMap.remove("userInfo");
|
|
|
HashMap<String, String> map = MapUtil.of("客户关注点", "");
|
|
HashMap<String, String> map = MapUtil.of("客户关注点", "");
|
|
@@ -705,7 +701,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String aiIntentionDegreeQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
public String aiIntentionDegreeQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson, Long logId) {
|
|
|
- Map<String, Object> stringObjectMap = buildRequestParamQw(qwExternalAiAnalyze, dataJson);
|
|
|
|
|
|
|
+ Map<String, Object> stringObjectMap = buildRequestParam(qwExternalAiAnalyze, dataJson);
|
|
|
stringObjectMap.put("modelType","客户意向度");
|
|
stringObjectMap.put("modelType","客户意向度");
|
|
|
stringObjectMap.remove("userInfo");
|
|
stringObjectMap.remove("userInfo");
|
|
|
HashMap<String, String> map = MapUtil.of("客户意向度", "");
|
|
HashMap<String, String> map = MapUtil.of("客户意向度", "");
|
|
@@ -878,7 +874,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private Map<String, Object> buildRequestParamQw(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson) {
|
|
|
|
|
|
|
+ private Map<String, Object> buildRequestParam(QwExternalAiAnalyze qwExternalAiAnalyze, String dataJson) {
|
|
|
Map<String, Object> requestParam = new HashMap<>();
|
|
Map<String, Object> requestParam = new HashMap<>();
|
|
|
|
|
|
|
|
// 获取各类数据
|
|
// 获取各类数据
|