fix BD Commissions

master
yuan 6 years ago
parent c86e760dc8
commit 0e5e7270dc

@ -12,7 +12,7 @@ import com.alibaba.fastjson.JSONObject;
* Created by yixian on 2017-02-07. * Created by yixian on 2017-02-07.
*/ */
public interface BDPrizeService { public interface BDPrizeService {
void generateRecord(); void generateRecord(String month);
@Transactional @Transactional
void recordGenerateProcess(Calendar now); void recordGenerateProcess(Calendar now);

@ -81,7 +81,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
private static String[] channels = new String[]{"Wechat", "Alipay", "Bestpay", "jd", "AlipayOnline","hf"}; private static String[] channels = new String[]{"Wechat", "Alipay", "Bestpay", "jd", "AlipayOnline","hf"};
@Override @Override
public void generateRecord() { public void generateRecord(String month) {
if (backupSystem) { if (backupSystem) {
throw new ServerErrorException("Updating System,wait for a moment"); throw new ServerErrorException("Updating System,wait for a moment");
} }
@ -89,9 +89,15 @@ public class BDPrizeServiceImpl implements BDPrizeService {
throw new ServerErrorException("Processing task, wait for a moment"); throw new ServerErrorException("Processing task, wait for a moment");
} }
try { try {
final Calendar now = Calendar.getInstance(); SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM");
DateUtils.truncate(now, Calendar.MONTH); Date date = null;
now.add(Calendar.MONTH, -1); try {
date = sdf.parse(month);
} catch (ParseException e) {
e.printStackTrace();
}
Calendar now = Calendar.getInstance();
now.setTime(date);
recordGenerateProcess(now); recordGenerateProcess(now);
} finally { } finally {

@ -29,9 +29,9 @@ public class BDPrizeController {
@Resource @Resource
private BDPrizeService bdPrizeService; private BDPrizeService bdPrizeService;
@ManagerMapping(value = "/generate_record", method = RequestMethod.POST, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN}) @ManagerMapping(value = "/generate_record/{month}", method = RequestMethod.POST, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN})
public void generateRecord() { public void generateRecord(@PathVariable String month) {
bdPrizeService.generateRecord(); bdPrizeService.generateRecord(month);
} }
@ManagerMapping(value = "/records", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.BD_USER}) @ManagerMapping(value = "/records", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.BD_USER})

@ -39,11 +39,12 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
}) })
}]); }]);
app.controller('bdPrizeRootCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', function ($scope, $http, $uibModal, commonDialog) { app.controller('bdPrizeRootCtrl', ['$scope', '$http', '$uibModal', 'commonDialog','$filter', function ($scope, $http, $uibModal, commonDialog,$filter) {
$scope.params = {year: new Date().getFullYear()}; $scope.params = {year: new Date().getFullYear()};
$scope.generate = {};
$scope.availableYears = [new Date().getFullYear() - 1, 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'}, $scope.kpiRanges = [{value: 1, label: '0-50%'}, {value: 2, label: '50%~80%'}, {value: 3, label: '80%~100%'},
{value: 4, label: '1-1.2'}, {value: 5, label: '>=1.2'}]; {value: 4, label: '100%-120%'}, {value: 5, label: '>=120%'}];
$scope.initMonth = function (year) { $scope.initMonth = function (year) {
$scope.params.year = year; $scope.params.year = year;
$scope.months = []; $scope.months = [];
@ -74,11 +75,20 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
}; };
$scope.getYearReports(new Date().getFullYear()); $scope.getYearReports(new Date().getFullYear());
$scope.generateReport = function () { $scope.generateReport = function () {
$scope.generate.status = {};
if (!$scope.generate.month) {
commonDialog.alert({
type: 'error', title: 'Error', content: 'Select a month first!'
});
return;
}
commonDialog.confirm({ commonDialog.confirm({
title: 'Warning', title: 'Warning',
content: 'This operation will clear the result of last month generated before. Are you sure?' content: 'This operation will clear the result of last month generated before. Are you sure?'
}).then(function () { }).then(function () {
$http.post('/sys/bd_prize/generate_record', null, {timeout: 60000}).then(function () { var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')};
$http.post('/sys/bd_prize/generate_record/'+params.month, null, {timeout: 60000}).then(function () {
$scope.generate.status = null;
commonDialog.alert({title: 'Success', content: 'Generate Finished', type: 'success'}); commonDialog.alert({title: 'Success', content: 'Generate Finished', type: 'success'});
$scope.getYearReports($scope.params.year); $scope.getYearReports($scope.params.year);
}, function (resp) { }, function (resp) {
@ -108,8 +118,7 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
rates: function () { rates: function () {
return angular.copy($scope.bd_rate_configs); return angular.copy($scope.bd_rate_configs);
} }
}, }
size:'lg'
}).result.then(function () { }).result.then(function () {
$scope.loadRateConfigs(); $scope.loadRateConfigs();
}) })
@ -139,8 +148,8 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
value: 3, value: 3,
label: '>=7 Months' label: '>=7 Months'
}]; }];
$scope.kpiRanges = [{value: 1, label: '0-0.5'}, {value: 2, label: '0.5-0.8'}, {value: 3, label: '0.8-1'}, $scope.kpiRanges = [{value: 1, label: '0-50%'}, {value: 2, label: '50%~80%'}, {value: 3, label: '80%~100%'},
{value: 4, label: '1-1.2'}, {value: 5, label: '>=1.2'}]; {value: 4, label: '100%-120%'}, {value: 5, label: '>=120%'}];
$scope.clientRate = [{value: 0.6, label: '0.6-0.79'}, {value: 0.8, label: '0.8-2.0'}]; $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.filter = {bd_level: 1,rate_from:0.6};
$scope.rates = rates; $scope.rates = rates;

@ -1,3 +1,8 @@
<style>
.intro_color{
color:#7a869d ;
}
</style>
<div class="modal-header"> <div class="modal-header">
<h4>Commission Config</h4> <h4>Commission Config</h4>
</div> </div>
@ -57,12 +62,12 @@
</div> </div>
</div> </div>
</div> </div>
<div class="box"> <div class="box intro_color">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">跨境事业部总监提成制度</h3> <h5 class="intro_color" >跨境事业部总监提成制度</h5>
</div> </div>
<div class="box-body"> <div class="box-body">
<ul> <ul class="small">
<li>享受墨尔本和悉尼两地部门流水总和提成</li> <li>享受墨尔本和悉尼两地部门流水总和提成</li>
<li>完成当月指标低于 51%,提成按照 0.005%提取</li> <li>完成当月指标低于 51%,提成按照 0.005%提取</li>
<li>完成当月指标高于 80%,提成按照 0.008%提取</li> <li>完成当月指标高于 80%,提成按照 0.008%提取</li>
@ -72,16 +77,16 @@
</ul> </ul>
</div> </div>
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">大客户部门 Manager 提成考核指标</h3> <h5 class="intro_color">大客户部门 Manager 提成考核指标</h5>
</div> </div>
<div class="box-body"> <div class="box-body">
<ul> <ul class="small">
<li>完成月度指标,当月部门提成为该部门总流水的 0.01%</li> <li>完成月度指标,当月部门提成为该部门总流水的 0.01%</li>
<li>未完成月度指标,当月部门提成为该部门总流水的 0.005%</li> <li>未完成月度指标,当月部门提成为该部门总流水的 0.005%</li>
</ul> </ul>
</div> </div>
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">悉尼分公司总经理</h3> <h6 class="intro_color">悉尼分公司总经理</h6>
</div> </div>
<div class="box-body"> <div class="box-body">
<ul> <ul>
@ -90,20 +95,20 @@
</ul> </ul>
</div> </div>
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">南京分公司技术部提成</h3> <h5 class="intro_color">南京分公司技术部提成</h5>
</div> </div>
<div class="box-body"> <div class="box-body">
<ul> <ul class="small">
<li>完成月度指标,当月提成为公司总流水的 0.01%</li> <li>完成月度指标,当月提成为公司总流水的 0.01%</li>
<li>未完成月度指标,当月提成为公司总流水的 0.005%</li> <li>未完成月度指标,当月提成为公司总流水的 0.005%</li>
<li>【发放原则:季度一发放;分配原则由总经理 Leo Huang 制定。】</li> <li>【发放原则:季度一发放;分配原则由总经理 Leo Huang 制定。】</li>
</ul> </ul>
</div> </div>
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">COO考核及提成政策</h3> <h5 class="intro_color">COO考核及提成政策</h5>
</div> </div>
<div class="box-body"> <div class="box-body">
<ul> <ul class="small">
<li>需完成董事会下达的指标任务</li> <li>需完成董事会下达的指标任务</li>
<li>按照公司总流水进行提取(包含合伙人)</li> <li>按照公司总流水进行提取(包含合伙人)</li>
<li>每月商户数量递增不得少于 100 家</li> <li>每月商户数量递增不得少于 100 家</li>

@ -9,9 +9,25 @@
<section class="content"> <section class="content">
<div class="box box-danger" ng-if="'1000'|withRole"> <div class="box box-danger" ng-if="'1000'|withRole">
<div class="box-body"> <div class="box-body">
<button class="btn btn-danger" ng-click="generateReport()">Generate Report</button> <div class="box box-default">
<button class="btn btn-primary" ng-click="editRateConfig()"><i class="fa fa-cog"></i> Edit Rate Config</button> <div class="box-body">
<button class="btn btn-primary" ng-click="editBDLevels()"><i class="fa fa-user"></i> Edit BD Level</button> <div class="form-inline">
<div class="form-group">
<input type="text" class="form-control" uib-datepicker-popup="yyyy-MM" ng-model="generate.month"
is-open="ctrl.genmonth" datepicker-options="{minMode: 'month'}"
ng-click="ctrl.genmonth=true" placeholder="Select Month"/>
</div>
<button class="btn btn-primary" ng-click="generateReport()" ng-disabled="!generate.month">
Generate Report
</button>
<button class="btn btn-primary" ng-click="editRateConfig()"><i class="fa fa-cog"></i> Edit Rate Config</button>
<button class="btn btn-primary" ng-click="editBDLevels()"><i class="fa fa-user"></i> Edit BD Level</button>
<loadingbar ng-if="generate.status"></loadingbar>
</div>
</div>
</div>
<!--<button class="btn btn-danger" ng-click="generateReport()">Generate Report</button>-->
<!--<button class="btn btn-primary" ng-click="editCommissionConfig()"><i class="fa fa-user"></i> Edit Commission Config</button>--> <!--<button class="btn btn-primary" ng-click="editCommissionConfig()"><i class="fa fa-user"></i> Edit Commission Config</button>-->
</div> </div>
</div> </div>
@ -59,7 +75,7 @@
<thead> <thead>
<tr> <tr>
<th>BD Level</th> <th>BD Level</th>
<th rowspan="2">KPI</th> <th rowspan="2">KPI完成度</th>
<th colspan="2">Junior BD</th> <th colspan="2">Junior BD</th>
<th colspan="2">Intermediate BD</th> <th colspan="2">Intermediate BD</th>
<th colspan="2">Senior BD</th> <th colspan="2">Senior BD</th>

@ -25,7 +25,7 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th>KPI</th> <th>KPI完成度</th>
<th>BD Rate</th> <th>BD Rate</th>
</tr> </tr>
</thead> </thead>

Loading…
Cancel
Save