From 11abda951a8c0132eea2970362e7b5e8c97804ae Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 15:57:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=90=8C=E6=AD=A5order=5Fchannel?= =?UTF-8?q?=E4=B8=BA=E2=80=9CAlipayOnline=E2=80=9D=E7=9A=84=E5=95=86?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/dev/core/AliforexcelService.java | 2 + .../dev/core/impl/AliforexcelServiceImpl.java | 50 +++++++++++++++++++ .../manage/dev/web/TestController.java | 5 ++ .../mappers/payment/TransactionMapper.java | 2 + .../mappers/payment/TransactionMapper.xml | 7 ++- .../ui/static/config/devtools/devtools.js | 15 +++++- .../registerAlipayOnlineMerchant.html | 3 ++ 8 files changed, 83 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 2a2d0cbe7..eb72d887b 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.15 + 1.0.16 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index 63ac55f5f..651b879ca 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -13,5 +13,7 @@ public interface AliforexcelService { JSONObject registerAlipayOnlineMerchant(); + JSONObject registerAlipayOnlineMerchantTmp(); + JSONObject getLessPartnerInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 59acf4ed6..2f91ecc83 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -140,6 +140,56 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } + @Override + public JSONObject registerAlipayOnlineMerchantTmp() { + JSONObject result = new JSONObject(); + List needRegisterMerchant = new ArrayList<>(); + List registerSuccessMerchant = new ArrayList<>(); + List registerFailMerchant = new ArrayList<>(); + List lessInfoMerchant = new ArrayList<>(); + List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClientsTmp(); + for (int clientId : useAlipayOnlineMerchant) { + JSONObject client = clientMapper.findClient(clientId); + if (client == null) { + continue; + } + try { + needRegisterMerchant.add(client.getString("client_moniker")); + checkPartnerInfo(client); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); + lessInfoMerchant.add(exception); + continue; + } + AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); + Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); + if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + Element responseElement = resultElement.element("response").element("alipay"); + if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + registerSuccessMerchant.add(client.getString("client_moniker")); + } + result.put("need_register_merchant", needRegisterMerchant); + result.put("success_register_merchant", registerSuccessMerchant); + result.put("fail_register_merchant", registerFailMerchant); + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + @Override public JSONObject getLessPartnerInfo() { JSONObject result = new JSONObject(); diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index ceb3a28cd..81692b649 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -455,6 +455,11 @@ public class TestController implements ApplicationEventPublisherAware { return aliforexcelService.registerAlipayOnlineMerchant(); } + @ManagerMapping(value = "/register/alipayOnlineGms/tmp", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) + public JSONObject registerAlipayOnlineMerchantTmp() { + return aliforexcelService.registerAlipayOnlineMerchantTmp(); + } + @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) public JSONObject getLessPartnerInfo() { return aliforexcelService.getLessPartnerInfo(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index 997831791..4879c4dd7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -159,4 +159,6 @@ public interface TransactionMapper { List getLastDaytransAmount(JSONObject params); List useAlipayOnlineClients(); + + List useAlipayOnlineClientsTmp(); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 5e1284444..f11770b51 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1211,6 +1211,11 @@ + + diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 65576c7a1..c238328c2 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -425,7 +425,20 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { alert(resp.data.message); }) }; - + $scope.registerOnlineGMSTmp = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.post('/dev/register/alipayOnlineGms/tmp').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + $scope.need_register_merchant = resp.data.need_register_merchant.toString(); + $scope.success_register_merchant = resp.data.success_register_merchant.toString(); + $scope.fail_register_merchant = resp.data.fail_register_merchant; + $scope.less_info_merchant = resp.data.less_info_merchant(); + }, function (resp) { + alert(resp.data.message); + }) + }; $scope.getLessPartnerInfo = function () { $scope.totalhide = true; $scope.selecttotal = false; diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index ef8545b78..df00a00bd 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -15,6 +15,9 @@
+
+ +
需要报备的商户编码