commit
7069f3a935
Binary file not shown.
@ -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
|
@ -1,20 +1,20 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
host: 192.168.0.84:3306
|
||||
host: 192.168.0.92:3306
|
||||
master:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
|
||||
password: ${spring.datasource.pwd}
|
||||
username: ${spring.datasource.user}
|
||||
pwd: rpayplus
|
||||
pwd: SuTUUxyvzS0cLETi6Rzm
|
||||
schema-name: royalpay
|
||||
slave:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
|
||||
password: ${spring.datasource.pwd}
|
||||
username: ${spring.datasource.user}
|
||||
user: root
|
||||
user: rpaydev
|
||||
redis:
|
||||
database: 9
|
||||
host: 192.168.0.84
|
||||
|
@ -1,204 +1,253 @@
|
||||
/**
|
||||
* Created by yixian on 2017-03-08.
|
||||
*/
|
||||
var commissionTypeMap = [{
|
||||
"label": 1,
|
||||
"value": "渠道计算法"
|
||||
},
|
||||
{
|
||||
"label": 2,
|
||||
"value": "总交易额比例"
|
||||
},
|
||||
{
|
||||
"label": 3,
|
||||
"value": "收益比例"
|
||||
}
|
||||
];
|
||||
define(['angular','../../analysis/org/analysis-org'], function (angular) {
|
||||
'use strict';
|
||||
var app = angular.module('orgcommission', ['ui.router']);
|
||||
app.config(['$stateProvider', function ($stateProvider) {
|
||||
$stateProvider.state('analysis_org.commission', {
|
||||
url: '/org_commissions',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_root.html',
|
||||
controller: 'orgCommissionRootCtrl'
|
||||
}).state('analysis_org.commission.month', {
|
||||
url: '/commissionorg/months/{monthStr}',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_month_root.html',
|
||||
controller: 'commissionMonthRootCtrl'
|
||||
}).state('analysis_org.info', {
|
||||
url: '/commissionorg/info',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_info.html',
|
||||
controller: 'commissionMonthRootCtrl'
|
||||
}).state('analysis_org.commission.month.org', {
|
||||
url: '/org',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_month.html',
|
||||
controller: 'orgCommissionMonthViewCtrl',
|
||||
resolve: {
|
||||
monthData: ['$http', '$stateParams', function ($http, $stateParams) {
|
||||
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr);
|
||||
}]
|
||||
}
|
||||
}).state('analysis_org.commission.month.referrer', {
|
||||
url: '/referrer',
|
||||
templateUrl: '/static/config/referrercommission/templates/referrer_commission_month.html',
|
||||
controller: 'referrerCommissionMonthViewCtrl',
|
||||
resolve: {
|
||||
monthData: ['$http', '$stateParams', function ($http, $stateParams) {
|
||||
return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr);
|
||||
}]
|
||||
}
|
||||
}).state('analysis_org.commission.month.org.orgdetail', {
|
||||
url: '/citypartners/{orgId}',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html',
|
||||
controller: 'orgCommissionOrgDetailCtrl',
|
||||
resolve: {
|
||||
detail: ['$http', '$stateParams', function ($http, $stateParams) {
|
||||
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId);
|
||||
}]
|
||||
}
|
||||
}).state('analysis_org.commission.month.referrer.referrerdetail', {
|
||||
url: '/referrer_commissions/{orgId}',
|
||||
templateUrl: '/static/config/referrercommission/templates/referrer_commission_detail.html',
|
||||
controller: 'referrerCommissionOrgDetailCtrl',
|
||||
resolve: {
|
||||
detail: ['$http', '$stateParams', function ($http, $stateParams) {
|
||||
return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId);
|
||||
}]
|
||||
}
|
||||
var commissionTypeMap = [
|
||||
{
|
||||
label: 1,
|
||||
value: '渠道计算法',
|
||||
},
|
||||
{
|
||||
label: 2,
|
||||
value: '总交易额比例',
|
||||
},
|
||||
{
|
||||
label: 3,
|
||||
value: '收益比例',
|
||||
},
|
||||
]
|
||||
define(['angular', '../../analysis/org/analysis-org'], function (angular) {
|
||||
'use strict'
|
||||
var app = angular.module('orgcommission', ['ui.router'])
|
||||
app.config([
|
||||
'$stateProvider',
|
||||
function ($stateProvider) {
|
||||
$stateProvider
|
||||
.state('analysis_org.commission', {
|
||||
url: '/org_commissions',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_root.html',
|
||||
controller: 'orgCommissionRootCtrl',
|
||||
})
|
||||
.state('analysis_org.commission.month', {
|
||||
url: '/commissionorg/months/{monthStr}',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_month_root.html',
|
||||
controller: 'commissionMonthRootCtrl',
|
||||
})
|
||||
.state('analysis_org.info', {
|
||||
url: '/commissionorg/info',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_info.html',
|
||||
controller: 'commissionMonthRootCtrl',
|
||||
})
|
||||
.state('analysis_org.commission.month.org', {
|
||||
url: '/org',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_month.html',
|
||||
controller: 'orgCommissionMonthViewCtrl',
|
||||
resolve: {
|
||||
monthData: [
|
||||
'$http',
|
||||
'$stateParams',
|
||||
function ($http, $stateParams) {
|
||||
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr)
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
.state('analysis_org.commission.month.referrer', {
|
||||
url: '/referrer',
|
||||
templateUrl: '/static/config/referrercommission/templates/referrer_commission_month.html',
|
||||
controller: 'referrerCommissionMonthViewCtrl',
|
||||
resolve: {
|
||||
monthData: [
|
||||
'$http',
|
||||
'$stateParams',
|
||||
function ($http, $stateParams) {
|
||||
return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr)
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
.state('analysis_org.commission.month.org.orgdetail', {
|
||||
url: '/citypartners/{orgId}',
|
||||
templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html',
|
||||
controller: 'orgCommissionOrgDetailCtrl',
|
||||
resolve: {
|
||||
detail: [
|
||||
'$http',
|
||||
'$stateParams',
|
||||
function ($http, $stateParams) {
|
||||
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId)
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}]);
|
||||
app.controller('commissionMonthRootCtrl', ['$scope', '$state', function ($scope, $state) {
|
||||
if($state.is('analysis_org.commission.month')){
|
||||
$state.go('.org');
|
||||
.state('analysis_org.commission.month.referrer.referrerdetail', {
|
||||
url: '/referrer_commissions/{orgId}',
|
||||
templateUrl: '/static/config/referrercommission/templates/referrer_commission_detail.html',
|
||||
controller: 'referrerCommissionOrgDetailCtrl',
|
||||
resolve: {
|
||||
detail: [
|
||||
'$http',
|
||||
'$stateParams',
|
||||
function ($http, $stateParams) {
|
||||
return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId)
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
},
|
||||
])
|
||||
app.controller('commissionMonthRootCtrl', [
|
||||
'$scope',
|
||||
'$state',
|
||||
function ($scope, $state) {
|
||||
if ($state.is('analysis_org.commission.month')) {
|
||||
$state.go('.org')
|
||||
}
|
||||
},
|
||||
])
|
||||
app.controller('orgCommissionRootCtrl', [
|
||||
'$scope',
|
||||
'$http',
|
||||
'$filter',
|
||||
'$state',
|
||||
'commonDialog',
|
||||
function ($scope, $http, $filter, $state, commonDialog) {
|
||||
$scope.generate = {}
|
||||
$scope.generateOrgCommission = function () {
|
||||
$scope.generate.status = {}
|
||||
if (!$scope.generate.month) {
|
||||
commonDialog.alert({
|
||||
type: 'error',
|
||||
title: 'Error',
|
||||
content: 'Select a month first!',
|
||||
})
|
||||
return
|
||||
}
|
||||
}]);
|
||||
app.controller('orgCommissionRootCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog',
|
||||
function ($scope, $http, $filter, $state, commonDialog) {
|
||||
$scope.generate = {};
|
||||
$scope.generateOrgCommission = function () {
|
||||
$scope.generate.status = {};
|
||||
if (!$scope.generate.month) {
|
||||
commonDialog.alert({
|
||||
type: 'error', title: 'Error', content: 'Select a month first!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
commonDialog.confirm({
|
||||
title: 'Confirm',
|
||||
content: 'This operation will clear the data generated before, Are you sure?'
|
||||
}).then(function () {
|
||||
var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')};
|
||||
$http.post('/sys/citypartner_prizes/generate', params).then(function () {
|
||||
$state.go('.org.month', {monthStr: params.month})
|
||||
$scope.generate.status = null;
|
||||
}, function (resp) {
|
||||
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
|
||||
})
|
||||
})
|
||||
};
|
||||
$scope.availableYears = [new Date().getFullYear()];
|
||||
//当前年至2017年年份
|
||||
for (var i = 1; i < new Date().getFullYear()-2017+1; i++) {
|
||||
$scope.availableYears.push(new Date().getFullYear() - i);
|
||||
}
|
||||
$scope.params = {};
|
||||
$scope.months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
||||
$scope.loadAvailableMonths = function (year) {
|
||||
$scope.params.year = year;
|
||||
$http.get('/sys/citypartner_prizes/months', {params: {year: $scope.params.year}}).then(function (resp) {
|
||||
$scope.availableMonths = resp.data;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.loadAvailableMonths(new Date().getFullYear());
|
||||
$scope.hasReport = function (mon) {
|
||||
var has = false;
|
||||
angular.forEach($scope.availableMonths, function (m) {
|
||||
if (mon == m.month) {
|
||||
has = true;
|
||||
}
|
||||
});
|
||||
return has;
|
||||
};
|
||||
$scope.gotoMonth = function (mon) {
|
||||
if(mon){
|
||||
$scope.params.month = mon;
|
||||
}
|
||||
var monthStr = $scope.params.year + '-' + $scope.params.month;
|
||||
$state.go('analysis_org.commission.month', {monthStr: monthStr})
|
||||
};
|
||||
|
||||
|
||||
}]);
|
||||
app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData','$http', function ($scope, monthData,$http) {
|
||||
$scope.monthData = monthData.data;
|
||||
$scope.ctrl = {};
|
||||
$scope.commissionTypeMap = commissionTypeMap;
|
||||
$scope.seniors = {};
|
||||
$scope.active = function (log) {
|
||||
$http.get('/sys/citypartner_prizes/senior/'+log.org_id+'/details?monthStr='+$scope.monthData.monthstr).then(function (resp) {
|
||||
$scope.seniors = resp.data;
|
||||
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id==log.org_id){
|
||||
$scope.ctrl.activeLog=null;
|
||||
return;
|
||||
}
|
||||
$scope.ctrl.activeLog=log;
|
||||
})
|
||||
commonDialog
|
||||
.confirm({
|
||||
title: 'Confirm',
|
||||
content: 'This operation will clear the data generated before, Are you sure?',
|
||||
})
|
||||
.then(function () {
|
||||
var params = { month: $filter('date')($scope.generate.month, 'yyyy-MM') }
|
||||
$http.post('/sys/citypartner_prizes/generate', params).then(
|
||||
function () {
|
||||
$state.go('.org.month', { monthStr: params.month })
|
||||
$scope.generate.status = null
|
||||
},
|
||||
function (resp) {
|
||||
commonDialog.alert({ type: 'error', title: 'Error', content: resp.data.message })
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
$scope.params = { year: new Date() }
|
||||
$scope.loadAvailableMonths = function () {
|
||||
const year = $scope.params.year.getFullYear()
|
||||
$http.get('/sys/citypartner_prizes/months', { params: { year: year } }).then(function (resp) {
|
||||
$scope.availableMonths = resp.data
|
||||
})
|
||||
}
|
||||
|
||||
$scope.loadAvailableMonths()
|
||||
$scope.months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
||||
$scope.hasReport = function (mon) {
|
||||
var has = false
|
||||
angular.forEach($scope.availableMonths, function (m) {
|
||||
if (mon == m.month) {
|
||||
has = true
|
||||
}
|
||||
})
|
||||
return has
|
||||
}
|
||||
$scope.gotoMonth = function (mon) {
|
||||
if (mon) {
|
||||
$scope.params.month = mon
|
||||
}
|
||||
}]);
|
||||
app.controller('orgCommissionOrgDetailCtrl', ['$scope', 'detail', function ($scope, detail) {
|
||||
$scope.detail = detail.data;
|
||||
$scope.ctrl = {};
|
||||
$scope.active = function (log) {
|
||||
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker==log.client_moniker){
|
||||
$scope.ctrl.activeLog=null;
|
||||
return;
|
||||
}
|
||||
$scope.ctrl.activeLog=log;
|
||||
var monthStr = $scope.params.year.getFullYear() + '-' + $scope.params.month
|
||||
$state.go('analysis_org.commission.month', { monthStr: monthStr })
|
||||
}
|
||||
},
|
||||
])
|
||||
app.controller('orgCommissionMonthViewCtrl', [
|
||||
'$scope',
|
||||
'monthData',
|
||||
'$http',
|
||||
function ($scope, monthData, $http) {
|
||||
$scope.monthData = monthData.data
|
||||
$scope.ctrl = {}
|
||||
$scope.commissionTypeMap = commissionTypeMap
|
||||
$scope.seniors = {}
|
||||
$scope.active = function (log) {
|
||||
$http.get('/sys/citypartner_prizes/senior/' + log.org_id + '/details?monthStr=' + $scope.monthData.monthstr).then(function (resp) {
|
||||
$scope.seniors = resp.data
|
||||
if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id == log.org_id) {
|
||||
$scope.ctrl.activeLog = null
|
||||
return
|
||||
}
|
||||
$scope.ctrl.activeLog = log
|
||||
})
|
||||
}
|
||||
},
|
||||
])
|
||||
app.controller('orgCommissionOrgDetailCtrl', [
|
||||
'$scope',
|
||||
'detail',
|
||||
function ($scope, detail) {
|
||||
$scope.detail = detail.data
|
||||
$scope.ctrl = {}
|
||||
$scope.active = function (log) {
|
||||
if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker == log.client_moniker) {
|
||||
$scope.ctrl.activeLog = null
|
||||
return
|
||||
}
|
||||
}]);
|
||||
$scope.ctrl.activeLog = log
|
||||
}
|
||||
},
|
||||
])
|
||||
|
||||
app.controller('referrerCommissionMonthViewCtrl', ['$scope', 'monthData', function ($scope, monthData) {
|
||||
$scope.monthData = monthData.data;
|
||||
$scope.ctrl = {};
|
||||
$scope.active = function (log) {
|
||||
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id==log.org_id){
|
||||
$scope.ctrl.activeLog=null;
|
||||
return;
|
||||
}
|
||||
$scope.ctrl.activeLog=log;
|
||||
app.controller('referrerCommissionMonthViewCtrl', [
|
||||
'$scope',
|
||||
'monthData',
|
||||
function ($scope, monthData) {
|
||||
$scope.monthData = monthData.data
|
||||
$scope.ctrl = {}
|
||||
$scope.active = function (log) {
|
||||
if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id == log.org_id) {
|
||||
$scope.ctrl.activeLog = null
|
||||
return
|
||||
}
|
||||
}]);
|
||||
$scope.ctrl.activeLog = log
|
||||
}
|
||||
},
|
||||
])
|
||||
|
||||
app.controller('referrerCommissionOrgDetailCtrl', ['$scope', 'detail', function ($scope, detail) {
|
||||
$scope.detail = detail.data;
|
||||
$scope.ctrl = {};
|
||||
$scope.active = function (log) {
|
||||
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker==log.client_moniker){
|
||||
$scope.ctrl.activeLog=null;
|
||||
return;
|
||||
}
|
||||
$scope.ctrl.activeLog=log;
|
||||
app.controller('referrerCommissionOrgDetailCtrl', [
|
||||
'$scope',
|
||||
'detail',
|
||||
function ($scope, detail) {
|
||||
$scope.detail = detail.data
|
||||
$scope.ctrl = {}
|
||||
$scope.active = function (log) {
|
||||
if ($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker == log.client_moniker) {
|
||||
$scope.ctrl.activeLog = null
|
||||
return
|
||||
}
|
||||
}]);
|
||||
$scope.ctrl.activeLog = log
|
||||
}
|
||||
},
|
||||
])
|
||||
|
||||
app.filter('commission_type_filter', function () {
|
||||
return function (sectorValue) {
|
||||
var sectorLabel = '';
|
||||
angular.forEach(commissionTypeMap, function (sector) {
|
||||
if (sector.label == sectorValue) {
|
||||
sectorLabel = sector.value;
|
||||
}
|
||||
});
|
||||
return sectorLabel;
|
||||
app.filter('commission_type_filter', function () {
|
||||
return function (sectorValue) {
|
||||
var sectorLabel = ''
|
||||
angular.forEach(commissionTypeMap, function (sector) {
|
||||
if (sector.label == sectorValue) {
|
||||
sectorLabel = sector.value
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return app;
|
||||
|
||||
|
||||
})
|
||||
return sectorLabel
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
return app
|
||||
})
|
||||
|
Loading…
Reference in new issue