send notify filter address

master
wangning 7 years ago
parent 3186110157
commit 27996f9136

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.mappers.system;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject;
@ -26,4 +28,8 @@ public interface MailUnsubMapper {
JSONObject getOne(@Param("id") Long id,@Param("address") String address);
PageList<JSONObject> queryPageable(JSONObject params, PageBounds pagination);
List<JSONObject> query(JSONObject params);
List<String> getAllAddress();
}

@ -11,7 +11,7 @@ import java.util.List;
*/
public interface MailService {
String sendEmail(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException;
String sendEmailNotice(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException;
String sendEmail(String title, String mailTos, String mailCcs, String content) throws URISyntaxException, IOException;

@ -75,8 +75,11 @@ public class MailServiceImp implements MailService {
@Override
public String sendEmail(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException {
public String sendEmailNotice(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException {
List<String> unsubAddress = mailUnsubMapper.getAllAddress();
unsubAddress.parallelStream().forEach(p->{
mailTo.remove(p);
});
Document doc = Jsoup.parse(content);
Elements links = doc.select("a[href]");
List<JSONObject> files = new ArrayList<JSONObject>();

@ -192,7 +192,7 @@ public class NoticeManageImpl implements NoticeManage {
try {
logger.info(noticeId+"|"+info.getTitle()+"|"+mailto);
String mail_id = mailService.sendEmail(noticeId,info.getTitle(),mailto,info.getContent());
String mail_id = mailService.sendEmailNotice(noticeId,info.getTitle(),mailto,info.getContent());
notice.put("mail_id",mail_id);
noticeManageMapper.updateNotice(notice);
} catch (URISyntaxException | IOException e) {

@ -27,4 +27,23 @@
</if>
</where>
</select>
<select id="query" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_mail_unsub
<where>
<if test="client_moniker!=null">
and client_moniker = #{client_moniker}
</if>
<if test="client_id != null">
and client_id = #{client_id}
</if>
<if test="address != null">
and address = #{address}
</if>
</where>
</select>
<select id="getAllAddress" resultType="java.lang.String">
select address from sys_mail_unsub
</select>
</mapper>
Loading…
Cancel
Save