Merge remote-tracking branch 'origin/master'

master
yixian 4 years ago
commit 77e265a7f4

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<!--编码字符集-->
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java"/>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="FileLength">
<property name="max" value="1000"/>
<property name="severity" value="error"/>
</module>
<!--检查项规则配置-->
<module name="TreeWalker">
<!-- 命名检查 -->
<module name="AbbreviationAsWordInName"/>
<module name="AbstractClassName">
<property name="ignoreModifier" value="true"/>
</module>
<module name="CatchParameterName"/>
<module name="ClassTypeParameterName"/>
<module name="ConstantName"/>
<module name="InterfaceTypeParameterName">
<property name="format" value="^[a-zA-Z]$"/>
</module>
<module name="LambdaParameterName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="severity" value="error"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z]([a-zA-Z0-9])*$"/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^[a-zA-Z]$"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z][_a-zA-Z0-9]+$"/>
</module>
<module name="StaticVariableName">
<property name="format" value="^[a-z](_?[a-zA-Z0-9]+)*$"/>
</module>
<module name="TypeName">
<property name="format" value="^[A-Z](_?[a-zA-Z0-9]+)*$"/>
</module>
<module name="TypeName">
<property name="format"
value="^I_[a-zA-Z0-9]*$"/>
<property name="tokens"
value="INTERFACE_DEF"/>
</module>
<!--
空格检查,该检查是为了增加代码的可读性、可维护性
-->
<module name="EmptyForInitializerPad">
<property name="option" value="nospace"/>
</module>
<module name="EmptyForIteratorPad">
<property name="option" value="space"/>
</module>
<module name="EmptyLineSeparator">
<property name="tokens" value="VARIABLE_DEF, METHOD_DEF"/>
</module>
<module name="MethodParamPad">
<property name="tokens" value="METHOD_DEF"/>
<property name="option" value="nospace"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="NoLineWrap">
<property name="tokens" value="IMPORT"/>
</module>
<module name="NoWhitespaceAfter">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="false"/>
</module>
<module name="NoWhitespaceBefore">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="SingleSpaceSeparator"/>
<module name="TypecastParenPad">
<property name="option" value="space"/>
</module>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI, TYPECAST, LITERAL_ELSE"/>
</module>
<module name="WhitespaceAround">
<!-- else、catch、finally、赋值符、运算符、连接符-->
<property name="tokens" value="ASSIGN, BOR, BOR_ASSIGN, EQUAL, GE, GT, LAMBDA, LAND, LE, LITERAL_CATCH, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_SYNCHRONIZED, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/>
</module>
<!--
Size检查依然是解决可读性
方法体大小、文件大小等
-->
<module name="AnonInnerLength">
<property name="max" value="80"/>
<property name="severity" value="error"/>
</module>
<module name="ExecutableStatementCount"/>
<module name="MethodCount">
<property name="maxTotal" value="30"/>
<property name="severity" value="error"/>
</module>
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF"/>
<property name="max" value="80"/>
<property name="countEmpty" value="false"/>
<property name="severity" value="error"/>
</module>
<module name="OuterTypeNumber"/>
<module name="ParameterNumber"/>
<!-- NeedBraces 检查是否应该使用括号的地方没有加括号
tokens: 定义检查的类型 -->
<module name="NeedBraces">
<property name="severity" value="error"/>
</module>
<!-- if-else嵌套语句个数 最多4层 -->
<module name="NestedIfDepth">
<property name="max" value="3"/>
<property name="severity" value="error"/>
</module>
</module>
</module>

@ -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

@ -0,0 +1,2 @@
cp checkstyle/pre-commit .git/hooks/
chmod +x .git/hooks/pre-commit

@ -5,11 +5,11 @@
<parent> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.2.25</version> <version>2.2.26</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.3.76-SNAPSHOT</version> <version>2.3.77</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.appclient.beans; package au.com.royalpay.payment.manage.appclient.beans;
import au.com.royalpay.payment.core.beans.OrderStatus; 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 au.com.royalpay.payment.tools.defines.TradeType;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -25,7 +25,7 @@ public class AppQueryBean {
private String[] client_ids; private String[] client_ids;
private String app_client_ids; private String app_client_ids;
private OrderStatus status = OrderStatus.ALL; private OrderStatus status = OrderStatus.ALL;
private PayChannel channel = PayChannel.ALL; private PayChannelSearch channel = PayChannelSearch.ALL;
private int[] gateway; private int[] gateway;
private int clearing_status=-1; private int clearing_status=-1;
private String gateway_app; private String gateway_app;
@ -164,11 +164,11 @@ public class AppQueryBean {
this.app_client_ids = app_client_ids; this.app_client_ids = app_client_ids;
} }
public PayChannel getChannel() { public PayChannelSearch getChannel() {
return channel; return channel;
} }
public void setChannel(PayChannel channel) { public void setChannel(PayChannelSearch channel) {
this.channel = channel; this.channel = channel;
} }

@ -1,11 +1,8 @@
package au.com.royalpay.payment.manage.dev.core.impl; 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.dev.core.ManualService;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; 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.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.manage.task.PostponeClientTask;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -37,12 +34,6 @@ public class ManualServiceimpl implements ManualService {
private ClientAccountMapper clientAccountMapper; private ClientAccountMapper clientAccountMapper;
@Resource @Resource
private SynchronizedScheduler synchronizedScheduler; private SynchronizedScheduler synchronizedScheduler;
@Resource
private ClientModifySupport clientModifySupport;
@Resource
private RpayApi rpayApi;
@Resource
private ClientMapper clientMapper;
@Override @Override
public void clientPostpone() { public void clientPostpone() {

@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.tradelog.beans; package au.com.royalpay.payment.manage.tradelog.beans;
import au.com.royalpay.payment.core.beans.OrderStatus; 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 au.com.royalpay.payment.tools.defines.TradeType;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -29,7 +29,7 @@ public class TradeLogQuery {
private int[] gateway; private int[] gateway;
private String source = "ALL" ; private String source = "ALL" ;
private OrderStatus status = OrderStatus.PAID; private OrderStatus status = OrderStatus.PAID;
private PayChannel channel = PayChannel.ALL; private PayChannelSearch channel = PayChannelSearch.ALL;
private String[] client_ids; private String[] client_ids;
private String dev_id; private String dev_id;
private int clearing_status; private int clearing_status;
@ -225,11 +225,11 @@ public class TradeLogQuery {
return trans_type; return trans_type;
} }
public PayChannel getChannel() { public PayChannelSearch getChannel() {
return channel; return channel;
} }
public void setChannel(PayChannel channel) { public void setChannel(PayChannelSearch channel) {
this.channel = channel; this.channel = channel;
} }

@ -1,20 +1,20 @@
spring: spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
host: 192.168.0.84:3306 host: 192.168.0.92:3306
master: master:
driver-class-name: com.mysql.cj.jdbc.Driver 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 jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
password: ${spring.datasource.pwd} password: ${spring.datasource.pwd}
username: ${spring.datasource.user} username: ${spring.datasource.user}
pwd: rpayplus pwd: SuTUUxyvzS0cLETi6Rzm
schema-name: royalpay schema-name: royalpay
slave: slave:
driver-class-name: com.mysql.cj.jdbc.Driver 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 jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
password: ${spring.datasource.pwd} password: ${spring.datasource.pwd}
username: ${spring.datasource.user} username: ${spring.datasource.user}
user: root user: rpaydev
redis: redis:
database: 9 database: 9
host: 192.168.0.84 host: 192.168.0.84

@ -18,8 +18,6 @@ jetty:
multipart: multipart:
max-file-size: 10Mb max-file-size: 10Mb
app: app:
active:
channels: Wechat,Alipay,AlipayOnline,Gmo,UnionPay,AlipayPlus
crossapp: crossapp:
enable: true enable: true
agreetemplate: agreetemplate:

@ -2,57 +2,63 @@
* Created by yixian on 2017-05-03. * Created by yixian on 2017-05-03.
*/ */
define(['angular', 'decimal', 'uiRouter', './report/analysis-report'], function (angular, Decimal) { define(['angular', 'decimal', 'uiRouter', './report/analysis-report'], function (angular, Decimal) {
'use strict'; 'use strict'
var app = angular.module('settleReportApp', ['ui.router']); var app = angular.module('settleReportApp', ['ui.router'])
app.config(['$stateProvider', function ($stateProvider) { app.config([
$stateProvider.state('analysis_report.settle_report', { '$stateProvider',
url: '/settle_report', function ($stateProvider) {
templateUrl: '/static/analysis/templates/settle_report.html', $stateProvider.state('analysis_report.settle_report', {
controller: 'settleFinancialReportCtrl' 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()]; return app
$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;
});

@ -10,20 +10,23 @@
<section class="content"> <section class="content">
<div class="box box-default"> <div class="box box-default">
<div class="box-header"> <div class="box-header">
<!-- <div uib-dropdown> <!-- <div uib-dropdown>
<button class="btn btn-primary" uib-dropdown-toggle type="button" ng-bind="params.year"></button> <button class="btn btn-primary" uib-dropdown-toggle type="button" ng-bind="params.year"></button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu"> <ul class="dropdown-menu" uib-dropdown-menu role="menu">
<li ng-repeat="year in availableYears" role="menuitem"><a role="button" ng-click="initMonth(year)" ng-bind="year"></a></li> <li ng-repeat="year in availableYears" role="menuitem"><a role="button" ng-click="initMonth(year)" ng-bind="year"></a></li>
</ul> </ul>
</div>--> </div>-->
<div ng-repeat="year in availableYears" style="display: inline"> <!-- <div ng-repeat="year in availableYears" style="display: inline">
<button class="btn btn-info" <button class="btn btn-info"
ng-click="initMonth(year)" ng-click="initMonth(year)"
ng-bind="year" ng-bind="year"
ng-class="{'active':year == params.year}" ng-class="{'active':year == params.year}"
></button> ></button>
</div> </div> -->
<button class="btn btn-info" ng-bind="params.year.getFullYear()" ng-click="ctrl.viewyear=true"></button>
<input type="text" class="hidden" uib-datepicker-popup="yyyy" ng-model="params.year" is-open="ctrl.viewyear"
datepicker-options="{minMode: 'year'}" ng-change="initMonth()" placeholder="Select Year">
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="row"> <div class="row">
@ -40,38 +43,39 @@
<div class="box-header"> <div class="box-header">
<span ng-bind="report.month"></span> <span ng-bind="report.month"></span>
<span ng-bind="report.analysis.gross_amount"></span> <span ng-bind="report.analysis.gross_amount"></span>
<a role="button" class="btn btn-primary pull-right" ng-href="/sys/financial/settlement/month_reports/{{report.month}}/xls"> <a role="button" class="btn btn-primary pull-right"
ng-href="/sys/financial/settlement/month_reports/{{report.month}}/xls">
<i class="fa fa-file-excel-o"></i> Export Excel <i class="fa fa-file-excel-o"></i> Export Excel
</a> </a>
</div> </div>
<div class="box-body table-responsive"> <div class="box-body table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>清算日期</th> <th>清算日期</th>
<th>净交易额(扣除退款)</th> <th>净交易额(扣除退款)</th>
<th>清算总额</th> <th>清算总额</th>
<th>清算给商户总额</th> <th>清算给商户总额</th>
<th>RoyalPay手续费</th> <th>RoyalPay手续费</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="settle in report.settlements"> <tr ng-repeat="settle in report.settlements">
<td ng-bind="settle.settle_date|limitTo:10"></td> <td ng-bind="settle.settle_date|limitTo:10"></td>
<td ng-bind="settle.gross_amount|currency:'$'"></td> <td ng-bind="settle.gross_amount|currency:'$'"></td>
<td ng-bind="settle.wechat_settlement|currency:'$'"></td> <td ng-bind="settle.wechat_settlement|currency:'$'"></td>
<td ng-bind="settle.net_amount|currency:'$'"></td> <td ng-bind="settle.net_amount|currency:'$'"></td>
<td ng-bind="settle.royalpay_charge|currency:'$'"></td> <td ng-bind="settle.royalpay_charge|currency:'$'"></td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td><b>Total</b></td> <td><b>Total</b></td>
<td class="text-green" ng-bind="analysis.gross_amount|currency:'$'"></td> <td class="text-green" ng-bind="analysis.gross_amount|currency:'$'"></td>
<td class="text-green" ng-bind="analysis.wechat_settlement|currency:'$'"></td> <td class="text-green" ng-bind="analysis.wechat_settlement|currency:'$'"></td>
<td class="text-green" ng-bind="analysis.net_amount|currency:'$'"></td> <td class="text-green" ng-bind="analysis.net_amount|currency:'$'"></td>
<td class="text-green" ng-bind="analysis.royalpay_charge|currency:'$'"></td> <td class="text-green" ng-bind="analysis.royalpay_charge|currency:'$'"></td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
</div> </div>

@ -2,427 +2,532 @@
* Created by yixian on 2017-02-08. * Created by yixian on 2017-02-08.
*/ */
define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
'use strict'; 'use strict'
var app = angular.module('bdprize', ['ui.router']); var app = angular.module('bdprize', ['ui.router'])
app.config(['$stateProvider', function ($stateProvider) { app.config([
$stateProvider.state('analysis_bd.bd_prizes', { '$stateProvider',
url: '/bd_prizes', function ($stateProvider) {
templateUrl: '/static/config/bdprize/templates/bd_prize_root.html', $stateProvider
controller: 'bdPrizeRootCtrl' .state('analysis_bd.bd_prizes', {
}).state('analysis_bd.bd_prizes.month_report', { url: '/bd_prizes',
url: '/{month}', templateUrl: '/static/config/bdprize/templates/bd_prize_root.html',
templateUrl: '/static/config/bdprize/templates/bd_prize_month_report.html', controller: 'bdPrizeRootCtrl',
controller: 'bdPrizeMonthReportCtrl', })
resolve: { .state('analysis_bd.bd_prizes.month_report', {
report: ['$http', '$stateParams', function ($http, $stateParams) { url: '/{month}',
return $http.get('/sys/bd_prize/records/' + $stateParams.month); templateUrl: '/static/config/bdprize/templates/bd_prize_month_report.html',
}] controller: 'bdPrizeMonthReportCtrl',
} resolve: {
}).state('analysis_bd.bd_prizes.month_report.detail', { report: [
url: '/bd_user/{bdId}', '$http',
templateUrl: '/static/config/bdprize/templates/bd_prize_detail.html', '$stateParams',
controller: 'bdPrizeDetailCtrl', function ($http, $stateParams) {
resolve: { return $http.get('/sys/bd_prize/records/' + $stateParams.month)
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', { .state('analysis_bd.bd_prizes.month_report.detail', {
url: '/{month}/my_report', url: '/bd_user/{bdId}',
templateUrl: '/static/config/bdprize/templates/bd_prize_detail.html', templateUrl: '/static/config/bdprize/templates/bd_prize_detail.html',
controller: 'bdPrizeDetailCtrl', controller: 'bdPrizeDetailCtrl',
resolve: { resolve: {
detail: ['$http', '$stateParams', function ($http, $stateParams) { detail: [
return $http.get('/sys/bd_prize/records/' + $stateParams.month + '/bd_user_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) { app.controller('bdPrizeRootCtrl', [
$scope.params = {year: new Date().getFullYear()}; '$scope',
$scope.generate = {}; '$http',
$scope.availableYears = [new Date().getFullYear() - 1, new Date().getFullYear()]; '$uibModal',
$scope.kpiRanges = [{value: 1, label: '0-50%'}, {value: 2, label: '50%~80%'}, {value: 3, label: '80%~100%'}, 'commonDialog',
{value: 4, label: '100%-120%'}, {value: 5, label: '>=120%'}]; '$filter',
$scope.initMonth = function (year) { function ($scope, $http, $uibModal, commonDialog, $filter) {
$scope.params.year = year; $scope.params = { year: new Date() }
$scope.months = []; $scope.generate = {}
for (var i = 1; i < 13; i++) { $scope.kpiRanges = [
var mon = '00' + i; { value: 1, label: '0-50%' },
mon = mon.substr(mon.length - 2, 2); { value: 2, label: '50%~80%' },
$scope.months.push(year + '-' + mon); { value: 3, label: '80%~100%' },
} { value: 4, label: '100%-120%' },
}; { value: 5, label: '>=120%' },
$scope.hasReport = function (mon) { ]
if ($scope.reportMonths != null) { $scope.initMonth = function () {
var have = false; const year = $scope.params.year.getFullYear()
angular.forEach($scope.reportMonths, function (month) { $scope.months = []
if (mon == month.month) { for (var i = 1; i < 13; i++) {
have = true; var mon = '00' + i
} mon = mon.substr(mon.length - 2, 2)
}); $scope.months.push(year + '-' + mon)
return have; }
} else { }
return false; $scope.hasReport = function (mon) {
} if ($scope.reportMonths != null) {
}; var have = false
$scope.getYearReports = function (year) { angular.forEach($scope.reportMonths, function (month) {
$scope.initMonth(year); if (mon == month.month) {
$http.get('/sys/bd_prize/records', {params: {year: year}}).then(function (resp) { have = true
$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;
} }
commonDialog.confirm({ })
title: 'Warning', return have
content: 'This operation will clear the result of last month generated before. Are you sure?' } else {
}).then(function () { return false
$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.getYearReports = function () {
$scope.generate.status = null; const year = $scope.params.year.getFullYear()
commonDialog.alert({title: 'Success', content: 'Generate Finished', type: 'success'}); $scope.initMonth()
$scope.getYearReports($scope.params.year); $http.get('/sys/bd_prize/records', { params: { year: year } }).then(function (resp) {
}, function (resp) { $scope.reportMonths = resp.data.data
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); })
$scope.generate.status = null; }
}) $scope.getYearReports()
}) $scope.generateReport = function () {
}; if (!$scope.generate.month) {
$scope.loadRateConfigs = function () { commonDialog.alert({
$http.get('/sys/bd_prize/config/rates').then(function (resp) { type: 'error',
$scope.bd_rate_configs = resp.data; title: 'Error',
$scope.kpi_ranges = []; content: 'Select a month first!',
var kpiStart = []; })
angular.forEach($scope.bd_rate_configs, function (cfg) { return
if (kpiStart.indexOf(cfg.kpi_range) < 0) { }
kpiStart.push(cfg.kpi_range); commonDialog
$scope.kpi_ranges.push(cfg); .confirm({
} title: 'Warning',
}) content: 'This operation will clear the result of last month generated before. Are you sure?',
}) })
}; .then(function () {
$scope.loadRateConfigs(); $scope.generate.status = {}
$scope.editRateConfig = function () { var params = { month: $filter('date')($scope.generate.month, 'yyyy-MM') }
$uibModal.open({ $http.post('/sys/bd_prize/generate_record/' + params.month, null, { timeout: 60000 }).then(
backdrop: 'static', keyboard: false, function (resp) {
templateUrl: '/static/config/bdprize/templates/rate_config_dialog.html', $scope.generate.status = null
controller: 'bdRateConfigCtrl', commonDialog.alert({ title: 'Success', content: 'Generate Finished', type: 'success' })
resolve: { $scope.getYearReports()
rates: function () { },
return angular.copy($scope.bd_rate_configs); function (resp) {
} commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
} $scope.generate.status = null
}).result.then(function () { }
$scope.loadRateConfigs(); )
}) })
}; }
$scope.editBDLevels = function () { $scope.loadRateConfigs = function () {
$uibModal.open({ $http.get('/sys/bd_prize/config/rates').then(function (resp) {
backdrop: 'static', keyboard: false, $scope.bd_rate_configs = resp.data
templateUrl: '/static/config/bdprize/templates/bd_level_config_dialog.html', $scope.kpi_ranges = []
size: 'lg', var kpiStart = []
controller: 'bdLevelConfigCtrl' angular.forEach($scope.bd_rate_configs, function (cfg) {
}) if (kpiStart.indexOf(cfg.kpi_range) < 0) {
}; kpiStart.push(cfg.kpi_range)
$scope.editCommissionConfig = function (monModal) { $scope.kpi_ranges.push(cfg)
$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;
})
} }
})
})
}
$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 () {
$scope.loadPersonalCommission(); 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) {
app.controller('bdRateConfigCtrl', ['$scope', '$http', 'rates', function ($scope, $http, rates) { $scope.personalCommission = resp.data
$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;
})
}
} }
}]); }
app.controller('bdLevelConfigCtrl', ['$scope', '$http', function ($scope, $http) { $scope.loadPersonalCommission()
$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) { app.controller('bdRateConfigCtrl', [
$scope.bdgroups = resp.data; '$scope',
$scope.getBDLevels(); '$http',
}) 'rates',
}; function ($scope, $http, rates) {
$scope.getBDGroups(); $scope.bdLevels = [
$scope.getBDLevels = function () { { value: 1, label: 'Junior' },
$http.get('/sys/bd_prize/config/bd_levels').then(function (resp) { { value: 2, label: 'Intermediate' },
$scope.bds = resp.data; { value: 3, label: 'Senior' },
}) ]
}; $scope.months = [
{ value: 1, label: '1-3 Months' },
$scope.bdLevels = [{value: 1, label: 'Junior'}, {value: 2, label: 'Intermediate'}, {value: 3, label: 'Senior'}]; { value: 2, label: '4-6 Months' },
$scope.updateBDLevel = function (bdInfo) { {
$http.put('/sys/bd_prize/config/bd_levels/' + bdInfo.manager_id, bdInfo).then(function () { value: 3,
$scope.getBDGroups(); label: '>=7 Months',
}, function (resp) { },
$scope.errmsg = resp.data.message; ]
}) $scope.kpiRanges = [
}; { value: 1, label: '0-50%' },
}]); { value: 2, label: '50%~80%' },
app.controller('bdCommissionConfigCtrl', ['$scope', '$state', '$http', '$filter', 'monModal', function ($scope, $state, $http, $filter, monModal) { { value: 3, label: '80%~100%' },
$scope.monModal = monModal; { value: 4, label: '100%-120%' },
$scope.params = {year: new Date().getFullYear()}; { value: 5, label: '>=120%' },
$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.clientRate = [
// $scope.newSwitch; { value: 0.6, label: '0.6-0.79' },
$scope.initMonth = function (year) { { value: 0.8, label: '0.8-2.0' },
$scope.params.year = year; ]
$scope.months = []; $scope.filter = { bd_level: 1, rate_from: 0.6 }
for (var i = 1; i < 13; i++) { $scope.rates = rates
var mon = '00' + i; $scope.submitRates = function () {
mon = mon.substr(mon.length - 2, 2); var validation = null
$scope.months.push(year + '-' + mon); $scope.errmsg = null
} angular.forEach($scope.rates, function (rate) {
}; if (isNaN(rate.prize_rate)) {
$scope.initMonth(new Date().getFullYear()); validation = { months: rate.time_range, bd_level: rate.bd_level }
$scope.hasReport = function (mon) { $scope.errmsg = 'Rate Value is NaN'
var start = '2017-01';//todo change for different country }
var end = $filter('date')(new Date(), 'yyyy-MM'); if (rate.prize_rate > 1) {
return start <= mon && end >= mon validation = { months: rate.time_range, bd_level: rate.bd_level }
}; $scope.errmsg = 'Rate value shall no more than 1%'
$scope.getBDLevels = function () { }
$http.get('/sys/bd_prize/config/bd_levels').then(function (resp) { if (rate.prize_rate < 0) {
$scope.bds = resp.data; validation = { months: rate.time_range, bd_level: rate.bd_level }
}) $scope.errmsg = 'Rate value shall be a positive value'
}; }
$scope.getBDLevels(); })
$scope.chooseLastConfig = function (mon) { if (!validation) {
let year = new Date(mon).getFullYear(); $http.put('/sys/bd_prize/config/rates', $scope.rates).then(
let month = new Date(mon).getMonth(); function () {
if(month == 0){ $scope.$close()
year--; },
month = year + '-12'; function (resp) {
}else if(month <= 9){ $scope.errmsg = resp.data.message
month = year + '-0' + month;
}else {
month = year + '-' + month;
} }
$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; app.controller('bdLevelConfigCtrl', [
if (!data.bd_type) { '$scope',
$scope.errmsg = "BD Type not be null"; '$http',
$scope.check = false; function ($scope, $http) {
return; $scope.bdtypes = [
} { id: 1, label: 'BD Manager(Sydney)' },
if (!data.bd_commission_rate) { { id: 2, label: 'KA Manager(Sydney)' },
$scope.errmsg = "BD Rate not be null"; { id: 6, label: 'BD Manager(Melbourne)' },
$scope.check = false; { id: 7, label: 'KA Manager(Melbourne)' },
return; ]
} $scope.getBDGroups = function () {
if (data.bd_commission_rate) { $http.get('/sys/manager_accounts/roles/bd_leader').then(function (resp) {
if (data.bd_commission_rate > 10) { $scope.bdgroups = resp.data
$scope.errmsg = "BD Rate is too big"; $scope.getBDLevels()
$scope.check = false; })
return; }
} $scope.getBDGroups()
} $scope.getBDLevels = function () {
if (!data.commission_start_amount && data.commission_start_amount != 0) { $http.get('/sys/bd_prize/config/bd_levels').then(function (resp) {
$scope.errmsg = "Commission Amount not be null"; $scope.bds = resp.data
$scope.check = false; })
return; }
}
if (data.commission_end_amount || data.commission_end_amount == 0) { $scope.bdLevels = [
if (data.commission_start_amount >= data.commission_end_amount) { { value: 1, label: 'Junior' },
$scope.errmsg = "Commission Start Amount should less than End Amount"; { value: 2, label: 'Intermediate' },
$scope.check = false; { value: 3, label: 'Senior' },
return; ]
} $scope.updateBDLevel = function (bdInfo) {
} $http.put('/sys/bd_prize/config/bd_levels/' + bdInfo.manager_id, bdInfo).then(
}); function () {
if ($scope.check) { $scope.getBDGroups()
$http.post('/sys/bd_prize/commission/le_ma/update/' + mon, bdlm).then(function (resp) { },
$scope.$close(); function (resp) {
// $scope.bdlm = null; $scope.errmsg = resp.data.message
// $scope.bdmon; }
// $scope.listConfig = false; )
// $scope.listCurrentMonBDCommission(mon); }
}) },
} ])
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.initMonth(new Date().getFullYear())
$scope.errmsg = null; $scope.hasReport = function (mon) {
angular.forEach(bds, function (data, index) { var start = '2017-01' //todo change for different country
if(data.get_prize){ var end = $filter('date')(new Date(), 'yyyy-MM')
if (!data.kpi_amount) { return start <= mon && end >= mon
$scope.errmsg = "BD kpi Amount not be null"; }
$scope.check = false; $scope.getBDLevels = function () {
return; $http.get('/sys/bd_prize/config/bd_levels').then(function (resp) {
} $scope.bds = resp.data
} })
}); }
if ($scope.check) { $scope.getBDLevels()
$http.post('/sys/bd_prize/commission/kpi/update/' + mon, bds).then(function (resp) { $scope.chooseLastConfig = function (mon) {
$scope.$close(); 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
} }
}]); $http.get('/sys/bd_prize/commission/le_ma/' + month).then(function (resp) {
app.controller('bdPrizeMonthReportCtrl', ['$scope', '$http', 'report', function ($scope, $http, report) { $scope.bdlm = []
$scope.report = report.data; angular.forEach(resp.data, function (e) {
}]); var bdC = {}
app.controller('bdPrizeDetailCtrl', ['$scope', 'detail', function ($scope, detail) { bdC.commission_start_amount = e.commission_start_amount
$scope.detail = detail.data; bdC.commission_end_amount = e.commission_end_amount
}]); bdC.bd_commission_rate = e.bd_commission_rate
app.filter('financialBdLevel', function () { bdC.bd_type = e.bd_type
return function (level) { $scope.bdlm.push(bdC)
switch (level) { })
case 0: $scope.listConfig = true
return 'Leader'; })
case 1: }
return 'Junior'; $scope.listCurrentMonBDCommission = function (mon) {
case 2: $http.get('/sys/bd_prize/commission/le_ma/' + mon).then(function (resp) {
return 'Intermediate'; $scope.bdlm = resp.data
case 3: $scope.bdmon = mon
return 'Senior'; $scope.listConfig = true
default: })
return 'Unknown'; }
$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) {
app.filter('financialClientSource', function () { $scope.errmsg = 'Commission Amount not be null'
return function (source) { $scope.check = false
switch (source) { return
case 1: }
return 'BD'; if (data.commission_end_amount || data.commission_end_amount == 0) {
case 2: if (data.commission_start_amount >= data.commission_end_amount) {
return 'Apply'; $scope.errmsg = 'Commission Start Amount should less than End Amount'
case 3: $scope.check = false
return 'Distribute'; return
default:
return 'Unknown';
} }
}
})
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 () { $scope.submitBdCommmissionConfig = function (mon, bds) {
return function (arr, filterObj) { $scope.check = true
if (arr == null || filterObj == null) { $scope.errmsg = null
return arr; 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) { app.controller('bdPrizeMonthReportCtrl', [
case 'Alipay': '$scope',
return '/static/images/alipay_sign_lg.png'; '$http',
case 'AlipayOnline': 'report',
return '/static/images/alipay_online.png'; function ($scope, $http, report) {
case 'System': $scope.report = report.data
return '/static/images/royalpay_sign.png'; },
case 'Bestpay': ])
return '/static/images/bestpay_sign_lg.png'; app.controller('bdPrizeDetailCtrl', [
case 'Wechat': '$scope',
return '/static/images/wechatpay_sign_lg.png'; 'detail',
case 'jd': function ($scope, detail) {
return '/static/images/jd_sign_lg.png'; $scope.detail = detail.data
case 'hf': },
return '/static/images/hf_sign_lg.png'; ])
case 'Rpay': app.filter('financialBdLevel', function () {
return '/static/images/rpayplus_sign_lg.png'; return function (level) {
case 'Yeepay': switch (level) {
return '/static/images/yeepay_sign_lg.png'; case 0:
case 'LakalaPay': return 'Leader'
return '/static/images/lakalapay_sign_lg.png'; case 1:
case 'rpaypmt_card': return 'Junior'
return '/static/images/card_payment_sign_lg.png'; case 2:
case 'rpaypmt_dd': return 'Intermediate'
return '/static/images/direct_debit_sign_lg.png'; 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 arr.filter(function (item) {
return app; 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
})

@ -13,15 +13,17 @@
<div class="box-body"> <div class="box-body">
<div class="form-inline"> <div class="form-inline">
<!--<div class="form-group">--> <!--<div class="form-group">-->
<!--<input type="text" class="form-control" uib-datepicker-popup="yyyy-MM" ng-model="generate.month"--> <!--<input type="text" class="form-control" uib-datepicker-popup="yyyy-MM" ng-model="generate.month"-->
<!--is-open="ctrl.genmonth" datepicker-options="{minMode: 'month'}"--> <!--is-open="ctrl.genmonth" datepicker-options="{minMode: 'month'}"-->
<!--ng-click="ctrl.genmonth=true" placeholder="Select Month"/>--> <!--ng-click="ctrl.genmonth=true" placeholder="Select Month"/>-->
<!--</div>--> <!--</div>-->
<!--<button class="btn btn-primary" ng-click="generateReport()" ng-disabled="!generate.month">--> <!--<button class="btn btn-primary" ng-click="generateReport()" ng-disabled="!generate.month">-->
<!--Generate Report--> <!--Generate Report-->
<!--</button>--> <!--</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="editRateConfig()"><i class="fa fa-cog"></i> Edit
<button class="btn btn-primary" ng-click="editBDLevels()"><i class="fa fa-user"></i> Edit BD Level</button> 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> <loadingbar ng-if="generate.status"></loadingbar>
</div> </div>
</div> </div>
@ -33,30 +35,29 @@
</div> </div>
<div class="box box-default" ng-if="('1000'|withRole) || ('1000000'|withRole) || ('10000000000000'|withRole)"> <div class="box box-default" ng-if="('1000'|withRole) || ('1000000'|withRole) || ('10000000000000'|withRole)">
<div class="box-header"> <div class="box-header">
<!-- <div uib-dropdown> <!-- <div uib-dropdown>
<button class="btn btn-primary" uib-dropdown-toggle type="button" ng-bind="params.year"></button> <button class="btn btn-primary" uib-dropdown-toggle type="button" ng-bind="params.year"></button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu"> <ul class="dropdown-menu" uib-dropdown-menu role="menu">
<li ng-repeat="year in availableYears" role="menuitem"><a role="button" ng-click="getYearReports(year)" ng-bind="year"></a></li> <li ng-repeat="year in availableYears" role="menuitem"><a role="button" ng-click="getYearReports(year)" ng-bind="year"></a></li>
</ul> </ul>
</div>--> </div>-->
<div ng-repeat="year in availableYears" style="display: inline"> <button class="btn btn-info" ng-bind="params.year.getFullYear()" ng-click="ctrl.viewyear=true"></button>
<button class="btn btn-info" <input type="text" class="hidden" uib-datepicker-popup="yyyy" ng-model="params.year"
ng-click="getYearReports(year)" is-open="ctrl.viewyear" datepicker-options="{minMode: 'year'}" ng-change="getYearReports()"
ng-bind="year" placeholder="Select Year">
ng-class="{'active':year == params.year}"
></button>
</div>
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="row"> <div class="row">
<div class="col-xs-2" style="text-align: center" ng-repeat="mon in months"> <div class="col-xs-2" style="text-align: center" ng-repeat="mon in months">
<a ng-if="hasReport(mon) && (('10000000000000'|withRole)||('1000'|withRole))"> <a ng-if="hasReport(mon) && (('10000000000000'|withRole)||('1000'|withRole))">
<h2 ROLE="button" class="text-success" ui-sref=".month_report({month:mon})" ng-bind="mon.substring(5,7)"></h2> <h2 ROLE="button" class="text-success" ui-sref=".month_report({month:mon})"
ng-bind="mon.substring(5,7)"></h2>
<span class="fa fa-edit btn" ng-click="editCommissionConfig(mon)"></span> <span class="fa fa-edit btn" ng-click="editCommissionConfig(mon)"></span>
<span class="fa fa-download btn" ng-click="exportCommission(mon)"></span> <span class="fa fa-download btn" ng-click="exportCommission(mon)"></span>
</a> </a>
<a ng-if="hasReport(mon) && ('100'|withRole) && (!('1000'|withRole))"> <a ng-if="hasReport(mon) && ('100'|withRole) && (!('1000'|withRole))">
<h2 ROLE="button" class="text-success" ui-sref=".bd_detail({month:mon})" ng-bind="mon.substring(5,7)"></h2> <h2 ROLE="button" class="text-success" ui-sref=".bd_detail({month:mon})"
ng-bind="mon.substring(5,7)"></h2>
<span class="fa fa-edit btn" ng-click="editCommissionConfig(mon)"></span> <span class="fa fa-edit btn" ng-click="editCommissionConfig(mon)"></span>
<span class="fa fa-download btn" ng-click="exportCommission(mon)"></span> <span class="fa fa-download btn" ng-click="exportCommission(mon)"></span>
</a> </a>
@ -73,43 +74,44 @@
<div class="box-body"> <div class="box-body">
<table class="table table-bordered table-hover table-striped"> <table class="table table-bordered table-hover table-striped">
<thead> <thead>
<tr> <tr>
<th>Month</th> <th>Month</th>
<th>KPI</th> <th>KPI</th>
<th>BD Level</th> <th>BD Level</th>
<th>Transaction Amount</th> <th>Transaction Amount</th>
<th>Total Commission</th> <th>Total Commission</th>
<th>Send Commission</th> <th>Send Commission</th>
<th>Hold Commission</th> <th>Hold Commission</th>
<th>Prize Type</th> <th>Prize Type</th>
<th>Details</th> <th>Details</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="commission in personalCommission"> <tr ng-repeat="commission in personalCommission">
<td>{{commission.month}}</td> <td>{{commission.month}}</td>
<td> <td>
<span ng-if="commission.kpi_amount">{{commission.kpi_amount}}</span> <span ng-if="commission.kpi_amount">{{commission.kpi_amount}}</span>
<span ng-if="!commission.kpi_amount">0.00</span> <span ng-if="!commission.kpi_amount">0.00</span>
</td> </td>
<td ng-bind="commission.bd_level|financialBdLevel"></td> <td ng-bind="commission.bd_level|financialBdLevel"></td>
<td>{{commission.total_amount|currency:'AUD '}}</td> <td>{{commission.total_amount|currency:'AUD '}}</td>
<td ng-bind="commission.total_prize|currency:'AUD '"></td> <td ng-bind="commission.total_prize|currency:'AUD '"></td>
<td ng-bind="commission.total_send_prize|currency:'AUD '"></td> <td ng-bind="commission.total_send_prize|currency:'AUD '"></td>
<td ng-bind="commission.total_hold_prize|currency:'AUD '"></td> <td ng-bind="commission.total_hold_prize|currency:'AUD '"></td>
<td> <td>
<span ng-if="commission.prize_type==0">BD</span> <span ng-if="commission.prize_type==0">BD</span>
<span ng-if="commission.prize_type==1">Group</span> <span ng-if="commission.prize_type==1">Group</span>
</td> </td>
<td> <td>
<a ui-sref=".bd_detail({month:commission.month})" ng-if="commission.prize_type==0"> <a ui-sref=".bd_detail({month:commission.month})" ng-if="commission.prize_type==0">
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</a> </a>
<a ng-href="/sys/bd_prize/commission/export/{{commission.month}}/bd_users" ng-if="commission.prize_type==0"> <a ng-href="/sys/bd_prize/commission/export/{{commission.month}}/bd_users"
<i class="fa fa-download"></i> ng-if="commission.prize_type==0">
</a> <i class="fa fa-download"></i>
</td> </a>
</tr> </td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -121,32 +123,34 @@
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover">
<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>
</tr> </tr>
<tr> <tr>
<th>费率</th> <th>费率</th>
<th>0.6-0.79</th> <th>0.6-0.79</th>
<th>0.8-2.0</th> <th>0.8-2.0</th>
<th>0.6-0.79</th> <th>0.6-0.79</th>
<th>0.8-2.0</th> <th>0.8-2.0</th>
<th>0.6-0.79</th> <th>0.6-0.79</th>
<th>0.8-2.0</th> <th>0.8-2.0</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="range in kpi_ranges"> <tr ng-repeat="range in kpi_ranges">
<td ng-bind="'#'+($index+1)"></td> <td ng-bind="'#'+($index+1)"></td>
<td ng-bind="(kpiRanges|filter:{value:range.kpi_range})[0].label"></td> <td ng-bind="(kpiRanges|filter:{value:range.kpi_range})[0].label"></td>
<td ng-repeat-start="level in [1,2,3] track by $index" <td ng-repeat-start="level in [1,2,3] track by $index"
ng-bind="(bd_rate_configs|filter:{kpi_range:range.kpi_range,bd_level:level,rate_from:0.6})[0].prize_rate+'%'"></td> ng-bind="(bd_rate_configs|filter:{kpi_range:range.kpi_range,bd_level:level,rate_from:0.6})[0].prize_rate+'%'">
<td ng-repeat-end </td>
ng-bind="(bd_rate_configs|filter:{kpi_range:range.kpi_range,bd_level:level,rate_from:0.8})[0].prize_rate+'%'"></td> <td ng-repeat-end
</tr> ng-bind="(bd_rate_configs|filter:{kpi_range:range.kpi_range,bd_level:level,rate_from:0.8})[0].prize_rate+'%'">
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -155,11 +159,13 @@
<li>按月度发放</li> <li>按月度发放</li>
<li>每月发放总提成额度的60%剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放</li> <li>每月发放总提成额度的60%剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放</li>
<li>提前离职者40%提成不予发放</li> <li>提前离职者40%提成不予发放</li>
<li>年度考评根据销管中心每月考评表打分制进行统计按照考评分数对应比例发放40%的占比部分扣下部分如果第二年考评超出一定评分110%可以补发同样如果年度考评分数超过100 分按照同比例发放</li> <li>年度考评根据销管中心每月考评表打分制进行统计按照考评分数对应比例发放40%的占比部分扣下部分如果第二年考评超出一定评分110%可以补发同样如果年度考评分数超过100 分按照同比例发放
</li>
<li>商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配</li> <li>商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配</li>
<li>连续 2 个月不产生流水的商户,由销管部统一收回,重新分配</li> <li>连续 2 个月不产生流水的商户,由销管部统一收回,重新分配</li>
<li>分配后的商户流水客户专员只能占一半</li> <li>分配后的商户流水客户专员只能占一半</li>
<li>离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1 个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护; <li>离职及调岗人员商户统一上交销管中心,由销管中心 leader 及跨境事业部总监相互协商及相互监督,按照公平公正的原则, 做出分配方案,并由总监确认后统一分配。调岗人员移交的商户,在移交后 1
个月内移交人员和接收人员平分该商家产生的提成,移交人员需配合接收人员做好商户对接和短期内的商户维护;
离职人员交接的商户提成,接收人员享受一半的提成,另一半作为跨境客服专员福利会基金</li> 离职人员交接的商户提成,接收人员享受一半的提成,另一半作为跨境客服专员福利会基金</li>
<li>被客户投诉情况严重者,此商户由销管中心无条件收回重新分配</li> <li>被客户投诉情况严重者,此商户由销管中心无条件收回重新分配</li>
<li>活动执行未传达到位且出现舞弊、徇私、懒惰等行为的,商户上交由销管中心统一分配</li> <li>活动执行未传达到位且出现舞弊、徇私、懒惰等行为的,商户上交由销管中心统一分配</li>

@ -1,204 +1,253 @@
/** /**
* Created by yixian on 2017-03-08. * Created by yixian on 2017-03-08.
*/ */
var commissionTypeMap = [{ var commissionTypeMap = [
"label": 1, {
"value": "渠道计算法" label: 1,
}, value: '渠道计算法',
{ },
"label": 2, {
"value": "总交易额比例" label: 2,
}, value: '总交易额比例',
{ },
"label": 3, {
"value": "收益比例" label: 3,
} value: '收益比例',
]; },
define(['angular','../../analysis/org/analysis-org'], function (angular) { ]
'use strict'; define(['angular', '../../analysis/org/analysis-org'], function (angular) {
var app = angular.module('orgcommission', ['ui.router']); 'use strict'
app.config(['$stateProvider', function ($stateProvider) { var app = angular.module('orgcommission', ['ui.router'])
$stateProvider.state('analysis_org.commission', { app.config([
url: '/org_commissions', '$stateProvider',
templateUrl: '/static/config/orgcommission/templates/org_commission_root.html', function ($stateProvider) {
controller: 'orgCommissionRootCtrl' $stateProvider
}).state('analysis_org.commission.month', { .state('analysis_org.commission', {
url: '/commissionorg/months/{monthStr}', url: '/org_commissions',
templateUrl: '/static/config/orgcommission/templates/org_commission_month_root.html', templateUrl: '/static/config/orgcommission/templates/org_commission_root.html',
controller: 'commissionMonthRootCtrl' controller: 'orgCommissionRootCtrl',
}).state('analysis_org.info', { })
url: '/commissionorg/info', .state('analysis_org.commission.month', {
templateUrl: '/static/config/orgcommission/templates/org_commission_info.html', url: '/commissionorg/months/{monthStr}',
controller: 'commissionMonthRootCtrl' templateUrl: '/static/config/orgcommission/templates/org_commission_month_root.html',
}).state('analysis_org.commission.month.org', { controller: 'commissionMonthRootCtrl',
url: '/org', })
templateUrl: '/static/config/orgcommission/templates/org_commission_month.html', .state('analysis_org.info', {
controller: 'orgCommissionMonthViewCtrl', url: '/commissionorg/info',
resolve: { templateUrl: '/static/config/orgcommission/templates/org_commission_info.html',
monthData: ['$http', '$stateParams', function ($http, $stateParams) { controller: 'commissionMonthRootCtrl',
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr); })
}] .state('analysis_org.commission.month.org', {
} url: '/org',
}).state('analysis_org.commission.month.referrer', { templateUrl: '/static/config/orgcommission/templates/org_commission_month.html',
url: '/referrer', controller: 'orgCommissionMonthViewCtrl',
templateUrl: '/static/config/referrercommission/templates/referrer_commission_month.html', resolve: {
controller: 'referrerCommissionMonthViewCtrl', monthData: [
resolve: { '$http',
monthData: ['$http', '$stateParams', function ($http, $stateParams) { '$stateParams',
return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr); function ($http, $stateParams) {
}] return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr)
} },
}).state('analysis_org.commission.month.org.orgdetail', { ],
url: '/citypartners/{orgId}', },
templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html', })
controller: 'orgCommissionOrgDetailCtrl', .state('analysis_org.commission.month.referrer', {
resolve: { url: '/referrer',
detail: ['$http', '$stateParams', function ($http, $stateParams) { templateUrl: '/static/config/referrercommission/templates/referrer_commission_month.html',
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId); controller: 'referrerCommissionMonthViewCtrl',
}] resolve: {
} monthData: [
}).state('analysis_org.commission.month.referrer.referrerdetail', { '$http',
url: '/referrer_commissions/{orgId}', '$stateParams',
templateUrl: '/static/config/referrercommission/templates/referrer_commission_detail.html', function ($http, $stateParams) {
controller: 'referrerCommissionOrgDetailCtrl', return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr)
resolve: { },
detail: ['$http', '$stateParams', function ($http, $stateParams) { ],
return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId); },
}] })
} .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', {
app.controller('commissionMonthRootCtrl', ['$scope', '$state', function ($scope, $state) { url: '/referrer_commissions/{orgId}',
if($state.is('analysis_org.commission.month')){ templateUrl: '/static/config/referrercommission/templates/referrer_commission_detail.html',
$state.go('.org'); 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
} }
}]); commonDialog
app.controller('orgCommissionRootCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog', .confirm({
function ($scope, $http, $filter, $state, commonDialog) { title: 'Confirm',
$scope.generate = {}; content: 'This operation will clear the data generated before, Are you sure?',
$scope.generateOrgCommission = function () { })
$scope.generate.status = {}; .then(function () {
if (!$scope.generate.month) { var params = { month: $filter('date')($scope.generate.month, 'yyyy-MM') }
commonDialog.alert({ $http.post('/sys/citypartner_prizes/generate', params).then(
type: 'error', title: 'Error', content: 'Select a month first!' function () {
}); $state.go('.org.month', { monthStr: params.month })
return; $scope.generate.status = null
} },
commonDialog.confirm({ function (resp) {
title: 'Confirm', commonDialog.alert({ type: 'error', title: 'Error', content: resp.data.message })
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.params = { year: new Date() }
$scope.generate.status = null; $scope.loadAvailableMonths = function () {
}, function (resp) { const year = $scope.params.year.getFullYear()
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message}); $http.get('/sys/citypartner_prizes/months', { params: { year: year } }).then(function (resp) {
}) $scope.availableMonths = resp.data
}) })
}; }
$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;
})
$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
} }
}]); var monthStr = $scope.params.year.getFullYear() + '-' + $scope.params.month
app.controller('orgCommissionOrgDetailCtrl', ['$scope', 'detail', function ($scope, detail) { $state.go('analysis_org.commission.month', { monthStr: monthStr })
$scope.detail = detail.data; }
$scope.ctrl = {}; },
$scope.active = function (log) { ])
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker==log.client_moniker){ app.controller('orgCommissionMonthViewCtrl', [
$scope.ctrl.activeLog=null; '$scope',
return; 'monthData',
} '$http',
$scope.ctrl.activeLog=log; 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) { app.controller('referrerCommissionMonthViewCtrl', [
$scope.monthData = monthData.data; '$scope',
$scope.ctrl = {}; 'monthData',
$scope.active = function (log) { function ($scope, monthData) {
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id==log.org_id){ $scope.monthData = monthData.data
$scope.ctrl.activeLog=null; $scope.ctrl = {}
return; $scope.active = function (log) {
} if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id == log.org_id) {
$scope.ctrl.activeLog=log; $scope.ctrl.activeLog = null
return
} }
}]); $scope.ctrl.activeLog = log
}
},
])
app.controller('referrerCommissionOrgDetailCtrl', ['$scope', 'detail', function ($scope, detail) { app.controller('referrerCommissionOrgDetailCtrl', [
$scope.detail = detail.data; '$scope',
$scope.ctrl = {}; 'detail',
$scope.active = function (log) { function ($scope, detail) {
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker==log.client_moniker){ $scope.detail = detail.data
$scope.ctrl.activeLog=null; $scope.ctrl = {}
return; $scope.active = function (log) {
} if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker == log.client_moniker) {
$scope.ctrl.activeLog=log; $scope.ctrl.activeLog = null
return
} }
}]); $scope.ctrl.activeLog = log
}
},
])
app.filter('commission_type_filter', function () { app.filter('commission_type_filter', function () {
return function (sectorValue) { return function (sectorValue) {
var sectorLabel = ''; var sectorLabel = ''
angular.forEach(commissionTypeMap, function (sector) { angular.forEach(commissionTypeMap, function (sector) {
if (sector.label == sectorValue) { if (sector.label == sectorValue) {
sectorLabel = sector.value; sectorLabel = sector.value
}
});
return sectorLabel;
} }
}); })
return sectorLabel
}
return app; })
}); return app
})

@ -11,8 +11,8 @@
<div class="form-inline"> <div class="form-inline">
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" uib-datepicker-popup="yyyy-MM" ng-model="generate.month" <input type="text" class="form-control" uib-datepicker-popup="yyyy-MM" ng-model="generate.month"
is-open="ctrl.genmonth" datepicker-options="{minMode: 'month'}" is-open="ctrl.genmonth" datepicker-options="{minMode: 'month'}" ng-click="ctrl.genmonth=true"
ng-click="ctrl.genmonth=true" placeholder="Select Month"/> placeholder="Select Month" />
</div> </div>
<button class="btn btn-primary" ng-click="generateOrgCommission()" ng-disabled="!generate.month"> <button class="btn btn-primary" ng-click="generateOrgCommission()" ng-disabled="!generate.month">
Generate Generate
@ -28,18 +28,15 @@
placeholder="Select Year"> placeholder="Select Year">
<span ng-bind="params.year.getFullYear()" ng-click="ctrl.viewyear=true"></span>--> <span ng-bind="params.year.getFullYear()" ng-click="ctrl.viewyear=true"></span>-->
<div ng-repeat="year in availableYears" style="display: inline"> <button class="btn btn-info" ng-bind="params.year.getFullYear()" ng-click="ctrl.viewyear=true"></button>
<button class="btn btn-info" <input type="text" class="hidden" uib-datepicker-popup="yyyy" ng-model="params.year" is-open="ctrl.viewyear"
ng-click="loadAvailableMonths(year)" datepicker-options="{minMode: 'year'}" ng-change="loadAvailableMonths()" placeholder="Select Year">
ng-bind="year"
ng-class="{'active':year == params.year}"
></button>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-3 col-sm-6 col-xs-12" ng-repeat="mon in availableMonths"> <div class="col-md-3 col-sm-6 col-xs-12" ng-repeat="mon in availableMonths">
<div class="info-box"> <div class="info-box">
<div class="info-box-icon bg-aqua" ng-bind="mon.month" ng-click="gotoMonth(mon.month)" role="button"> <div class="info-box-icon bg-aqua" ng-bind="mon.month" ng-click="gotoMonth(mon.month)"
role="button">
</div> </div>
<div class="info-box-content"> <div class="info-box-content">
<!--<div class="info-box-text text-bold text-red" ng-bind="r.charge_date"></div>--> <!--<div class="info-box-text text-bold text-red" ng-bind="r.charge_date"></div>-->

@ -2,239 +2,241 @@
* Created by Tayl0r on 2017/5/24. * Created by Tayl0r on 2017/5/24.
*/ */
define(['angular', 'decimal', 'uiRouter', 'angularEcharts', '../../analysis/report/analysis-report'], function (angular, Decimal) { define(['angular', 'decimal', 'uiRouter', 'angularEcharts', '../../analysis/report/analysis-report'], function (angular, Decimal) {
'use strict'; 'use strict'
var app = angular.module('platformRevenue', ['ui.router']); var app = angular.module('platformRevenue', ['ui.router'])
app.config(['$stateProvider', function ($stateProvider) { app.config([
$stateProvider.state('analysis_report.platformrevenue', { '$stateProvider',
url: '/platformrevenue', function ($stateProvider) {
templateUrl: '/static/config/platformrevenue/templates/platform_revenue_root.html', $stateProvider
controller: 'platformRevenueRootCtrl' .state('analysis_report.platformrevenue', {
}).state('analysis_report.platformsettle', { url: '/platformrevenue',
url: '/platformsettle', templateUrl: '/static/config/platformrevenue/templates/platform_revenue_root.html',
templateUrl: '/static/config/platformrevenue/templates/platform_settle_logs.html', controller: 'platformRevenueRootCtrl',
controller: 'platformSettleLogCtrl', })
.state('analysis_report.platformsettle', {
}); url: '/platformsettle',
}]); templateUrl: '/static/config/platformrevenue/templates/platform_settle_logs.html',
app.controller('platformSettleLogCtrl', ['$scope', '$http', '$state','$filter','Upload','commonDialog', function ($scope, $http, $state,$filter,Upload, commonDialog) { controller: 'platformSettleLogCtrl',
})
$scope.wechatPagination = {}; },
$scope.loadWechatLogs = function (page) { ])
var params = $scope.queryParams || {}; app.controller('platformSettleLogCtrl', [
params.page = page || $scope.wechatPagination.page || 1; '$scope',
params.limit = 20; '$http',
params.channel = 'Wechat'; '$state',
$http.get('/platform/analysis/settle/log', {params: params}).then(function (resp) { '$filter',
$scope.wechatLogs = resp.data.data; 'Upload',
$scope.wechatPagination = resp.data.pagination; 'commonDialog',
}); function ($scope, $http, $state, $filter, Upload, commonDialog) {
}; $scope.wechatPagination = {}
$scope.loadWechatLogs(1); $scope.loadWechatLogs = function (page) {
var params = $scope.queryParams || {}
$scope.aliPagination = {}; params.page = page || $scope.wechatPagination.page || 1
$scope.loadAliLogs = function (page) { params.limit = 20
var params = $scope.queryParams || {}; params.channel = 'Wechat'
params.page = page || $scope.aliPagination.page || 1; $http.get('/platform/analysis/settle/log', { params: params }).then(function (resp) {
params.limit = 20; $scope.wechatLogs = resp.data.data
params.channel = 'Alipay'; $scope.wechatPagination = resp.data.pagination
$http.get('/platform/analysis/settle/log', {params: params}).then(function (resp) { })
$scope.aliLogs = resp.data.data; }
$scope.aliPagination = resp.data.pagination; $scope.loadWechatLogs(1)
});
} $scope.aliPagination = {}
$scope.loadAliLogs(1); $scope.loadAliLogs = function (page) {
$scope.aliOnlinePagination = {}; var params = $scope.queryParams || {}
$scope.loadAliOnlineLogs = function (page) { params.page = page || $scope.aliPagination.page || 1
var params = $scope.queryParams || {}; params.limit = 20
params.page = page || $scope.aliOnlinePagination.page || 1; params.channel = 'Alipay'
params.limit = 20; $http.get('/platform/analysis/settle/log', { params: params }).then(function (resp) {
params.channel = 'AlipayOnline'; $scope.aliLogs = resp.data.data
$http.get('/platform/analysis/settle/log', {params: params}).then(function (resp) { $scope.aliPagination = resp.data.pagination
$scope.aliOnlineLogs = resp.data.data; })
$scope.aliOnlinePagination = resp.data.pagination; }
}); $scope.loadAliLogs(1)
} $scope.aliOnlinePagination = {}
$scope.loadAliOnlineLogs(1); $scope.loadAliOnlineLogs = function (page) {
$scope.loadBestpayLog = function () { var params = $scope.queryParams || {}
$http.get('/platform/analysis/settle/Bestpay').then(function (resp) { params.page = page || $scope.aliOnlinePagination.page || 1
$scope.bestpayLogs = resp.data; params.limit = 20
}); params.channel = 'AlipayOnline'
} $http.get('/platform/analysis/settle/log', { params: params }).then(function (resp) {
$scope.loadBestpayLog(); $scope.aliOnlineLogs = resp.data.data
$scope.verifySettleLog = function(log){ $scope.aliOnlinePagination = resp.data.pagination
$http.get('/platform/analysis/settle/verify',{params:log}).then(function () { })
$scope.loadAliLogs(1); }
$scope.loadAliOnlineLogs(1); $scope.loadAliOnlineLogs(1)
$scope.loadWechatLogs(1); $scope.loadBestpayLog = function () {
commonDialog.alert({ $http.get('/platform/analysis/settle/Bestpay').then(function (resp) {
title: 'Success', $scope.bestpayLogs = resp.data
content: '校验结果已经重新生成,请查看!', })
type: 'success' }
}) $scope.loadBestpayLog()
},function (resp) { $scope.verifySettleLog = function (log) {
commonDialog.alert({ $http.get('/platform/analysis/settle/verify', { params: log }).then(
title: 'Error', function () {
content: resp.data.message, $scope.loadAliLogs(1)
type: 'error' $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 () { $scope.dohfSettle = function () {
$http.get('/platform/analysis/generate/settle/log').then(function () { var param = angular.copy($scope.hfParam)
$scope.loadWechatLogs(1); if (!param.start) {
$scope.loadAliLogs(1); alert('请先选择开始时间')
$state.reload();
});
$state.reload();
} }
if (!param.end) {
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.fileId) {
}]); 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) ;
} }
$scope.initMonth = function (year) { param.start = $filter('date')(param.start, 'yyyy-MM-dd')
$scope.months = []; param.end = $filter('date')(param.end, 'yyyy-MM-dd')
for (var i = 1; i < 13; i++) {
var mon = '00' + i; $http.put('/platform/analysis/generate/hf/settle', param).then(function (resp) {})
mon = mon.substr(mon.length - 2, 2); }
$scope.months.push(year + '-' + mon); },
} ])
}; app.controller('platformRevenueRootCtrl', [
$scope.initMonth($scope.params.year); '$scope',
$scope.hasReport = function (mon) { '$http',
var start = '2017-01'; '$filter',
var end = $filter('date')(new Date(), 'yyyy-MM'); 'chartParser',
return start <= mon && end >= mon function ($scope, $http, $filter, chartParser) {
}; $scope.params = { year: new Date() }
$scope.loadYearReport = function (year) { $scope.hasReport = function (mon) {
$scope.params.year = year; var start = '2017-01'
$http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) { var end = $filter('date')(new Date(), 'yyyy-MM')
$scope.report = resp.data; return start <= mon && end >= mon
loadChargeAnalysis(year); }
$scope.analysis = { $scope.loadYearReport = function () {
analysis_year: year, const year = $scope.params.year.getFullYear()
partner_commission: 0, $http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) {
bd_commission: 0, $scope.report = resp.data
royalpay_surcharge: 0 loadChargeAnalysis(year)
}; $scope.analysis = {
angular.forEach($scope.report, function (report) { analysis_year: year,
$scope.analysis.partner_commission = Decimal.add(report.partner_charge, $scope.analysis.partner_commission).toFixed(2); partner_commission: 0,
$scope.analysis.bd_commission = Decimal.add(report.bd_charge, $scope.analysis.bd_commission).toFixed(2); bd_commission: 0,
$scope.analysis.royalpay_surcharge = Decimal.add(report.royalpay_charge, $scope.analysis.royalpay_surcharge).toFixed(2); 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)
function loadChargeAnalysis(year) { $scope.analysis.royalpay_surcharge = Decimal.add(report.royalpay_charge, $scope.analysis.royalpay_surcharge).toFixed(2)
var analysisConfig = { })
chart: { })
tooltip: { }
trigger: 'axis', $scope.loadYearReport()
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' function loadChargeAnalysis(year) {
}, var analysisConfig = {
formatter: '{b}:AUD {c}' chart: {
}, tooltip: {
legend: { trigger: 'axis',
data: ['BD Commission', 'Partner Commission', 'RoyalPay SurCharge'] axisPointer: {
}, // 坐标轴指示器,坐标轴触发有效
grid: { type: 'shadow', // 默认为直线,可选为:'line' | 'shadow'
left: '3%', },
right: '4%', formatter: '{b}:AUD {c}',
bottom: '3%', },
containLabel: true legend: {
}, data: ['BD Commission', 'Partner Commission', 'RoyalPay SurCharge'],
yAxis: [ },
{ grid: {
type: 'value' left: '3%',
} right: '4%',
] bottom: '3%',
}, containLabel: true,
},
xAxis: { yAxis: [
basic: {type: 'category'}, {
key: 'charge_date' type: 'value',
}, },
],
series: [ },
{
basic: {name: 'BD Commission', type: 'bar'}, xAxis: {
column: {key: 'bd_charge'} basic: { type: 'category' },
}, key: 'charge_date',
{ },
basic: {
name: 'Partner Commission', series: [
type: 'bar' {
}, basic: { name: 'BD Commission', type: 'bar' },
column: {key: 'partner_charge'} column: { key: 'bd_charge' },
}, },
{ {
basic: {name: 'RoyalPay SurCharge', type: 'bar', stack: 'RoyalPaySurcharge'}, basic: {
column: {key: 'royalpay_charge'} name: 'Partner Commission',
} type: 'bar',
] },
}; column: { key: 'partner_charge' },
$http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) { },
$scope.chargeAnalysis = chartParser.parse(analysisConfig, resp.data); {
}) basic: { name: 'RoyalPay SurCharge', type: 'bar', stack: 'RoyalPaySurcharge' },
column: { key: 'royalpay_charge' },
},
],
} }
$http.get('/analysis/platform/revenue/year_reports/' + year).then(function (resp) {
$scope.loadYearReport(new Date().getFullYear()); $scope.chargeAnalysis = chartParser.parse(analysisConfig, resp.data)
}]); })
return app; }
}); },
])
return app
})

@ -14,7 +14,7 @@
<div class="form-inline"> <div class="form-inline">
<div class="form-group"> <div class="form-group">
<label class="control-label" style="width: 50px">年份</label> <label class="control-label" style="width: 50px">年份</label>
<!--<div uib-dropdown class="btn-group"> <!--<div uib-dropdown class="btn-group">
<button id="single-button" type="button" class="btn btn-primary" style="width: 100px" ng-bind="analysis.analysis_year" uib-dropdown-toggle ng-disabled="disabled"> <button id="single-button" type="button" class="btn btn-primary" style="width: 100px" ng-bind="analysis.analysis_year" uib-dropdown-toggle ng-disabled="disabled">
<span class="caret"></span> <span class="caret"></span>
</button> </button>
@ -25,30 +25,28 @@
</ul> </ul>
</div>--> </div>-->
<div ng-repeat="year in availableYears" style="display: inline"> <button class="btn btn-info" ng-bind="params.year.getFullYear()"
<button class="btn btn-info" ng-click="ctrl.viewyear=true"></button>
ng-click="loadYearReport(year)" <input type="text" class="hidden" uib-datepicker-popup="yyyy" ng-model="params.year"
ng-bind="year" is-open="ctrl.viewyear" datepicker-options="{minMode: 'year'}" ng-change="loadYearReport()"
ng-class="{'active':year == params.year}" placeholder="Select Year">
></button>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<section class="content"> <section class="content">
<div class="row"> <div class="row">
<div class="col-md-3 col-sm-6 col-xs-12" ng-repeat="r in report"> <div class="col-md-3 col-sm-6 col-xs-12" ng-repeat="r in report">
<div class="info-box"> <div class="info-box">
<div class="info-box-icon bg-aqua" ng-bind="r.charge_date.substring(5,7)"> <div class="info-box-icon bg-aqua" ng-bind="r.charge_date.substring(5,7)">
<!--<span class="info-box-icon bg-aqua" ng-bind="r.charge_date.substring(5,7)"></span>--> <!--<span class="info-box-icon bg-aqua" ng-bind="r.charge_date.substring(5,7)"></span>-->
</div> </div>
<div class="info-box-content"> <div class="info-box-content">
<!--<div class="info-box-text text-bold text-red" ng-bind="r.charge_date"></div>--> <!--<div class="info-box-text text-bold text-red" ng-bind="r.charge_date"></div>-->
<div > <div>
<div class="info-box-number-right"> <div class="info-box-number-right">
<span class="text-bold">Partner Commission:</span> <span class="text-bold">Partner Commission:</span>
@ -59,11 +57,12 @@
<span ng-bind="r.bd_charge|currency:'$'" class="text-green"></span> <span ng-bind="r.bd_charge|currency:'$'" class="text-green"></span>
</div> </div>
<div class="info-box-number-right"> <div class="info-box-number-right">
<i class="fa fa-angle-double-down" aria-hidden="true" title="show detail" <i class="fa fa-angle-double-down" aria-hidden="true" title="show detail" uib-popover="
uib-popover="
Wechat:{{r.channels.Wechat}} &#10 &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp Wechat:{{r.channels.Wechat}} &#10 &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
Alipay:{{r.channels.Alipay}} &#10 Alipay:{{r.channels.Alipay}} &#10
Bestpay:{{r.channels.Bestpay}}" popover-title="RoyalPay SurCharge Detail" popover-placement="bottom" popover-data-html="true"></i><span class="text-bold">RoyalPay SurCharge:</span> Bestpay:{{r.channels.Bestpay}}" popover-title="RoyalPay SurCharge Detail"
popover-placement="bottom" popover-data-html="true"></i><span class="text-bold">RoyalPay
SurCharge:</span>
<span ng-bind="r.royalpay_charge|currency:'$'" class="text-green"></span> <span ng-bind="r.royalpay_charge|currency:'$'" class="text-green"></span>
</div> </div>
@ -77,20 +76,20 @@
<div class="box-body table-responsive"> <div class="box-body table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>Partner Commission</th> <th>Partner Commission</th>
<th>BD Commission</th> <th>BD Commission</th>
<th>RoyalPay SurCharge</th> <th>RoyalPay SurCharge</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>Total</td> <td>Total</td>
<td ng-bind="analysis.partner_commission|currency:'$'" class="text-green"></td> <td ng-bind="analysis.partner_commission|currency:'$'" class="text-green"></td>
<td ng-bind="analysis.bd_commission|currency:'$'" class="text-green"></td> <td ng-bind="analysis.bd_commission|currency:'$'" class="text-green"></td>
<td ng-bind="analysis.royalpay_surcharge|currency:'$'" class="text-green"></td> <td ng-bind="analysis.royalpay_surcharge|currency:'$'" class="text-green"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -101,7 +100,7 @@
<div class="box-header with-border">平台收入趋势</div> <div class="box-header with-border">平台收入趋势</div>
<div class="box-body"> <div class="box-body">
<div class="chart" echarts="chargeAnalysis" style="height: 300px" <div class="chart" echarts="chargeAnalysis" style="height: 300px"
ng-class="{nodata:chargeAnalysis.nodata}"></div> ng-class="{nodata:chargeAnalysis.nodata}"></div>
</div> </div>
</div> </div>
</div> </div>

@ -43,10 +43,10 @@
<label class="control-label col-sm-3" for="merchant_storename_input">* Merchant Short Name</label> <label class="control-label col-sm-3" for="merchant_storename_input">* Merchant Short Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.short_name" <input class="form-control" ng-model="subMerchantInfo.short_name"
type="text" name="merchant_storename" id="merchant_storename_input" required maxlength="50"> type="text" name="merchant_storename" id="merchant_storename_input" required maxlength="20">
<div ng-messages="subForm.merchant_storename.$error" ng-if="subForm.merchant_storename.$dirty"> <div ng-messages="subForm.merchant_storename.$error" ng-if="subForm.merchant_storename.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p> <p class="small text-danger" ng-message="maxlength">Length is more than 20</p>
</div> </div>
</div> </div>
</div> </div>
@ -92,7 +92,7 @@
<label class="control-label col-sm-3" for="website_input">* Website</label> <label class="control-label col-sm-3" for="website_input">* Website</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_website" <input class="form-control" ng-model="subMerchantInfo.company_website"
type="url" name="company_website" id="website_input" required maxlength="128"> type="url" name="company_website" id="website_input" required maxlength="100">
<p class="small " >( Not required when business type is Offline scenario)</p> <p class="small " >( Not required when business type is Offline scenario)</p>
<div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty"> <div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty">
@ -122,10 +122,12 @@
ng-class="{'has-error':subForm.office_phone.$invalid && subForm.office_phone.$dirty}"> ng-class="{'has-error':subForm.office_phone.$invalid && subForm.office_phone.$dirty}">
<label class="control-label col-sm-3" for="office_phone_input">* Office Phone</label> <label class="control-label col-sm-3" for="office_phone_input">* Office Phone</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_phone" <input class="form-control" ng-model="subMerchantInfo.company_phone" maxlength="20"
type="tel" name="office_phone" id="office_phone_input" required> type="tel" name="office_phone" id="office_phone_input" required>
<div ng-messages="subForm.office_phone.$error" ng-if="subForm.office_phone.$dirty"> <div ng-messages="subForm.office_phone.$error" ng-if="subForm.office_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 20</p>
</div> </div>
</div> </div>
@ -162,10 +164,10 @@
<label class="control-label col-sm-3" for="contact_email_input">* Contact Email</label> <label class="control-label col-sm-3" for="contact_email_input">* Contact Email</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_email" <input class="form-control" ng-model="subMerchantInfo.contact_email"
type="text" name="contact_email" id="contact_email_input" required maxlength="128"> type="text" name="contact_email" id="contact_email_input" required maxlength="50">
<div ng-messages="subForm.contact_email.$error" ng-if="subForm.contact_email.$dirty"> <div ng-messages="subForm.contact_email.$error" ng-if="subForm.contact_email.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 128</p> <p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div> </div>
</div> </div>
</div> </div>

@ -94,7 +94,7 @@
<label class="control-label col-sm-3" for="website_input">* Website</label> <label class="control-label col-sm-3" for="website_input">* Website</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_website" <input class="form-control" ng-model="subMerchantInfo.company_website"
type="url" name="website" id="website_input" required maxlength="128"> type="url" name="website" id="website_input" required maxlength="100">
<p class="small " >(Not required when business type is Offline scenario)</p> <p class="small " >(Not required when business type is Offline scenario)</p>
<div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty"> <div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
@ -162,10 +162,10 @@
<label class="control-label col-sm-3" for="contact_email_input">* Contact Email</label> <label class="control-label col-sm-3" for="contact_email_input">* Contact Email</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_email" <input class="form-control" ng-model="subMerchantInfo.contact_email"
type="text" name="contact_email" id="contact_email_input" required maxlength="128"> type="text" name="contact_email" id="contact_email_input" required maxlength="50">
<div ng-messages="subForm.contact_email.$error" ng-if="subForm.contact_email.$dirty"> <div ng-messages="subForm.contact_email.$error" ng-if="subForm.contact_email.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 128</p> <p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div> </div>
</div> </div>
</div> </div>

@ -1,23 +1,11 @@
package au.com.royalpay.payment.manage.process.custom; 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.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.List;
/** /**
* Create by yixian at 2018-08-14 20:28 * Create by yixian at 2018-08-14 20:28
*/ */

@ -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_pass http://rppaycenter;
proxy_http_version 1.1; proxy_http_version 1.1;

Loading…
Cancel
Save