|
@@ -23,21 +23,18 @@ import com.fs.course.param.FsCourseLinkCreateParam;
|
|
import com.fs.course.service.IFsCourseLinkService;
|
|
import com.fs.course.service.IFsCourseLinkService;
|
|
import com.fs.crm.domain.CrmCustomer;
|
|
import com.fs.crm.domain.CrmCustomer;
|
|
import com.fs.crm.mapper.CrmCustomerMapper;
|
|
import com.fs.crm.mapper.CrmCustomerMapper;
|
|
-import com.fs.fastGpt.param.SendHookAIParam;
|
|
|
|
-import com.fs.qw.param.newparam.ExternalContactPageListParam;
|
|
|
|
-import com.fs.qw.vo.newvo.ExternalContactDetailsVO;
|
|
|
|
-import com.fs.qw.vo.newvo.ExternalContactListVO;
|
|
|
|
-import com.fs.qw.vo.newvo.ExternalContactNumVO;
|
|
|
|
-import com.fs.qw.vo.newvo.ExternalContactPageVO;
|
|
|
|
-import com.fs.store.domain.FsUser;
|
|
|
|
-import com.fs.store.mapper.FsUserMapper;
|
|
|
|
import com.fs.qw.domain.*;
|
|
import com.fs.qw.domain.*;
|
|
import com.fs.qw.mapper.*;
|
|
import com.fs.qw.mapper.*;
|
|
import com.fs.qw.param.*;
|
|
import com.fs.qw.param.*;
|
|
|
|
+import com.fs.qw.param.newparam.ExternalContactPageListParam;
|
|
import com.fs.qw.result.QwExternalContactLogVo;
|
|
import com.fs.qw.result.QwExternalContactLogVo;
|
|
import com.fs.qw.result.QwExternalContactVo;
|
|
import com.fs.qw.result.QwExternalContactVo;
|
|
import com.fs.qw.service.*;
|
|
import com.fs.qw.service.*;
|
|
import com.fs.qw.vo.*;
|
|
import com.fs.qw.vo.*;
|
|
|
|
+import com.fs.qw.vo.newvo.ExternalContactDetailsVO;
|
|
|
|
+import com.fs.qw.vo.newvo.ExternalContactListVO;
|
|
|
|
+import com.fs.qw.vo.newvo.ExternalContactNumVO;
|
|
|
|
+import com.fs.qw.vo.newvo.ExternalContactPageVO;
|
|
import com.fs.qwApi.Result.QwOpenidResult;
|
|
import com.fs.qwApi.Result.QwOpenidResult;
|
|
import com.fs.qwApi.domain.*;
|
|
import com.fs.qwApi.domain.*;
|
|
import com.fs.qwApi.domain.inner.*;
|
|
import com.fs.qwApi.domain.inner.*;
|
|
@@ -58,8 +55,8 @@ import com.fs.store.mapper.FsUserMapper;
|
|
import com.fs.system.domain.SysConfig;
|
|
import com.fs.system.domain.SysConfig;
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.voice.utils.StringUtil;
|
|
import com.fs.voice.utils.StringUtil;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
-//import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -88,6 +85,7 @@ import java.util.stream.Stream;
|
|
* @author fs
|
|
* @author fs
|
|
* @date 2024-06-20
|
|
* @date 2024-06-20
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactMapper, QwExternalContact> implements IQwExternalContactService {
|
|
public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactMapper, QwExternalContact> implements IQwExternalContactService {
|
|
|
|
|
|
@@ -1219,10 +1217,10 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
List<QwExternalContact> externalContactList = qwExternalContactMapper.selectList(new QueryWrapper<QwExternalContact>().eq("external_user_id", externalUserID).eq("corp_id", corpId));
|
|
List<QwExternalContact> externalContactList = qwExternalContactMapper.selectList(new QueryWrapper<QwExternalContact>().eq("external_user_id", externalUserID).eq("corp_id", corpId));
|
|
if(!externalContactList.isEmpty()){
|
|
if(!externalContactList.isEmpty()){
|
|
externalContactList.forEach(e -> {
|
|
externalContactList.forEach(e -> {
|
|
- e.setRepeat(1);
|
|
|
|
|
|
+ e.setIsRepeat(1);
|
|
});
|
|
});
|
|
qwExternalContactService.updateBatchById(externalContactList);
|
|
qwExternalContactService.updateBatchById(externalContactList);
|
|
- qwExternalContact.setRepeat(1);
|
|
|
|
|
|
+ qwExternalContact.setIsRepeat(1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1243,9 +1241,9 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
if (isNewQwExternalContact) {
|
|
if (isNewQwExternalContact) {
|
|
qwExternalContact.setName("待同步客户");
|
|
qwExternalContact.setName("待同步客户");
|
|
qwExternalContact.setGender(0);
|
|
qwExternalContact.setGender(0);
|
|
- qwExternalContactMapper.insertQwExternalContact(qwExternalContact);
|
|
|
|
|
|
+ qwExternalContactMapper.insert(qwExternalContact);
|
|
} else {
|
|
} else {
|
|
- qwExternalContactMapper.updateQwExternalContact(qwExternalContact);
|
|
|
|
|
|
+ qwExternalContactMapper.updateById(qwExternalContact);
|
|
}
|
|
}
|
|
|
|
|
|
QwExternalContact contact = qwExternalContact;
|
|
QwExternalContact contact = qwExternalContact;
|
|
@@ -1518,6 +1516,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
String tagRemark = null;
|
|
String tagRemark = null;
|
|
//根据qwUser 匹配 分时段的标签
|
|
//根据qwUser 匹配 分时段的标签
|
|
QwAutoTags qwAutoTags = qwAutoTagsMapper.selectQwAutoTagsByIdJSON(corpId, qwUser.getId());
|
|
QwAutoTags qwAutoTags = qwAutoTagsMapper.selectQwAutoTagsByIdJSON(corpId, qwUser.getId());
|
|
|
|
+ log.info("自动打标签方案{}", qwAutoTags);
|
|
if (qwAutoTags != null) {
|
|
if (qwAutoTags != null) {
|
|
//标签日志记录
|
|
//标签日志记录
|
|
qwAutoTagsLogs.setAutoTagId(qwAutoTags.getId());
|
|
qwAutoTagsLogs.setAutoTagId(qwAutoTags.getId());
|
|
@@ -1543,11 +1542,12 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
String startTime = rulesTags.getStartTime();
|
|
String startTime = rulesTags.getStartTime();
|
|
String endTime = rulesTags.getEndTime();
|
|
String endTime = rulesTags.getEndTime();
|
|
String remarks = rulesTags.getRemarks();
|
|
String remarks = rulesTags.getRemarks();
|
|
-
|
|
|
|
|
|
+ log.info("自动打标签开始时间:{} 到 {}, time:{} 到 {}", startDate, endDate, startTime, endTime);
|
|
// 检查今天是否在 week 集合中
|
|
// 检查今天是否在 week 集合中
|
|
// boolean isTodayInWeek = week.contains(todayIndex);
|
|
// boolean isTodayInWeek = week.contains(todayIndex);
|
|
boolean isToday = false;
|
|
boolean isToday = false;
|
|
- if(startDate == null || endDate == null){
|
|
|
|
|
|
+ if(startDate != null && endDate != null){
|
|
|
|
+ log.info("进入日期判断");
|
|
isToday = !nowDate.isBefore(startDate) && !nowDate.isAfter(endDate);
|
|
isToday = !nowDate.isBefore(startDate) && !nowDate.isAfter(endDate);
|
|
}
|
|
}
|
|
// 转换时间字符串为 LocalTime
|
|
// 转换时间字符串为 LocalTime
|
|
@@ -1555,6 +1555,8 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
LocalTime end = LocalTime.parse(endTime.equals("24:00") ? "23:59:59" : endTime);
|
|
LocalTime end = LocalTime.parse(endTime.equals("24:00") ? "23:59:59" : endTime);
|
|
// 检查当前时间是否在 startTime 和 endTime 之间
|
|
// 检查当前时间是否在 startTime 和 endTime 之间
|
|
boolean isNowInTimeRange = !now.isBefore(start) && !now.isAfter(end);
|
|
boolean isNowInTimeRange = !now.isBefore(start) && !now.isAfter(end);
|
|
|
|
+ log.info("是否满足时间打标签:天:{}, 时:{}", isToday, isNowInTimeRange);
|
|
|
|
+ log.info("是否每天{}", rulesTags.getEveryDay());
|
|
// 如果当前时间和日期匹配规则,将 tagsItem 添加到 combinedTagsSet 中
|
|
// 如果当前时间和日期匹配规则,将 tagsItem 添加到 combinedTagsSet 中
|
|
if (((rulesTags.getEveryDay() != null && rulesTags.getEveryDay() == 1) || isToday) && isNowInTimeRange) {
|
|
if (((rulesTags.getEveryDay() != null && rulesTags.getEveryDay() == 1) || isToday) && isNowInTimeRange) {
|
|
|
|
|