fix 临时密码修复,过滤多余字段

master
luoyang 5 years ago
parent 8ab0b4f67f
commit 716937b333

@ -5087,14 +5087,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
try {
mailService.sendEmailWhihBcc("测试商户账户已更新", "info@royalpay.com.au", needSendEmails, content);
} catch (Exception e) {
throw new BadRequestException("邮件发送失败", e);
logger.error("邮件发送失败", e);
}
}).start();
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 -> {
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();
TemplateMessage msg = initSendTestPasswordTemplate(userOpenId, paymentApi.getTemplateId("test-merchant-password"), signStr.replace("+", "%2B"));
paymentApi.sendTemplateMessage(msg);

Loading…
Cancel
Save