diff --git a/checkstyle/GeekCheckStyle.xml b/checkstyle/GeekCheckStyle.xml new file mode 100644 index 000000000..f7b6658e7 --- /dev/null +++ b/checkstyle/GeekCheckStyle.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/checkstyle/checkstyle-8.38-all.jar b/checkstyle/checkstyle-8.38-all.jar new file mode 100644 index 000000000..52076fe4f Binary files /dev/null and b/checkstyle/checkstyle-8.38-all.jar differ diff --git a/checkstyle/pre-commit b/checkstyle/pre-commit new file mode 100644 index 000000000..274e80d25 --- /dev/null +++ b/checkstyle/pre-commit @@ -0,0 +1,62 @@ +#! /bin/bash +# @author:haloo# +#@func:pre-commit# +## cp ./checkstyle/pre-commit ./.git/hooks/ + +echo 避免NPE是程序员的基本修养 +echo 开始style checking + +wd=`pwd` +echo "当前工作目录:$wd" + +# check-style版本号 +check_style_version="checkstyle-8.38-all.jar" +check_style_xml_name="GeekCheckStyle.xml" +check_jar_path="$wd/checkstyle/$check_style_version" +check_xml_path="$wd/checkstyle/$check_style_xml_name" + +## 清空temp文件 + +rm -f temp + +is_err=0 +errorCount=0 +warnCount=0 + +## 查找add到git 缓冲区中,以.java后缀的文件 +for file in `git status --porcelain | sed s/^...// | grep '\.java$'`; do + path="$wd/$file" + echo "检查文件: $path" + re=`java -jar $check_jar_path -c $check_xml_path $path >> temp` + + warn=`cat temp | grep "WARN"` + if [[ $warn = *"WARN"* ]];then + echo "${warn}" + needle="WARN" + number_of_occurrences=$(grep -o "$needle" <<< "$warn" | wc -l) + ((warnCount = warnCount + number_of_occurrences)) + is_err=1 + fi + + err=`cat temp | grep "ERROR"` + if [[ $err = *"ERROR"* ]];then + echo "${err}" + needle="ERROR" + number_of_occurrences=$(grep -o "$needle" <<< "$err" | wc -l) + ((errorCount = errorCount + number_of_occurrences)) + is_err=1 + fi +done + +echo "检查完成,祝你好运" + +rm -f temp + +if [ $is_err -ne 0 ];then + echo "出现了 $errorCount 个error" + echo "出现了 $warnCount 个warn" + echo "请先符合style才能提交" + exit 1 +fi +echo "No Bug ,It is Good!!" +exit 0 diff --git a/init.sh b/init.sh new file mode 100644 index 000000000..42f10fb1c --- /dev/null +++ b/init.sh @@ -0,0 +1,2 @@ +cp checkstyle/pre-commit .git/hooks/ +chmod +x .git/hooks/pre-commit diff --git a/pom.xml b/pom.xml index a3ca784e9..6d785065f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 2.2.25 + 2.2.26 4.0.0 manage - 2.3.76-SNAPSHOT + 2.3.77 UTF-8 2.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java index 86bb7a7fd..6ba0d197d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java @@ -1,7 +1,7 @@ package au.com.royalpay.payment.manage.appclient.beans; import au.com.royalpay.payment.core.beans.OrderStatus; -import au.com.royalpay.payment.core.beans.PayChannel; +import au.com.royalpay.payment.core.beans.PayChannelSearch; import au.com.royalpay.payment.tools.defines.TradeType; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; @@ -25,7 +25,7 @@ public class AppQueryBean { private String[] client_ids; private String app_client_ids; private OrderStatus status = OrderStatus.ALL; - private PayChannel channel = PayChannel.ALL; + private PayChannelSearch channel = PayChannelSearch.ALL; private int[] gateway; private int clearing_status=-1; private String gateway_app; @@ -164,11 +164,11 @@ public class AppQueryBean { this.app_client_ids = app_client_ids; } - public PayChannel getChannel() { + public PayChannelSearch getChannel() { return channel; } - public void setChannel(PayChannel channel) { + public void setChannel(PayChannelSearch channel) { this.channel = channel; } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java index fb3a04fd6..d99e2d39c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java @@ -1,11 +1,8 @@ package au.com.royalpay.payment.manage.dev.core.impl; -import au.com.royalpay.payment.channels.rpay.runtime.RpayApi; import au.com.royalpay.payment.manage.dev.core.ManualService; import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; -import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; import au.com.royalpay.payment.manage.task.PostponeClientTask; import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; import com.alibaba.fastjson.JSONObject; @@ -37,12 +34,6 @@ public class ManualServiceimpl implements ManualService { private ClientAccountMapper clientAccountMapper; @Resource private SynchronizedScheduler synchronizedScheduler; - @Resource - private ClientModifySupport clientModifySupport; - @Resource - private RpayApi rpayApi; - @Resource - private ClientMapper clientMapper; @Override public void clientPostpone() { diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java index d284d8ff7..936b2f5b6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java @@ -1,7 +1,7 @@ package au.com.royalpay.payment.manage.tradelog.beans; import au.com.royalpay.payment.core.beans.OrderStatus; -import au.com.royalpay.payment.core.beans.PayChannel; +import au.com.royalpay.payment.core.beans.PayChannelSearch; import au.com.royalpay.payment.tools.defines.TradeType; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; @@ -29,7 +29,7 @@ public class TradeLogQuery { private int[] gateway; private String source = "ALL" ; private OrderStatus status = OrderStatus.PAID; - private PayChannel channel = PayChannel.ALL; + private PayChannelSearch channel = PayChannelSearch.ALL; private String[] client_ids; private String dev_id; private int clearing_status; @@ -225,11 +225,11 @@ public class TradeLogQuery { return trans_type; } - public PayChannel getChannel() { + public PayChannelSearch getChannel() { return channel; } - public void setChannel(PayChannel channel) { + public void setChannel(PayChannelSearch channel) { this.channel = channel; } diff --git a/src/main/resources/application-officedev.yml b/src/main/resources/application-officedev.yml index 41b67c62f..f0bab2078 100644 --- a/src/main/resources/application-officedev.yml +++ b/src/main/resources/application-officedev.yml @@ -1,20 +1,20 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - host: 192.168.0.84:3306 + host: 192.168.0.92:3306 master: driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false password: ${spring.datasource.pwd} username: ${spring.datasource.user} - pwd: rpayplus + pwd: SuTUUxyvzS0cLETi6Rzm schema-name: royalpay slave: driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false password: ${spring.datasource.pwd} username: ${spring.datasource.user} - user: root + user: rpaydev redis: database: 9 host: 192.168.0.84 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 671b83a4c..bf9fc95dd 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -18,8 +18,6 @@ jetty: multipart: max-file-size: 10Mb app: - active: - channels: Wechat,Alipay,AlipayOnline,Gmo,UnionPay,AlipayPlus crossapp: enable: true agreetemplate: diff --git a/src/main/ui/static/analysis/settle_report.js b/src/main/ui/static/analysis/settle_report.js index b7f907541..5b823ff3c 100644 --- a/src/main/ui/static/analysis/settle_report.js +++ b/src/main/ui/static/analysis/settle_report.js @@ -2,57 +2,63 @@ * Created by yixian on 2017-05-03. */ define(['angular', 'decimal', 'uiRouter', './report/analysis-report'], function (angular, Decimal) { - 'use strict'; - var app = angular.module('settleReportApp', ['ui.router']); - app.config(['$stateProvider', function ($stateProvider) { - $stateProvider.state('analysis_report.settle_report', { - url: '/settle_report', - templateUrl: '/static/analysis/templates/settle_report.html', - controller: 'settleFinancialReportCtrl' + 'use strict' + var app = angular.module('settleReportApp', ['ui.router']) + app.config([ + '$stateProvider', + function ($stateProvider) { + $stateProvider.state('analysis_report.settle_report', { + url: '/settle_report', + templateUrl: '/static/analysis/templates/settle_report.html', + controller: 'settleFinancialReportCtrl', + }) + }, + ]) + app.controller('settleFinancialReportCtrl', [ + '$scope', + '$http', + '$filter', + function ($scope, $http, $filter) { + $scope.params = { year: new Date() } + $scope.initMonth = function () { + const year = $scope.params.year.getFullYear() + $scope.months = [] + for (var i = 1; i < 13; i++) { + var mon = '00' + i + mon = mon.substr(mon.length - 2, 2) + $scope.months.push(year + '-' + mon) + } + } + $scope.initMonth() + $scope.hasReport = function (mon) { + var end = $filter('date')(new Date(), 'yyyy-MM') + return end >= mon + } + $scope.loadReport = function (mon) { + var monItems = mon.split('-') + var year = monItems[0] + var month = monItems[1] + var monStr = year + month + $http.get('/sys/financial/settlement/month_reports/' + monStr).then(function (resp) { + $scope.report = { + month: monStr, + settlements: resp.data, + } + $scope.analysis = { + gross_amount: 0, + wechat_settlement: 0, + net_amount: 0, + royalpay_charge: 0, + } + angular.forEach($scope.report.settlements, function (settle) { + $scope.analysis.gross_amount = Decimal.add(settle.gross_amount, $scope.analysis.gross_amount).toFixed(2) + $scope.analysis.wechat_settlement = Decimal.add(settle.wechat_settlement, $scope.analysis.wechat_settlement).toFixed(2) + $scope.analysis.net_amount = Decimal.add(settle.net_amount, $scope.analysis.net_amount).toFixed(2) + $scope.analysis.royalpay_charge = Decimal.add(settle.royalpay_charge, $scope.analysis.royalpay_charge).toFixed(2) + }) }) - }]); - app.controller('settleFinancialReportCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) { - $scope.params = {year: new Date().getFullYear()}; - $scope.availableYears = [new Date().getFullYear() - 1, new Date().getFullYear()]; - $scope.initMonth = function (year) { - $scope.params.year = year; - $scope.months = []; - for (var i = 1; i < 13; i++) { - var mon = '00' + i; - mon = mon.substr(mon.length - 2, 2); - $scope.months.push(year + '-' + mon); - } - }; - $scope.initMonth(new Date().getFullYear()); - $scope.hasReport = function (mon) { - var start = '2017-02';//todo modify in different country - var end = $filter('date')(new Date(), 'yyyy-MM'); - return start <= mon && end >= mon - }; - $scope.loadReport = function (mon) { - var monItems = mon.split('-'); - var year = monItems[0]; - var month = monItems[1]; - var monStr = year + month; - $http.get('/sys/financial/settlement/month_reports/' + monStr).then(function (resp) { - $scope.report = { - month: monStr, - settlements: resp.data - }; - $scope.analysis = { - gross_amount: 0, - wechat_settlement: 0, - net_amount: 0, - royalpay_charge: 0 - }; - angular.forEach($scope.report.settlements, function (settle) { - $scope.analysis.gross_amount = Decimal.add(settle.gross_amount, $scope.analysis.gross_amount).toFixed(2); - $scope.analysis.wechat_settlement = Decimal.add(settle.wechat_settlement, $scope.analysis.wechat_settlement).toFixed(2); - $scope.analysis.net_amount = Decimal.add(settle.net_amount, $scope.analysis.net_amount).toFixed(2); - $scope.analysis.royalpay_charge = Decimal.add(settle.royalpay_charge, $scope.analysis.royalpay_charge).toFixed(2); - }); - }) - }; - }]); - return app; -}); \ No newline at end of file + } + }, + ]) + return app +}) diff --git a/src/main/ui/static/analysis/templates/settle_report.html b/src/main/ui/static/analysis/templates/settle_report.html index b335ae010..c91528f4d 100644 --- a/src/main/ui/static/analysis/templates/settle_report.html +++ b/src/main/ui/static/analysis/templates/settle_report.html @@ -10,20 +10,23 @@
- -
+ + +
@@ -40,38 +43,39 @@
- - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + +
清算日期净交易额(扣除退款)清算总额清算给商户总额RoyalPay手续费
清算日期净交易额(扣除退款)清算总额清算给商户总额RoyalPay手续费
Total
Total
diff --git a/src/main/ui/static/config/bdprize/bdprize.js b/src/main/ui/static/config/bdprize/bdprize.js index b3ad7aded..16a873dd7 100644 --- a/src/main/ui/static/config/bdprize/bdprize.js +++ b/src/main/ui/static/config/bdprize/bdprize.js @@ -2,427 +2,532 @@ * Created by yixian on 2017-02-08. */ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { - 'use strict'; - var app = angular.module('bdprize', ['ui.router']); - app.config(['$stateProvider', function ($stateProvider) { - $stateProvider.state('analysis_bd.bd_prizes', { - url: '/bd_prizes', - templateUrl: '/static/config/bdprize/templates/bd_prize_root.html', - controller: 'bdPrizeRootCtrl' - }).state('analysis_bd.bd_prizes.month_report', { - url: '/{month}', - templateUrl: '/static/config/bdprize/templates/bd_prize_month_report.html', - controller: 'bdPrizeMonthReportCtrl', - resolve: { - report: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/sys/bd_prize/records/' + $stateParams.month); - }] - } - }).state('analysis_bd.bd_prizes.month_report.detail', { - url: '/bd_user/{bdId}', - templateUrl: '/static/config/bdprize/templates/bd_prize_detail.html', - controller: 'bdPrizeDetailCtrl', - resolve: { - detail: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/sys/bd_prize/records/' + $stateParams.month + '/bd_users/' + $stateParams.bdId); - }] - } - }).state('analysis_bd.bd_prizes.bd_detail', { - url: '/{month}/my_report', - templateUrl: '/static/config/bdprize/templates/bd_prize_detail.html', - controller: 'bdPrizeDetailCtrl', - resolve: { - detail: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/sys/bd_prize/records/' + $stateParams.month + '/bd_user_detail') - }] - } + 'use strict' + var app = angular.module('bdprize', ['ui.router']) + app.config([ + '$stateProvider', + function ($stateProvider) { + $stateProvider + .state('analysis_bd.bd_prizes', { + url: '/bd_prizes', + templateUrl: '/static/config/bdprize/templates/bd_prize_root.html', + controller: 'bdPrizeRootCtrl', + }) + .state('analysis_bd.bd_prizes.month_report', { + url: '/{month}', + templateUrl: '/static/config/bdprize/templates/bd_prize_month_report.html', + controller: 'bdPrizeMonthReportCtrl', + resolve: { + report: [ + '$http', + '$stateParams', + function ($http, $stateParams) { + return $http.get('/sys/bd_prize/records/' + $stateParams.month) + }, + ], + }, + }) + .state('analysis_bd.bd_prizes.month_report.detail', { + url: '/bd_user/{bdId}', + templateUrl: '/static/config/bdprize/templates/bd_prize_detail.html', + controller: 'bdPrizeDetailCtrl', + resolve: { + detail: [ + '$http', + '$stateParams', + function ($http, $stateParams) { + return $http.get('/sys/bd_prize/records/' + $stateParams.month + '/bd_users/' + $stateParams.bdId) + }, + ], + }, }) - }]); + .state('analysis_bd.bd_prizes.bd_detail', { + url: '/{month}/my_report', + templateUrl: '/static/config/bdprize/templates/bd_prize_detail.html', + controller: 'bdPrizeDetailCtrl', + resolve: { + detail: [ + '$http', + '$stateParams', + function ($http, $stateParams) { + return $http.get('/sys/bd_prize/records/' + $stateParams.month + '/bd_user_detail') + }, + ], + }, + }) + }, + ]) - 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-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 = []; - for (var i = 1; i < 13; i++) { - var mon = '00' + i; - mon = mon.substr(mon.length - 2, 2); - $scope.months.push(year + '-' + mon); - } - }; - $scope.hasReport = function (mon) { - if ($scope.reportMonths != null) { - var have = false; - angular.forEach($scope.reportMonths, function (month) { - if (mon == month.month) { - have = true; - } - }); - return have; - } else { - return false; - } - }; - $scope.getYearReports = function (year) { - $scope.initMonth(year); - $http.get('/sys/bd_prize/records', {params: {year: year}}).then(function (resp) { - $scope.reportMonths = resp.data.data; - }) - }; - $scope.getYearReports(new Date().getFullYear()); - $scope.generateReport = function () { - if (!$scope.generate.month) { - commonDialog.alert({ - type: 'error', title: 'Error', content: 'Select a month first!' - }); - return; + app.controller('bdPrizeRootCtrl', [ + '$scope', + '$http', + '$uibModal', + 'commonDialog', + '$filter', + function ($scope, $http, $uibModal, commonDialog, $filter) { + $scope.params = { year: new Date() } + $scope.generate = {} + $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 () { + const year = $scope.params.year.getFullYear() + $scope.months = [] + for (var i = 1; i < 13; i++) { + var mon = '00' + i + mon = mon.substr(mon.length - 2, 2) + $scope.months.push(year + '-' + mon) + } + } + $scope.hasReport = function (mon) { + if ($scope.reportMonths != null) { + var have = false + angular.forEach($scope.reportMonths, function (month) { + if (mon == month.month) { + have = true } - commonDialog.confirm({ - title: 'Warning', - content: 'This operation will clear the result of last month generated before. Are you sure?' - }).then(function () { - $scope.generate.status = {}; - var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')}; - $http.post('/sys/bd_prize/generate_record/'+params.month, null, {timeout: 60000}).then(function (resp) { - $scope.generate.status = null; - commonDialog.alert({title: 'Success', content: 'Generate Finished', type: 'success'}); - $scope.getYearReports($scope.params.year); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - $scope.generate.status = null; - }) - }) - }; - $scope.loadRateConfigs = function () { - $http.get('/sys/bd_prize/config/rates').then(function (resp) { - $scope.bd_rate_configs = resp.data; - $scope.kpi_ranges = []; - var kpiStart = []; - angular.forEach($scope.bd_rate_configs, function (cfg) { - if (kpiStart.indexOf(cfg.kpi_range) < 0) { - kpiStart.push(cfg.kpi_range); - $scope.kpi_ranges.push(cfg); - } - }) - }) - }; - $scope.loadRateConfigs(); - $scope.editRateConfig = function () { - $uibModal.open({ - backdrop: 'static', keyboard: false, - templateUrl: '/static/config/bdprize/templates/rate_config_dialog.html', - controller: 'bdRateConfigCtrl', - resolve: { - rates: function () { - return angular.copy($scope.bd_rate_configs); - } - } - }).result.then(function () { - $scope.loadRateConfigs(); - }) - }; - $scope.editBDLevels = function () { - $uibModal.open({ - backdrop: 'static', keyboard: false, - templateUrl: '/static/config/bdprize/templates/bd_level_config_dialog.html', - size: 'lg', - controller: 'bdLevelConfigCtrl' - }) - }; - $scope.editCommissionConfig = function (monModal) { - $uibModal.open({ - backdrop: 'static', keyboard: false, - templateUrl: '/static/config/bdprize/templates/bd_commission_config_dialog.html', - controller: 'bdCommissionConfigCtrl', - size: 'lg', - resolve: { - monModal: function () { - return angular.copy(monModal); - } - } - }) - }; - $scope.exportCommission = function (monModal) { - location.href = '/sys/bd_prize/commission/export/' + monModal; - }; - - $scope.loadPersonalCommission = function () { - if (($scope.currentUser.role & parseInt('100', 2)) > 0 && $scope.currentUser.org_id === 1) { - $http.get('/sys/bd_prize/commission/personal/bd_user').then(function (resp) { - $scope.personalCommission = resp.data; - }) + }) + return have + } else { + return false + } + } + $scope.getYearReports = function () { + const year = $scope.params.year.getFullYear() + $scope.initMonth() + $http.get('/sys/bd_prize/records', { params: { year: year } }).then(function (resp) { + $scope.reportMonths = resp.data.data + }) + } + $scope.getYearReports() + $scope.generateReport = function () { + 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 () { + $scope.generate.status = {} + var params = { month: $filter('date')($scope.generate.month, 'yyyy-MM') } + $http.post('/sys/bd_prize/generate_record/' + params.month, null, { timeout: 60000 }).then( + function (resp) { + $scope.generate.status = null + commonDialog.alert({ title: 'Success', content: 'Generate Finished', type: 'success' }) + $scope.getYearReports() + }, + function (resp) { + commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) + $scope.generate.status = null + } + ) + }) + } + $scope.loadRateConfigs = function () { + $http.get('/sys/bd_prize/config/rates').then(function (resp) { + $scope.bd_rate_configs = resp.data + $scope.kpi_ranges = [] + var kpiStart = [] + angular.forEach($scope.bd_rate_configs, function (cfg) { + if (kpiStart.indexOf(cfg.kpi_range) < 0) { + kpiStart.push(cfg.kpi_range) + $scope.kpi_ranges.push(cfg) } + }) + }) + } + $scope.loadRateConfigs() + $scope.editRateConfig = function () { + $uibModal + .open({ + backdrop: 'static', + keyboard: false, + templateUrl: '/static/config/bdprize/templates/rate_config_dialog.html', + controller: 'bdRateConfigCtrl', + resolve: { + rates: function () { + return angular.copy($scope.bd_rate_configs) + }, + }, + }) + .result.then(function () { + $scope.loadRateConfigs() + }) + } + $scope.editBDLevels = function () { + $uibModal.open({ + backdrop: 'static', + keyboard: false, + templateUrl: '/static/config/bdprize/templates/bd_level_config_dialog.html', + size: 'lg', + controller: 'bdLevelConfigCtrl', + }) + } + $scope.editCommissionConfig = function (monModal) { + $uibModal.open({ + backdrop: 'static', + keyboard: false, + templateUrl: '/static/config/bdprize/templates/bd_commission_config_dialog.html', + controller: 'bdCommissionConfigCtrl', + size: 'lg', + resolve: { + monModal: function () { + return angular.copy(monModal) + }, + }, + }) + } + $scope.exportCommission = function (monModal) { + location.href = '/sys/bd_prize/commission/export/' + monModal + } - }; - $scope.loadPersonalCommission(); - }]); - app.controller('bdRateConfigCtrl', ['$scope', '$http', 'rates', function ($scope, $http, rates) { - $scope.bdLevels = [{value: 1, label: 'Junior'}, {value: 2, label: 'Intermediate'}, {value: 3, label: 'Senior'}]; - $scope.months = [{value: 1, label: '1-3 Months'}, {value: 2, label: '4-6 Months'}, { - value: 3, - label: '>=7 Months' - }]; - $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; - $scope.submitRates = function () { - var validation = null; - $scope.errmsg = null; - angular.forEach($scope.rates, function (rate) { - if (isNaN(rate.prize_rate)) { - validation = {months: rate.time_range, bd_level: rate.bd_level}; - $scope.errmsg = 'Rate Value is NaN'; - } - if (rate.prize_rate > 1) { - validation = {months: rate.time_range, bd_level: rate.bd_level}; - $scope.errmsg = 'Rate value shall no more than 1%'; - } - if (rate.prize_rate < 0) { - validation = {months: rate.time_range, bd_level: rate.bd_level}; - $scope.errmsg = 'Rate value shall be a positive value'; - } - }); - if (!validation) { - $http.put('/sys/bd_prize/config/rates', $scope.rates).then(function () { - $scope.$close(); - }, function (resp) { - $scope.errmsg = resp.data.message; - }) - } + $scope.loadPersonalCommission = function () { + if (($scope.currentUser.role & parseInt('100', 2)) > 0 && $scope.currentUser.org_id === 1) { + $http.get('/sys/bd_prize/commission/personal/bd_user').then(function (resp) { + $scope.personalCommission = resp.data + }) } - }]); - app.controller('bdLevelConfigCtrl', ['$scope', '$http', function ($scope, $http) { - $scope.bdtypes = [{id: 1, label: 'BD Manager(Sydney)'}, {id: 2, label: 'KA Manager(Sydney)'},{id: 6, label: 'BD Manager(Melbourne)'}, {id: 7, label: 'KA Manager(Melbourne)'}]; - $scope.getBDGroups = function () { - $http.get('/sys/manager_accounts/roles/bd_leader').then(function (resp) { - $scope.bdgroups = resp.data; - $scope.getBDLevels(); - }) - }; - $scope.getBDGroups(); - $scope.getBDLevels = function () { - $http.get('/sys/bd_prize/config/bd_levels').then(function (resp) { - $scope.bds = resp.data; - }) - }; - - $scope.bdLevels = [{value: 1, label: 'Junior'}, {value: 2, label: 'Intermediate'}, {value: 3, label: 'Senior'}]; - $scope.updateBDLevel = function (bdInfo) { - $http.put('/sys/bd_prize/config/bd_levels/' + bdInfo.manager_id, bdInfo).then(function () { - $scope.getBDGroups(); - }, function (resp) { - $scope.errmsg = resp.data.message; - }) - }; - }]); - 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: 'BD Manager(Sydney)'}, {id: 2, label: 'KA Manager(Sydney)'}, {id: 6, label: 'BD Manager(Melbourne)'}, {id: 7, label: 'KA Manager(Melbourne)'}];//, {id: 3, label: 'Sydney GM'},{id: 4, label: 'COO'},{id: 5, label: 'NJ Department'}]; - // $scope.bdmon; - // $scope.newSwitch; - $scope.initMonth = function (year) { - $scope.params.year = year; - $scope.months = []; - for (var i = 1; i < 13; i++) { - var mon = '00' + i; - mon = mon.substr(mon.length - 2, 2); - $scope.months.push(year + '-' + mon); - } - }; - $scope.initMonth(new Date().getFullYear()); - $scope.hasReport = function (mon) { - var start = '2017-01';//todo change for different country - var end = $filter('date')(new Date(), 'yyyy-MM'); - return start <= mon && end >= mon - }; - $scope.getBDLevels = function () { - $http.get('/sys/bd_prize/config/bd_levels').then(function (resp) { - $scope.bds = resp.data; - }) - }; - $scope.getBDLevels(); - $scope.chooseLastConfig = function (mon) { - let year = new Date(mon).getFullYear(); - let month = new Date(mon).getMonth(); - if(month == 0){ - year--; - month = year + '-12'; - }else if(month <= 9){ - month = year + '-0' + month; - }else { - month = year + '-' + month; + } + $scope.loadPersonalCommission() + }, + ]) + app.controller('bdRateConfigCtrl', [ + '$scope', + '$http', + 'rates', + function ($scope, $http, rates) { + $scope.bdLevels = [ + { value: 1, label: 'Junior' }, + { value: 2, label: 'Intermediate' }, + { value: 3, label: 'Senior' }, + ] + $scope.months = [ + { value: 1, label: '1-3 Months' }, + { value: 2, label: '4-6 Months' }, + { + value: 3, + label: '>=7 Months', + }, + ] + $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 + $scope.submitRates = function () { + var validation = null + $scope.errmsg = null + angular.forEach($scope.rates, function (rate) { + if (isNaN(rate.prize_rate)) { + validation = { months: rate.time_range, bd_level: rate.bd_level } + $scope.errmsg = 'Rate Value is NaN' + } + if (rate.prize_rate > 1) { + validation = { months: rate.time_range, bd_level: rate.bd_level } + $scope.errmsg = 'Rate value shall no more than 1%' + } + if (rate.prize_rate < 0) { + validation = { months: rate.time_range, bd_level: rate.bd_level } + $scope.errmsg = 'Rate value shall be a positive value' + } + }) + if (!validation) { + $http.put('/sys/bd_prize/config/rates', $scope.rates).then( + function () { + $scope.$close() + }, + function (resp) { + $scope.errmsg = resp.data.message } - $http.get('/sys/bd_prize/commission/le_ma/' + month).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; - $scope.bdmon = mon; - $scope.listConfig = true; - }) - }; - $scope.listCurrentMonBDCommission($scope.monModal); - $scope.deleteCommission = function (config) { - $http.delete('sys/bd_prize/commission/delete/' + config) - $scope.listCurrentMonBDCommission($scope.monModal); - $state.reload(); + ) } - $scope.submitCommmissionConfig = function (mon, bdlm) { - $scope.check = true; - angular.forEach(bdlm, function (data, index) { - $scope.errmsg = null; - if (!data.bd_type) { - $scope.errmsg = "BD Type not be null"; - $scope.check = false; - return; - } - if (!data.bd_commission_rate) { - $scope.errmsg = "BD Rate not be null"; - $scope.check = false; - return; - } - if (data.bd_commission_rate) { - if (data.bd_commission_rate > 10) { - $scope.errmsg = "BD Rate is too big"; - $scope.check = false; - return; - } - } - if (!data.commission_start_amount && data.commission_start_amount != 0) { - $scope.errmsg = "Commission Amount not be null"; - $scope.check = false; - return; - } - if (data.commission_end_amount || data.commission_end_amount == 0) { - if (data.commission_start_amount >= data.commission_end_amount) { - $scope.errmsg = "Commission Start Amount should less than End Amount"; - $scope.check = false; - return; - } - } - }); - if ($scope.check) { - $http.post('/sys/bd_prize/commission/le_ma/update/' + mon, bdlm).then(function (resp) { - $scope.$close(); - // $scope.bdlm = null; - // $scope.bdmon; - // $scope.listConfig = false; - // $scope.listCurrentMonBDCommission(mon); - }) - } + } + }, + ]) + app.controller('bdLevelConfigCtrl', [ + '$scope', + '$http', + function ($scope, $http) { + $scope.bdtypes = [ + { id: 1, label: 'BD Manager(Sydney)' }, + { id: 2, label: 'KA Manager(Sydney)' }, + { id: 6, label: 'BD Manager(Melbourne)' }, + { id: 7, label: 'KA Manager(Melbourne)' }, + ] + $scope.getBDGroups = function () { + $http.get('/sys/manager_accounts/roles/bd_leader').then(function (resp) { + $scope.bdgroups = resp.data + $scope.getBDLevels() + }) + } + $scope.getBDGroups() + $scope.getBDLevels = function () { + $http.get('/sys/bd_prize/config/bd_levels').then(function (resp) { + $scope.bds = resp.data + }) + } + + $scope.bdLevels = [ + { value: 1, label: 'Junior' }, + { value: 2, label: 'Intermediate' }, + { value: 3, label: 'Senior' }, + ] + $scope.updateBDLevel = function (bdInfo) { + $http.put('/sys/bd_prize/config/bd_levels/' + bdInfo.manager_id, bdInfo).then( + function () { + $scope.getBDGroups() + }, + function (resp) { + $scope.errmsg = resp.data.message + } + ) + } + }, + ]) + 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: 'BD Manager(Sydney)' }, + { id: 2, label: 'KA Manager(Sydney)' }, + { id: 6, label: 'BD Manager(Melbourne)' }, + { id: 7, label: 'KA Manager(Melbourne)' }, + ] //, {id: 3, label: 'Sydney GM'},{id: 4, label: 'COO'},{id: 5, label: 'NJ Department'}]; + // $scope.bdmon; + // $scope.newSwitch; + $scope.initMonth = function (year) { + $scope.params.year = year + $scope.months = [] + for (var i = 1; i < 13; i++) { + var mon = '00' + i + mon = mon.substr(mon.length - 2, 2) + $scope.months.push(year + '-' + mon) } - $scope.submitBdCommmissionConfig = function (mon, bds) { - $scope.check = true; - $scope.errmsg = null; - angular.forEach(bds, function (data, index) { - if(data.get_prize){ - if (!data.kpi_amount) { - $scope.errmsg = "BD kpi Amount not be null"; - $scope.check = false; - return; - } - } - }); - if ($scope.check) { - $http.post('/sys/bd_prize/commission/kpi/update/' + mon, bds).then(function (resp) { - $scope.$close(); - }) - } + } + $scope.initMonth(new Date().getFullYear()) + $scope.hasReport = function (mon) { + var start = '2017-01' //todo change for different country + var end = $filter('date')(new Date(), 'yyyy-MM') + return start <= mon && end >= mon + } + $scope.getBDLevels = function () { + $http.get('/sys/bd_prize/config/bd_levels').then(function (resp) { + $scope.bds = resp.data + }) + } + $scope.getBDLevels() + $scope.chooseLastConfig = function (mon) { + let year = new Date(mon).getFullYear() + let month = new Date(mon).getMonth() + if (month == 0) { + year-- + month = year + '-12' + } else if (month <= 9) { + month = year + '-0' + month + } else { + month = year + '-' + month } - }]); - app.controller('bdPrizeMonthReportCtrl', ['$scope', '$http', 'report', function ($scope, $http, report) { - $scope.report = report.data; - }]); - app.controller('bdPrizeDetailCtrl', ['$scope', 'detail', function ($scope, detail) { - $scope.detail = detail.data; - }]); - app.filter('financialBdLevel', function () { - return function (level) { - switch (level) { - case 0: - return 'Leader'; - case 1: - return 'Junior'; - case 2: - return 'Intermediate'; - case 3: - return 'Senior'; - default: - return 'Unknown'; + $http.get('/sys/bd_prize/commission/le_ma/' + month).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 + $scope.bdmon = mon + $scope.listConfig = true + }) + } + $scope.listCurrentMonBDCommission($scope.monModal) + $scope.deleteCommission = function (config) { + $http.delete('sys/bd_prize/commission/delete/' + config) + $scope.listCurrentMonBDCommission($scope.monModal) + $state.reload() + } + $scope.submitCommmissionConfig = function (mon, bdlm) { + $scope.check = true + angular.forEach(bdlm, function (data, index) { + $scope.errmsg = null + if (!data.bd_type) { + $scope.errmsg = 'BD Type not be null' + $scope.check = false + return + } + if (!data.bd_commission_rate) { + $scope.errmsg = 'BD Rate not be null' + $scope.check = false + return + } + if (data.bd_commission_rate) { + if (data.bd_commission_rate > 10) { + $scope.errmsg = 'BD Rate is too big' + $scope.check = false + return } - } - }); - app.filter('financialClientSource', function () { - return function (source) { - switch (source) { - case 1: - return 'BD'; - case 2: - return 'Apply'; - case 3: - return 'Distribute'; - default: - return 'Unknown'; + } + if (!data.commission_start_amount && data.commission_start_amount != 0) { + $scope.errmsg = 'Commission Amount not be null' + $scope.check = false + return + } + if (data.commission_end_amount || data.commission_end_amount == 0) { + if (data.commission_start_amount >= data.commission_end_amount) { + $scope.errmsg = 'Commission Start Amount should less than End Amount' + $scope.check = false + return } + } + }) + if ($scope.check) { + $http.post('/sys/bd_prize/commission/le_ma/update/' + mon, bdlm).then(function (resp) { + $scope.$close() + // $scope.bdlm = null; + // $scope.bdmon; + // $scope.listConfig = false; + // $scope.listCurrentMonBDCommission(mon); + }) } - }); - app.filter('prizeLogsFilter', [function () { - return function (arr, filterObj) { - if (arr == null || filterObj == null) { - return arr; + } + $scope.submitBdCommmissionConfig = function (mon, bds) { + $scope.check = true + $scope.errmsg = null + angular.forEach(bds, function (data, index) { + if (data.get_prize) { + if (!data.kpi_amount) { + $scope.errmsg = 'BD kpi Amount not be null' + $scope.check = false + return } - return arr.filter(function (item) { - return item.prize_type == filterObj - }) + } + }) + if ($scope.check) { + $http.post('/sys/bd_prize/commission/kpi/update/' + mon, bds).then(function (resp) { + $scope.$close() + }) } - }]); - app.filter('channel_image', function () { - return function (channel) { - switch (channel) { - case 'Alipay': - return '/static/images/alipay_sign_lg.png'; - case 'AlipayOnline': - return '/static/images/alipay_online.png'; - case 'System': - return '/static/images/royalpay_sign.png'; - case 'Bestpay': - return '/static/images/bestpay_sign_lg.png'; - case 'Wechat': - return '/static/images/wechatpay_sign_lg.png'; - case 'jd': - return '/static/images/jd_sign_lg.png'; - case 'hf': - return '/static/images/hf_sign_lg.png'; - case 'Rpay': - return '/static/images/rpayplus_sign_lg.png'; - case 'Yeepay': - return '/static/images/yeepay_sign_lg.png'; - case 'LakalaPay': - return '/static/images/lakalapay_sign_lg.png'; - case 'rpaypmt_card': - return '/static/images/card_payment_sign_lg.png'; - case 'rpaypmt_dd': - return '/static/images/direct_debit_sign_lg.png'; - } + } + }, + ]) + app.controller('bdPrizeMonthReportCtrl', [ + '$scope', + '$http', + 'report', + function ($scope, $http, report) { + $scope.report = report.data + }, + ]) + app.controller('bdPrizeDetailCtrl', [ + '$scope', + 'detail', + function ($scope, detail) { + $scope.detail = detail.data + }, + ]) + app.filter('financialBdLevel', function () { + return function (level) { + switch (level) { + case 0: + return 'Leader' + case 1: + return 'Junior' + case 2: + return 'Intermediate' + case 3: + return 'Senior' + default: + return 'Unknown' + } + } + }) + app.filter('financialClientSource', function () { + return function (source) { + switch (source) { + case 1: + return 'BD' + case 2: + return 'Apply' + case 3: + return 'Distribute' + default: + return 'Unknown' + } + } + }) + app.filter('prizeLogsFilter', [ + function () { + return function (arr, filterObj) { + if (arr == null || filterObj == null) { + return arr } - }); - return app; -}); + return arr.filter(function (item) { + return item.prize_type == filterObj + }) + } + }, + ]) + app.filter('channel_image', function () { + return function (channel) { + switch (channel) { + case 'Alipay': + return '/static/images/alipay_sign_lg.png' + case 'AlipayOnline': + return '/static/images/alipay_online.png' + case 'System': + return '/static/images/royalpay_sign.png' + case 'Bestpay': + return '/static/images/bestpay_sign_lg.png' + case 'Wechat': + return '/static/images/wechatpay_sign_lg.png' + case 'jd': + return '/static/images/jd_sign_lg.png' + case 'hf': + return '/static/images/hf_sign_lg.png' + case 'Rpay': + return '/static/images/rpayplus_sign_lg.png' + case 'Yeepay': + return '/static/images/yeepay_sign_lg.png' + case 'LakalaPay': + return '/static/images/lakalapay_sign_lg.png' + case 'rpaypmt_card': + return '/static/images/card_payment_sign_lg.png' + case 'rpaypmt_dd': + return '/static/images/direct_debit_sign_lg.png' + } + } + }) + return app +}) 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 dc4b7f769..f7dd99284 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 @@ -13,15 +13,17 @@
- - - + + + - + - - + +
@@ -33,30 +35,29 @@
- -
- -
+ +
-

+

-

+

@@ -73,43 +74,44 @@
- - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + +
MonthKPIBD LevelTransaction AmountTotal CommissionSend CommissionHold CommissionPrize TypeDetails
MonthKPIBD LevelTransaction AmountTotal CommissionSend CommissionHold CommissionPrize TypeDetails
{{commission.month}} - {{commission.kpi_amount}} - 0.00 - {{commission.total_amount|currency:'AUD '}} - BD - Group - - - - - - - -
{{commission.month}} + {{commission.kpi_amount}} + 0.00 + {{commission.total_amount|currency:'AUD '}} + BD + Group + + + + + + + +
@@ -121,32 +123,34 @@
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - + + + + + +
BD LevelKPI完成度Junior BDIntermediate BDSenior BD
费率0.6-0.790.8-2.00.6-0.790.8-2.00.6-0.790.8-2.0
BD LevelKPI完成度Junior BDIntermediate BDSenior BD
费率0.6-0.790.8-2.00.6-0.790.8-2.00.6-0.790.8-2.0
+ +
@@ -155,11 +159,13 @@
  • 按月度发放
  • 每月发放总提成额度的60%,剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放
  • 提前离职者,40%提成不予发放
  • -
  • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放40%的占比部分,扣下部分如果第二年考评超出一定评分110%可以补发;同样,如果年度考评分数超过100 分按照同比例发放
  • +
  • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放40%的占比部分,扣下部分如果第二年考评超出一定评分110%可以补发;同样,如果年度考评分数超过100 分按照同比例发放 +
  • 商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配
  • 连续 2 个月不产生流水的商户,由销管部统一收回,重新分配
  • 分配后的商户流水客户专员只能占一半
  • -
  • 离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1 个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护; +
  • 离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1 + 个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护; 离职人员交接的商户提成,接收人员享受一半的提成,另一半作为跨境客服专员福利会基金
  • 被客户投诉情况严重者,此商户由销管中心无条件收回重新分配
  • 活动执行未传达到位且出现舞弊、徇私、懒惰等行为的,商户上交由销管中心统一分配
  • diff --git a/src/main/ui/static/config/orgcommission/orgcommission.js b/src/main/ui/static/config/orgcommission/orgcommission.js index 3e096d113..8cfde8094 100644 --- a/src/main/ui/static/config/orgcommission/orgcommission.js +++ b/src/main/ui/static/config/orgcommission/orgcommission.js @@ -1,204 +1,253 @@ /** * Created by yixian on 2017-03-08. */ -var commissionTypeMap = [{ - "label": 1, - "value": "渠道计算法" -}, - { - "label": 2, - "value": "总交易额比例" - }, - { - "label": 3, - "value": "收益比例" - } -]; -define(['angular','../../analysis/org/analysis-org'], function (angular) { - 'use strict'; - var app = angular.module('orgcommission', ['ui.router']); - app.config(['$stateProvider', function ($stateProvider) { - $stateProvider.state('analysis_org.commission', { - url: '/org_commissions', - templateUrl: '/static/config/orgcommission/templates/org_commission_root.html', - controller: 'orgCommissionRootCtrl' - }).state('analysis_org.commission.month', { - url: '/commissionorg/months/{monthStr}', - templateUrl: '/static/config/orgcommission/templates/org_commission_month_root.html', - controller: 'commissionMonthRootCtrl' - }).state('analysis_org.info', { - url: '/commissionorg/info', - templateUrl: '/static/config/orgcommission/templates/org_commission_info.html', - controller: 'commissionMonthRootCtrl' - }).state('analysis_org.commission.month.org', { - url: '/org', - templateUrl: '/static/config/orgcommission/templates/org_commission_month.html', - controller: 'orgCommissionMonthViewCtrl', - resolve: { - monthData: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr); - }] - } - }).state('analysis_org.commission.month.referrer', { - url: '/referrer', - templateUrl: '/static/config/referrercommission/templates/referrer_commission_month.html', - controller: 'referrerCommissionMonthViewCtrl', - resolve: { - monthData: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr); - }] - } - }).state('analysis_org.commission.month.org.orgdetail', { - url: '/citypartners/{orgId}', - templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html', - controller: 'orgCommissionOrgDetailCtrl', - resolve: { - detail: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId); - }] - } - }).state('analysis_org.commission.month.referrer.referrerdetail', { - url: '/referrer_commissions/{orgId}', - templateUrl: '/static/config/referrercommission/templates/referrer_commission_detail.html', - controller: 'referrerCommissionOrgDetailCtrl', - resolve: { - detail: ['$http', '$stateParams', function ($http, $stateParams) { - return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId); - }] - } +var commissionTypeMap = [ + { + label: 1, + value: '渠道计算法', + }, + { + label: 2, + value: '总交易额比例', + }, + { + label: 3, + value: '收益比例', + }, +] +define(['angular', '../../analysis/org/analysis-org'], function (angular) { + 'use strict' + var app = angular.module('orgcommission', ['ui.router']) + app.config([ + '$stateProvider', + function ($stateProvider) { + $stateProvider + .state('analysis_org.commission', { + url: '/org_commissions', + templateUrl: '/static/config/orgcommission/templates/org_commission_root.html', + controller: 'orgCommissionRootCtrl', + }) + .state('analysis_org.commission.month', { + url: '/commissionorg/months/{monthStr}', + templateUrl: '/static/config/orgcommission/templates/org_commission_month_root.html', + controller: 'commissionMonthRootCtrl', + }) + .state('analysis_org.info', { + url: '/commissionorg/info', + templateUrl: '/static/config/orgcommission/templates/org_commission_info.html', + controller: 'commissionMonthRootCtrl', + }) + .state('analysis_org.commission.month.org', { + url: '/org', + templateUrl: '/static/config/orgcommission/templates/org_commission_month.html', + controller: 'orgCommissionMonthViewCtrl', + resolve: { + monthData: [ + '$http', + '$stateParams', + function ($http, $stateParams) { + return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr) + }, + ], + }, + }) + .state('analysis_org.commission.month.referrer', { + url: '/referrer', + templateUrl: '/static/config/referrercommission/templates/referrer_commission_month.html', + controller: 'referrerCommissionMonthViewCtrl', + resolve: { + monthData: [ + '$http', + '$stateParams', + function ($http, $stateParams) { + return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr) + }, + ], + }, + }) + .state('analysis_org.commission.month.org.orgdetail', { + url: '/citypartners/{orgId}', + templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html', + controller: 'orgCommissionOrgDetailCtrl', + resolve: { + detail: [ + '$http', + '$stateParams', + function ($http, $stateParams) { + return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId) + }, + ], + }, }) - }]); - app.controller('commissionMonthRootCtrl', ['$scope', '$state', function ($scope, $state) { - if($state.is('analysis_org.commission.month')){ - $state.go('.org'); + .state('analysis_org.commission.month.referrer.referrerdetail', { + url: '/referrer_commissions/{orgId}', + templateUrl: '/static/config/referrercommission/templates/referrer_commission_detail.html', + controller: 'referrerCommissionOrgDetailCtrl', + resolve: { + detail: [ + '$http', + '$stateParams', + function ($http, $stateParams) { + return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId) + }, + ], + }, + }) + }, + ]) + app.controller('commissionMonthRootCtrl', [ + '$scope', + '$state', + function ($scope, $state) { + if ($state.is('analysis_org.commission.month')) { + $state.go('.org') + } + }, + ]) + app.controller('orgCommissionRootCtrl', [ + '$scope', + '$http', + '$filter', + '$state', + 'commonDialog', + function ($scope, $http, $filter, $state, commonDialog) { + $scope.generate = {} + $scope.generateOrgCommission = function () { + $scope.generate.status = {} + if (!$scope.generate.month) { + commonDialog.alert({ + type: 'error', + title: 'Error', + content: 'Select a month first!', + }) + return } - }]); - app.controller('orgCommissionRootCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog', - function ($scope, $http, $filter, $state, commonDialog) { - $scope.generate = {}; - $scope.generateOrgCommission = function () { - $scope.generate.status = {}; - if (!$scope.generate.month) { - commonDialog.alert({ - type: 'error', title: 'Error', content: 'Select a month first!' - }); - return; - } - commonDialog.confirm({ - title: 'Confirm', - content: 'This operation will clear the data generated before, Are you sure?' - }).then(function () { - var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')}; - $http.post('/sys/citypartner_prizes/generate', params).then(function () { - $state.go('.org.month', {monthStr: params.month}) - $scope.generate.status = null; - }, function (resp) { - commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message}); - }) - }) - }; - $scope.availableYears = [new Date().getFullYear()]; - //当前年至2017年年份 - for (var i = 1; i < new Date().getFullYear()-2017+1; i++) { - $scope.availableYears.push(new Date().getFullYear() - i); - } - $scope.params = {}; - $scope.months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; - $scope.loadAvailableMonths = function (year) { - $scope.params.year = year; - $http.get('/sys/citypartner_prizes/months', {params: {year: $scope.params.year}}).then(function (resp) { - $scope.availableMonths = resp.data; - }); - }; - - $scope.loadAvailableMonths(new Date().getFullYear()); - $scope.hasReport = function (mon) { - var has = false; - angular.forEach($scope.availableMonths, function (m) { - if (mon == m.month) { - has = true; - } - }); - return has; - }; - $scope.gotoMonth = function (mon) { - if(mon){ - $scope.params.month = mon; - } - var monthStr = $scope.params.year + '-' + $scope.params.month; - $state.go('analysis_org.commission.month', {monthStr: monthStr}) - }; - - - }]); - app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData','$http', function ($scope, monthData,$http) { - $scope.monthData = monthData.data; - $scope.ctrl = {}; - $scope.commissionTypeMap = commissionTypeMap; - $scope.seniors = {}; - $scope.active = function (log) { - $http.get('/sys/citypartner_prizes/senior/'+log.org_id+'/details?monthStr='+$scope.monthData.monthstr).then(function (resp) { - $scope.seniors = resp.data; - if($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id==log.org_id){ - $scope.ctrl.activeLog=null; - return; - } - $scope.ctrl.activeLog=log; - }) + commonDialog + .confirm({ + title: 'Confirm', + content: 'This operation will clear the data generated before, Are you sure?', + }) + .then(function () { + var params = { month: $filter('date')($scope.generate.month, 'yyyy-MM') } + $http.post('/sys/citypartner_prizes/generate', params).then( + function () { + $state.go('.org.month', { monthStr: params.month }) + $scope.generate.status = null + }, + function (resp) { + commonDialog.alert({ type: 'error', title: 'Error', content: resp.data.message }) + } + ) + }) + } + $scope.params = { year: new Date() } + $scope.loadAvailableMonths = function () { + const year = $scope.params.year.getFullYear() + $http.get('/sys/citypartner_prizes/months', { params: { year: year } }).then(function (resp) { + $scope.availableMonths = resp.data + }) + } + $scope.loadAvailableMonths() + $scope.months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + $scope.hasReport = function (mon) { + var has = false + angular.forEach($scope.availableMonths, function (m) { + if (mon == m.month) { + has = true + } + }) + return has + } + $scope.gotoMonth = function (mon) { + if (mon) { + $scope.params.month = mon } - }]); - app.controller('orgCommissionOrgDetailCtrl', ['$scope', 'detail', function ($scope, detail) { - $scope.detail = detail.data; - $scope.ctrl = {}; - $scope.active = function (log) { - if($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker==log.client_moniker){ - $scope.ctrl.activeLog=null; - return; - } - $scope.ctrl.activeLog=log; + var monthStr = $scope.params.year.getFullYear() + '-' + $scope.params.month + $state.go('analysis_org.commission.month', { monthStr: monthStr }) + } + }, + ]) + app.controller('orgCommissionMonthViewCtrl', [ + '$scope', + 'monthData', + '$http', + function ($scope, monthData, $http) { + $scope.monthData = monthData.data + $scope.ctrl = {} + $scope.commissionTypeMap = commissionTypeMap + $scope.seniors = {} + $scope.active = function (log) { + $http.get('/sys/citypartner_prizes/senior/' + log.org_id + '/details?monthStr=' + $scope.monthData.monthstr).then(function (resp) { + $scope.seniors = resp.data + if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id == log.org_id) { + $scope.ctrl.activeLog = null + return + } + $scope.ctrl.activeLog = log + }) + } + }, + ]) + app.controller('orgCommissionOrgDetailCtrl', [ + '$scope', + 'detail', + function ($scope, detail) { + $scope.detail = detail.data + $scope.ctrl = {} + $scope.active = function (log) { + if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker == log.client_moniker) { + $scope.ctrl.activeLog = null + return } - }]); + $scope.ctrl.activeLog = log + } + }, + ]) - app.controller('referrerCommissionMonthViewCtrl', ['$scope', 'monthData', function ($scope, monthData) { - $scope.monthData = monthData.data; - $scope.ctrl = {}; - $scope.active = function (log) { - if($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id==log.org_id){ - $scope.ctrl.activeLog=null; - return; - } - $scope.ctrl.activeLog=log; + app.controller('referrerCommissionMonthViewCtrl', [ + '$scope', + 'monthData', + function ($scope, monthData) { + $scope.monthData = monthData.data + $scope.ctrl = {} + $scope.active = function (log) { + if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id == log.org_id) { + $scope.ctrl.activeLog = null + return } - }]); + $scope.ctrl.activeLog = log + } + }, + ]) - app.controller('referrerCommissionOrgDetailCtrl', ['$scope', 'detail', function ($scope, detail) { - $scope.detail = detail.data; - $scope.ctrl = {}; - $scope.active = function (log) { - if($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker==log.client_moniker){ - $scope.ctrl.activeLog=null; - return; - } - $scope.ctrl.activeLog=log; + app.controller('referrerCommissionOrgDetailCtrl', [ + '$scope', + 'detail', + function ($scope, detail) { + $scope.detail = detail.data + $scope.ctrl = {} + $scope.active = function (log) { + if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker == log.client_moniker) { + $scope.ctrl.activeLog = null + return } - }]); + $scope.ctrl.activeLog = log + } + }, + ]) - app.filter('commission_type_filter', function () { - return function (sectorValue) { - var sectorLabel = ''; - angular.forEach(commissionTypeMap, function (sector) { - if (sector.label == sectorValue) { - sectorLabel = sector.value; - } - }); - return sectorLabel; + app.filter('commission_type_filter', function () { + return function (sectorValue) { + var sectorLabel = '' + angular.forEach(commissionTypeMap, function (sector) { + if (sector.label == sectorValue) { + sectorLabel = sector.value } - }); - - - return app; - - + }) + return sectorLabel + } + }) -}); + return app +}) diff --git a/src/main/ui/static/config/orgcommission/templates/org_commission_root.html b/src/main/ui/static/config/orgcommission/templates/org_commission_root.html index f9e064700..d777cb390 100644 --- a/src/main/ui/static/config/orgcommission/templates/org_commission_root.html +++ b/src/main/ui/static/config/orgcommission/templates/org_commission_root.html @@ -11,8 +11,8 @@
    + is-open="ctrl.genmonth" datepicker-options="{minMode: 'month'}" ng-click="ctrl.genmonth=true" + placeholder="Select Month" />
    -
    + +
    -
    +
    diff --git a/src/main/ui/static/config/platformrevenue/platformrevenue.js b/src/main/ui/static/config/platformrevenue/platformrevenue.js index 425e36d39..505b81d96 100644 --- a/src/main/ui/static/config/platformrevenue/platformrevenue.js +++ b/src/main/ui/static/config/platformrevenue/platformrevenue.js @@ -2,239 +2,241 @@ * Created by Tayl0r on 2017/5/24. */ define(['angular', 'decimal', 'uiRouter', 'angularEcharts', '../../analysis/report/analysis-report'], function (angular, Decimal) { - 'use strict'; - var app = angular.module('platformRevenue', ['ui.router']); - app.config(['$stateProvider', function ($stateProvider) { - $stateProvider.state('analysis_report.platformrevenue', { - url: '/platformrevenue', - templateUrl: '/static/config/platformrevenue/templates/platform_revenue_root.html', - controller: 'platformRevenueRootCtrl' - }).state('analysis_report.platformsettle', { - url: '/platformsettle', - templateUrl: '/static/config/platformrevenue/templates/platform_settle_logs.html', - controller: 'platformSettleLogCtrl', - - }); - }]); - app.controller('platformSettleLogCtrl', ['$scope', '$http', '$state','$filter','Upload','commonDialog', function ($scope, $http, $state,$filter,Upload, commonDialog) { - - $scope.wechatPagination = {}; - $scope.loadWechatLogs = function (page) { - var params = $scope.queryParams || {}; - params.page = page || $scope.wechatPagination.page || 1; - params.limit = 20; - params.channel = 'Wechat'; - $http.get('/platform/analysis/settle/log', {params: params}).then(function (resp) { - $scope.wechatLogs = resp.data.data; - $scope.wechatPagination = resp.data.pagination; - }); - }; - $scope.loadWechatLogs(1); - - $scope.aliPagination = {}; - $scope.loadAliLogs = function (page) { - var params = $scope.queryParams || {}; - params.page = page || $scope.aliPagination.page || 1; - params.limit = 20; - params.channel = 'Alipay'; - $http.get('/platform/analysis/settle/log', {params: params}).then(function (resp) { - $scope.aliLogs = resp.data.data; - $scope.aliPagination = resp.data.pagination; - }); - } - $scope.loadAliLogs(1); - $scope.aliOnlinePagination = {}; - $scope.loadAliOnlineLogs = function (page) { - var params = $scope.queryParams || {}; - params.page = page || $scope.aliOnlinePagination.page || 1; - params.limit = 20; - params.channel = 'AlipayOnline'; - $http.get('/platform/analysis/settle/log', {params: params}).then(function (resp) { - $scope.aliOnlineLogs = resp.data.data; - $scope.aliOnlinePagination = resp.data.pagination; - }); - } - $scope.loadAliOnlineLogs(1); - $scope.loadBestpayLog = function () { - $http.get('/platform/analysis/settle/Bestpay').then(function (resp) { - $scope.bestpayLogs = resp.data; - }); - } - $scope.loadBestpayLog(); - $scope.verifySettleLog = function(log){ - $http.get('/platform/analysis/settle/verify',{params:log}).then(function () { - $scope.loadAliLogs(1); - $scope.loadAliOnlineLogs(1); - $scope.loadWechatLogs(1); - commonDialog.alert({ - title: 'Success', - content: '校验结果已经重新生成,请查看!', - type: 'success' - }) - },function (resp) { - commonDialog.alert({ - title: 'Error', - content: resp.data.message, - type: 'error' - }) - }); + 'use strict' + var app = angular.module('platformRevenue', ['ui.router']) + app.config([ + '$stateProvider', + function ($stateProvider) { + $stateProvider + .state('analysis_report.platformrevenue', { + url: '/platformrevenue', + templateUrl: '/static/config/platformrevenue/templates/platform_revenue_root.html', + controller: 'platformRevenueRootCtrl', + }) + .state('analysis_report.platformsettle', { + url: '/platformsettle', + templateUrl: '/static/config/platformrevenue/templates/platform_settle_logs.html', + controller: 'platformSettleLogCtrl', + }) + }, + ]) + app.controller('platformSettleLogCtrl', [ + '$scope', + '$http', + '$state', + '$filter', + 'Upload', + 'commonDialog', + function ($scope, $http, $state, $filter, Upload, commonDialog) { + $scope.wechatPagination = {} + $scope.loadWechatLogs = function (page) { + var params = $scope.queryParams || {} + params.page = page || $scope.wechatPagination.page || 1 + params.limit = 20 + params.channel = 'Wechat' + $http.get('/platform/analysis/settle/log', { params: params }).then(function (resp) { + $scope.wechatLogs = resp.data.data + $scope.wechatPagination = resp.data.pagination + }) + } + $scope.loadWechatLogs(1) + + $scope.aliPagination = {} + $scope.loadAliLogs = function (page) { + var params = $scope.queryParams || {} + params.page = page || $scope.aliPagination.page || 1 + params.limit = 20 + params.channel = 'Alipay' + $http.get('/platform/analysis/settle/log', { params: params }).then(function (resp) { + $scope.aliLogs = resp.data.data + $scope.aliPagination = resp.data.pagination + }) + } + $scope.loadAliLogs(1) + $scope.aliOnlinePagination = {} + $scope.loadAliOnlineLogs = function (page) { + var params = $scope.queryParams || {} + params.page = page || $scope.aliOnlinePagination.page || 1 + params.limit = 20 + params.channel = 'AlipayOnline' + $http.get('/platform/analysis/settle/log', { params: params }).then(function (resp) { + $scope.aliOnlineLogs = resp.data.data + $scope.aliOnlinePagination = resp.data.pagination + }) + } + $scope.loadAliOnlineLogs(1) + $scope.loadBestpayLog = function () { + $http.get('/platform/analysis/settle/Bestpay').then(function (resp) { + $scope.bestpayLogs = resp.data + }) + } + $scope.loadBestpayLog() + $scope.verifySettleLog = function (log) { + $http.get('/platform/analysis/settle/verify', { params: log }).then( + function () { + $scope.loadAliLogs(1) + $scope.loadAliOnlineLogs(1) + $scope.loadWechatLogs(1) + commonDialog.alert({ + title: 'Success', + content: '校验结果已经重新生成,请查看!', + type: 'success', + }) + }, + function (resp) { + commonDialog.alert({ + title: 'Error', + content: resp.data.message, + type: 'error', + }) + } + ) + } + + $scope.generateSettleLogs = function () { + $http.get('/platform/analysis/generate/settle/log').then(function () { + $scope.loadWechatLogs(1) + $scope.loadAliLogs(1) + $state.reload() + }) + $state.reload() + } + + $scope.hfParam = {} + $scope.hfPagination = {} + $scope.loadhfLogs = function (page) { + var params = $scope.queryParams || {} + params.page = page || $scope.hfPagination.page || 1 + params.limit = 20 + params.channel = 'hf' + $http.get('/platform/analysis/settle/log', { params: params }).then(function (resp) { + $scope.hfLogs = resp.data.data + $scope.hfPagination = resp.data.pagination + }) + } + + $scope.loadhfLogs(1) + $scope.uploadhfSettleFile = function (file) { + if (file != null) { + Upload.upload({ + url: '/attachment/secret_files', + data: { file: file }, + }).then( + function (resp) { + $scope.hfParam.fileId = resp.data.fileid + commonDialog.alert({ title: 'Upload Success', content: '', type: 'success' }) + }, + function (resp) {}, + function (evt) {} + ) } + } - $scope.generateSettleLogs = function () { - $http.get('/platform/analysis/generate/settle/log').then(function () { - $scope.loadWechatLogs(1); - $scope.loadAliLogs(1); - $state.reload(); - }); - $state.reload(); + $scope.dohfSettle = function () { + var param = angular.copy($scope.hfParam) + if (!param.start) { + alert('请先选择开始时间') } - - - - $scope.hfParam={}; - $scope.hfPagination = {}; - $scope.loadhfLogs = function (page) { - var params = $scope.queryParams || {}; - params.page = page || $scope.hfPagination.page || 1; - params.limit = 20; - params.channel = 'hf'; - $http.get('/platform/analysis/settle/log', {params: params}).then(function (resp) { - $scope.hfLogs = resp.data.data; - $scope.hfPagination = resp.data.pagination; - }); - }; - - $scope.loadhfLogs(1); - $scope.uploadhfSettleFile = function (file) { - if (file != null) { - Upload.upload({ - url: '/attachment/secret_files', - data: {file: file} - }).then(function (resp) { - $scope.hfParam.fileId = resp.data.fileid; - commonDialog.alert({title: 'Upload Success', content:'', type: 'success'}) - }, function (resp) { - }, function (evt) { - }) - } - }; - - $scope.dohfSettle = function () { - var param = angular.copy($scope.hfParam); - if(!param.start){ - alert("请先选择开始时间"); - } - if(!param.end){ - alert("请先选择结束时间"); - } - if(!param.fileId){ - alert("请先上传汇付清算文件"); - } - param.start = $filter('date')(param.start, "yyyy-MM-dd"); - param.end = $filter('date')(param.end, "yyyy-MM-dd"); - - $http.put('/platform/analysis/generate/hf/settle',param).then(function (resp) { - - }); - + if (!param.end) { + alert('请先选择结束时间') } - - }]); - app.controller('platformRevenueRootCtrl', ['$scope', '$http', '$filter', 'chartParser', function ($scope, $http, $filter, chartParser) { - $scope.params = {year: new Date().getFullYear()}; - $scope.availableYears = []; - var years = new Date().getFullYear() - 2016; - for( var i = years ; i>=0 ; i-- ){ - $scope.availableYears.push(new Date().getFullYear() - i) ; + if (!param.fileId) { + alert('请先上传汇付清算文件') } - $scope.initMonth = function (year) { - $scope.months = []; - for (var i = 1; i < 13; i++) { - var mon = '00' + i; - mon = mon.substr(mon.length - 2, 2); - $scope.months.push(year + '-' + mon); - } - }; - $scope.initMonth($scope.params.year); - $scope.hasReport = function (mon) { - var start = '2017-01'; - var end = $filter('date')(new Date(), 'yyyy-MM'); - return start <= mon && end >= mon - }; - $scope.loadYearReport = function (year) { - $scope.params.year = year; - $http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) { - $scope.report = resp.data; - loadChargeAnalysis(year); - $scope.analysis = { - analysis_year: year, - partner_commission: 0, - bd_commission: 0, - royalpay_surcharge: 0 - }; - angular.forEach($scope.report, function (report) { - $scope.analysis.partner_commission = Decimal.add(report.partner_charge, $scope.analysis.partner_commission).toFixed(2); - $scope.analysis.bd_commission = Decimal.add(report.bd_charge, $scope.analysis.bd_commission).toFixed(2); - $scope.analysis.royalpay_surcharge = Decimal.add(report.royalpay_charge, $scope.analysis.royalpay_surcharge).toFixed(2); - }); - }) - }; - - function loadChargeAnalysis(year) { - var analysisConfig = { - chart: { - tooltip: { - trigger: 'axis', - axisPointer: { // 坐标轴指示器,坐标轴触发有效 - type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' - }, - formatter: '{b}:AUD {c}' - }, - legend: { - data: ['BD Commission', 'Partner Commission', 'RoyalPay SurCharge'] - }, - grid: { - left: '3%', - right: '4%', - bottom: '3%', - containLabel: true - }, - yAxis: [ - { - type: 'value' - } - ] - }, - - xAxis: { - basic: {type: 'category'}, - key: 'charge_date' - }, - - series: [ - { - basic: {name: 'BD Commission', type: 'bar'}, - column: {key: 'bd_charge'} - }, - { - basic: { - name: 'Partner Commission', - type: 'bar' - }, - column: {key: 'partner_charge'} - }, - { - basic: {name: 'RoyalPay SurCharge', type: 'bar', stack: 'RoyalPaySurcharge'}, - column: {key: 'royalpay_charge'} - } - ] - }; - $http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) { - $scope.chargeAnalysis = chartParser.parse(analysisConfig, resp.data); - }) + param.start = $filter('date')(param.start, 'yyyy-MM-dd') + param.end = $filter('date')(param.end, 'yyyy-MM-dd') + + $http.put('/platform/analysis/generate/hf/settle', param).then(function (resp) {}) + } + }, + ]) + app.controller('platformRevenueRootCtrl', [ + '$scope', + '$http', + '$filter', + 'chartParser', + function ($scope, $http, $filter, chartParser) { + $scope.params = { year: new Date() } + $scope.hasReport = function (mon) { + var start = '2017-01' + var end = $filter('date')(new Date(), 'yyyy-MM') + return start <= mon && end >= mon + } + $scope.loadYearReport = function () { + const year = $scope.params.year.getFullYear() + $http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) { + $scope.report = resp.data + loadChargeAnalysis(year) + $scope.analysis = { + analysis_year: year, + partner_commission: 0, + bd_commission: 0, + royalpay_surcharge: 0, + } + angular.forEach($scope.report, function (report) { + $scope.analysis.partner_commission = Decimal.add(report.partner_charge, $scope.analysis.partner_commission).toFixed(2) + $scope.analysis.bd_commission = Decimal.add(report.bd_charge, $scope.analysis.bd_commission).toFixed(2) + $scope.analysis.royalpay_surcharge = Decimal.add(report.royalpay_charge, $scope.analysis.royalpay_surcharge).toFixed(2) + }) + }) + } + $scope.loadYearReport() + + function loadChargeAnalysis(year) { + var analysisConfig = { + chart: { + tooltip: { + trigger: 'axis', + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: 'shadow', // 默认为直线,可选为:'line' | 'shadow' + }, + formatter: '{b}:AUD {c}', + }, + legend: { + data: ['BD Commission', 'Partner Commission', 'RoyalPay SurCharge'], + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true, + }, + yAxis: [ + { + type: 'value', + }, + ], + }, + + xAxis: { + basic: { type: 'category' }, + key: 'charge_date', + }, + + series: [ + { + basic: { name: 'BD Commission', type: 'bar' }, + column: { key: 'bd_charge' }, + }, + { + basic: { + name: 'Partner Commission', + type: 'bar', + }, + column: { key: 'partner_charge' }, + }, + { + basic: { name: 'RoyalPay SurCharge', type: 'bar', stack: 'RoyalPaySurcharge' }, + column: { key: 'royalpay_charge' }, + }, + ], } - - $scope.loadYearReport(new Date().getFullYear()); - }]); - return app; -}); \ No newline at end of file + $http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) { + $scope.chargeAnalysis = chartParser.parse(analysisConfig, resp.data) + }) + } + }, + ]) + return app +}) diff --git a/src/main/ui/static/config/platformrevenue/templates/platform_revenue_root.html b/src/main/ui/static/config/platformrevenue/templates/platform_revenue_root.html index aa13b50bd..eeb6fdd35 100644 --- a/src/main/ui/static/config/platformrevenue/templates/platform_revenue_root.html +++ b/src/main/ui/static/config/platformrevenue/templates/platform_revenue_root.html @@ -14,7 +14,7 @@
    - -
    - -
    + +
    -
    +
    - +
    -
    +
    Partner Commission: @@ -59,11 +57,12 @@
    - RoyalPay SurCharge: + Bestpay:{{r.channels.Bestpay}}" popover-title="RoyalPay SurCharge Detail" + popover-placement="bottom" popover-data-html="true">RoyalPay + SurCharge:
    @@ -77,20 +76,20 @@
    - - - - - - + + + + + + - - - - - - + + + + + +
    Partner CommissionBD CommissionRoyalPay SurCharge
    Partner CommissionBD CommissionRoyalPay SurCharge
    Total
    Total
    @@ -101,7 +100,7 @@
    平台收入趋势
    + ng-class="{nodata:chargeAnalysis.nodata}">
    diff --git a/src/main/ui/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html index bb1789c49..de2ec9660 100644 --- a/src/main/ui/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html @@ -43,10 +43,10 @@
    + type="text" name="merchant_storename" id="merchant_storename_input" required maxlength="20">

    Required Field

    -

    Length is more than 50

    +

    Length is more than 20

    @@ -92,7 +92,7 @@
    + type="url" name="company_website" id="website_input" required maxlength="100">

    ( Not required when business type is Offline scenario)

    @@ -122,10 +122,12 @@ ng-class="{'has-error':subForm.office_phone.$invalid && subForm.office_phone.$dirty}">
    -

    Required Field

    +

    Length is more than 20

    +
    @@ -162,10 +164,10 @@
    + type="text" name="contact_email" id="contact_email_input" required maxlength="50">

    Required Field

    -

    Length is more than 128

    +

    Length is more than 50

    diff --git a/src/main/ui/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html index 3c86baaed..5502868db 100644 --- a/src/main/ui/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html @@ -94,7 +94,7 @@
    + type="url" name="website" id="website_input" required maxlength="100">

    (Not required when business type is Offline scenario)

    Required Field

    @@ -162,10 +162,10 @@
    + type="text" name="contact_email" id="contact_email_input" required maxlength="50">

    Required Field

    -

    Length is more than 128

    +

    Length is more than 50

    diff --git a/src/test/java/au/com/royalpay/payment/manage/process/custom/ManualReportCustom.java b/src/test/java/au/com/royalpay/payment/manage/process/custom/ManualReportCustom.java index 66b0c559f..f258ea143 100644 --- a/src/test/java/au/com/royalpay/payment/manage/process/custom/ManualReportCustom.java +++ b/src/test/java/au/com/royalpay/payment/manage/process/custom/ManualReportCustom.java @@ -1,23 +1,11 @@ package au.com.royalpay.payment.manage.process.custom; -import au.com.royalpay.payment.channels.alipay.runtime.impls.AlipayCustomDeclaringTaskProcessor; -//import au.com.royalpay.payment.core.mappers.PmtCustomReportsDetailMapper; -//import au.com.royalpay.payment.core.mappers.PmtCustomReportsMapper; -import au.com.royalpay.payment.core.mappers.PmtOrderMapper; -import au.com.royalpay.payment.manage.mappers.custom.CustomReportDetailsMapper; -import au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper; -import com.alibaba.fastjson.JSONObject; -import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; -import javax.annotation.Resource; -import java.util.List; - /** * Create by yixian at 2018-08-14 20:28 */ diff --git a/uidocker/conf.d/default.conf b/uidocker/conf.d/default.conf index beb93bbf7..9bbf8bfde 100644 --- a/uidocker/conf.d/default.conf +++ b/uidocker/conf.d/default.conf @@ -68,7 +68,7 @@ server { } - location ~ ^/api/v1.0/((jd)|(customs)|(alipay)|(rpay)|(yeepay)|(card_payment_view)|(lakala_pay)|(cb_bankpay)|(bestpay)|(hf)|(wechat_jsapi_gateway)|(h5_payment)|(gateway)|(hf_gateway)|(jd_gateway)|(micropay)|(retail_qrcode)|(jsapi_gateway)|(share_code)|(payment))/ { + location ~ ^/api/v1.0/((alipay_connect)|(customs)|(alipay)|(rpay)|(yeepay)|(card_payment_view)|(lakala_pay)|(cb_bankpay)|(bestpay)|(hf)|(wechat_jsapi_gateway)|(h5_payment)|(gateway)|(hf_gateway)|(jd_gateway)|(micropay)|(retail_qrcode)|(jsapi_gateway)|(share_code)|(payment))/ { proxy_pass http://rppaycenter; proxy_http_version 1.1;