From aa2fea8f7151fa25c614790b3ffd2e6b59e1af66 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 22 May 2019 16:13:35 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=8E=BB=E6=8E=89representative=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/merchants/core/ClientManager.java | 4 +-- .../core/impls/ClientManagerImpl.java | 16 ++-------- .../web/PartnerManageController.java | 8 ++--- .../static/payment/partner/partner-manage.js | 31 ++++++------------- 5 files changed, 18 insertions(+), 43 deletions(-) diff --git a/pom.xml b/pom.xml index 5ab2a115a..de462a78c 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.5 + 1.0.6 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 2f085f777..b3b9a7b10 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 @@ -323,9 +323,9 @@ public interface ClientManager { String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager); - void registerAlipayGms(String clientMoniker, JSONObject representative_id, JSONObject manager); + void registerAlipayGms(String clientMoniker, JSONObject manager); - void registerAlipayOnlineGms(String clientMoniker, JSONObject representative_id, JSONObject manager); + void registerAlipayOnlineGms(String clientMoniker, JSONObject manager); String queryAlipayGmsStatus(String clientMoniker, 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 2626bc65a..a6fc718a9 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 @@ -3979,7 +3979,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void registerAlipayGms(String clientMoniker, JSONObject representative_id, JSONObject manager) { + public void registerAlipayGms(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -4002,13 +4002,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new BadRequestException("Alipay Industry can't be null"); } - if (!"Company".equals(client.getString("business_structure"))) { - if (StringUtils.isBlank(representative_id.getString("representative_id"))) { - throw new BadRequestException("ID or passport number can't be null"); - } - client.put("representative_id", representative_id.getString("representative_id")); - } - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { @@ -4117,7 +4110,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void registerAlipayOnlineGms(String clientMoniker, JSONObject representative_id, JSONObject manager) { + public void registerAlipayOnlineGms(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -4140,11 +4133,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } client.put("bank_id", client_bank.getString("account_no")); - if (StringUtils.isBlank(representative_id.getString("representative_id"))) { - throw new BadRequestException("ID or passport number can't be null"); - } - client.put("representative_id", representative_id.getString("representative_id")); - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { 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 d324988f5..bb2f39f80 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 @@ -628,8 +628,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/register/alipay_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void registerAlipayGms(@PathVariable String clientMoniker,@RequestBody JSONObject representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.registerAlipayGms(clientMoniker, representative_id, manager); + public void registerAlipayGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.registerAlipayGms(clientMoniker, manager); } @ManagerMapping(value = "/{clientMoniker}/query/alipay_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) @@ -638,8 +638,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/register/alipayOnline_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@RequestBody JSONObject representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.registerAlipayOnlineGms(clientMoniker, representative_id, manager); + public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.registerAlipayOnlineGms(clientMoniker, manager); } @ManagerMapping(value = "/{clientMoniker}/query/alipayOnline_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 0eb1c26be..4ccf01a20 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -1588,26 +1588,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipay_gms_json').then(function (resp) { $scope.alipay_gms_json = resp.data; commonDialog.confirm({ - title: 'Warning', - content: '是否使用该商户的现有信息进件?', - json:$scope.alipay_gms_json + title: 'Warning', + content: '是否使用该商户的现有信息进件?', + json: $scope.alipay_gms_json }).then(function () { - if ($scope.partner.business_structure === "Company") { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: ""}).then(function () { + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms').then(function () { commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'}); }, function (resp) { commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); }) - } else { - commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: text}).then(function () { - commonDialog.alert({title: 'Success', content: '提示:Alipay进件成功', type: 'success'}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); - }) - }); - } - }) + }); }) }; $scope.queryAlipayGms = function () { @@ -1625,14 +1615,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter content: '是否使用该商户的现有信息进件?', json:$scope.alipayOnline_gms_json }).then(function () { - commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms', {representative_id: text}).then(function () { - commonDialog.alert({title: 'Success', content: '提示:AlipayOnline进件成功', type: 'success'}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); - }) + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(function () { + commonDialog.alert({title: 'Success', content: '提示:AlipayOnline进件成功', type: 'success'}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); }); - }) }); };