From b7abc5b78fc49a677bdf8bb7785a06525775bfab Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Thu, 4 Jan 2018 15:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E6=88=B7=E8=AF=A6=E6=83=85=E9=87=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0Local=20Merchant=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db/modify.sql | 5 ++++- .../web/PartnerManageController.java | 5 +++++ .../static/payment/partner/partner-manage.js | 20 ++++++++++++++++++- .../partner/templates/partner_detail.html | 7 +++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/db/modify.sql b/src/db/modify.sql index 246464dcc..3d0650c51 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -106,7 +106,7 @@ ALTER TABLE `sys_accounts` MODIFY COLUMN `creator` varchar(50) NOT NULL COMMENT '开户者'; ALTER TABLE `sys_clients_audit_process` - MODIFY COLUMN `operator_id` varchar(50) NOT NULL ; + MODIFY COLUMN `operator_id` tinyint(1) NOT NULL ; ALTER TABLE `pmt_refunds` MODIFY COLUMN `operator_id` varchar(50) DEFAULT NULL COMMENT '退款操作者账号'; @@ -117,5 +117,8 @@ ALTER TABLE `sys_clients_apply` ALTER TABLE `cashback_draw_deposits` MODIFY COLUMN `operator_id` varchar(50) NOT NULL ; + ALTER TABLE `sys_clients` + ADD COLUMN `local_merchant` tinyint(1) DEFAULT 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 35d9091c2..f9d090a2c 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 @@ -477,4 +477,9 @@ public class PartnerManageController { public void wechatCcompliancePermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.switchPermission(manager, clientMoniker, "wechat_compliance", pass.getBooleanValue("allow")); } + + @ManagerMapping(value = "/{clientMoniker}/local_merchant_permission",method = RequestMethod.PUT,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow")); + } } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 9324a9fd7..2d8a28884 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -378,7 +378,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }]); app.controller('partnerDetailCtrl', ['$scope', '$http', '$state', '$uibModal', '$rootScope', 'Upload', 'commonDialog', 'partner', function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner) { - $scope.init = {wechatcompliance: false}; + $scope.init = {wechat_compliance: false,local_merchant:false}; $scope.partner = partner.data; $scope.showDBUsers = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/bd_user').then(function (resp) { @@ -730,6 +730,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }) }; + $scope.changeLocalMerchant = function () { + if (!$scope.partner) { + return; + } + if (!$scope.init.local_merchant) { + $scope.init.local_merchant = true; + return; + } + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/local_merchant_permission', {allow: $scope.partner.local_merchant}).then(function () { + + }, function (resp) { + commonDialog.alert({ + title: 'failed to change local_merchant permission status', + content: resp.data.message, + type: 'error' + }) + }) + }; }]); app.controller('partnerEditCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'partner', function ($scope, $http, $state, Upload, commonDialog, timezone, partner) { 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 05bd827ee..bf258e9aa 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -357,6 +357,13 @@

+
+ +
+ +
+