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/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 21b54171e..620238f22 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -1156,7 +1156,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider Context ctx = new Context(); ctx.setVariable("date", DateFormatUtils.format(date, "dd-MM-yyyy")); ctx.setVariable("abaFiles", abaFileList); - ctx.setVariable("totalAmount", abaFileList.stream().map(ABAFile::getTotalSettleAmount).reduce(BigDecimal::add)); + BigDecimal total = abaFileList.stream().map(ABAFile::getTotalSettleAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO); + ctx.setVariable("totalAmount", total.setScale(2, RoundingMode.DOWN).toPlainString()); final String content = thymeleaf.process("mail/settlement_mail", ctx); // 测试用地址 // String mailId = mailService.sendEmail(title, "164851225@qq.com", "1029811920@qq.com", content, 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/analysis/templates/settlement_send_check_code.html b/src/main/ui/static/analysis/templates/settlement_send_check_code.html index 16a683a05..fe998b758 100644 --- a/src/main/ui/static/analysis/templates/settlement_send_check_code.html +++ b/src/main/ui/static/analysis/templates/settlement_send_check_code.html @@ -3,6 +3,7 @@ \ No newline at end of file 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); }); };