add gateway、channel analysis

master
luoyang 5 years ago
parent d98f927d16
commit 33dd59d223

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.2.10</version> <version>2.2.11</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.8.0</jib-maven-plugin.version> <jib-maven-plugin.version>1.8.0</jib-maven-plugin.version>

@ -16,6 +16,7 @@ import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.time.DurationFormatUtils; import org.apache.commons.lang3.time.DurationFormatUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -558,7 +559,10 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
record.put("new_customers",newCustomers); record.put("new_customers",newCustomers);
record.put("old_customers",oldCustomers); record.put("old_customers",oldCustomers);
record.put("client_id",client.getIntValue("client_id")); record.put("client_id",client.getIntValue("client_id"));
customerAndOrdersStatisticsMapper.save(record); if (StringUtils.equalsIgnoreCase("rpaypmt_card", record.getString("channel")) || StringUtils.equalsIgnoreCase("rpaypmt_dd", record.getString("channel"))) {
record.put("single_amount", record.getBigDecimal("total").divide(record.getBigDecimal("orders"), 2, RoundingMode.HALF_UP));
}
customerAndOrdersStatisticsMapper.save(record);
} }
} }
} }

@ -145,7 +145,7 @@
<![CDATA[ <![CDATA[
SELECT ifnull(sum(s.orders),0) orders, SELECT ifnull(sum(s.orders),0) orders,
ifnull(sum(s.total),0) total, ifnull(sum(s.total),0) total,
ifnull(sum(s.total)/sum(s.customers),0) single_amount, ifnull(sum(s.single_amount),0) single_amount,
ifnull(date_format(s.date,'%d-%m-%Y'),0) trade_date ifnull(date_format(s.date,'%d-%m-%Y'),0) trade_date
FROM calendar cal FROM calendar cal
LEFT JOIN statistics_customer_order s ON s.date=cal.datelist LEFT JOIN statistics_customer_order s ON s.date=cal.datelist

@ -540,6 +540,14 @@
THEN 'Native QR Code' THEN 'Native QR Code'
WHEN 14 WHEN 14
THEN 'Share Link' THEN 'Share Link'
WHEN 15
THEN 'Native JSAPI'
WHEN 16
THEN 'Card Payment'
WHEN 17
THEN 'Card Payment'
WHEN 18
THEN 'Direct Debit'
END AS gateway_label, END AS gateway_label,
ifnull(COUNT(DISTINCT l.client_id), 0) partner_count ifnull(COUNT(DISTINCT l.client_id), 0) partner_count
FROM pmt_transactions l FROM pmt_transactions l

@ -173,7 +173,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
trigger: 'axis' trigger: 'axis'
}, },
legend: { legend: {
data: ['Alipay交易金额','AlipayOnline交易金额', 'Bestpay交易金额','Wechat交易金额',"JD Pay交易金额","HF Pay交易金额","Yeepay交易金额","LakalaPay交易金额"], data: ['Alipay交易金额','AlipayOnline交易金额', 'Bestpay交易金额','Wechat交易金额',"JD Pay交易金额","HF Pay交易金额","Yeepay交易金额","LakalaPay交易金额","Card Payment交易金额","Direct Debit交易金额"],
bottom: 0, bottom: 0,
height: '15%', height: '15%',
width: '80%', width: '80%',
@ -279,6 +279,28 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
yAxisIndex: 0 yAxisIndex: 0
}, },
column: {key: 'LakalaPay.total'} column: {key: 'LakalaPay.total'}
},
{
basic: {
name: 'Card Payment交易金额',
type: 'line',
label: {normal: {show: true}},
showAllSymbols: true,
showSymbol: true,
yAxisIndex: 0
},
column: {key: 'rpaypmt_card.total'}
},
{
basic: {
name: 'Direct Debit交易金额',
type: 'line',
label: {normal: {show: true}},
showAllSymbols: true,
showSymbol: true,
yAxisIndex: 0
},
column: {key: 'rpaypmt_dd.total'}
} }
] ]
}; };
@ -289,7 +311,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
trigger: 'axis' trigger: 'axis'
}, },
legend: { legend: {
data: ['Alipay交易订单','AlipayOnline交易订单', 'Bestpay交易订单','Wechat交易订单',"JD Pay交易订单","HF Pay交易订单","Yeepay交易订单","LakalaPay交易订单"], data: ['Alipay交易订单','AlipayOnline交易订单', 'Bestpay交易订单','Wechat交易订单',"JD Pay交易订单","HF Pay交易订单","Yeepay交易订单","LakalaPay交易订单","Card Payment交易订单","Direct Debit交易订单"],
bottom: 0, bottom: 0,
height: '15%', height: '15%',
width: '80%', width: '80%',
@ -395,6 +417,28 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
yAxisIndex: 0 yAxisIndex: 0
}, },
column: {key: 'LakalaPay.orders'} column: {key: 'LakalaPay.orders'}
},
{
basic: {
name: 'Card Payment交易订单',
type: 'line',
label: {normal: {show: true}},
showAllSymbols: true,
showSymbol: true,
yAxisIndex: 0
},
column: {key: 'rpaypmt_card.orders'}
},
{
basic: {
name: 'Direct Debit交易订单',
type: 'line',
label: {normal: {show: true}},
showAllSymbols: true,
showSymbol: true,
yAxisIndex: 0
},
column: {key: 'rpaypmt_dd.orders'}
} }
] ]
}; };
@ -404,7 +448,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
trigger: 'axis' trigger: 'axis'
}, },
legend: { legend: {
data: ['Alipay交易客单价','AlipayOnline交易客单价', 'Bestpay交易客单价','Wechat交易客单价',"JD Pay交易客单价","HF Pay交易客单价","Yeepay交易客单价","LakalaPay交易客单价"], data: ['Alipay交易客单价','AlipayOnline交易客单价', 'Bestpay交易客单价','Wechat交易客单价',"JD Pay交易客单价","HF Pay交易客单价","Yeepay交易客单价","LakalaPay交易客单价","Card Payment交易客单价","Direct Debit交易客单价"],
bottom: 0, bottom: 0,
}, },
yAxis: [ yAxis: [
@ -507,15 +551,32 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
yAxisIndex: 0 yAxisIndex: 0
}, },
column: {key: 'LakalaPay.single_amount'} column: {key: 'LakalaPay.single_amount'}
},
{
basic: {
name: 'Card Payment交易客单价',
type: 'line',
label: {normal: {show: true}},
showAllSymbols: true,
showSymbol: true,
yAxisIndex: 0
},
column: {key: 'rpaypmt_card.single_amount'}
},
{
basic: {
name: 'Direct Debit交易客单价',
type: 'line',
label: {normal: {show: true}},
showAllSymbols: true,
showSymbol: true,
yAxisIndex: 0
},
column: {key: 'rpaypmt_dd.single_amount'}
} }
] ]
}; };
$scope.chooseLast7Days(); $scope.chooseLast7Days();
}]); }]);

@ -653,6 +653,19 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.gateway_sign.platform_public_key = $scope.org.platform_public_key; $scope.gateway_sign.platform_public_key = $scope.org.platform_public_key;
$scope.gateway_sign.org_id = $scope.org.org_id; $scope.gateway_sign.org_id = $scope.org.org_id;
$scope.gateway_sign.mch_public_key = $scope.org.mch_public_key; $scope.gateway_sign.mch_public_key = $scope.org.mch_public_key;
$scope.paginationc = {};
$scope.loadCommission = function () {
var params = {};
params.page = $scope.paginationc.page || 1;
params.org_id = $scope.org.org_id;
$http.get('/sys/orgs/'+$scope.org.org_id + '/extract/search', {params: params}).then(function (resp) {
$scope.client_extarct = resp.data.data;
$scope.paginationc = resp.data.pagination;
});
};
$scope.loadCommission();
$scope.refreshPlatformPubliKey = function () { $scope.refreshPlatformPubliKey = function () {
$uibModal.open({ $uibModal.open({

@ -22,143 +22,6 @@
<div class="box box-warning"> <div class="box box-warning">
<div class="box-body"> <div class="box-body">
<uib-tabset> <uib-tabset>
<!-- <uib-tab heading="Basic Info">
<form class="form-horizontal margin-top" name="org_form" novalidate>
<div class="panel">
<div class="form-group" ng-class="{'has-error':org_form.name.$invalid && org_form.name.$dirty}">
<label class="control-label col-sm-2" for="org_name_input">Name *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.name" id="org_name_input" name="name" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Logo</label>
<div class="col-sm-8">
<p class="form-control-static">
<button class="btn btn-primary" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
<i class="fa fa-upload"></i> Upload
</button>
<uib-progressbar value="logoProgress.value" ng-if="logoProgress"></uib-progressbar>
<img ng-src="{{org.logo}}" class="col-sm-3" ng-if="org.logo">
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.location.$invalid && org_form.location.$dirty}">
<label class="control-label col-sm-2" for="org_location_input">Location *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.location" id="org_location_input" name="location" required>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.type.$invalid && org_form.type.$dirty}"
ng-if="!currentUser.org_id">
<label class="control-label col-sm-2" for="org_type_input">Type *</label>
<div class="col-sm-8">
&lt;!&ndash;<select class="form-control" ng-model="org.type" ng-init="org.type=0" id="org_type_input">&ndash;&gt;
&lt;!&ndash;<option value="0">代理人</option>&ndash;&gt;
&lt;!&ndash;<option value="1">推荐人</option>&ndash;&gt;
&lt;!&ndash;</select>&ndash;&gt;
<select class="form-control" name="type" required ng-model="org.type"
id="org_type_input"
ng-options="type.value as type.label for type in types">
&lt;!&ndash;<option value="">Please Choose</option>&ndash;&gt;
</select>
</div>
</div>
<div ng-if="org.type == 1">
<div class="form-group" ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">
<label class="control-label col-sm-2" for="rate_value_input">Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.rate_value" id="rate_value_input" name="rate_value" max="100">
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
</div>
<div ng-if="org.type == 0">
<div class="form-group" ng-class="{'has-error':org_form.alipay_rate_value.$invalid && org_form.alipay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="alipay_rate_value_input">Alipay Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.alipay_rate_value" id="alipay_rate_value_input" name="alipay_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.wechat_rate_value.$invalid && org_form.wechat_rate_value.$dirty}">
<label class="control-label col-sm-2" for="wechat_rate_value_input">Wechat Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.wechat_rate_value" id="wechat_rate_value_input" name="wechat_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.bestpay_rate_value.$invalid && org_form.bestpay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="bestpay_rate_value_input">Bestpay Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.bestpay_rate_value" id="bestpay_rate_value_input" name="bestpay_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.jd_rate_value.$invalid && org_form.jd_rate_value.$dirty}">
<label class="control-label col-sm-2" for="jd_rate_value_input">JD Pay Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.jd_rate_value" id="jd_rate_value_input" name="jd_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.alipayonline_rate_value.$invalid && org_form.alipayonline_rate_value.$dirty}">
<label class="control-label col-sm-2" for="alipayonline_rate_value_input">AlipayOnline Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.alipayonline_rate_value" id="alipayonline_rate_value_input" name="alipayonline_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.contact_person.$invalid && org_form.contact_person.$dirty}">
<label class="control-label col-sm-2" for="org_contact_person_input">Contact Person *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.contact_person" id="org_contact_person_input" name="contact_person" required>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.contact_phone.$invalid && org_form.contact_phone.$dirty}">
<label class="control-label col-sm-2" for="org_contact_phone_input">Phone *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.contact_phone" id="org_contact_phone_input" name="contact_phone" required>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.contact_mail.$invalid && org_form.contact_mail.$dirty}">
<label class="control-label col-sm-2" for="org_contact_mail_input">Mail *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.contact_mail" id="org_contact_mail_input" name="contact_mail" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="commission_checkbox">Enable Commission</label>
<div class="col-sm-8">
<input id="commission_checkbox" type="checkbox" class="checkbox-inline checkbox" ng-model="org.commission" readonly
onclick="return false">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.remark.$invalid && org_form.remark.$dirty}">
<label class="control-label col-sm-2" for="remark-input">Remark</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="org.remark" name="remark"
id="remark-input" maxlength="500"></textarea>
</div>
</div>
</div>
<div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button" ng-click="update(org_form)">Save
</button>
<a class="btn btn-danger" role="button" ui-sref="^" ui-sref-opts="{reload:true}">Back</a>
</div>
&lt;!&ndash;<button class="btn btn-success col-sm-offset-2" ng-click="update()"><i class="fa fa-save"></i> Update</button>&ndash;&gt;
</form>
</uib-tab>-->
<uib-tab heading="Basic Info"> <uib-tab heading="Basic Info">
<form class="form-horizontal margin-top" name="org_form" novalidate> <form class="form-horizontal margin-top" name="org_form" novalidate>
<div class="panel"> <div class="panel">
@ -462,88 +325,65 @@
</div> </div>
</form> </form>
</uib-tab> </uib-tab>
</uib-tabset> <uib-tab heading="提成">
</div> <div class="box box-default">
</div> <div class="box-header">合伙人提成</div>
<!-- <div class="box-solid" ng-if="org.type == 0"> <div class="box-body table-responsive">
<div class="box box-warning"> <table class="table table-bordered table-striped table-hover">
<div class="box-header"> <thead>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2"> <tr>
<form class="navbar-form navbar-left" role="search"> <th>名称</th>
<div class="form-group"> <th>时间</th>
<label class="control-label" for="username-filter-input">Username</label> <th>交易金额</th>
<input type="text" class="form-control" ng-model="search.username" placeholder="Username" id="username-filter-input"> <th>商户总手续费</th>
<th>Royalpay手续费</th>
<th>合伙人提成</th>
<th>提成分润</th>
<th>支付渠道</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="clientExtracts in client_extarct">
<td ng-bind="clientExtracts.name"></td>
<td>
{{clientExtracts.year|limitTo:10}}
-
{{clientExtracts.month|limitTo:10}}
</td>
<td ng-bind="clientExtracts.gross_amount|currency:'AUD'"></td>
<td ng-bind="clientExtracts.total_charge|currency:'AUD'"></td>
<td ng-bind="clientExtracts.royalpay_charge|currency:'AUD'"></td>
<td ng-bind="clientExtracts.org_charge|currency:'AUD'"></td>
<td ng-bind="clientExtracts.share_charge|currency:'AUD'"></td>
<td>
<img ng-if='clientExtracts.channel=="Alipay"' src="/static/images/alipay_sign_lg.png"/>
<img ng-if='clientExtracts.channel=="AlipayOnline"' src="/static/images/alipay_online.png" style="width: 48px;height: 48px"/>
<img ng-if='clientExtracts.channel=="Wechat"' src="/static/images/wechatpay_sign_lg.png"/>
{{clientExtracts.channel}}
</td>
</tr>
</tbody>
</table>
</div> </div>
<div class="form-group" ng-if="'1'|withRole"> <div class="box-footer" ng-if="client_extarct.length">
<label class="control-label" for="role-filter-select">Role</label> <uib-pagination boundary-links="true"
<select class="form-control" id="role-filter-select" ng-model="search.role"> class="pagination"
<option value="1111111">All</option> first-text="&laquo;"
<option value="1">Administrator</option> items-per-page="paginationc.limit"
<option value="10">Compliance</option> last-text="&raquo;"
<option value="100">BD User</option> max-size="10"
<option value="1000">Accountant</option> next-text="&rsaquo;"
<option value="10000">Service</option> ng-change="loadCommission()"
<option value="100000">Account Manager</option> ng-model="paginationc.page"
<option value="1000000">Director</option> previous-text="&lsaquo;"
<option value="10000000">Site Manager</option> total-items="paginationc.totalCount"></uib-pagination>
<option value="100000000">Developer</option> <div class="row">
</select> <div class="col-xs-12">Total Records:{{paginationc.totalCount}};Total Pages:{{paginationc.totalPages}}</div>
</div>
</div> </div>
</form>
<div class="navbar-form navbar-right">
<button class="btn btn-success" type="button" ng-click="newManager()">
<i class="fa fa-plus"></i> New Manager Account
</button>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-body">
<div class="row">
<div class="col-sm-12 table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Username</th>
<th>Display Name</th>
<th>Wechat</th>
<th>Create Time</th>
<th>Email</th>
<th>Roles</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="manager in managers|managersFilter:search">
<td ng-bind="manager.username"></td>
<td ng-bind="manager.display_name"></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow:ellipsis;"><img ng-src="{{manager.headimg}}" style="height: 30px;width:30px;" class="img-circle" ng-if="manager.headimg"> {{manager.nickname}}</td>
<td ng-bind="manager.create_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="manager.email"></td>
<td>
<i class="fa fa-user-secret" title="Administrator" ng-class="{'text-green':manager.admin,'text-gray':!manager.admin}"></i>
<i class="fa fa-eye" title="Compliance" ng-class="{'text-green':manager.operator,'text-gray':!manager.operator}"></i>
<i class="fa fa-crosshairs" title="BD User" ng-class="{'text-green':manager.bd,'text-gray':!manager.bd}"></i>
<i class="fa fa-balance-scale" title="Accountant" ng-class="{'text-green':manager.finacial,'text-gray':!manager.finacial}"></i>
<i class="fa fa-tty" title="Service" ng-class="{'text-green':manager.sevant,'text-gray':!manager.servant}"></i>
<i class="fa fa-university" title="Account Manager" ng-class="{'text-green':manager.accountmanager,'text-gray':!manager.accountmanager}"></i>
<i class="fa fa-line-chart" title="Director" ng-class="{'text-green':manager.director,'text-gray':!manager.director}"></i>
<i class="fa fa-map-o" title="Site Manager" ng-class="{'text-green':manager.sitemanager,'text-gray':!manager.sitemanager}"></i>
<i class="fa fa-code" title="Developer" ng-class="{'text-green':manager.developer,'text-gray':!manager.developer}"></i>
</td>
<td>
<a role="button" class="text-bold text-primary" ng-click="modifyManager(manager)">Modify</a>
|
<a class="text-bold text-danger" role="button" ng-click="disableManager(manager)">Disable</a>
</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </uib-tab>
</div> </uib-tabset>
</div> </div>
</div>--> </div>
</section> </section>

Loading…
Cancel
Save