|
|
@ -4799,7 +4799,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional
|
|
|
|
|
|
|
|
public void updateAllPartnerPassword(String clientMoniker) {
|
|
|
|
public void updateAllPartnerPassword(String clientMoniker) {
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
if (client == null) {
|
|
|
|
if (client == null) {
|
|
|
@ -5095,25 +5094,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
private void sendTestMerchantPassword(List<JSONObject> accounts) {
|
|
|
|
private void sendTestMerchantPassword(List<JSONObject> accounts) {
|
|
|
|
List<JSONObject> royalPayUsers = managerMapper.listRoyalPayUsers();
|
|
|
|
List<JSONObject> royalPayUsers = managerMapper.listRoyalPayUsers();
|
|
|
|
royalPayUsers = royalPayUsers.stream().filter(rpUser -> StringUtils.isNotEmpty(rpUser.getString("email"))).collect(Collectors.toList());
|
|
|
|
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<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<>();
|
|
|
|
List<JSONObject> sendAccounts = new ArrayList<>();
|
|
|
|
needNotifyUsers.forEach(userOpenId -> {
|
|
|
|
needNotifyUsers.forEach(userOpenId -> {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
accounts.forEach(account ->{
|
|
|
|
accounts.forEach(account -> {
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
params.put("client_moniker", account.getString("client_moniker"));
|
|
|
|
params.put("client_moniker", account.getString("client_moniker"));
|
|
|
|
params.put("role", account.getIntValue("role"));
|
|
|
|
params.put("role", account.getIntValue("role"));
|
|
|
@ -5125,14 +5110,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
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);
|
|
|
|
} catch (WechatException e) {
|
|
|
|
|
|
|
|
logger.error("给{}发送微信消息失败,原因:{}", userOpenId, e.getMessage());
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("给{}发送密码重置消息失败,原因: {}", userOpenId, e.getMessage());
|
|
|
|
logger.error("给{}发送微信消息失败,原因:{}", userOpenId, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private TemplateMessage initSendTestPasswordTemplate(String wxopenid, String templateId, String url) {
|
|
|
|
private TemplateMessage initSendTestPasswordTemplate(String wxopenid, String templateId, String url) {
|
|
|
|
TemplateMessage msg = new TemplateMessage(wxopenid, templateId, PlatformEnvironment.getEnv().concatUrl("testMerchantPassword" + url));
|
|
|
|
TemplateMessage msg = new TemplateMessage(wxopenid, templateId, PlatformEnvironment.getEnv().concatUrl("testMerchantPassword" + url));
|
|
|
|
msg.put("first", "系统测试商户账户已重置", "#000000");
|
|
|
|
msg.put("first", "系统测试商户账户已重置", "#000000");
|
|
|
|