add 开通邮件发送联系人和法人、合同添加法人信息

master
luoyang 5 years ago
parent e74825e720
commit 6c6737a3b0

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.2.7</version> <version>1.2.8</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -211,9 +211,11 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource @Resource
private SysConfigManager sysConfigManager; private SysConfigManager sysConfigManager;
@Resource @Resource
private SysClientLegalPersonMapper sysClientLegalPersonMapper;
@Resource
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf"; 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 @Resource
private SmsSender smsSender; private SmsSender smsSender;
@ -2323,6 +2325,13 @@ public class RetailAppServiceImp implements RetailAppService {
Date endDate = TimeZoneUtils.nextYearByCurrDay(); Date endDate = TimeZoneUtils.nextYearByCurrDay();
String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy");
client.put("end_date", end_date); 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); return exportClientAggregateFile(client);
} }

@ -309,7 +309,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private String agreetemplatePdfPath; private String agreetemplatePdfPath;
@Value("${app.agreetemplate.aggregate.path}") @Value("${app.agreetemplate.aggregate.path}")
private String aggregateAgreetemplatePdfPath; 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 @Resource
@ -1208,10 +1208,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
// "utf-8", model); // "utf-8", model);
ctx.setVariable("password", "*****"); ctx.setVariable("password", "*****");
final String contentBd = thymeleaf.process("mail/new_client_notice", ctx); 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)) { if (StringUtils.isEmpty(mailTo)) {
throw new EmailException("Client Contact Email is invalid"); 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<>(); final List<String> emails = new ArrayList<>();
for (JSONObject bd : bds) { for (JSONObject bd : bds) {
String email = bd.getString("email"); String email = bd.getString("email");
@ -1223,7 +1230,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override @Override
public void run() { public void run() {
try { 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, ","), mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","),
"", contentBd); "", contentBd);
JSONObject clientUpdate = new JSONObject(); JSONObject clientUpdate = new JSONObject();
@ -2134,6 +2141,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
Date endDate = TimeZoneUtils.nextYearByCurrDay(); Date endDate = TimeZoneUtils.nextYearByCurrDay();
String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy");
client.put("end_date", end_date); 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; return client;
} }
@ -2770,6 +2784,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("account_name", account.getString("account_name")); client.put("account_name", account.getString("account_name"));
String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy");
client.put("start_date", start_date); 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(); PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath);
pdu.setPdfTemplate(client); pdu.setPdfTemplate(client);
@ -2838,6 +2859,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("account_name", account.getString("account_name")); client.put("account_name", account.getString("account_name"));
String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy"); String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy");
client.put("start_date", start_date); 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(); PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath);
pdu.setPdfTemplate(client); pdu.setPdfTemplate(client);
@ -2922,6 +2950,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
Date endDate = TimeZoneUtils.nextYearByCurrDay(); Date endDate = TimeZoneUtils.nextYearByCurrDay();
String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy");
client.put("end_date", end_date); 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(); PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath); pdu.setTemplatePdfPath(aggregateAgreetemplatePdfPath);
pdu.setPdfTemplate(client); pdu.setPdfTemplate(client);
@ -3499,6 +3534,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(img, "png", out); ImageIO.write(img, "png", out);
client.put("img","data:image/png;base64," + Base64.encodeBase64String(out.toByteArray())); 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); return exportImgAggregateFile(account, client);
} }

@ -770,6 +770,51 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table border="1" cellspacing='0'>
<tbody>
<tr>
<td width="20%">
<p><strong><strong>Legal Representative:</strong></strong></p>
</td>
<td width="40%" rowspan="5" class="first">
</td>
<td>
<p ng-bind="aggregateFileInfo.legal_person"></p>
</td>
</tr>
<tr>
<td>
<p><strong><strong>Position:</strong></strong></p>
</td>
<td>
<p ng-bind="aggregateFileInfo.legal_job_title"></p>
</td>
</tr>
<tr>
<td>
<p><strong><strong>Phone:</strong></strong></p>
</td>
<td>
<p ng-bind="aggregateFileInfo.legal_phone"></p>
</td>
</tr>
<tr>
<td width="167">
<p><strong><strong>Fax:</strong></strong></p>
</td>
<td width="256">
</td>
</tr>
<tr>
<td width="167">
<p><strong><strong>Email:</strong></strong></p>
</td>
<td width="256">
<p ng-bind="aggregateFileInfo.legal_email"></p>
</td>
</tr>
</tbody>
</table>
</div> </div>
<p></p> <p></p>

Loading…
Cancel
Save