diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java
index 253fdd539..ad7970323 100644
--- a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java
+++ b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/BDPrizeService.java
@@ -12,7 +12,7 @@ import com.alibaba.fastjson.JSONObject;
* Created by yixian on 2017-02-07.
*/
public interface BDPrizeService {
- void generateRecord();
+ void generateRecord(String month);
@Transactional
void recordGenerateProcess(Calendar now);
diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java
index d9f54108c..317283c6a 100644
--- a/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java
+++ b/src/main/java/au/com/royalpay/payment/manage/bdprize/core/impls/BDPrizeServiceImpl.java
@@ -81,7 +81,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
private static String[] channels = new String[]{"Wechat", "Alipay", "Bestpay", "jd", "AlipayOnline","hf"};
@Override
- public void generateRecord() {
+ public void generateRecord(String month) {
if (backupSystem) {
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");
}
try {
- final Calendar now = Calendar.getInstance();
- DateUtils.truncate(now, Calendar.MONTH);
- now.add(Calendar.MONTH, -1);
+ SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM");
+ Date date = null;
+ try {
+ date = sdf.parse(month);
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }
+ Calendar now = Calendar.getInstance();
+ now.setTime(date);
recordGenerateProcess(now);
} finally {
diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java
index 65c96b428..e3e75e552 100644
--- a/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java
+++ b/src/main/java/au/com/royalpay/payment/manage/bdprize/web/BDPrizeController.java
@@ -29,9 +29,9 @@ public class BDPrizeController {
@Resource
private BDPrizeService bdPrizeService;
- @ManagerMapping(value = "/generate_record", method = RequestMethod.POST, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN})
- public void generateRecord() {
- bdPrizeService.generateRecord();
+ @ManagerMapping(value = "/generate_record/{month}", method = RequestMethod.POST, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN})
+ public void generateRecord(@PathVariable String month) {
+ bdPrizeService.generateRecord(month);
}
@ManagerMapping(value = "/records", method = RequestMethod.GET, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.BD_USER})
diff --git a/src/main/ui/static/config/bdprize/bdprize.js b/src/main/ui/static/config/bdprize/bdprize.js
index d1b163ae6..f19249c91 100644
--- a/src/main/ui/static/config/bdprize/bdprize.js
+++ b/src/main/ui/static/config/bdprize/bdprize.js
@@ -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.generate = {};
$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.kpiRanges = [{value: 1, label: '0-50%'}, {value: 2, label: '50%~80%'}, {value: 3, label: '80%~100%'},
+ {value: 4, label: '100%-120%'}, {value: 5, label: '>=120%'}];
$scope.initMonth = function (year) {
$scope.params.year = year;
$scope.months = [];
@@ -74,11 +75,20 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
};
$scope.getYearReports(new Date().getFullYear());
$scope.generateReport = function () {
+ $scope.generate.status = {};
+ if (!$scope.generate.month) {
+ commonDialog.alert({
+ type: 'error', title: 'Error', content: 'Select a month first!'
+ });
+ return;
+ }
commonDialog.confirm({
title: 'Warning',
content: 'This operation will clear the result of last month generated before. Are you sure?'
}).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'});
$scope.getYearReports($scope.params.year);
}, function (resp) {
@@ -108,8 +118,7 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
rates: function () {
return angular.copy($scope.bd_rate_configs);
}
- },
- size:'lg'
+ }
}).result.then(function () {
$scope.loadRateConfigs();
})
@@ -139,8 +148,8 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
value: 3,
label: '>=7 Months'
}];
- $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.kpiRanges = [{value: 1, label: '0-50%'}, {value: 2, label: '50%~80%'}, {value: 3, label: '80%~100%'},
+ {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.filter = {bd_level: 1,rate_from:0.6};
$scope.rates = rates;
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 b3b547119..e61375c00 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
@@ -1,3 +1,8 @@
+
@@ -57,12 +62,12 @@
-
+
-
+
- 享受墨尔本和悉尼两地部门流水总和提成
- 完成当月指标低于 51%,提成按照 0.005%提取
- 完成当月指标高于 80%,提成按照 0.008%提取
@@ -72,16 +77,16 @@
-
+
- 完成月度指标,当月部门提成为该部门总流水的 0.01%
- 未完成月度指标,当月部门提成为该部门总流水的 0.005%;
-
+
- 完成月度指标,当月提成为公司总流水的 0.01%
- 未完成月度指标,当月提成为公司总流水的 0.005%
- 【发放原则:季度一发放;分配原则由总经理 Leo Huang 制定。】
-
+
- 需完成董事会下达的指标任务
- 按照公司总流水进行提取(包含合伙人)
- 每月商户数量递增不得少于 100 家
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 406bb2f56..23183fd11 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
@@ -9,9 +9,25 @@
-
-
-
+
+
+
@@ -59,7 +75,7 @@
BD Level |
- KPI |
+ KPI完成度 |
Junior BD |
Intermediate BD |
Senior BD |
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 cacbab082..397bc2ec9 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
@@ -25,7 +25,7 @@