From c86e760dc8d4fe874fcf1b466790b9c2c8e112bb Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Fri, 6 Jul 2018 09:42:27 +0800 Subject: [PATCH] fix BD Commissions --- src/db/modify.sql | 6 +- .../financial/FinancialBDConfigMapper.xml | 3 +- src/main/ui/static/config/bdprize/bdprize.js | 55 +++-- .../bd_commission_config_dialog.html | 197 ++++++++++++------ .../templates/bd_prize_month_report.html | 46 +++- .../bdprize/templates/bd_prize_root.html | 55 +++-- .../bdprize/templates/rate_config_dialog.html | 16 +- 7 files changed, 251 insertions(+), 127 deletions(-) diff --git a/src/db/modify.sql b/src/db/modify.sql index f5605ad5d..e608d4d25 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -611,4 +611,8 @@ CREATE TABLE `pre_apply_handle_log` ( ALTER TABLE `sys_client_pre_apply` ADD COLUMN `status` tinyint(2) NULL DEFAULT 0 COMMENT '0:未处理,1:处理中,2:处理完成'; -alter table sys_clients add column hfindustry varchar(10) DEFAULT NULL COMMENT 'HF行业'; \ No newline at end of file +alter table sys_clients add column hfindustry varchar(10) DEFAULT NULL COMMENT 'HF行业'; + +alter table financial_bd_prize_rate_config add column `kpi_range` smallint(6) NOT NULL; +alter table financial_bd_config add column `kpi_amount` decimal(15,2) NOT NULL; +alter table financial_bd_prize_log add column `kpi_amount` decimal(15,2) DEFAULT NULL; \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml index 25eadc450..55dd4eb35 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml @@ -9,7 +9,8 @@ c.bd_level, c.city, c.get_prize, - c.bd_group + c.bd_group, + c.kpi_amount FROM sys_managers m LEFT JOIN financial_bd_config c ON c.manager_id = m.manager_id WHERE m.role & 4 > 0 AND m.is_valid = 1 AND (m.org_id = 1 OR m.org_id IS NULL) diff --git a/src/main/ui/static/config/bdprize/bdprize.js b/src/main/ui/static/config/bdprize/bdprize.js index 47e2fbd55..d1b163ae6 100644 --- a/src/main/ui/static/config/bdprize/bdprize.js +++ b/src/main/ui/static/config/bdprize/bdprize.js @@ -42,6 +42,8 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { app.controller('bdPrizeRootCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', function ($scope, $http, $uibModal, commonDialog) { $scope.params = {year: new Date().getFullYear()}; $scope.availableYears = [new Date().getFullYear() - 1, new Date().getFullYear()]; + $scope.kpiRanges = [{value: 1, label: '0-0.5'}, {value: 2, label: '0.5-0.8'}, {value: 3, label: '0.8-1'}, + {value: 4, label: '1-1.2'}, {value: 5, label: '>=1.2'}]; $scope.initMonth = function (year) { $scope.params.year = year; $scope.months = []; @@ -87,12 +89,12 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { $scope.loadRateConfigs = function () { $http.get('/sys/bd_prize/config/rates').then(function (resp) { $scope.bd_rate_configs = resp.data; - $scope.bd_rate_ranges = []; - var rangeStart = []; + $scope.kpi_ranges = []; + var kpiStart = []; angular.forEach($scope.bd_rate_configs, function (cfg) { - if (rangeStart.indexOf(cfg.rate_from) < 0) { - rangeStart.push(cfg.rate_from); - $scope.bd_rate_ranges.push(cfg); + if (kpiStart.indexOf(cfg.kpi_range) < 0) { + kpiStart.push(cfg.kpi_range); + $scope.kpi_ranges.push(cfg); } }) }) @@ -137,9 +139,10 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { value: 3, label: '>=7 Months' }]; - $scope.kpiRanges = [{value: 1, label: '<50%'}, {value: 2, label: '50%<=kpi<80%'}, {value: 3, label: '80%<=kpi<100%'}, - {value: 4, label: '100%<=kpi<120%'}, {value: 5, label: '>=120%'}]; - $scope.filter = {bd_level: 1, months: 1,kpi_range:1}; + $scope.kpiRanges = [{value: 1, label: '0-0.5'}, {value: 2, label: '0.5-0.8'}, {value: 3, label: '0.8-1'}, + {value: 4, label: '1-1.2'}, {value: 5, label: '>=1.2'}]; + $scope.clientRate = [{value: 0.6, label: '0.6-0.79'}, {value: 0.8, label: '0.8-2.0'}]; + $scope.filter = {bd_level: 1,rate_from:0.6}; $scope.rates = rates; $scope.submitRates = function () { var validation = null; @@ -194,7 +197,7 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { app.controller('bdCommissionConfigCtrl', ['$scope', '$state', '$http', '$filter', 'monModal', function ($scope, $state, $http, $filter, monModal) { $scope.monModal = monModal; $scope.params = {year: new Date().getFullYear()}; - $scope.bdtypes = [{id: 1, label: 'Director'}, {id: 2, label: 'Manager'}, {id: 3, label: 'Sydney GM'},{id: 4, label: 'COO'},{id: 5, label: 'NJ Department'}]; + $scope.bdtypes = [{id: 1, label: 'BD Manager'}, {id: 2, label: 'KA Manager'}, {id: 3, label: 'Sydney GM'},{id: 4, label: 'COO'},{id: 5, label: 'NJ Department'}]; // $scope.bdmon; // $scope.newSwitch; $scope.initMonth = function (year) { @@ -218,6 +221,28 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { }) }; $scope.getBDLevels(); + $scope.chooseLastConfig = function (mon) { + var index = $scope.months.indexOf(mon); + if(index == 0){ + var year = new Date().getFullYear(); + year--; + mon = year + '-12'; + }else { + mon = $scope.months[index-1]; + } + $http.get('/sys/bd_prize/commission/le_ma/' + mon).then(function (resp) { + $scope.bdlm = []; + angular.forEach(resp.data,function (e) { + var bdC = {}; + bdC.commission_start_amount = e.commission_start_amount; + bdC.commission_end_amount = e.commission_end_amount; + bdC.bd_commission_rate = e.bd_commission_rate; + bdC.bd_type = e.bd_type; + $scope.bdlm.push(bdC); + }); + $scope.listConfig = true; + }) + }; $scope.listCurrentMonBDCommission = function (mon) { $http.get('/sys/bd_prize/commission/le_ma/' + mon).then(function (resp) { $scope.bdlm = resp.data; @@ -277,12 +302,14 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { } $scope.submitBdCommmissionConfig = function (mon, bds) { $scope.check = true; + $scope.errmsg = null; angular.forEach(bds, function (data, index) { - $scope.errmsg = null; - if (!data.kpi_amount) { - $scope.errmsg = "BD kpi Amount not be null"; - $scope.check = false; - return; + if(data.get_prize){ + if (!data.kpi_amount) { + $scope.errmsg = "BD kpi Amount not be null"; + $scope.check = false; + return; + } } }); if ($scope.check) { diff --git a/src/main/ui/static/config/bdprize/templates/bd_commission_config_dialog.html b/src/main/ui/static/config/bdprize/templates/bd_commission_config_dialog.html index fb60e206e..b3b547119 100644 --- a/src/main/ui/static/config/bdprize/templates/bd_commission_config_dialog.html +++ b/src/main/ui/static/config/bdprize/templates/bd_commission_config_dialog.html @@ -6,75 +6,142 @@ -
- - - - - - - - - - - - - - - - - -
Commission AmountCommission RateBD Type - -
-
- - ~ - -
-
-
- - % -
-
- - - -
-
-
@@ -54,7 +54,7 @@
BD Total Commission: ${{report.AlipayReport.total_prize}}
-
BD Taotal Send: ${{report.AlipayReport.total_send_prize}}
+
BD Total Send: ${{report.AlipayReport.total_send_prize}}
BD Total Fund: ${{report.AlipayReport.total_donation}}
@@ -65,9 +65,9 @@
-
BD Taotal Commission: ${{report.BestpayReport.total_prize}}
-
BD Taotal Send: ${{report.BestpayReport.total_send_prize}}
-
BD Taotal Fund: ${{report.BestpayReport.total_donation}}
+
BD Total Commission: ${{report.BestpayReport.total_prize}}
+
BD Total Send: ${{report.BestpayReport.total_send_prize}}
+
BD Total Fund: ${{report.BestpayReport.total_donation}}
@@ -94,7 +94,7 @@ {{log.kpi_amount}} {{log.bd_name}} (Left Company) - {{log.total_amount|currency:'AUD '}} (({{log.total_amount}}/{{log.kpi_amount}})|percentage) + {{log.total_amount|currency:'AUD '}} @@ -112,7 +112,7 @@
-
BD Manager Commission
+
Manager Commission
@@ -154,7 +154,7 @@ -->
-
Director Commission
+
COO Commission
@@ -166,6 +166,32 @@
+
+
Sydney GM Commission
+
+
+
+ Transaction Amount: +
+
+ Total Commission: +
+
+
+
+
+
NJ Department Commission
+
+
+
+ Transaction Amount: +
+
+ Total Commission: +
+
+
+
diff --git a/src/main/ui/static/config/bdprize/templates/bd_prize_root.html b/src/main/ui/static/config/bdprize/templates/bd_prize_root.html index 453417d77..406bb2f56 100644 --- a/src/main/ui/static/config/bdprize/templates/bd_prize_root.html +++ b/src/main/ui/static/config/bdprize/templates/bd_prize_root.html @@ -59,49 +59,48 @@
- - - - - + + + + - - - - - - - - - - + + + + + + + - + - - + - + ng-bind="(bd_rate_configs|filter:{kpi_range:range.kpi_range,bd_level:level,rate_from:0.6})[0].prize_rate+'%'"> + ng-bind="(bd_rate_configs|filter:{kpi_range:range.kpi_range,bd_level:level,rate_from:0.8})[0].prize_rate+'%'">
BD Level费率费率Junior BDIntermediate BDSenior BDKPIJunior BDIntermediate BDSenior BD
商户开通时长1-3个月4-6个月>=7个月1-3个月4-6个月>=7个月1-3个月4-6个月>=7个月费率0.6-0.790.8-2.00.6-0.790.8-2.00.6-0.790.8-2.0

补充说明

    -
  • 商户费率变更,提成比随之变更
  • -
  • 商户开通时长从商户开通时间起算
  • -
  • 后台系统自主申请商户,提成按照前三个月0.05%,后期0.01%发放,自主申请商户在详情列表中的Client Source标注为Apply
  • -
  • 调岗人员移交的商户,移交后6个月内移交人员和接收人员平分提成,应在商户BD配置里进行设置,分配比例请关注详情列表中的Coefficient,正常情况下应当为1
  • -
  • 离职人员移交的商户,接收人员享受一半提成,另一半作为BD福利基金,离职转交商户在详情列表中用红色标注
  • -
  • BD提成按月发放
  • -
  • 每月发放总额的80%,剩余20%于每年年底,即12月25日圣诞节前发放
  • +
  • 按月度发放
  • +
  • 每月发放总提成额度的 80%,剩余 20%按照“年度考评分数比例”于每年年底即 12 月 25 日圣诞前发放
  • 提前离职者,20%提成不予发放
  • +
  • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放 20%的占比部分,扣下部分如果第二年考评超出一定评分 110%可以补发;同样,如果年度考评分数超过 100 分按照同比例发放
  • +
  • 商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配
  • +
  • 连续 2 个月不产生流水的商户,由销管部统一收回,重新分配
  • +
  • 分配后的商户流水客户专员只能占一半
  • +
  • 离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1 个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护; + 离职人员交接的商户提成,接收人员享受一半的提成,另一半作为跨境客服专员福利会基金
  • +
  • 被客户投诉情况严重者,此商户由销管中心无条件收回重新分配
  • +
  • 活动执行未传达到位且出现舞弊、徇私、懒惰等行为的,商户上交由销管中心统一分配
  • +
  • 后期维护不及时,连续一个月不跟踪者,此商户上交销管中心,统一重新分配
  • +
  • 以上分配,销管中心 leader 和跨境支付事业部商量好之后需做好方案后经 COO 审批方可执行
diff --git a/src/main/ui/static/config/bdprize/templates/rate_config_dialog.html b/src/main/ui/static/config/bdprize/templates/rate_config_dialog.html index 1366d6ca1..cacbab082 100644 --- a/src/main/ui/static/config/bdprize/templates/rate_config_dialog.html +++ b/src/main/ui/static/config/bdprize/templates/rate_config_dialog.html @@ -9,29 +9,29 @@ -
+
- - + +
- + - - + +
Client RateKPI BD Rate
{{rate.rate_from}}-{{rate.rate_to}}