|
@@ -29,6 +29,11 @@ import com.storlead.sales.mail.pojo.vo.*;
|
|
|
import com.storlead.sales.mail.properties.MailFileProperties;
|
|
import com.storlead.sales.mail.properties.MailFileProperties;
|
|
|
import com.storlead.sales.mail.service.*;
|
|
import com.storlead.sales.mail.service.*;
|
|
|
import com.storlead.framework.mybatis.service.impl.MyBaseServiceImpl;
|
|
import com.storlead.framework.mybatis.service.impl.MyBaseServiceImpl;
|
|
|
|
|
+import com.storlead.sales.mail.integration.external.IntegrationExternalInvoker;
|
|
|
|
|
+import com.storlead.sales.mail.integration.handler.CrmMailSyncHandler;
|
|
|
|
|
+import com.storlead.sales.mail.integration.handler.NewMailRemindHandler;
|
|
|
|
|
+import com.storlead.sales.mail.integration.service.MailIntegrationTaskService;
|
|
|
|
|
+import com.storlead.sales.mail.integration.util.MailIdsParser;
|
|
|
import com.storlead.sales.mail.util.EmailHelper;
|
|
import com.storlead.sales.mail.util.EmailHelper;
|
|
|
import com.storlead.sales.mail.util.EmailSenderWithThreadLocal;
|
|
import com.storlead.sales.mail.util.EmailSenderWithThreadLocal;
|
|
|
import com.storlead.sales.mail.util.ReceiveMailQueueThreadPool;
|
|
import com.storlead.sales.mail.util.ReceiveMailQueueThreadPool;
|
|
@@ -116,6 +121,18 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
@Resource
|
|
@Resource
|
|
|
private Environment environment;
|
|
private Environment environment;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private MailIntegrationTaskService mailIntegrationTaskService;
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private CrmMailSyncHandler crmMailSyncHandler;
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private NewMailRemindHandler newMailRemindHandler;
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IntegrationExternalInvoker integrationExternalInvoker;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void updateSelectBindCustomerMail() {
|
|
public void updateSelectBindCustomerMail() {
|
|
|
// this.baseMapper.updateCleanBindCustomerMail();
|
|
// this.baseMapper.updateCleanBindCustomerMail();
|
|
@@ -465,27 +482,6 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
MailProperties properties = new MailProperties(smtpPop);
|
|
MailProperties properties = new MailProperties(smtpPop);
|
|
|
MailConnection mailConnection = MailConnectionUtil.receiveEmailsConnection(properties);
|
|
MailConnection mailConnection = MailConnectionUtil.receiveEmailsConnection(properties);
|
|
|
if (Objects.isNull(mailConnection)) {
|
|
if (Objects.isNull(mailConnection)) {
|
|
|
-// if(isBackTask) {
|
|
|
|
|
-// // 处理异常,并发送通知
|
|
|
|
|
-// if (Objects.nonNull(smtpPop.getId())) {
|
|
|
|
|
-// LambdaUpdateWrapper<SmtpPopSettingsEntity> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
|
-// updateWrapper.set(SmtpPopSettingsEntity::getEnabled,0);
|
|
|
|
|
-// updateWrapper.eq(SmtpPopSettingsEntity::getId, smtpPop.getId())
|
|
|
|
|
-// .setSql("connect_error_count = connect_error_count + 1"); // 原值 + 1
|
|
|
|
|
-// popSettingsService.update(updateWrapper);
|
|
|
|
|
-// // 禁止后续流程
|
|
|
|
|
-//// smtpPop.setEnabled(false);
|
|
|
|
|
-// }
|
|
|
|
|
-//// // 发送消息通知提醒邮箱连接异常
|
|
|
|
|
-//// String[] argsArr = {"wecom"};
|
|
|
|
|
-//// Set<Long> userIds = new HashSet<>();
|
|
|
|
|
-//// userIds.add(smtpPop.getOwnerBy());
|
|
|
|
|
-////
|
|
|
|
|
-//// Map<String,Object> messageMap = new HashMap<>();
|
|
|
|
|
-//// messageMap.put("messageContent","");
|
|
|
|
|
-//// messageMap.put("titleRemark","["+smtpPop.getEmailAddress()+"]");
|
|
|
|
|
-//// invokeSendMessage(messageMap,userIds,argsArr);
|
|
|
|
|
-// }
|
|
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
Folder inbox = mailConnection.getFolder(folderName);
|
|
Folder inbox = mailConnection.getFolder(folderName);
|
|
@@ -540,20 +536,7 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void invokeSendMessage(Map messageMap,Set<Long> toUserIds,String[] argsArr ) {
|
|
|
|
|
- try {
|
|
|
|
|
- Object myClassInstance = SpringContextUtils.getBean("messageService");
|
|
|
|
|
- Class<?> clazz = myClassInstance.getClass();
|
|
|
|
|
-
|
|
|
|
|
-// Class<?> clazz = Class.forName("com.storlead.message.service.impl.MessageService");
|
|
|
|
|
|
|
|
|
|
- Method method = clazz.getMethod("autoMatchEventSendMessage",Map.class,String.class,String.class,Set.class, String[].class);
|
|
|
|
|
- method.invoke(myClassInstance, messageMap,"999","EMAIL_SMTP_WARN",toUserIds,argsArr);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("invokeSendMessage - error",e);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void pullHeadMail(List<Message> messages,SmtpPopSettingsEntity smtpPop, EmailBoxEnum boxEnum,Set<String> blackls,List<EmailFolderRuleEntity> folderRules,Boolean isBackTask) {
|
|
public void pullHeadMail(List<Message> messages,SmtpPopSettingsEntity smtpPop, EmailBoxEnum boxEnum,Set<String> blackls,List<EmailFolderRuleEntity> folderRules,Boolean isBackTask) {
|
|
|
// Lock lock = userLockMap.computeIfAbsent(smtpPop.getOwnerBy(), id -> new ReentrantLock());
|
|
// Lock lock = userLockMap.computeIfAbsent(smtpPop.getOwnerBy(), id -> new ReentrantLock());
|
|
@@ -640,18 +623,11 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
List<Long> finalIsMailIds = entities.stream().map(EmailsEntity::getId).collect(Collectors.toList());
|
|
List<Long> finalIsMailIds = entities.stream().map(EmailsEntity::getId).collect(Collectors.toList());
|
|
|
log.error("finalIsMailIds = "+finalIsMailIds);
|
|
log.error("finalIsMailIds = "+finalIsMailIds);
|
|
|
if (!CollectionUtils.isEmpty(finalIsMailIds)) {
|
|
if (!CollectionUtils.isEmpty(finalIsMailIds)) {
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
|
- updateFollowUpTime(entities, smtpPop.getOwnerBy());
|
|
|
|
|
- // 发送新邮件提醒,绑定客户后,直接查询性能会好
|
|
|
|
|
- log.error("操作完绑定客户"+ JSON.toJSON(finalIsMailIds)+"__"+isBackTask+"___EmailBoxEnum.code___"+finalboxCode+"____="+EmailBoxEnum.INBOX.code.equals(finalboxCode));
|
|
|
|
|
- if (!CollectionUtils.isEmpty(finalIsMailIds) && finalIsBackTask && EmailBoxEnum.INBOX.code.equals(finalboxCode)) {
|
|
|
|
|
- log.error("进入发送提醒");
|
|
|
|
|
- sendNewMailRemind(finalIsMailIds,smtpPop.getOwnerBy(),smtpPop.getEmailAddress());
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
|
- autoReplyMails(entities);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ boolean needNewRemind = Boolean.TRUE.equals(finalIsBackTask)
|
|
|
|
|
+ && EmailBoxEnum.INBOX.code.equals(finalboxCode);
|
|
|
|
|
+ mailIntegrationTaskService.createAfterPullHeadMail(
|
|
|
|
|
+ finalIsMailIds, smtpPop.getOwnerBy(), needNewRemind);
|
|
|
|
|
+ CompletableFuture.runAsync(() -> autoReplyMails(entities));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}catch(Exception e){
|
|
}catch(Exception e){
|
|
@@ -659,57 +635,11 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void sendNewMailRemind(List<Long> mailIds,Long userId,String mailAccount) {
|
|
|
|
|
- if (CollectionUtils.isEmpty(mailIds)) {
|
|
|
|
|
|
|
+ public void sendNewMailRemind(List<Long> mailIds, Long userId, String mailAccount) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(mailIds) || userId == null) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- String messageContent = "您有"+mailIds.size()+"封新邮件,请前往查看!";
|
|
|
|
|
- // 获取新绑定的邮箱
|
|
|
|
|
- List<Long> cusIds = this.baseMapper.selectCusIdByMailId(mailIds);
|
|
|
|
|
- if (!CollectionUtils.isEmpty(cusIds)) {
|
|
|
|
|
- List<CustomerMailVO> customervos = this.baseMapper.selectCusInfoByCusId(cusIds);
|
|
|
|
|
-
|
|
|
|
|
- if (!CollectionUtils.isEmpty(customervos)) {
|
|
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
|
|
- String moreCus = "";
|
|
|
|
|
- for (CustomerMailVO customer : customervos) {
|
|
|
|
|
- if (sb.length() > 0) {
|
|
|
|
|
- moreCus = "等";
|
|
|
|
|
- sb.append("、");
|
|
|
|
|
- }
|
|
|
|
|
- sb.append("【");
|
|
|
|
|
- sb.append(customer.getCountry());
|
|
|
|
|
- sb.append("-");
|
|
|
|
|
- sb.append(customer.getCustomerName());
|
|
|
|
|
- sb.append("】");
|
|
|
|
|
- }
|
|
|
|
|
- messageContent = "您有来自"+sb+moreCus+"客户的"+mailIds.size()+"封新邮件,请前往查看!";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- try {
|
|
|
|
|
- Map<String,Object> messageMap = new HashMap<>();
|
|
|
|
|
- messageMap.put("messageContent",messageContent);
|
|
|
|
|
-
|
|
|
|
|
- Integer mailCount = this.baseMapper.countSmtpMailCount(userId);
|
|
|
|
|
- if (mailCount > 1) {
|
|
|
|
|
- messageMap.put("titleRemark","["+mailAccount+"]");
|
|
|
|
|
- } else {
|
|
|
|
|
- messageMap.put("titleRemark","");
|
|
|
|
|
- }
|
|
|
|
|
- Set<Long> toUserIds = new HashSet<>();
|
|
|
|
|
- toUserIds.add(userId);
|
|
|
|
|
-
|
|
|
|
|
- Object myClassInstance = SpringContextUtils.getBean("messageService");
|
|
|
|
|
- Class<?> clazz = myClassInstance.getClass();
|
|
|
|
|
-
|
|
|
|
|
-// Class<?> clazz = Class.forName("com.storlead.message.service.impl.MessageService");
|
|
|
|
|
-
|
|
|
|
|
- Method method = clazz.getMethod("autoMatchEventSendMessage",Map.class,String.class,String.class,Set.class, String[].class);
|
|
|
|
|
- String[] argsArr = {"site","wecom","sms","mail"};
|
|
|
|
|
- method.invoke(myClassInstance, messageMap,"11","NEW_EMAIL",toUserIds,argsArr);
|
|
|
|
|
- }catch (Exception e) {
|
|
|
|
|
- log.error("autoMatchEventSendMessage error",e);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ newMailRemindHandler.execute(MailIdsParser.join(mailIds), userId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void autoReplyMails(List<EmailsEntity> entities){
|
|
public void autoReplyMails(List<EmailsEntity> entities){
|
|
@@ -722,48 +652,13 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void updateFollowUpTime(List<EmailsEntity> entities,Long ownerBy){
|
|
|
|
|
- for (EmailsEntity entity : entities) {
|
|
|
|
|
- try {
|
|
|
|
|
- // 修改客户跟进实际
|
|
|
|
|
- if (Integer.valueOf(1).equals(entity.getInOutMark())) {
|
|
|
|
|
- bindLiaisonMailCustomerIdByMailIdAndUserId(entity.getId(), entity.getFrom(), ownerBy, 1);
|
|
|
|
|
- } else {
|
|
|
|
|
- String recipient = entity.getRecipient();
|
|
|
|
|
- if (StrUtil.isNotBlank(entity.getRecipientCc())) {
|
|
|
|
|
- if (StrUtil.isNotBlank(recipient)) {
|
|
|
|
|
- recipient = recipient + "," + entity.getRecipientCc();
|
|
|
|
|
- } else {
|
|
|
|
|
- recipient = entity.getRecipientCc();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- bindLiaisonMailCustomerIdByMailIdAndUserId(entity.getId(), recipient, ownerBy, 2);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if ("SENT".equals(entity.getFolder())) {
|
|
|
|
|
- Object myClassInstance = SpringContextUtils.getBean("customerServiceImpl");
|
|
|
|
|
- Class<?> clazz = myClassInstance.getClass();
|
|
|
|
|
- Set<String> mailAddress = new HashSet<>();
|
|
|
|
|
- if (StrUtil.isNotBlank(entity.getRecipient())) {
|
|
|
|
|
- List<String> recipientls = Arrays.asList(entity.getRecipient().toLowerCase().split(","));
|
|
|
|
|
- mailAddress.addAll(recipientls);
|
|
|
|
|
- }
|
|
|
|
|
- if (StrUtil.isNotBlank(entity.getRecipientCc())) {
|
|
|
|
|
- List<String> recipientccls = Arrays.asList(entity.getRecipientCc().toLowerCase().split(","));
|
|
|
|
|
- mailAddress.addAll(recipientccls);
|
|
|
|
|
- }
|
|
|
|
|
- if (!CollectionUtils.isEmpty(mailAddress)) {
|
|
|
|
|
- LocalDateTime sentDate = (Objects.isNull(entity.getSentDate())) ? LocalDateTime.now() : entity.getSentDate().toInstant()
|
|
|
|
|
- .atZone(ZoneId.systemDefault()) // 使用系统默认时区
|
|
|
|
|
- .toLocalDateTime();
|
|
|
|
|
- Method method = clazz.getMethod("updateFollowUpTimeByEmail", Set.class, LocalDateTime.class);
|
|
|
|
|
- method.invoke(myClassInstance, mailAddress, sentDate);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("updateFollowUpTimeByEmail --e", e);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void updateFollowUpTime(List<EmailsEntity> entities, Long ownerBy) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(entities)) {
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
+ List<Long> mailIds = entities.stream().map(EmailsEntity::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
|
|
+ crmMailSyncHandler.execute(MailIdsParser.join(mailIds), ownerBy);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void autoReplyMail(EmailsEntity entity) {
|
|
public void autoReplyMail(EmailsEntity entity) {
|
|
@@ -1186,23 +1081,6 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public IPage<EmailsEntity> pageWithScope(Page page, MailDTO dto) {
|
|
|
|
|
- return this.baseMapper.pageListNew(page,dto);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public IPage<EmailsEntity> pageWithScopeCus(Page page, MailDTO dto) {
|
|
|
|
|
- return this.baseMapper.pageListCus(page,dto);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public IPage<EmailsEntity> pageWithScopeAllCus(Page page, MailDTO dto) {
|
|
|
|
|
- return this.baseMapper.pageListNewAllCus(page,dto);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
private void saveAttachmentRecord(BodyPart bodyPart, String downloadDir,Long smtpPopId,Long emailId) throws MessagingException, IOException {
|
|
private void saveAttachmentRecord(BodyPart bodyPart, String downloadDir,Long smtpPopId,Long emailId) throws MessagingException, IOException {
|
|
|
String fileName = bodyPart.getFileName();
|
|
String fileName = bodyPart.getFileName();
|
|
|
fileName = MimeUtility.decodeText(fileName);
|
|
fileName = MimeUtility.decodeText(fileName);
|
|
@@ -1405,14 +1283,7 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
// emailsMapper.bindMailCustomerIdByMailId(mailId,customerId,liaisonIds);
|
|
// emailsMapper.bindMailCustomerIdByMailId(mailId,customerId,liaisonIds);
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
- Object myClassInstance = SpringContextUtils.getBean("customerMailBingMarkServiceImpl");
|
|
|
|
|
- Class<?> clazz = myClassInstance.getClass();
|
|
|
|
|
- try {
|
|
|
|
|
- Method method = clazz.getMethod("mateBindCustomerLiaisonMail",Long.class,Long.class,String.class,Integer.class);
|
|
|
|
|
- method.invoke(myClassInstance,mailId,userId,lowerMailAddress,inOutMark);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("mateBindCustomerLiaisonFromMail --e",e);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ integrationExternalInvoker.mateBindCustomerLiaisonMail(mailId, userId, lowerMailAddress, inOutMark);
|
|
|
//}
|
|
//}
|
|
|
// });
|
|
// });
|
|
|
// ThreadPoolUtil.execute(ttlRunnable);
|
|
// ThreadPoolUtil.execute(ttlRunnable);
|
|
@@ -1712,85 +1583,6 @@ public class EmailsServiceImpl extends MyBaseServiceImpl<EmailsMapper, EmailsEnt
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void analysisMailEml(List<Message> messages,Set<String> cusMails,Long ownerBy) {
|
|
|
|
|
- if (CollectionUtils.isEmpty(messages) || CollectionUtils.isEmpty(cusMails)) {
|
|
|
|
|
- return;
|
|
|
|
|
- } List<Message> messagels = messages;
|
|
|
|
|
- for (Message message : messagels) {
|
|
|
|
|
- Set<String> cusAddressls = cusMails;
|
|
|
|
|
- try {
|
|
|
|
|
- String[] r = message.getHeader("Message-ID");
|
|
|
|
|
- if (Objects.isNull(r)) {
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- String messageId = message.getHeader("Message-ID")[0];
|
|
|
|
|
- Map<String, String> fromMap = decodeAndPrintAddresses(message.getFrom());
|
|
|
|
|
- String fromAddress = mapKeyToString(fromMap);
|
|
|
|
|
- Integer count = this.getEmailsByMessageId(messageId, fromAddress);
|
|
|
|
|
- if (!Integer.valueOf(0).equals(count)) {
|
|
|
|
|
- log.error("getEmailsByMessageId-----" + messageId);
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- EmailsEntity entity = convertMessageToEmailVo(message, false);
|
|
|
|
|
- if (Objects.isNull(entity)) {
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- entity.setMessageId(messageId);
|
|
|
|
|
-
|
|
|
|
|
- if (StrUtil.isBlank(entity.getFromName())) {
|
|
|
|
|
- entity.setFromName(StringUtil.extractUsernames(entity.getFrom()));
|
|
|
|
|
- }
|
|
|
|
|
- if (StrUtil.isBlank(entity.getRecipientName())) {
|
|
|
|
|
- entity.setRecipientName(StringUtil.extractUsernames(entity.getRecipient()));
|
|
|
|
|
- }
|
|
|
|
|
- if (StrUtil.isBlank(entity.getRecipientCcName())) {
|
|
|
|
|
- entity.setRecipientCcName(StringUtil.extractUsernames(entity.getRecipientCc()));
|
|
|
|
|
- }
|
|
|
|
|
- if (cusAddressls.contains(entity.getFrom())) {
|
|
|
|
|
- entity.setInOutMark(1);
|
|
|
|
|
- entity.setFolder("INBOX");
|
|
|
|
|
- } else {
|
|
|
|
|
- entity.setInOutMark(2);
|
|
|
|
|
- entity.setFolder("SENT");
|
|
|
|
|
- }
|
|
|
|
|
- if (Objects.isNull(entity.getRecipientDate())) {
|
|
|
|
|
- entity.setRecipientDate(entity.getSentDate());
|
|
|
|
|
- }
|
|
|
|
|
- entity.setSourceType(1);
|
|
|
|
|
- entity.setOwnerBy(ownerBy);
|
|
|
|
|
- entity.setUpdateBy(1L);
|
|
|
|
|
- entity.setCreateBy(1L);
|
|
|
|
|
- entity.setIsOnlyHead(0);
|
|
|
|
|
-
|
|
|
|
|
- Boolean b = saveOrUpdate(entity);
|
|
|
|
|
- if (b) {
|
|
|
|
|
- analysisDownLoadAttachment(entity, message);
|
|
|
|
|
- /**
|
|
|
|
|
- * 加载附件
|
|
|
|
|
- */
|
|
|
|
|
- if (Integer.valueOf(1).equals(entity.getInOutMark())) {
|
|
|
|
|
- bindLiaisonMailCustomerIdByMailIdAndUserId(entity.getId(), entity.getFrom(), 1L, 1);
|
|
|
|
|
- } else {
|
|
|
|
|
- String recipient = entity.getRecipient();
|
|
|
|
|
- if (StrUtil.isNotBlank(entity.getRecipientCc())) {
|
|
|
|
|
- if (StrUtil.isNotBlank(recipient)) {
|
|
|
|
|
- recipient = recipient + "," + entity.getRecipientCc();
|
|
|
|
|
- } else {
|
|
|
|
|
- recipient = entity.getRecipientCc();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- bindLiaisonMailCustomerIdByMailIdAndUserId(entity.getId(), recipient, 1L, 2);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("analysisMailEml -- error:", e);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<EmailsEntity> analysisMailEmlls(List<Message> messages,Set<String> internalMails,Long ownerBy) {
|
|
public List<EmailsEntity> analysisMailEmlls(List<Message> messages,Set<String> internalMails,Long ownerBy) {
|
|
|
|
|
|