diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java index 439a252e3..86cb29a46 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java @@ -38,28 +38,28 @@ public class DashboardController { @ManagerMapping("/common_analysis_3") public JSONObject commonAnalysis3(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); + JSONObject params = analysis.toParams(analysis.getTimezone()); orgManager.checkOrg(manager,params); return dashboardService.getCommonAnalysis3(params); } @ManagerMapping("/common_analysis_4") public JSONObject commonAnalysis4(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); + JSONObject params = analysis.toParams(analysis.getTimezone()); orgManager.checkOrg(manager,params); return dashboardService.getCommonAnalysis4(params); } @ManagerMapping("/common_analysis_2") public JSONObject commonAnalysis2(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); + JSONObject params = analysis.toParams(analysis.getTimezone()); orgManager.checkOrg(manager,params); return dashboardService.getCommonAnalysis2(params); } @ManagerMapping("/trade_in_types") public List tradeInTypes(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); + JSONObject params = analysis.toParams(analysis.getTimezone()); orgManager.checkOrg(manager,params); return dashboardService.getTradeInTypes(params); } @@ -67,7 +67,7 @@ public class DashboardController { @ManagerMapping("/top_trade_partners") public List topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestParam(defaultValue = "10") int limit) { - JSONObject params = analysis.toParams(null); + JSONObject params = analysis.toParams(analysis.getTimezone()); orgManager.checkOrg(manager,params); return dashboardService.getTopTradePartners(params, limit); } @@ -107,7 +107,7 @@ public class DashboardController { @ManagerMapping("/partners_in_types") public List partnersInTypes(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); + JSONObject params = analysis.toParams(analysis.getTimezone()); orgManager.checkOrg(manager,params); if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { params.put("bd_group", manager.getString("manager_id")); @@ -154,7 +154,7 @@ public class DashboardController { @ManagerMapping("/Total_platform_amount") public JSONObject getPlatformAmount(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ - JSONObject params = analysis.toParams(null); + JSONObject params = analysis.toParams(analysis.getTimezone()); orgManager.checkOrg(manager,params); return dashboardService.getPlatformAmount(params); } diff --git a/src/main/ui/static/commons/services/commonDialog.js b/src/main/ui/static/commons/services/commonDialog.js index 74e834463..57aa93950 100644 --- a/src/main/ui/static/commons/services/commonDialog.js +++ b/src/main/ui/static/commons/services/commonDialog.js @@ -36,6 +36,7 @@ define(['../app', 'angular'], function (app, angular) { var config = { title: cfg.title, content: cfg.content, + contentHtml: cfg.contentHtml, backdrop: cfg.backdrop, size: cfg.size, choises: cfg.choises || choises diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 196e39946..318b68266 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -500,15 +500,37 @@ 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) { + app.controller('partnerDetailCtrl', ['$scope', '$http', '$state', '$uibModal', '$rootScope', 'Upload', 'commonDialog', 'partner', '$sce', function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner, $sce) { $scope.init = {wechat_compliance: false, local_merchant: false}; $scope.partner = partner.data; + $scope.isComplianceOfCompanyName = false; + $scope.isComplianceOfShortName = false; + $scope.isComplianceOfBusinessStructure = false; var website = partner.data.company_website; if (website!=null){ if (website.indexOf('http')!=0){ $scope.partner.company_website= 'http://'+angular.copy(website); } } + $scope.decideCompliance = function (name) { + var keywords = ['education','financial' ,'train','immigrant','invest', + '律师咨询','会计事务所','移民留学','娱乐','金融','地产','投资']; + for(var i = 0; i < keywords.length; i++){ + if (name.indexOf(keywords[i]) != -1) { + return true; + } + } + return false; + }; + if (partner.data.company_name != null) { + $scope.isComplianceOfCompanyName = $scope.decideCompliance(partner.data.company_name); + } + if (partner.data.short_name != null) { + $scope.isComplianceOfShortName = $scope.decideCompliance(partner.data.short_name); + } + if (partner.data.business_structure != null) { + $scope.isComplianceOfBusinessStructure = $scope.decideCompliance(partner.data.business_structure); + } $scope.showDBUsers = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/bd_user').then(function (resp) { $scope.partner.client_bds = resp.data; @@ -548,9 +570,33 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter alert("Bank Account not checked"); return; } + var title = 'Audit Partner'; + var content = 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited?'; + var choises = ''; + var contentHtml = ''; + if ($scope.isComplianceOfCompanyName || $scope.isComplianceOfShortName + || $scope.isComplianceOfBusinessStructure) { + var info = []; + if ($scope.isComplianceOfCompanyName) { + info.push('Company Name'); + } + if ($scope.isComplianceOfShortName) { + info.push('Short Name'); + } + if ($scope.isComplianceOfBusinessStructure) { + info.push('Business Structure'); + } + title = 'Warning'; + contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],'+ info.toString() +'存在微信渠道不合规信息'); + choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true}, + {label: '确认提交', className: 'btn-success', key: '1'}]; + content = ''; + } commonDialog.confirm({ - title: 'Audit Partner', - content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited?' + title: title, + content: content, + choises: choises, + contentHtml: contentHtml }).then(function () { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit', {pass: 1}).then(function () { if ($scope.partner.approve_result == 2 && ($scope.partner.source == 1 || $scope.partner.source == 2)) { @@ -1115,7 +1161,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }]); - app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', function ($scope, $http, $state, commonDialog,$uibModal) { + app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', '$sce', function ($scope, $http, $state, commonDialog,$uibModal, $sce) { $scope.refresh = false; $scope.loadPartnerPaymentInfo = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) { @@ -1314,6 +1360,34 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }) }; + var info = []; + $scope.decideCompliance = function (name) { + var keywords = ['education','financial' ,'train','immigrant','invest', + '律师咨询','会计事务所','移民留学','娱乐','金融','地产','投资']; + for(var i = 0; i < keywords.length; i++){ + if (name.indexOf(keywords[i]) != -1) { + return true; + } + } + return false; + }; + $scope.getComplianceInfo = function () { + if ($scope.paymentInfo.company_name != null) { + if($scope.decideCompliance($scope.paymentInfo.company_name)) { + info.push('Company Name'); + } + } + if ($scope.paymentInfo.short_name != null) { + if($scope.decideCompliance($scope.paymentInfo.short_name)) { + info.push('Short Name'); + } + } + if ($scope.paymentInfo.business_structure != null) { + if($scope.decideCompliance($scope.paymentInfo.business_structure)) { + info.push('Business Structure'); + } + } + }; $scope.toggleChannel = function (channel) { if (!channel) { return; @@ -1325,6 +1399,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.init.channel[channel] = true; return; } + $scope.getComplianceInfo(); + if ($scope.paymentInfo['enable_wechat'] && channel == 'wechat' + && $scope.paymentInfo.open_status == 5 && info.length > 0) { + commonDialog.confirm({ + title: "Warning", + contentHtml: $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],'+ info.toString() +'存在微信渠道不合规信息') + }).then(function () { + $scope.saveChannel(channel); + }) + } else { + $scope.saveChannel(channel); + } + info = []; + }; + $scope.saveChannel = function (channel) { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/channels/' + channel + '/permission', {allow: $scope.paymentInfo['enable_' + channel]}).then(function () { $scope.loadPartnerPaymentInfo(); }, function (resp) { @@ -1334,7 +1423,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter type: 'error' }) }) - }; + } $scope.toggleHfLink = function (channel) { if (!channel) { return; 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 4e218de2d..35cde22f8 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -291,14 +291,22 @@
-

+

+

+ 注意:(微信渠道可能不合规) +

-

+

+

+ 注意:(微信渠道可能不合规) +

@@ -312,8 +320,12 @@
-

+

+ 注意:(微信渠道可能不合规) +