From 650e579f9532c9a85aa05a414335bad7d02891c7 Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Fri, 4 Jan 2019 11:28:06 +0800 Subject: [PATCH] yeepay sub init --- .../core/impls/ClientManagerImpl.java | 11 +- .../static/payment/partner/partner-manage.js | 76 ++++- .../apply_yeepay_sub_merchant_id.html | 307 +++++++++++++----- .../templates/sub_merchant_id_apply.html | 8 +- 4 files changed, 298 insertions(+), 104 deletions(-) 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 b66cc5359..646e6f4ce 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 @@ -3719,7 +3719,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid merchantInfo.put("create_time",new Date()); merchantInfo.put("operator",manager.getString("display_name")); merchantInfo.put("client_id",client.getIntValue("client_id")); - merchantInfo.put("vouchers",merchantInfo.getJSONObject("vouchers").toJSONString()); + merchantInfo.put("client_id",merchantInfo.getString("client_id")); +// merchantInfo.put("vouchers",merchantInfo.getJSONObject("vouchers").toJSONString()); + List directorsAll = new ArrayList<>(); + List executivesAll = new ArrayList<>(); + directorsAll.add(merchantInfo.getJSONObject("directors")); + executivesAll.add(merchantInfo.getJSONObject("executives")); + JSONObject extInfo = new JSONObject(); + extInfo.put("directors",directorsAll); + extInfo.put("executives",executivesAll); + merchantInfo.put("extinfo",extInfo.toJSONString()); yeePayClientConfigMapper.saveMerchantConfig(merchantInfo); JSONObject yeepayConfig = yeePayClientConfigMapper.findMerchantConfig(client.getIntValue("client_id")); SubmerchantRegisterResult result = yeePayClient.registerMerchant(client,yeepayConfig); diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 02ffc234a..b66269a3b 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3505,6 +3505,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.subMerchantInfo = angular.copy(subMerchantInfo); var vouchers={}; + $scope.directors={}; + $scope.executives={}; + $scope.industry = ''; + var merchantInfo = {}; + var merchantId = ''; @@ -3570,7 +3575,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }).then(function (resp) { delete $scope.businessLicenceProgress; $scope.businessLicence = resp.data.path; - vouchers['businessLicence'] = resp.data.path; + merchantInfo['business_licence'] = resp.data.path; merchantId = resp.data.merchantId; commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) }, function (resp) { @@ -3708,8 +3713,57 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }; + $scope.uploadDirectorPassport = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.directorPassportProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.directorPassportProgress; + $scope.directorPassport = resp.data.path; + $scope.directors.filePath = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.directorPassportProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.directorPassportProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadExecutivePassport = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.executivePassportProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.executivePassportProgress; + $scope.executivePassport = resp.data.path; + $scope.executives.filePath = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.executivePassportProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.executivePassportProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + $scope.saveYeepayApply = function (form) { - var merchantInfo = {}; $scope.errmsg = null; if (form.$invalid) { angular.forEach(form, function (item, key) { @@ -3719,14 +3773,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); return; } - angular.forEach(form, function (item, key) { - if(item !=null) { - if(item.$name !=null) { - merchantInfo[key] = item.$modelValue; - } - } - }); - merchantInfo['vouchers'] = vouchers; + // angular.forEach(form, function (item, key) { + // if(item !=null) { + // if(item.$name !=null) { + // merchantInfo[key] = item.$modelValue; + // } + // } + // }); + merchantInfo['executives'] = $scope.executives; + merchantInfo['directors'] = $scope.directors; + merchantInfo['industry'] = $scope.industry; merchantInfo['merchantId'] = merchantId; $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registYeepaySubMerchantId', merchantInfo).then(function (resp) { $scope.apply_sub_merchant_id = resp.data; diff --git a/src/main/ui/static/payment/partner/templates/apply_yeepay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_yeepay_sub_merchant_id.html index c58fc37e2..407af6b14 100644 --- a/src/main/ui/static/payment/partner/templates/apply_yeepay_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/apply_yeepay_sub_merchant_id.html @@ -6,21 +6,21 @@
Apply Yeepay Sub Merchant Id
-
- -
- -
-

Required Field

-
-
-
+ + + + + + + + + + + + + + +
* Business Category
+
+

Required Field

+

Length is more than 50

- -
Url:{{legalIDcardBack}}
-
- +
+
-
- + +
+

Required Field

+

Length is more than 50

- -
Url:{{businessLicence}}
- +
- -
Url:{{taxLevel}}
+ +
Url:{{directorPassport}}
-
- +
+
-
- + +
+

Required Field

+

Length is more than 50

- -
Url:{{bankAccountOpen}}
-
- +
+
-
- + +
+

Required Field

+

Length is more than 50

- -
Url:{{orgCode}}
-
- +
+
-
- + +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

- -
Url:{{nonStanProtocol}}
- +
- -
Url:{{zipPath}}
+ +
Url:{{executivePassport}}
+
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
diff --git a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html index 835b5b5dc..9cb9eb766 100644 --- a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html +++ b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html @@ -182,10 +182,10 @@ Apply Time -
  • - Business Content - {{id_apply.business_content | yeepayBusinessContent}} -
  • + + + +
  • Business Category {{id_apply.industry | yeepayIndustry}}