|
|
@ -5087,14 +5087,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
mailService.sendEmailWhihBcc("测试商户账户已更新", "info@royalpay.com.au", needSendEmails, content);
|
|
|
|
mailService.sendEmailWhihBcc("测试商户账户已更新", "info@royalpay.com.au", needSendEmails, content);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new BadRequestException("邮件发送失败", e);
|
|
|
|
logger.error("邮件发送失败", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).start();
|
|
|
|
}).start();
|
|
|
|
|
|
|
|
|
|
|
|
List<String> needNotifyUsers = royalPayUsers.stream().filter(user -> StringUtils.isNotEmpty(user.getString("wx_openid"))).map(user -> user.getString("wx_openid")).collect(Collectors.toList());
|
|
|
|
List<String> needNotifyUsers = royalPayUsers.stream().filter(user -> StringUtils.isNotEmpty(user.getString("wx_openid"))).map(user -> user.getString("wx_openid")).collect(Collectors.toList());
|
|
|
|
|
|
|
|
List<JSONObject> sendAccounts = new ArrayList<>();
|
|
|
|
needNotifyUsers.forEach(userOpenId -> {
|
|
|
|
needNotifyUsers.forEach(userOpenId -> {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String signStr = "?sign=" + AESencrypt(accounts.toString(), userOpenId);
|
|
|
|
accounts.forEach(account ->{
|
|
|
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
|
|
|
params.put("client_moniker", account.getString("client_moniker"));
|
|
|
|
|
|
|
|
params.put("role", account.getIntValue("role"));
|
|
|
|
|
|
|
|
params.put("username", account.getString("username"));
|
|
|
|
|
|
|
|
params.put("password", account.getString("password"));
|
|
|
|
|
|
|
|
sendAccounts.add(params);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
String signStr = "?sign=" + AESencrypt(sendAccounts.toString(), userOpenId);
|
|
|
|
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
|
|
|
|
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
|
|
|
|
TemplateMessage msg = initSendTestPasswordTemplate(userOpenId, paymentApi.getTemplateId("test-merchant-password"), signStr.replace("+", "%2B"));
|
|
|
|
TemplateMessage msg = initSendTestPasswordTemplate(userOpenId, paymentApi.getTemplateId("test-merchant-password"), signStr.replace("+", "%2B"));
|
|
|
|
paymentApi.sendTemplateMessage(msg);
|
|
|
|
paymentApi.sendTemplateMessage(msg);
|
|
|
|