|
|
|
@ -4799,7 +4799,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void updateAllPartnerPassword(String clientMoniker) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
@ -5095,20 +5094,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
private void sendTestMerchantPassword(List<JSONObject> accounts) {
|
|
|
|
|
List<JSONObject> royalPayUsers = managerMapper.listRoyalPayUsers();
|
|
|
|
|
royalPayUsers = royalPayUsers.stream().filter(rpUser -> StringUtils.isNotEmpty(rpUser.getString("email"))).collect(Collectors.toList());
|
|
|
|
|
String needSendEmails = royalPayUsers.stream().filter(user -> StringUtils.isNotEmpty(user.getString("email"))).map(user ->
|
|
|
|
|
user.getString("email")
|
|
|
|
|
).collect(Collectors.joining(","));
|
|
|
|
|
Context ctx = new Context();
|
|
|
|
|
ctx.setVariable("accounts", accounts);
|
|
|
|
|
final String content = thymeleaf.process("mail/test_merchant_password", ctx);
|
|
|
|
|
new Thread(() -> {
|
|
|
|
|
try {
|
|
|
|
|
mailService.sendEmailWhihBcc("测试商户账户已更新", "info@royalpay.com.au", needSendEmails, content);
|
|
|
|
|
} catch (Exception 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 -> {
|
|
|
|
@ -5125,14 +5110,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
|
|
|
|
|
TemplateMessage msg = initSendTestPasswordTemplate(userOpenId, paymentApi.getTemplateId("test-merchant-password"), signStr.replace("+", "%2B"));
|
|
|
|
|
paymentApi.sendTemplateMessage(msg);
|
|
|
|
|
} catch (WechatException e) {
|
|
|
|
|
logger.error("给{}发送微信消息失败,原因:{}", userOpenId, e.getMessage());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("给{}发送密码重置消息失败,原因: {}", userOpenId, e.getMessage());
|
|
|
|
|
logger.error("给{}发送微信消息失败,原因:{}", userOpenId, e);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private TemplateMessage initSendTestPasswordTemplate(String wxopenid, String templateId, String url) {
|
|
|
|
|
TemplateMessage msg = new TemplateMessage(wxopenid, templateId, PlatformEnvironment.getEnv().concatUrl("testMerchantPassword" + url));
|
|
|
|
|
msg.put("first", "系统测试商户账户已重置", "#000000");
|
|
|
|
|