fix 修复dashboard lakala订单以及取消pine密码发送邮件

master
luoyang 5 years ago
parent 48f2151bc2
commit da3a9a1cb8

@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.1.2</jib-maven-plugin.version>
<docker-image.version>1.1.15</docker-image.version>
<docker-image.version>1.1.16</docker-image.version>
</properties>
<dependencies>

@ -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,25 +5094,11 @@ 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 -> {
try {
accounts.forEach(account ->{
accounts.forEach(account -> {
JSONObject params = new JSONObject();
params.put("client_moniker", account.getString("client_moniker"));
params.put("role", account.getIntValue("role"));
@ -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");

@ -338,7 +338,7 @@
ifnull(sum(CASE WHEN s.channel = 'Yeepay' THEN s.orders ELSE 0 END),0) yeepay_order_count,
ifnull(COUNT(DISTINCT s.client_id,IF(s.channel = 'Yeepay',TRUE,NULL)),0) yeepay_client_count,
ifnull(sum(CASE WHEN s.channel = 'LakalaPay' THEN s.total ELSE 0 END),0) lakalapayamount,
ifnull(sum(CASE WHEN s.channel = 'LakalaPay' THEN s.orders ELSE 0 END),0) lakala_order_count,
ifnull(sum(CASE WHEN s.channel = 'LakalaPay' THEN s.orders ELSE 0 END),0) lakalapay_order_count,
ifnull(COUNT(DISTINCT s.client_id,IF(s.channel = 'LakalaPay',TRUE,NULL)),0) lakala_client_count,
ifnull(sum(s.orders), 0) all_count,
ifnull(sum(s.total), 0) all_amount,

Loading…
Cancel
Save