From 793f920e2befec0d0f392f0a13c7ca661abae88e Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Tue, 12 Jun 2018 14:59:44 +0800 Subject: [PATCH] update --- .../payment/manage/notice/core/impls/MailServiceImp.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java index 0003c200a..54d2f505e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java @@ -77,7 +77,12 @@ public class MailServiceImp implements MailService { @Override public String sendEmailNotice(String notice_id, String title, List mailTo, String content) throws URISyntaxException, IOException { List unsubAddress = mailUnsubMapper.getAllAddress(); - mailTo.removeAll(unsubAddress); + List mailToWithoutUnsub = new ArrayList<>(); + mailTo.parallelStream().forEach(p->{ + if(!unsubAddress.contains(p.getString("mailto"))){ + mailToWithoutUnsub.add(p); + } + }); Document doc = Jsoup.parse(content); Elements links = doc.select("a[href]"); List files = new ArrayList(); @@ -104,7 +109,7 @@ public class MailServiceImp implements MailService { NoticeBean noticeBean = new NoticeBean(); noticeBean.setTitle(title); noticeBean.setNotice_id(notice_id); - noticeBean.setMailClients(mailTo); + noticeBean.setMailClients(mailToWithoutUnsub); noticeBean.setContent(doc.outerHtml()); if (files.size() > 0) { noticeBean.setFiles(files.toString());