From f509f81377f2e3017abea231b2f82b19fbc75882 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 13 Sep 2018 09:55:19 +0800 Subject: [PATCH 1/2] fix risk --- .../core/impls/ClientManagerImpl.java | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 6e3121e91..f456698da 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -1185,10 +1185,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow)); - if (channel.equals("wechat") || channel.equals("alipay")) { + if (allow == true) { + if (channel.equals("wechat") || channel.equals("alipay")) { + int clientId = client.getIntValue("client_id"); + List clientBankAccounts = clientBankAccountMapper.clientBankAccounts(clientId); - isRiskyMerchant(client,null); + if (clientBankAccounts.size() > 0 ) { + isRiskyMerchant(client,clientBankAccounts.get(0)); + }else { + isRiskyMerchant(client,null); + } + + } } + logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " + channel + " to " + allow); return; @@ -3844,9 +3854,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid List listRiskySimilarMerchants = riskAttentionMerchantsMapper.listRiskySimilarMerchants(needCheckParams); if (listRiskySimilarMerchants.size() > 0) { StringBuilder appendStr = new StringBuilder(); - listRiskySimilarMerchants.forEach(json -> appendStr.append(json.getString("client_moniker")).append(",")); + StringBuilder infoStr = new StringBuilder(); + + listRiskySimilarMerchants.forEach(json -> { + appendStr.append(json.getString("client_moniker")).append(","); + JSONObject riskInfo = riskAttentionMerchantsMapper.findByClientMoniker(json.getString("client_moniker")); + infoStr.append("ABN = " + riskInfo.getString("abn") + ",ACN = " + riskInfo.getString("acn") + ",contact_phone = " + riskInfo.getString("contact_phone") + ",contact_person = " + riskInfo.getString("contact_person") + ",bank_account_no = " + riskInfo.getString("bank_account_no")); + }); + appendStr.deleteCharAt(appendStr.length() - 1); - throw new BadRequestException("该商户信息已经进入系统黑名单,关联商户为【" + appendStr + "】"); + throw new BadRequestException("该商户信息已经进入系统黑名单,关联商户为【" + appendStr.toString().toUpperCase() + "】【" + infoStr + "】"); } } From 49cf2a4b9b8c32eab6ab83ab6b0d799a818a1ebb Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 13 Sep 2018 10:40:23 +0800 Subject: [PATCH 2/2] fix risk --- .../manage/merchants/core/impls/ClientManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index f456698da..c4ae3ac90 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -1185,6 +1185,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow)); + logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " + + channel + " to " + allow); + if (allow == true) { if (channel.equals("wechat") || channel.equals("alipay")) { int clientId = client.getIntValue("client_id"); @@ -1198,9 +1201,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - - logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " - + channel + " to " + allow); return; } }