From 8c75c1dc3bdeacd52174eaf5e553d717073665db Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 10 Mar 2020 17:07:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix=20ka=E5=95=86=E6=88=B7=E5=AD=90?= =?UTF-8?q?=E5=95=86=E6=88=B7=E6=A3=80=E7=B4=A2=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/static/payment/partner/templates/partner_pay_logs.html | 4 ++-- .../static/payment/partner/templates/partner_settlement.html | 4 ++-- .../ui/static/payment/tradelog/templates/balance_report.html | 4 ++-- .../payment/tradelog/templates/partner_settlement_logs.html | 4 ++-- .../static/payment/tradelog/templates/partner_trade_logs.html | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html index 311ed6a48..eddcdbc13 100644 --- a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html +++ b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html @@ -205,14 +205,14 @@
-

+

All

-

+

All

-

+

All

-

+

All

-

+

All @@ -257,7 +257,7 @@ ng-click="chooseClient(sub)">{{sub.short_name}} 

-

+

All

-

+

All

-

+

All

-

+

All

-

+

All

\ No newline at end of file From f864b7c6956103f254e75b4e76e0e3e16e408099 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 11 Mar 2020 11:42:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?add=20level3=5Fmch=5Fconfig=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../core/impls/ClientManagerImpl.java | 45 +++++++++++++++---- .../static/payment/partner/partner-manage.js | 22 +-------- .../tradelog/partner-settlement-log.js | 10 ----- .../ui/static/payment/tradelog/tradelog.js | 10 ----- .../ui/static/payment/tradelog/transflow.js | 10 ----- 6 files changed, 40 insertions(+), 59 deletions(-) diff --git a/pom.xml b/pom.xml index 8bb9d2e4a..597eeb11a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.3.93 + 1.3.94 UTF-8 1.8.0 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 83b28df4e..aee9245cc 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 @@ -746,6 +746,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid checkOrgPermission(manager, superClient); partner.put("parent_client_id", superClient.getIntValue("client_id")); } + //如果level3商户,为一级商户增加level3_mch_config=true + checkLevel3MchStatus(superClient); } partner.put("create_time", new Date()); partner.put("ali_sub_merchant_id", registery.getClientMoniker()); @@ -2097,7 +2099,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if(mchConfig.getBooleanValue("hide_sub_mch")){ return new ArrayList<>(); } - if (!mchConfig.getBooleanValue("disable_level3_mch") && listChildClients.size()<100) { + if (mchConfig.getBooleanValue("level3_mch_config")) { for (JSONObject partner : listChildClients) { List clients = clientMapper.listChildClients(partner.getIntValue("client_id")); if (clients.size() > 0) { @@ -2128,13 +2130,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid params.put("search_text", searchText); } PageList childClients = clientMapper.listChildClientsByPage(params, pageBounds); - for (JSONObject partner : childClients) { - List clients = clientMapper.listChildClients(partner.getIntValue("client_id")); - if (clients.size() > 0) { - partner.put("level3Clients", clients); - clients.forEach(e -> { - e.put("parent_client_moniker", partner.getString("client_moniker")); - }); + JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); + if (mchConfig.getBooleanValue("level3_mch_config")) { + for (JSONObject partner : childClients) { + List clients = clientMapper.listChildClients(partner.getIntValue("client_id")); + if (clients.size() > 0) { + partner.put("level3Clients", clients); + clients.forEach(e -> { + e.put("parent_client_moniker", partner.getString("client_moniker")); + }); + } } } return PageListUtils.buildPageListResult(childClients); @@ -6650,11 +6655,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } private String[] getChildClientIds(int clientId) { + JSONObject mchConfig = merchantInfoProvider.getMchExtParams(clientId); List clientIds = new ArrayList<>(); List childs = clientMapper.listChildClients(clientId); clientIds.add(String.valueOf(clientId)); childs.forEach(p -> { clientIds.add(p.getString("client_id")); + if (mchConfig.getBooleanValue("level3_mch_config")) { + List clients = clientMapper.listChildClients(p.getIntValue("client_id")); + if (clients.size() > 0) { + clients.forEach(e -> { + clientIds.add(e.getString("client_id")); + }); + } + } }); return clientIds.toArray(new String[]{}); } @@ -6689,4 +6703,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } + private void checkLevel3MchStatus(JSONObject superClient) { + if (superClient.containsKey("parent_client_id") && superClient.getIntValue("parent_client_id") != 0) { + JSONObject superParentClient = getClientInfo(superClient.getIntValue("parent_client_id")); + if (superParentClient == null) { + throw new InvalidShortIdException(); + } + JSONObject mchConfig = merchantInfoProvider.getMchExtParams(superParentClient.getIntValue("client_id")); + if (!mchConfig.getBooleanValue("level3_mch_config")) { + mchConfig.put("level3_mch_config", true); + superParentClient.put("ext_params", mchConfig.toJSONString()); + clientMapper.update(superParentClient); + } + } + } + } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 48b4ce9ba..f37fcd429 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3301,6 +3301,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.$close(); }, function (resp) { $scope.errmsg = resp.data.message; + $scope.partner.client_pay_type = $scope.partner.client_pay_type.split(","); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.split(","); }) } $scope.uploadLogo = function (file) { @@ -3550,16 +3552,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.clients.push(client); }); - $scope.clientIds = []; - $scope.clients.forEach(function (client) { - $scope.clientIds.push(client.client_id); - if (client.level3Clients) { - client.level3Clients.forEach(function (level3Client) { - $scope.clientIds.push(level3Client.client_id); - }); - } - }); - $scope.params.client_ids = angular.copy($scope.clientIds); }); }; @@ -4417,16 +4409,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.clients.push(client); }); - $scope.clientIds = []; - $scope.clients.forEach(function (client) { - $scope.clientIds.push(client.client_id); - if (client.level3Clients) { - client.level3Clients.forEach(function (level3Client) { - $scope.clientIds.push(level3Client.client_id); - }); - } - }); - $scope.params.client_ids = angular.copy($scope.clientIds); }); }; $scope.initClientInfo = function(){ diff --git a/src/main/ui/static/payment/tradelog/partner-settlement-log.js b/src/main/ui/static/payment/tradelog/partner-settlement-log.js index 7016b7a4d..5be99bcf7 100644 --- a/src/main/ui/static/payment/tradelog/partner-settlement-log.js +++ b/src/main/ui/static/payment/tradelog/partner-settlement-log.js @@ -50,16 +50,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { } $scope.clients.push(client); }); - $scope.clientIds = []; - $scope.clients.forEach(function (client) { - $scope.clientIds.push(client.client_id); - if (client.level3Clients) { - client.level3Clients.forEach(function (level3Client) { - $scope.clientIds.push(level3Client.client_id); - }); - } - }); - $scope.params.client_ids = angular.copy($scope.clientIds); }); }; $scope.today = new Date(); diff --git a/src/main/ui/static/payment/tradelog/tradelog.js b/src/main/ui/static/payment/tradelog/tradelog.js index 155288858..a0f188efa 100644 --- a/src/main/ui/static/payment/tradelog/tradelog.js +++ b/src/main/ui/static/payment/tradelog/tradelog.js @@ -313,16 +313,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { } $scope.clients.push(client); }); - $scope.clientIds = []; - $scope.clients.forEach(function (client) { - $scope.clientIds.push(client.client_id); - if (client.level3Clients) { - client.level3Clients.forEach(function (level3Client) { - $scope.clientIds.push(level3Client.client_id); - }); - } - }); - $scope.params.client_ids = angular.copy($scope.clientIds); }); }; diff --git a/src/main/ui/static/payment/tradelog/transflow.js b/src/main/ui/static/payment/tradelog/transflow.js index 6bd6bb890..653d5748a 100644 --- a/src/main/ui/static/payment/tradelog/transflow.js +++ b/src/main/ui/static/payment/tradelog/transflow.js @@ -138,16 +138,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { } $scope.clients.push(client); }); - $scope.clientIds = []; - $scope.clients.forEach(function (client) { - $scope.clientIds.push(client.client_id); - if (client.level3Clients) { - client.level3Clients.forEach(function (level3Client) { - $scope.clientIds.push(level3Client.client_id); - }); - } - }); - $scope.params.client_ids = angular.copy($scope.clientIds); }); };