From 1f607ffa4b2575dc74df1ea5590fded15e1185ce Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 10 Feb 2020 18:14:16 +0800 Subject: [PATCH 1/3] fix url pom.xml --- pom.xml | 2 +- .../payment/manage/gateway/web/GtwPayController.java | 2 +- .../core/impls/CityPartnerPrizeServiceImplTest.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 3cfbd50c2..f8515097f 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.3.27 + 1.3.28 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/web/GtwPayController.java b/src/main/java/au/com/royalpay/payment/manage/gateway/web/GtwPayController.java index 45935b2c0..0f47756ca 100644 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/web/GtwPayController.java +++ b/src/main/java/au/com/royalpay/payment/manage/gateway/web/GtwPayController.java @@ -16,7 +16,7 @@ import javax.annotation.Resource; * @author taylor */ @RestController -@RequestMapping("/api/v1.0/gateway/org/{shortId}") +@RequestMapping("/api/v1.0/org_gateway/partner/{shortId}") @Gtw2Ctrl public class GtwPayController { @Resource diff --git a/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImplTest.java b/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImplTest.java index 55a5a0555..13ff97c55 100644 --- a/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImplTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImplTest.java @@ -129,7 +129,7 @@ public class CityPartnerPrizeServiceImplTest { put("settle_info", settleConfig); put("compliance_file_info", complianceInfo); }}; - String originUrl = "https://mpay.royalpay.com.au/api/v1.0/gateway/org/AXLCEXDDMB/merchant/application"; + String originUrl = "https://mpay.royalpay.com.au/api/v1.0/org_gateway/partner/AXLCEXDDMB/merchant/application"; String url = addSignUrl(originUrl, params, PRIKEY); HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.POST); gen.setJSONEntity(params); @@ -146,7 +146,7 @@ public class CityPartnerPrizeServiceImplTest { @Test public void queryMerchantStatus() throws Exception{ String partnerCode = "PBAR"; - String originUrl = "https://mpay.royalpay.com.au/api/v1.0/gateway/org/AXLCEXDDMB/merchant/" + partnerCode + "/status"; + String originUrl = "https://mpay.royalpay.com.au/api/v1.0/org_gateway/partner/AXLCEXDDMB/merchant/" + partnerCode + "/status"; String url = addSignUrl(originUrl, null, PRIKEY); HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.GET); HttpRequestResult result = gen.execute(); @@ -159,7 +159,7 @@ public class CityPartnerPrizeServiceImplTest { @Test public void updateFile() throws Exception{ - String originUrl = "https://mpay.royalpay.com.au/api/v1.0/gateway/org/RQ6CJ4CGJZ/attachment/files"; + String originUrl = "https://mpay.royalpay.com.au/api/v1.0/org_gateway/partner/RQ6CJ4CGJZ/attachment/files"; String url = addSignUrl(originUrl, null, PRIKEY); File file = new File("/Users/luoyang/Downloads/121.jpg"); InputStream stream = new FileInputStream(file); From 7d7c3d53c484a3333101a35cabd3f0d16e4ed8f5 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Mon, 10 Feb 2020 19:00:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[Rp]=20=E5=AD=90=E5=95=86=E6=88=B7=E5=88=86?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/mappers/system/ClientMapper.java | 5 +++++ .../manage/merchants/core/ClientManager.java | 2 ++ .../core/impls/ClientManagerImpl.java | 17 ++++++++++++++++ .../web/PartnerManageController.java | 5 +++++ .../static/payment/partner/partner-manage.js | 13 +++++++----- .../partner/templates/sub_partners.html | 20 ++++++++++++++++++- 6 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index 4b164c94a..67f5d4bd9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -78,6 +78,11 @@ public interface ClientMapper { @AdvanceSelect(addonWhereClause = "is_valid=1") List listChildClients(@Param("parent_client_id") int parentClientId); + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid=1") + PageList listChildClientsByPage(@Param("parent_client_id") int parentClientId, PageBounds pageBounds); + + @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid=1") List listChildClients(@Param("parent_client_id") int parentClientId, PageBounds pagination); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index e5ae1cf5c..917d1ffb4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -173,6 +173,8 @@ public interface ClientManager { List listSubClients(JSONObject manager, String clientMoniker); + JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,int page); + List listSubClients(int clientId); // void newSubClient(String clientMoniker, SubClientRegistry registry, JSONObject manager); 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 013295833..6aed5f44d 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 @@ -2088,6 +2088,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return listChildClients; } + + @Override + public JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,int page) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + + PageBounds pageBounds; + pageBounds= new PageBounds(page, 5, Order.formString("create_time.desc")); + + PageList childClients = clientMapper.listChildClientsByPage(client.getIntValue("client_id"), pageBounds); + return PageListUtils.buildPageListResult(childClients); + + } + @Override @Cacheable(value = ":sub_clients:", key = "''+#clientId") public List listSubClients(int clientId) { diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index dc7606d84..be10148f3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -500,6 +500,11 @@ public class PartnerManageController { return clientManager.listSubClients(manager, clientMoniker); } + @ManagerMapping(value = "/{clientMoniker}/sub_clients/{page}", method = RequestMethod.GET) + public JSONObject listSubClients(@PathVariable String clientMoniker,@PathVariable int page, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return clientManager.listSubClientsByPage(manager, clientMoniker,page); + } + //创建子商户 @ManagerMapping(value = "/{clientMoniker}/sub_clients", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) public void newSubClient(@PathVariable String clientMoniker, @RequestBody @Valid ClientRegisterInfo registery, Errors errors, diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index c2f5488d4..89654fcee 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -2421,16 +2421,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }).result.then(function () { - $scope.loadSubClients(); + $scope.loadSubClients(1); }); }; - $scope.loadSubClients = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients').then(function (resp) { - $scope.subPartners = resp.data; + $scope.loadSubClients = function (page) { + $scope.page = page || $scope.pagination.page || 1; + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/'+$scope.page).then(function (resp) { + $scope.subPartners = resp.data.data; + $scope.pagination = resp.data.pagination; }); }; - $scope.loadSubClients(); + + $scope.loadSubClients(1); $scope.loadPartnerPaymentInfo = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) { diff --git a/src/main/ui/static/payment/partner/templates/sub_partners.html b/src/main/ui/static/payment/partner/templates/sub_partners.html index 5be44afaa..35a52563d 100644 --- a/src/main/ui/static/payment/partner/templates/sub_partners.html +++ b/src/main/ui/static/payment/partner/templates/sub_partners.html @@ -134,5 +134,23 @@ + - \ No newline at end of file + From cdc151b7ee5742f5d6db56df781f6ce0b4c7e177 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 11 Feb 2020 10:18:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?add=20=E5=AD=90=E5=95=86=E6=88=B7=E5=88=86?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../payment/manage/merchants/web/PartnerManageController.java | 2 +- src/main/ui/static/payment/partner/templates/sub_partners.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f8515097f..902d63450 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.3.28 + 1.3.29 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index be10148f3..dbec29599 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -501,7 +501,7 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/sub_clients/{page}", method = RequestMethod.GET) - public JSONObject listSubClients(@PathVariable String clientMoniker,@PathVariable int page, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + public JSONObject listSubClientsByPage(@PathVariable String clientMoniker,@PathVariable int page, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { return clientManager.listSubClientsByPage(manager, clientMoniker,page); } diff --git a/src/main/ui/static/payment/partner/templates/sub_partners.html b/src/main/ui/static/payment/partner/templates/sub_partners.html index 35a52563d..bc84644e8 100644 --- a/src/main/ui/static/payment/partner/templates/sub_partners.html +++ b/src/main/ui/static/payment/partner/templates/sub_partners.html @@ -148,7 +148,7 @@ last-text="»">
- {{'select.sign.total_records'|translate}}:{{pagination.totalCount}};{{'partners.total_pages'|translate}}:{{pagination.totalPages}} + Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}