|
|
|
@ -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<String> 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<String> 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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2838,6 +2852,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 +2943,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 +3527,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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|