|
@@ -356,7 +356,7 @@ public class CrmCustomerAiTagUtil {
|
|
|
HashMap<String, String> userInfo = new HashMap<String, String>();
|
|
HashMap<String, String> userInfo = new HashMap<String, String>();
|
|
|
List<SysDictData> portraits = SpringUtils.getBean(SysDictDataMapper.class).selectDictDataByType(AI_PORTRAIT);
|
|
List<SysDictData> portraits = SpringUtils.getBean(SysDictDataMapper.class).selectDictDataByType(AI_PORTRAIT);
|
|
|
List<String> dictValue = portraits.stream().map(SysDictData::getDictValue).collect(Collectors.toList());
|
|
List<String> dictValue = portraits.stream().map(SysDictData::getDictValue).collect(Collectors.toList());
|
|
|
- if (!crmCustomerAnalyze.getCustomerPortraitJson().isEmpty()){
|
|
|
|
|
|
|
+ if (crmCustomerAnalyze.getCustomerPortraitJson()!= null && !crmCustomerAnalyze.getCustomerPortraitJson().isEmpty()){
|
|
|
Map<String, String> portraitList = JSON.parseObject(
|
|
Map<String, String> portraitList = JSON.parseObject(
|
|
|
crmCustomerAnalyze.getCustomerPortraitJson(),
|
|
crmCustomerAnalyze.getCustomerPortraitJson(),
|
|
|
new cn.hutool.core.lang.TypeReference<Map<String, String>>() {}
|
|
new cn.hutool.core.lang.TypeReference<Map<String, String>>() {}
|
|
@@ -403,6 +403,13 @@ public class CrmCustomerAiTagUtil {
|
|
|
if (!maps.isEmpty()){
|
|
if (!maps.isEmpty()){
|
|
|
CrmCustomerAnalyzeMapper bean = SpringUtils.getBean(CrmCustomerAnalyzeMapper.class);
|
|
CrmCustomerAnalyzeMapper bean = SpringUtils.getBean(CrmCustomerAnalyzeMapper.class);
|
|
|
CrmCustomerAnalyze crmCustomerAnalyze = bean.selectLatestOne(Long.valueOf(customerId));
|
|
CrmCustomerAnalyze crmCustomerAnalyze = bean.selectLatestOne(Long.valueOf(customerId));
|
|
|
|
|
+ if (crmCustomerAnalyze == null){
|
|
|
|
|
+ CrmCustomerMapper customerMapper = SpringUtils.getBean(CrmCustomerMapper.class);
|
|
|
|
|
+ CrmCustomer crmCustomer = customerMapper.selectCrmCustomerById(Long.valueOf(customerId));
|
|
|
|
|
+ crmCustomerAnalyze = new CrmCustomerAnalyze();
|
|
|
|
|
+ crmCustomerAnalyze.setCustomerId(Long.valueOf(customerId));
|
|
|
|
|
+ crmCustomerAnalyze.setCustomerName(crmCustomer.getCustomerName());
|
|
|
|
|
+ }
|
|
|
crmCustomerAnalyze.setAiChatRecord(JSONUtil.toJsonStr(maps));
|
|
crmCustomerAnalyze.setAiChatRecord(JSONUtil.toJsonStr(maps));
|
|
|
crmCustomerAnalyze.setCreateTime(new Date());
|
|
crmCustomerAnalyze.setCreateTime(new Date());
|
|
|
bean.insertCrmCustomerAnalyze(crmCustomerAnalyze);
|
|
bean.insertCrmCustomerAnalyze(crmCustomerAnalyze);
|