From a92f4876f14cab984a7bb0f10bdaccd7ffef8a61 Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Tue, 16 Oct 2018 20:51:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E9=86=92=E5=A1=AB=E5=86=99=E9=A3=8E?= =?UTF-8?q?=E6=8E=A7=E6=9D=90=E6=96=99=E7=9A=84=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/RiskBusinessService.java | 6 +++++ .../core/impl/RiskBusinessServiceImpl.java | 19 ++++++++++++++ .../web/RiskBusinessController.java | 5 +++- .../templates/mail/risk_urge_mail.html | 25 +++++++++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/templates/mail/risk_urge_mail.html diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java index 77b63ec15..61cb7fdbb 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java @@ -71,4 +71,10 @@ public interface RiskBusinessService { */ void sendRefuseEmail(String riskId) throws IOException; + /** + * 发送提醒邮件 + * @param riskId + */ + void sendUrgeEmail(String riskId) throws IOException; + } diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java index 7a181ea24..1bc2ecaf2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java @@ -205,6 +205,25 @@ public class RiskBusinessServiceImpl implements RiskBusinessService { }); } + @Override + public void sendUrgeEmail(String riskId) throws IOException { + JSONObject event = getRiskEventDetail(riskId); + Context ctx = getMailContext(event); + final List emailsTos = (List)ctx.getVariable("emailsTos"); + final List emailsCcs = ctx.getVariable("emailsCcs")==null?new ArrayList<>():(List)ctx.getVariable("emailsCcs"); + final String content = thymeleaf.process("mail/risk_urge_mail.html", ctx); + royalThreadPoolExecutor.execute(() -> { + try { + String emailId = mailService.sendRiskEmail("Please submit risk materials as soon as possible", emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","), + emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), content, event.getIntValue("order_type")==3?(List)ctx.getVariable("files"):null,event.getIntValue("order_type")); + event.put("email_status",3); + riskEventMapper.update(event); + } catch (Exception e) { + throw new EmailException("Email Sending Failed", e); + } + }); + } + private Context getMailContext(JSONObject event) throws IOException { JSONObject client = clientMapper.findClientByMonikerAll(event.getString("client_moniker")); if (client == null) { diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java index 1614e94be..6eea345c9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java @@ -74,6 +74,9 @@ public class RiskBusinessController { riskBusinessService.sendRefuseEmail(risk_id); } - + @RequestMapping(value = "/{risk_id}/urge",method = RequestMethod.PUT) + public void urgeEmail(@PathVariable String risk_id) throws IOException { + riskBusinessService.sendUrgeEmail(risk_id); + } } diff --git a/src/main/resources/templates/mail/risk_urge_mail.html b/src/main/resources/templates/mail/risk_urge_mail.html new file mode 100644 index 000000000..00d0b1fab --- /dev/null +++ b/src/main/resources/templates/mail/risk_urge_mail.html @@ -0,0 +1,25 @@ + +Dear RoyalPay Merchant/BD : +

您好,您的风控材料链接即将过期,请及时提交风控材料。未能按时提交完整证明材料,支付渠道将被关停,请您务必配合调查。感谢。

+

Your link to the risk materials is about to expire, please submit the risk materials in time.If you can not provide qualified materials on time, the payment channels would be suspended or restricted with amount limit. Please be sure to assist the investigation. Thanks.

+

Best Regards

+

+
+ Contact Us
+ Email:
+ info@royalpay.com.au
+ Tel:
+ 1300 10 77 50
+
+ Service WeChat Account:
+
+ Level 14, 383 Kent Street, Sydney NSW 2000
+
+ Level 11, 15 William Street, Melbourne VIC 3000 +

+

Tunnel Show Pty Ltd trading as RoyalPay
+ Representative of AFSL licensee 448066 +

+