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 c6d1d0b70..92da4fffa 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 @@ -4744,7 +4744,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - beforeCommitToDoAgreeValid(client, manager); + beforeCommitToDoAgreeValid(client, manager,"Wechat"); OpenStatusModify openStatusModify = new OpenStatusModify(manager, clientMoniker, 1); openStatusModify.setApprove_result(4); @@ -4766,7 +4766,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } int clientId = client.getIntValue("client_id"); client.putAll(clientConfigService.find(clientId)); - beforeCommitToDoAgreeValid(client, manager); + beforeCommitToDoAgreeValid(client, manager,"rpaypmt_card"); JSONObject surCharge = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "rpaypmt_card"); if (surCharge == null || surCharge.size() <= 0) { @@ -4784,7 +4784,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid saveClientAuditProcess(client.getIntValue("client_id"), null, 1, "提交Compliance制作合同", manager,2); } - private void beforeCommitToDoAgreeValid(JSONObject client, JSONObject manager) { + private void beforeCommitToDoAgreeValid(JSONObject client, JSONObject manager, String channel) { if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); if (bdOperatClientRole <= 0) { @@ -4792,7 +4792,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - JSONObject surCharge = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); + JSONObject surCharge = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), channel); if (surCharge == null || surCharge.size() <= 0) { throw new BadRequestException("The Partner's Rate is not config!"); } diff --git a/src/main/ui/static/boot/manager-bootv2.js b/src/main/ui/static/boot/manager-bootv2.js index c592cbe37..fec641d86 100644 --- a/src/main/ui/static/boot/manager-bootv2.js +++ b/src/main/ui/static/boot/manager-bootv2.js @@ -76,8 +76,8 @@ require(['angular', 'jquery'], function (angular, $) { }); function boot(user) { - var paths = ['static/boot/managerMainAppv2', 'static/menu/managerMenu','static/analysis/org/analysis-org', 'static/analysis/report/analysis-report', 'static/analysis/monitoring/analysis-monitoring', 'static/analysis/bd/analysis-bd','static/analysis/trans-analysis']; - var moduleNames = ['managerMainAppv2', 'listMenuApp','analysisTransaction', 'analysisBD', 'analysisOrg', 'analysisMonitoring', 'analysisReport']; + var paths = ['static/boot/managerMainAppv2', 'static/menu/managerMenu','static/analysis/org/analysis-org', 'static/analysis/report/analysis-report', 'static/analysis/monitoring/analysis-monitoring', 'static/analysis/bd/analysis-bd','static/analysis/trans-analysis','static/payment/partner/add-partner']; + var moduleNames = ['managerMainAppv2', 'listMenuApp','analysisTransaction', 'analysisBD', 'analysisOrg', 'analysisMonitoring', 'analysisReport','addPartnerApp']; window.currentUser = user; angular.forEach(user.modules, function (mod) { paths.push(mod.js_path); diff --git a/src/main/ui/static/payment/partner/add-partner.js b/src/main/ui/static/payment/partner/add-partner.js index 821e49bd0..ad947fe1d 100644 --- a/src/main/ui/static/payment/partner/add-partner.js +++ b/src/main/ui/static/payment/partner/add-partner.js @@ -22,6 +22,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter controller: 'addPartnerCtrl' }).state('partners.edit', { url: '/{clientMoniker}/edit', + params: {"commitCardPayment": false, commitCrossBorderPayment: false}, templateUrl: '/static/payment/partner/templates/partner_edit.html', controller: 'partnerEditCtrl', resolve: { @@ -38,7 +39,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } else { $scope.partner = {timezone: 'Australia/Melbourne'}; } - $scope.partner.enable_cross_payment = true; + $scope.partner.enable_cross_payment = false; $scope.partner.enable_cross_payment = false; $scope.initMerchantCode = function () { $http.get('/sys/partners/init/merchant_code').then(function (response) { @@ -47,11 +48,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.merchantIsValid = true; }); }; + $scope.enablePaymentType = function (type) { + $scope.partner[type] = !$scope.partner[type]; + }; + $scope.enablePaymentType('enable_cross_payment'); $scope.initMerchantCode(); $scope.partner.company_phone_c = 61; $scope.partner.contact_phone_c = 61; $scope.partner.client_pay_type = []; $scope.partner.client_pay_desc = []; + var resetClientPayDescByTpey = function (type) { type = parseInt(type); if (type == 1) { @@ -63,9 +69,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.partner.sameAsContactPerson = false; - $scope.enablePaymentType = function (type) { - $scope.partner[type] = !$scope.partner[type]; - }; $scope.checkboxOnclick = function (){ $scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson); if($scope.partner.sameAsContactPerson) { @@ -499,6 +502,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.partner[type] = !$scope.partner[type]; }; + if ($state.params.commitCardPayment) { + $scope.enablePaymentType('enable_card_payment'); + } + + if ($state.params.commitCrossBorderPayment) { + $scope.enablePaymentType('enable_cross_payment'); + } + function hasRole() { var rolenum; switch (sessionStorage.getItem('role')) { diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index d0f5574d3..acd67a9ac 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -922,6 +922,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) } $scope.apply2makeAgreeFile = function () { + if (!$scope.partner.enable_cross_payment) { + commonDialog.alert({ + title: 'Error!', + content: '请完善商户跨境支付基本信息、签约费率、合规文件!', + type: 'error' + }); + $state.go('partners.edit',{ + clientMoniker:$scope.partner.client_moniker, + commitCardPayment:false, + commitCrossBorderPayment:true}); + return; + } $http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_agree_file').then(function () { commonDialog.alert({ title: 'Success!', @@ -936,6 +948,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.apply2makeCardAgreeFile = function () { + if (!$scope.partner.enable_card_payment) { + commonDialog.alert({ + title: 'Error!', + content: '请完善商户卡支付基本信息、签约费率、合规文件!', + type: 'error' + }); + $state.go('partners.edit',{ + clientMoniker:$scope.partner.client_moniker, + commitCardPayment:true, + commitCrossBorderPayment: false}); + return; + } $http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_card_agree_file').then(function () { commonDialog.alert({ title: 'Success!', @@ -944,8 +968,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); $state.reload(); }, function (resp) { + if (String(resp.data.message).match("No Rate Config")) { + commonDialog.alert({ + title: 'Error!', + content: '商户卡支付签约费率未配置,请添加商户卡支付签约费率!', + type: 'error' + }); + $state.go('partners.detail.rates', { + clientMoniker: $scope.partner.client_moniker + }); + }else { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); } + } ); }; @@ -2019,7 +2054,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); - app.controller('partnerRatesCtrl', ['$scope', '$rootScope', '$http', '$uibModal', 'commonDialog', '$sce', function ($scope, $rootScope, $http, $uibModal, commonDialog, $sce) { + app.controller('partnerRatesCtrl', ['$scope', '$rootScope', '$http', '$uibModal', 'commonDialog', '$sce','$state', function ($scope, $rootScope, $http, $uibModal, commonDialog, $sce,$state) { $scope.bankCtrl = {edit: true, rate_name: 'Wechat'}; $scope.init = { skip_clearing: false, diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index 45deacc9b..cd24bc7f2 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -23,6 +23,10 @@ .form-control-span{ height: 34px; } + .check-box { + zoom: 130%; + margin-right: 5px; + }

New Partner

@@ -41,10 +45,10 @@
diff --git a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html index 9ff619fa9..36ef11d4d 100644 --- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html @@ -214,9 +214,9 @@
  • CB_BankPay
  • Card Payment
  • Direct Debit
  • - +
    diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index ce2e83288..811b02888 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -363,7 +363,7 @@
    diff --git a/src/main/ui/static/payment/partner/templates/partner_edit.html b/src/main/ui/static/payment/partner/templates/partner_edit.html index b2bd550f7..01afef275 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -17,6 +17,10 @@ .form-control-span{ height: 34px; } + .check-box { + zoom: 130%; + margin-right: 5px; + }

    @@ -37,10 +41,16 @@