|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fs.ad.enums.AdUploadType;
|
|
|
@@ -1058,6 +1059,8 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
} else {
|
|
|
qwExternalContactMapper.insertQwExternalContact(qwExternalContact);
|
|
|
}
|
|
|
+
|
|
|
+ logger.info("成功同步一个用户");
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
@@ -2176,8 +2179,8 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
|
|
|
@Override
|
|
|
public QwUser getQwUserByRedisForId(String qwUserId) {
|
|
|
- if(qwUserId==null|| !qwUserId.isEmpty()){
|
|
|
- return null;
|
|
|
+ if(StringUtils.isEmpty(qwUserId)){
|
|
|
+ return null;
|
|
|
}
|
|
|
String redisKey = "qwUserRdById:" + qwUserId;
|
|
|
|
|
|
@@ -2306,7 +2309,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (qwContactWay.getIsSpanWelcome() == 1 && isClose) {
|
|
|
+ if (qwContactWay.getIsWelcome() == 1 && isClose) {
|
|
|
isSend = qwContactWayService.sendWelcomeMsg(qwContactWay, corpId, welcomeCode,qwUser,contact.getId());
|
|
|
}
|
|
|
}
|
|
|
@@ -2345,7 +2348,6 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
LocalTime start = LocalTime.parse(schedule.getStartTime());
|
|
|
LocalTime end = LocalTime.parse(schedule.getEndTime().equals("24:00") ? "23:59:59" : schedule.getEndTime());
|
|
|
if (!now.isBefore(start) && !now.isAfter(end)) {
|
|
|
-
|
|
|
TextMessage textMessage = new TextMessage();
|
|
|
textMessage.setContent(schedule.getWelcomeText());
|
|
|
sendWelcomeMsgParam.setText(textMessage);
|
|
|
@@ -2448,6 +2450,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
|
|
|
if (wayLogs==null){
|
|
|
|
|
|
+
|
|
|
QwAppContactWayLogs qwAppContactWayLogs = new QwAppContactWayLogs();
|
|
|
qwAppContactWayLogs.setAppWayId(qwAppContactWay.getId());
|
|
|
qwAppContactWayLogs.setUserId(qwAppContactWay.getUserId());
|
|
|
@@ -4258,7 +4261,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
|
|
|
//客户删除销售-找这个销售的sop任务中所有的营期里有没有这个客户,删了(暂时不要删-这种流失的有些一样能发消息)
|
|
|
// sopUserLogsInfoMapper.deleteByQwUserIdAndCorpIdToContactId(userID,corpId, externalUserID);
|
|
|
- logger.error("客户删除销售-"+"|"+externalUserID+"|"+userID+"|"+corpId);
|
|
|
+// logger.error("客户删除销售-"+"|"+externalUserID+"|"+userID+"|"+corpId);
|
|
|
|
|
|
QwExternalContact qwExternalContact = qwExternalContactMapper.selectQwExternalContactUserIdAndExternalIdAndCompanyId(externalUserID, userID, corpId);
|
|
|
if (qwExternalContact != null) {
|
|
|
@@ -4890,7 +4893,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
for (QwOptionsVO qwOptionsVO : qwOptionsVOS) {
|
|
|
String corpId = qwOptionsVO.getCorpId();
|
|
|
// System.out.println("同步的"+corpId);
|
|
|
-// logger.info("同步的"+corpId);
|
|
|
+ logger.info("同步的"+corpId);
|
|
|
executor.execute(() -> qwExternalContactSyncByCorpId(corpId));
|
|
|
}
|
|
|
executor.shutdown();
|
|
|
@@ -5832,6 +5835,27 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
return qwExternalContactMapper.selectQwUserDelLossList(param);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void updateQwExternalContactStatusById(QwExternalContact qwExternalContact) {
|
|
|
+ qwExternalContactMapper.updateQwExternalContactStatusById(qwExternalContact);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R getRepeat(RepeatParam param) {
|
|
|
+ List<QwExternalContact> list = qwExternalContactMapper.selectList(new QueryWrapper<QwExternalContact>().eq("external_user_id", param.getExternalUserId()));
|
|
|
+ if(list.isEmpty()) return R.error("未找到外部联系人");
|
|
|
+ QwExternalContact qwExternalContact = list.get(0);
|
|
|
+ List<QwExternalContact> qwExternalContacts = qwExternalContactMapper.selectList(new QueryWrapper<QwExternalContact>().eq("repeat_no", qwExternalContact.getRepeatNo()));
|
|
|
+ List<String> userIdList = PubFun.listToNewList(qwExternalContacts, QwExternalContact::getUserId);
|
|
|
+ List<QwUser> qwUsers = qwUserMapper.selectList(new QueryWrapper<QwUser>().in("qw_user_id", userIdList).eq("corp_id", qwExternalContact.getCorpId()));
|
|
|
+ List<String> companyIds = PubFun.listToNewList(qwUsers, QwUser::getCorpId);
|
|
|
+ List<QwCompany> companyList = qwCompanyMapper.selectByCorpIds(companyIds);
|
|
|
+ Map<String, QwCompany> companyMap = PubFun.listToMapByGroupObject(companyList, QwCompany::getCorpId);
|
|
|
+ QwCompany qwCompany = new QwCompany();
|
|
|
+ qwCompany.setCorpName("未找到主题");
|
|
|
+ return R.ok().put("data", qwUsers.stream().map(e -> QwUserVO.builder().qwUserId(e.getQwUserId()).qwUserName(e.getQwUserName()).companyName(companyMap.getOrDefault(e.getCorpId(), qwCompany).getCorpName()).build()));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public Boolean getSopAiChatByRedis(String qwUserId,String corpId,String externalUserId){
|
|
|
|