From 6c6737a3b039b62c1676529a9a76526b46f93143 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 6 Sep 2019 14:08:59 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=BC=80=E9=80=9A=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E5=8F=91=E9=80=81=E8=81=94=E7=B3=BB=E4=BA=BA=E5=92=8C=E6=B3=95?= =?UTF-8?q?=E4=BA=BA=E3=80=81=E5=90=88=E5=90=8C=E6=B7=BB=E5=8A=A0=E6=B3=95?= =?UTF-8?q?=E4=BA=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../core/impls/RetailAppServiceImp.java | 11 ++++- .../core/impls/ClientManagerImpl.java | 48 +++++++++++++++++-- .../templates/contract_for_compliance.html | 45 +++++++++++++++++ 4 files changed, 101 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index a3ffde951..34064760a 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.7 + 1.2.8 UTF-8 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index f7f0d19ff..8e2c8382a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -211,9 +211,11 @@ public class RetailAppServiceImp implements RetailAppService { @Resource private SysConfigManager sysConfigManager; @Resource + private SysClientLegalPersonMapper sysClientLegalPersonMapper; + @Resource private StringRedisTemplate stringRedisTemplate; private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf"; - private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/22/1566440384256_R7Jc3cl5JPZsmVznKffzStwVMELwsl.pdf"; + private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/09/06/1567741055646_qeWC7kwqEwsJjRHisJSyAjqnB9nnnh.pdf"; @Resource private SmsSender smsSender; @@ -2323,6 +2325,13 @@ public class RetailAppServiceImp implements RetailAppService { Date endDate = TimeZoneUtils.nextYearByCurrDay(); String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); client.put("end_date", end_date); + JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); + if (clientLegal != null) { + client.put("legal_person", clientLegal.getString("representative_person")); + client.put("legal_job_title", clientLegal.getString("job_title")); + client.put("legal_phone", clientLegal.getString("phone")); + client.put("legal_email", clientLegal.getString("email")); + } return exportClientAggregateFile(client); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index e9545ebe0..7a7148bdf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -309,7 +309,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid private String agreetemplatePdfPath; @Value("${app.agreetemplate.aggregate.path}") private String aggregateAgreetemplatePdfPath; - private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/22/1566440384256_R7Jc3cl5JPZsmVznKffzStwVMELwsl.pdf"; + private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/09/06/1567741055646_qeWC7kwqEwsJjRHisJSyAjqnB9nnnh.pdf"; @Resource @@ -1208,10 +1208,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid // "utf-8", model); ctx.setVariable("password", "*****"); final String contentBd = thymeleaf.process("mail/new_client_notice", ctx); - final String mailTo = client.getString("contact_email"); + final List mailTos = new ArrayList<>(); + String mailTo = client.getString("contact_email"); if (StringUtils.isEmpty(mailTo)) { throw new EmailException("Client Contact Email is invalid"); } + mailTos.add(mailTo); + JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); + if (clientLegal != null && StringUtils.isNotBlank(clientLegal.getString("email"))) { + mailTos.add(clientLegal.getString("email")); + } + final List emails = new ArrayList<>(); for (JSONObject bd : bds) { String email = bd.getString("email"); @@ -1223,7 +1230,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override public void run() { try { - String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo, "", content); + String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", StringUtils.join(mailTos,","), "", content); mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","), "", contentBd); JSONObject clientUpdate = new JSONObject(); @@ -2134,6 +2141,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid Date endDate = TimeZoneUtils.nextYearByCurrDay(); String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); client.put("end_date", end_date); + JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); + if (clientLegal != null) { + client.put("legal_person", clientLegal.getString("representative_person")); + client.put("legal_job_title", clientLegal.getString("job_title")); + client.put("legal_phone", clientLegal.getString("phone")); + client.put("legal_email", clientLegal.getString("email")); + } return client; } @@ -2770,6 +2784,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("account_name", account.getString("account_name")); String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); client.put("start_date", start_date); + JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); + if (clientLegal != null) { + client.put("legal_person", clientLegal.getString("representative_person")); + client.put("legal_job_title", clientLegal.getString("job_title")); + client.put("legal_phone", clientLegal.getString("phone")); + client.put("legal_email", clientLegal.getString("email")); + } PdfUtils pdu = new PdfUtils(); pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); pdu.setPdfTemplate(client); @@ -2838,6 +2859,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("account_name", account.getString("account_name")); String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); client.put("start_date", start_date); + JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); + if (clientLegal != null) { + client.put("legal_person", clientLegal.getString("representative_person")); + client.put("legal_job_title", clientLegal.getString("job_title")); + client.put("legal_phone", clientLegal.getString("phone")); + client.put("legal_email", clientLegal.getString("email")); + } PdfUtils pdu = new PdfUtils(); pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); pdu.setPdfTemplate(client); @@ -2922,6 +2950,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid Date endDate = TimeZoneUtils.nextYearByCurrDay(); String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); client.put("end_date", end_date); + JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); + if (clientLegal != null) { + client.put("legal_person", clientLegal.getString("representative_person")); + client.put("legal_job_title", clientLegal.getString("job_title")); + client.put("legal_phone", clientLegal.getString("phone")); + client.put("legal_email", clientLegal.getString("email")); + } PdfUtils pdu = new PdfUtils(); pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); pdu.setPdfTemplate(client); @@ -3499,6 +3534,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid ByteArrayOutputStream out = new ByteArrayOutputStream(); ImageIO.write(img, "png", out); client.put("img","data:image/png;base64," + Base64.encodeBase64String(out.toByteArray())); + JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); + if (clientLegal != null) { + client.put("legal_person", clientLegal.getString("representative_person")); + client.put("legal_job_title", clientLegal.getString("job_title")); + client.put("legal_phone", clientLegal.getString("phone")); + client.put("legal_email", clientLegal.getString("email")); + } return exportImgAggregateFile(account, client); } diff --git a/src/main/ui/static/payment/partner/templates/contract_for_compliance.html b/src/main/ui/static/payment/partner/templates/contract_for_compliance.html index df5b90f7f..e4037752a 100644 --- a/src/main/ui/static/payment/partner/templates/contract_for_compliance.html +++ b/src/main/ui/static/payment/partner/templates/contract_for_compliance.html @@ -770,6 +770,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+

Legal Representative:

+
+ +

+
+

Position:

+
+

+
+

Phone:

+
+

+
+

Fax:

+
+
+

Email:

+
+

+