Merge branch 'mergeReferrer&CityPartner' into develop

# Conflicts:
#	src/db/modify.sql
#	src/main/ui/static/analysis/org/templates/analysis_org.html
master
wangning 7 years ago
commit e391b89723

@ -139,15 +139,16 @@ ALTER TABLE sys_clients_customers ADD COLUMN channel varchar(15) not NULL ;
ALTER TABLE sys_clients_customers ADD COLUMN last_payment_time datetime DEFAULT NULL COMMENT '最后一次付款时间'; ALTER TABLE sys_clients_customers ADD COLUMN last_payment_time datetime DEFAULT NULL COMMENT '最后一次付款时间';
ALTER TABLE sys_org ADD COLUMN parent_org_id int(11) DEFAULT NULL; ALTER TABLE sys_org ADD COLUMN parent_org_id int(11) DEFAULT NULL;
ALTER TABLE sys_org ADD COLUMN min_wechat_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低微信费率'; ALTER TABLE sys_org ADD COLUMN min_wechat_rate DECIMAL(3,2) DEFAULT 'NULL' COMMENT '旗下商户最低微信费率';
ALTER TABLE sys_org ADD COLUMN min_alipay_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低支付宝费率'; ALTER TABLE sys_org ADD COLUMN min_alipay_rate DECIMAL(3,2) DEFAULT 'NULL' COMMENT '旗下商户最低支付宝费率';
ALTER TABLE sys_org ADD COLUMN min_alipayonline_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低支付宝线上费率'; ALTER TABLE sys_org ADD COLUMN min_alipayonline_rate DECIMAL(3,2) DEFAULT 'NULL' COMMENT '旗下商户最低支付宝线上费率';
ALTER TABLE sys_org ADD COLUMN min_bestpay_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低翼支付费率'; ALTER TABLE sys_org ADD COLUMN min_bestpay_rate DECIMAL(3,2) DEFAULT 'NULL' COMMENT '旗下商户最低翼支付费率';
ALTER TABLE sys_org ADD COLUMN min_jd_rate DECIMAL(3,2) DEFAULT NULL COMMENT '旗下商户最低京东费率'; ALTER TABLE sys_org ADD COLUMN min_jd_rate DECIMAL(3,2) DEFAULT 'NULL' COMMENT '旗下商户最低京东费率';
ALTER TABLE sys_org ADD COLUMN commission_type SMALLINT(1) DEFAULT '1' COMMENT '提成类型 1:渠道计算法 2:总交易额比例 3:收益比例'; ALTER TABLE sys_org ADD COLUMN commission_type SMALLINT(1) DEFAULT '1' COMMENT '提成类型 1:渠道计算法 2:总交易额比例 3:收益比例';
<<<<<<<<< Temporary merge branch 1
--agent_commission --agent_commission
CREATE TABLE `financial_agent_commission` ( CREATE TABLE `financial_agent_commission` (

@ -6,10 +6,7 @@
<a ui-sref="analysis_org.organlasis"><i class="fa fa-hand-peace-o"></i>合伙人销售量|City Partner Sale</a> <a ui-sref="analysis_org.organlasis"><i class="fa fa-hand-peace-o"></i>合伙人销售量|City Partner Sale</a>
</li> </li>
<li ui-sref-active-eq="active" ng-if="('orgcommission'|withModule)"> <li ui-sref-active-eq="active" ng-if="('orgcommission'|withModule)">
<a ui-sref="analysis_org.orgcommission"><i class="fa fa-users"></i></i>合伙人提成|City Partner Commissions</a> <a ui-sref="analysis_org.commission"><i class="fa fa-users"></i></i>合伙人提成|City Partner Commissions</a>
</li>
<li ui-sref-active-eq="active" ng-if="('org_sale'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1)">
<a ui-sref="analysis_org.referrercommission"><i class="fa fa-users"></i></i>推荐人提成|Referrer Commissions</a>
</li> </li>
</ul> </ul>

@ -14,18 +14,20 @@ var commissionTypeMap = [{
"value": "收益比例" "value": "收益比例"
} }
]; ];
define(['angular','../../analysis/org/analysis-org'], function (angular) { define(['angular','../../analysis/org/analysis-org'], function (angular) {
'use strict'; 'use strict';
var app = angular.module('orgcommission', ['ui.router']); var app = angular.module('orgcommission', ['ui.router']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('analysis_org.orgcommission', { $stateProvider.state('analysis_org.commission', {
url: '/org_commissions', url: '/org_commissions',
templateUrl: '/static/config/orgcommission/templates/org_commission_root.html', templateUrl: '/static/config/orgcommission/templates/org_commission_root.html',
controller: 'orgCommissionRootCtrl' controller: 'orgCommissionRootCtrl'
}).state('analysis_org.orgcommission.month', { }).state('analysis_org.commission.month', {
url: '/months/{monthStr}', url: '/commissionorg/months/{monthStr}',
templateUrl: '/static/config/orgcommission/templates/org_commission_month_root.html',
controller: 'commissionMonthRootCtrl'
}).state('analysis_org.commission.month.org', {
url: '/org',
templateUrl: '/static/config/orgcommission/templates/org_commission_month.html', templateUrl: '/static/config/orgcommission/templates/org_commission_month.html',
controller: 'orgCommissionMonthViewCtrl', controller: 'orgCommissionMonthViewCtrl',
resolve: { resolve: {
@ -33,7 +35,16 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr); return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr);
}] }]
} }
}).state('analysis_org.orgcommission.month.orgdetail', { }).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}', url: '/citypartners/{orgId}',
templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html', templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html',
controller: 'orgCommissionOrgDetailCtrl', controller: 'orgCommissionOrgDetailCtrl',
@ -42,13 +53,25 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId); 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);
}]
}
}) })
}]); }]);
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', app.controller('orgCommissionRootCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog',
function ($scope, $http, $filter, $state, commonDialog) { function ($scope, $http, $filter, $state, commonDialog) {
$scope.generate = {}; $scope.generate = {};
$scope.generateOrgCommission = function () { $scope.generateOrgCommission = function () {
$scope.generate.status = {}; $scope.generate.status = {};
if (!$scope.generate.month) { if (!$scope.generate.month) {
@ -63,7 +86,7 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
}).then(function () { }).then(function () {
var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')}; var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')};
$http.post('/sys/citypartner_prizes/generate', params).then(function () { $http.post('/sys/citypartner_prizes/generate', params).then(function () {
$state.go('analysis_org.orgcommission.month', {monthStr: params.month}) $state.go('.org.month', {monthStr: params.month})
$scope.generate.status = null; $scope.generate.status = null;
}, function (resp) { }, function (resp) {
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message}); commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
@ -89,9 +112,14 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
return has; return has;
}; };
$scope.gotoMonth = function (mon) { $scope.gotoMonth = function (mon) {
var monthStr = $scope.params.year.getFullYear() + '-' + (('0' + mon).substr(-2)); if(mon){
$state.go('analysis_org.orgcommission.month', {monthStr: monthStr}) $scope.params.month = mon;
}
var monthStr = $scope.params.year.getFullYear() + '-' + $scope.params.month;
$state.go('analysis_org.commission.month', {monthStr: monthStr})
}; };
}]); }]);
app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData','$filter', function ($scope, monthData) { app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData','$filter', function ($scope, monthData) {
$scope.monthData = monthData.data; $scope.monthData = monthData.data;
@ -118,6 +146,29 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
} }
}]); }]);
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.filter('commission_type_filter', function () { app.filter('commission_type_filter', function () {
return function (sectorValue) { return function (sectorValue) {

@ -0,0 +1,13 @@
<div is-open="ctrl.viewyear">
<ul id="myTab" class="nav nav-tabs">
<li ui-sref-active="active">
<a ui-sref=".org" data-toggle="tab">
合伙人提成
</a>
</li>
<li ui-sref-active="active"><a ui-sref=".referrer" data-toggle="tab">推荐人提成</a></li>
</ul>
<div class="tab-content" ui-view>
</div>
</div>

@ -1,11 +1,4 @@
<!--<section class="content-header">--> <div class="content">
<!--<h1>City Partner Commissions</h1>-->
<!--<ol class="breadcrumb">-->
<!--<li><i class="fa fa-users"></i> Analysis</li>-->
<!--<li class="active">City Partner Commissions</li>-->
<!--</ol>-->
<!--</section>-->
<section class="content">
<div class="box box-default"> <div class="box box-default">
<div class="box-body"> <div class="box-body">
<div class="form-inline"> <div class="form-inline">
@ -13,7 +6,6 @@
<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="generateOrgCommission()" ng-disabled="!generate.month"> <button class="btn btn-primary" ng-click="generateOrgCommission()" ng-disabled="!generate.month">
Generate Generate
@ -32,7 +24,7 @@
<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.monthstr)" 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>-->
@ -54,7 +46,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div ui-view></div> <div ui-view></div>
</section> </div>

@ -5,7 +5,6 @@
} }
</style> </style>
<div class="box box-warning" ng-if="detail"> <div class="box box-warning" ng-if="detail">
<div class="box-header">Analysis</div> <div class="box-header">Analysis</div>
<div class="box-body nowrap"> <div class="box-body nowrap">

@ -34,7 +34,7 @@
<td ng-bind="log.gross_amount|currency:'AUD'"></td> <td ng-bind="log.gross_amount|currency:'AUD'"></td>
<td ng-bind="log.org_charge|currency:'AUD'"></td> <td ng-bind="log.org_charge|currency:'AUD'"></td>
<td> <td>
<a ui-sref=".orgdetail({orgId:log.org_id})"> <a ui-sref=".referrerdetail({orgId:log.org_id})">
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</a> </a>
</td> </td>

Loading…
Cancel
Save