修改partner dashboard

master
yuan 7 years ago
parent 414c4a783d
commit 0bef940daa

@ -231,22 +231,23 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
}
JSONObject res = new JSONObject();
params.put("client_id", partner.getIntValue("client_id"));
JSONObject today = getTransJSONO(params);
params.put("begin",DateUtils.addDays(params.getDate("begin"),-1));
params.put("end",DateUtils.addDays(params.getDate("end"),-1));
JSONObject yes = getTransJSONO(params);
res.put("today",today);
res.put("yes",yes);
return res;
}
private JSONObject getTransJSONO(JSONObject params){
JSONObject res = new JSONObject();
JSONObject object = transactionAnalysisMapper.getClientTransaction(params);
res.put("trade_amount", object.getBigDecimal("trade_amount"));
res.put("trade_count", object.getIntValue("trade_count"));
res.put("refund_amount", object.getBigDecimal("refund_amount"));
res.put("not_settled", transactionAnalysisMapper.analysisNotSettled(params));
res.put("pre_amount", transactionAnalysisMapper.analysisPreAmount(params));
List<JSONObject> topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc")));
if (!topOrders.isEmpty()) {
res.put("top_amount_order", topOrders.get(0));
}
res.put("total_customers", transactionAnalysisMapper.countCustomers(params));
res.put("new_customers", transactionAnalysisMapper.countNewCustomers(params));
res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params));
return res;
}
@Override
public List<JSONObject> getTradeAnalysisInHours(JSONObject partner, AnalysisBean partnerAnalysisBean) {
String timezone = partner.getJSONObject("client").getString("timezone");

@ -2,13 +2,15 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
import au.com.royalpay.payment.manage.analysis.core.PartnerCardDashboardService;
import au.com.royalpay.payment.manage.logview.beans.ClientLoginLogQueryBean;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.signin.core.ClientLoginLogRepository;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@ -22,6 +24,12 @@ public class PartnerDashboardController {
@Resource
private DashboardService dashboardService;
@Resource
private PartnerCardDashboardService partnerCardDashboardService;
@Resource
private CleanService cleanService;
@PartnerMapping("/common_analysis")
public JSONObject commonAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) {
return dashboardService.getCommonAnalysis(partner,partnerAnalysisBean);
@ -41,4 +49,35 @@ public class PartnerDashboardController {
public List<JSONObject> customersInDays(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) {
return dashboardService.getCustomersAndOrdersInDays(partner,partnerAnalysisBean);
}
@PartnerMapping("/trans_common")
public JSONObject transCommon(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) {
return dashboardService.getCommonAnalysis(partner,partnerAnalysisBean);
}
@PartnerMapping("{client_moniker}/basic_info")
public JSONObject commonAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) {
return partnerCardDashboardService.getCommonAnalysis(client_moniker);
}
@PartnerMapping("/trans_type_analysis")
public List<JSONObject> getTransTypesAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) {
JSONObject params = partnerAnalysisBean.toParams("timezone");
params.put("client_id",partner.getString("client_id"));
return dashboardService.getTradeInTypes(params);
}
@PartnerMapping("{client_moniker}/avg_order_customer")
public JSONObject getAvgOrderAndCustomer(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) {
return partnerCardDashboardService.getOrderAndCustomerPerDay(client_moniker);
}
@PartnerMapping("{client_moniker}/settlement_logs")
public JSONObject getPartnerSettlementLog(@PathVariable String client_moniker, TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) {
return partnerCardDashboardService.getSettlementLog(client_moniker, query);
}
@PartnerMapping("/{client_id}/settlement_logs/{detailId}")
public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String detailId) {
return cleanService.getCleanLogTransactions(client_id, detailId);
}
}

@ -95,7 +95,7 @@
<![CDATA[
SELECT sum(s.customers) customers,sum(s.orders) orders,sum(s.new_customers) new_customers,
sum(s.old_customers) old_customers,sum(s.total) total, sum(s.total)/sum(s.customers) single_amount,
date_format(s.date,'%d/%m/%Y') trade_date
date_format(s.date,'%Y-%m-%d') trade_date
FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
]]>

@ -24,6 +24,7 @@
<meta name="theme-color" content="#ffffff">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="static/css/new_partner_dashboard.css">
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="static/lib/bootstrap/css/bootstrap.min.css">

@ -0,0 +1,103 @@
mdi {
display: inline-block;
font: normal normal normal 24px/1 "Material Design Icons";
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0);
}
.mini-stat {
box-shadow: 1px 0 20px rgba(0, 0, 0, .05);
padding: 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
margin-bottom: 30px;
}
.mini-stat-info {
font-size: 14px;
padding-top: 2px;
}
.mini-stat-info span {
display: block;
font-size: 24px;
}
.bg-white {
background-color: #fff!important;
}
.bg-success {
background-color: #6fd088!important;
}
.bg-info {
background-color: #0097a7!important;
}
.bg-light {
background-color: #f8f9fa!important;
}
.mini-stat-icon {
width: 60px;
height: 60px;
display: inline-block;
line-height: 60px;
text-align: center;
font-size: 30px;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
float: left;
margin-right: 10px;
}
.bg-light {
background-color: #f8f9fa!important;
}
.card {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 1px solid rgba(0, 0, 0, .125);
border-radius: .25rem;
box-shadow: 1px 0 20px rgba(0,0,0,.05);
}
.text-right {
text-align: right!important;
}
.text-light {
color: #f8f9fa!important;
}
.m-b-30 {
margin-bottom: 30px;
}
.card-body {
-webkit-box-flex: 1;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
padding: 1.25rem;}
.header-title {
margin-bottom: 8px;
text-transform: uppercase;
letter-spacing: .02em;
font-size: 14px;
}
.mt-0, .my-0 {
margin-top: 0!important;
}
.m-t-20 {
margin-top: 20px;
}
.mb-0, .my-0 {
margin-bottom: 0!important;
}
.m-r-5 {
margin-right: 5px;
}

@ -12,7 +12,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
controller: 'partnerDashboardCtrl'
})
}]);
app.controller('partnerDashboardCtrl', ['$scope', '$http', '$filter', '$uibModal','$timeout', 'chartParser', function ($scope, $http, $filter, $uibModal,$timeout, chartParser) {
/*app.controller('partnerDashboardCtrl', ['$scope', '$http', '$filter', '$uibModal','$timeout', 'chartParser', function ($scope, $http, $filter, $uibModal,$timeout, chartParser) {
$scope.params = {};
$scope.chooseShow = 'All';
$scope.clients = [$scope.currentUser.client];
@ -431,7 +431,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
}
},
legend: {
data: ['Wechat', 'Alipay'/*,'Bestpay'*/],
data: ['Wechat', 'Alipay'/!*,'Bestpay'*!/],
bottom: 0,
height: '15%',
width: '80%',
@ -442,7 +442,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
name: 'Exchange Rate',
min: 'auto'
}
/*color: colors*/
/!*color: colors*!/
},
xAxis: {
basic: {
@ -566,6 +566,534 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}
}]);*/
app.controller('partnerDashboardCtrl', ['$scope', '$http', '$filter', '$uibModal','$timeout', 'chartParser', function ($scope, $http, $filter, $uibModal,$timeout, chartParser) {
$scope.scales = [
{
key: 'today',
label: '今日',
params: function () {
return {
begin: $filter('date')(new Date(), 'yyyyMMdd'),
end: $filter('date')(new Date(), 'yyyyMMdd')
}
}
},
{
key: 'yesterday',
label: '昨日',
params: function () {
var date = new Date();
date = date.setDate(date.getDate() - 1);
return {
begin: $filter('date')(date, 'yyyyMMdd'),
end: $filter('date')(date, 'yyyyMMdd')
}
}
},
{
key: 'seven',
label: '近7日',
params: function () {
var date = new Date();
var end = $filter('date')(date, 'yyyyMMdd');
date = date.setDate(date.getDate() - 6);
return {
begin: $filter('date')(date, 'yyyyMMdd'),
end: end
}
}
},
{
key: 'month',
label: '本月',
params: function () {
var date = new Date();
var end = $filter('date')(date, 'yyyyMMdd');
date = date.setDate(1);
return {
begin: $filter('date')(date, 'yyyyMMdd'),
end: end
}
}
},
{
key: 'lastmonth',
label: '上月',
params: function () {
var date = new Date();
date = date.setDate(1);
var oneDay=1000*60*60*24;
var end = $filter('date')(date-oneDay, 'yyyyMMdd');
var date2 = new Date();
date2.setMonth(date2.getMonth() - 1);
date2 = date2.setDate(1);
var begin = $filter('date')(date2, 'yyyyMMdd');
return {
begin: begin,
end: end
}
}
}
];
$scope.params = {};
$scope.pagination = {};
$scope.clientMoniker = $scope.currentUser.client_moniker;
$scope.loadDashboard = function () {
loadBasicInfo()
loadTransCommon();
getAvgOrderAndCustomer();
};
$scope.loadDashboard();
function loadBasicInfo() {
$http.get('/dashboard/partner/' + $scope.clientMoniker + '/basic_info').then(function (resp) {
$scope.basicinfo = resp.data;
});
}
function loadTransCommon() {
var params = {begin: $filter('date')(new Date(), 'yyyyMMdd'), end: $filter('date')(new Date(), 'yyyyMMdd')};
$http.get('/dashboard/partner/trans_common',{params:params}).then(function (resp) {
$scope.transcommon = resp.data;
});
}
function loadTradeAmountInTypes(params) {
var tradeInTypeConfig = {
chart: {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
toolbox: {
show: true,
feature: {
mySeven: {
title: 'Last a week',
show: true,
icon: 'path://M3.59-4.07L32.38-4.07L32.38 0.04Q22.25 25.11 17.19 46.34L10.65 46.34Q16.14 26.94 26.19 1.41L3.59 1.41L3.59-4.07Z',
onclick: function () {
loadTradeAmountInTypes($scope.scales[2].params())
}
},
myThirty: {
title: 'Last a month',
show: true,
icon: 'path://M12.52 17.02L16.10 17.02Q20.71 17.02 22.43 15.72Q25.66 13.23 25.66 8.23Q25.66-0.63 17.61-0.63Q10.93-0.63 9.42 6.93L3.73 6.93Q4.50 2.19 7.03-0.91Q10.90-5.51 17.61-5.51Q23.24-5.51 26.89-2.28Q31.22 1.52 31.22 8.02Q31.22 16.78 23.38 19.48Q32.84 23.14 32.84 32.81Q32.84 39.00 29.32 42.97Q25.10 47.79 17.72 47.79Q10.79 47.79 6.68 43.04Q3.66 39.56 3.02 33.44L8.93 33.44Q9.67 42.83 17.72 42.83Q21.45 42.83 23.98 40.72Q27.14 38.01 27.14 32.81Q27.14 21.63 16.10 21.63L12.52 21.63L12.52 17.02ZM54-5.51Q67.99-5.51 67.99 21.14Q67.99 47.79 54 47.79Q40.04 47.79 40.04 21.14Q40.04-5.51 54-5.51M46.97 33.65L59.84 4.30Q57.80-0.55 53.93-0.55Q45.95-0.55 45.95 21.14Q45.95 28.52 46.97 33.65M48.16 37.91Q50.13 42.83 54 42.83Q62.09 42.83 62.09 21.07Q62.09 13.86 61.07 8.66L48.16 37.91Z',
onclick: function () {
var params = {};
var dt = new Date();
params.end = $filter('date')(dt, 'yyyyMMdd');
dt.setDate(dt.getDate() - 29);
params.begin = $filter('date')(dt, 'yyyyMMdd');
loadTradeAmountInTypes(params)
}
}
}
},
color: colors
},
series: [{
basic: {
name: '交易渠道', type: 'pie', itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
},
column: {key: 'aud_fee', name: 'gateway_label'}
}]
};
$http.get('/dashboard/partner/trans_type_analysis',{params:params}).then(function (resp) {
$scope.trade_type_chart = chartParser.parse(tradeInTypeConfig, resp.data);
});
}
loadTradeAmountInTypes($scope.scales[4].params());
function getAvgOrderAndCustomer() {
$http.get('/dashboard/partner/' + $scope.clientMoniker + '/avg_order_customer').then(function (resp) {
$scope.avgOrderAndCustomer = resp.data;
});
}
function loadFeeAnalysis(params) {
var analysisConfig = {
chart: {
tooltip: {
trigger: 'axis',
formatter: '{b}:AUD {c}'
},
toolbox: {
show: true,
feature: {
mySeven: {
title: 'Last a week',
show: true,
icon: 'path://M3.59-4.07L32.38-4.07L32.38 0.04Q22.25 25.11 17.19 46.34L10.65 46.34Q16.14 26.94 26.19 1.41L3.59 1.41L3.59-4.07Z',
onclick: function () {
loadFeeAnalysis($scope.scales[2].params());
}
},
myThirty: {
title: 'Last a month',
show: true,
icon: 'path://M12.52 17.02L16.10 17.02Q20.71 17.02 22.43 15.72Q25.66 13.23 25.66 8.23Q25.66-0.63 17.61-0.63Q10.93-0.63 9.42 6.93L3.73 6.93Q4.50 2.19 7.03-0.91Q10.90-5.51 17.61-5.51Q23.24-5.51 26.89-2.28Q31.22 1.52 31.22 8.02Q31.22 16.78 23.38 19.48Q32.84 23.14 32.84 32.81Q32.84 39.00 29.32 42.97Q25.10 47.79 17.72 47.79Q10.79 47.79 6.68 43.04Q3.66 39.56 3.02 33.44L8.93 33.44Q9.67 42.83 17.72 42.83Q21.45 42.83 23.98 40.72Q27.14 38.01 27.14 32.81Q27.14 21.63 16.10 21.63L12.52 21.63L12.52 17.02ZM54-5.51Q67.99-5.51 67.99 21.14Q67.99 47.79 54 47.79Q40.04 47.79 40.04 21.14Q40.04-5.51 54-5.51M46.97 33.65L59.84 4.30Q57.80-0.55 53.93-0.55Q45.95-0.55 45.95 21.14Q45.95 28.52 46.97 33.65M48.16 37.91Q50.13 42.83 54 42.83Q62.09 42.83 62.09 21.07Q62.09 13.86 61.07 8.66L48.16 37.91Z',
onclick: function () {
var params = {};
var dt = new Date();
params.end = $filter('date')(dt, 'yyyyMMdd');
dt.setDate(dt.getDate() - 29);
params.begin = $filter('date')(dt, 'yyyyMMdd');
loadFeeAnalysis(params);
}
}
}
},
yAxis: {
type: 'value',
name: 'Amount(AUD)'
},
color: colors
},
xAxis: {
basic: {
type: 'category',
boundaryGap: false
},
key: 'date_str'
},
series: [
{
basic: {type: 'line', label: {normal: {show: true}}, showAllSymbols: true},
column: {key: 'aud_fee'}
}
]
};
$http.get('/dashboard/partner/fee_analysis', {params: params}).then(function (resp) {
$scope.trade_line = chartParser.parse(analysisConfig, resp.data);
})
}
loadFeeAnalysis($scope.scales[4].params());
function getOrderCustomerChartAnalysis(params) {
$http.get('/dashboard/partner/customers',{params:params}).then(function (resp) {
var dates = [];
var new_customers = [];
var old_customers = [];
var total_amounts = [];
var orders = [];
resp.data.reverse().forEach(function (e) {
dates.push(e.trade_date);
new_customers.push(e.new_customers);
old_customers.push(e.old_customers);
orders.push(e.orders);
total_amounts.push(e.total);
});
$scope.customersHistory = customersHistoryConfig(dates, old_customers, new_customers, orders);
});
}
getOrderCustomerChartAnalysis($scope.scales[4].params());
var customersHistoryConfig = function (date, old_customers, new_customers, orders) {
return {
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
toolbox: {
show: true,
feature: {
mySeven: {
title: 'Last a week',
show: true,
icon: 'path://M3.59-4.07L32.38-4.07L32.38 0.04Q22.25 25.11 17.19 46.34L10.65 46.34Q16.14 26.94 26.19 1.41L3.59 1.41L3.59-4.07Z',
onclick: function () {
getOrderCustomerChartAnalysis($scope.scales[2].params())
}
},
myThirty: {
title: 'Last a month',
show: true,
icon: 'path://M12.52 17.02L16.10 17.02Q20.71 17.02 22.43 15.72Q25.66 13.23 25.66 8.23Q25.66-0.63 17.61-0.63Q10.93-0.63 9.42 6.93L3.73 6.93Q4.50 2.19 7.03-0.91Q10.90-5.51 17.61-5.51Q23.24-5.51 26.89-2.28Q31.22 1.52 31.22 8.02Q31.22 16.78 23.38 19.48Q32.84 23.14 32.84 32.81Q32.84 39.00 29.32 42.97Q25.10 47.79 17.72 47.79Q10.79 47.79 6.68 43.04Q3.66 39.56 3.02 33.44L8.93 33.44Q9.67 42.83 17.72 42.83Q21.45 42.83 23.98 40.72Q27.14 38.01 27.14 32.81Q27.14 21.63 16.10 21.63L12.52 21.63L12.52 17.02ZM54-5.51Q67.99-5.51 67.99 21.14Q67.99 47.79 54 47.79Q40.04 47.79 40.04 21.14Q40.04-5.51 54-5.51M46.97 33.65L59.84 4.30Q57.80-0.55 53.93-0.55Q45.95-0.55 45.95 21.14Q45.95 28.52 46.97 33.65M48.16 37.91Q50.13 42.83 54 42.83Q62.09 42.83 62.09 21.07Q62.09 13.86 61.07 8.66L48.16 37.91Z',
onclick: function () {
var params = {};
var dt = new Date();
params.end = $filter('date')(dt, 'yyyyMMdd');
dt.setDate(dt.getDate() - 29);
params.begin = $filter('date')(dt, 'yyyyMMdd');
getOrderCustomerChartAnalysis(params)
}
}
}
},
legend: {
data: ['Old Customers', 'New Customers', 'Order Counts']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: date
}
],
yAxis: [
{
type: 'value',
name: 'Customers'
}, {
type: 'value',
name: 'Orders'
}
],
series: [
{
name: 'Old Customers',
type: 'bar',
stack: 'customers',
data: old_customers
},
{
name: 'New Customers',
type: 'bar',
stack: 'customers',
data: new_customers
},
{
name: 'Order Counts',
type: 'line',
yAxisIndex: 1,
data: orders
}
]
};
};
/*function loadTradeTimeAnalysis(params) {
var timeAnalysis = {
chart: {
tooltip: {
trigger: 'axis'
},
toolbox: {
show: true,
feature: {
mySeven: {
title: '最近7天',
show: true,
icon: 'path://M3.59-4.07L32.38-4.07L32.38 0.04Q22.25 25.11 17.19 46.34L10.65 46.34Q16.14 26.94 26.19 1.41L3.59 1.41L3.59-4.07Z',
onclick: function () {
loadTradeTimeAnalysis($scope.scales[2].params());
}
},
myThirty: {
title: '最近30天',
show: true,
icon: 'path://M12.52 17.02L16.10 17.02Q20.71 17.02 22.43 15.72Q25.66 13.23 25.66 8.23Q25.66-0.63 17.61-0.63Q10.93-0.63 9.42 6.93L3.73 6.93Q4.50 2.19 7.03-0.91Q10.90-5.51 17.61-5.51Q23.24-5.51 26.89-2.28Q31.22 1.52 31.22 8.02Q31.22 16.78 23.38 19.48Q32.84 23.14 32.84 32.81Q32.84 39.00 29.32 42.97Q25.10 47.79 17.72 47.79Q10.79 47.79 6.68 43.04Q3.66 39.56 3.02 33.44L8.93 33.44Q9.67 42.83 17.72 42.83Q21.45 42.83 23.98 40.72Q27.14 38.01 27.14 32.81Q27.14 21.63 16.10 21.63L12.52 21.63L12.52 17.02ZM54-5.51Q67.99-5.51 67.99 21.14Q67.99 47.79 54 47.79Q40.04 47.79 40.04 21.14Q40.04-5.51 54-5.51M46.97 33.65L59.84 4.30Q57.80-0.55 53.93-0.55Q45.95-0.55 45.95 21.14Q45.95 28.52 46.97 33.65M48.16 37.91Q50.13 42.83 54 42.83Q62.09 42.83 62.09 21.07Q62.09 13.86 61.07 8.66L48.16 37.91Z',
onclick: function () {
var params = {};
var dt = new Date();
params.end = $filter('date')(dt, 'yyyyMMdd');
dt.setDate(dt.getDate() - 29);
params.begin = $filter('date')(dt, 'yyyyMMdd');
loadTradeTimeAnalysis(params)
}
}
}
},
legend: {
data: ['Total Amount', 'Total Count', 'Retail In-Store Amount', 'Retail In-Store Count', 'Retail API Amount', 'Retail API Count',
'QR Code Amount', 'QR Code Count',
'Online API Amount', 'Online API Count', 'WeChat HTML5 Amount', 'WeChat HTML5 Count'],
bottom: 0,
height: '15%',
width: '80%',
left: '10%'
},
grid: {
top: 10,
bottom: '15%',
containLabel: true
},
yAxis: [
{
name: 'Avg Amount(AUD)',
type: 'value'
},
{
name: 'Avg Count(Records)',
type: 'value'
}
],
color: colors
},
xAxis: {
basic: {type: 'category', boundaryGap: false, formatter: '{value}:00'},
key: 'hour'
},
series: [
{
basic: {
name: 'Total Amount',
type: 'line',
symbol: 'triangle',
areaStyle: {normal: {}},
yAxisIndex: 0
},
column: {key: 'total_fee'}
},
{
basic: {
name: 'Total Count',
type: 'line',
yAxisIndex: 1
},
column: {key: 'total_count'}
},
{
basic: {
name: 'Retail In-Store Amount',
type: 'line',
symbol: 'triangle',
areaStyle: {normal: {}},
yAxisIndex: 0
},
column: {key: 'offline_fee'}
},
{
basic: {
name: 'Retail In-Store Count',
type: 'line',
yAxisIndex: 1
},
column: {key: 'offline_count'}
},
{
basic: {
name: 'Retail API Amount',
type: 'line',
symbol: 'triangle',
areaStyle: {normal: {}},
yAxisIndex: 0
},
column: {key: 'offline_api_fee'}
},
{
basic: {
name: 'Retail API Count',
type: 'line',
yAxisIndex: 1
},
column: {key: 'offline_api_count'}
},
{
basic: {
name: 'QR Code Amount',
type: 'line',
symbol: 'triangle',
areaStyle: {normal: {}},
yAxisIndex: 0
},
column: {key: 'client_code_fee'}
},
{
basic: {
name: 'QR Code Count',
type: 'line',
yAxisIndex: 1
},
column: {key: 'client_code_count'}
},
{
basic: {
name: 'Online API Amount',
type: 'line',
symbol: 'triangle',
areaStyle: {normal: {}},
yAxisIndex: 0
},
column: {key: 'gateway_qrcode_fee'}
},
{
basic: {
name: 'Online API Count',
type: 'line',
yAxisIndex: 1
},
column: {key: 'gateway_qrcode_count'}
},
{
basic: {
name: 'WeChat HTML5 Amount',
type: 'line',
symbol: 'triangle',
areaStyle: {normal: {}},
yAxisIndex: 0
},
column: {key: 'gateway_jsapi_fee'}
},
{
basic: {
name: 'WeChat HTML5 Count',
type: 'line',
yAxisIndex: 1
},
column: {key: 'gateway_jsapi_count'}
}
]
};
$http.get('/dashboard/partner/trade_in_hours', {params: params}).then(function (resp) {
$scope.trade_time = chartParser.parse(timeAnalysis, resp.data);
})
}
loadTradeTimeAnalysis($scope.scales[4].params());*/
$scope.loadSettlementLogs = function (page) {
var params = angular.copy($scope.params);
// if (params.datefrom) {
// params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
// }
// if (params.dateto) {
// params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
// }
params.page = page || $scope.pagination.page || 1;
params.limit = 8;
$http.get('/dashboard/partner/' + $scope.clientMoniker + '/settlement_logs', {params: params}).then(function (resp) {
$scope.settlementLogs = resp.data.data;
$scope.pagination = resp.data.pagination;
});
};
$scope.getClearingTransactions = function (client_id,detail_id) {
$uibModal.open({
templateUrl: '/static/analysis/templates/settlement_transactions.html',
controller: 'managerClearingDetailCtrl',
resolve: {
detail: ['$http', '$stateParams', function ($http) {
return $http.get('/dashboard/partner/' + client_id+'/settlement_logs/'+detail_id);
}]
},
size: 'lg'
});
};
$scope.loadSettlementLogs(1);
}]);
app.filter('abs', function () {
return function (value) {
return Math.abs(value);
}
});
return app;
});

@ -1,4 +1,5 @@
<!--
<section class="content-header">
<h1>
Dashboard
@ -26,17 +27,17 @@
ng-bind="scale.label" ng-click="switchScale(scale)" type="button"></button>
</div>
</div>
<!--<div class="col-xs-12" ng-if="currentUser.client.has_children">-->
<!--<div class="btn-group pull-right" uib-dropdown>-->
<!--<button id="single-button" type="button" class="btn btn-primary" uib-dropdown-toggle ng-disabled="disabled">-->
<!--{{choose}} <span class="caret"></span>-->
<!--</button>-->
<!--<ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="single-button" style="min-width: 80px">-->
<!--<li><a href="#" ng-click="choose='all';chooseClient('All')">all</a></li>-->
<!--<li ng-repeat="client in clients"><a href="#" ng-click="choose=client.short_name;chooseClient(client.client_id)">{{client.short_name}}</a></li>-->
<!--</ul>-->
<!--</div>-->
<!--</div>-->
&lt;!&ndash;<div class="col-xs-12" ng-if="currentUser.client.has_children">&ndash;&gt;
&lt;!&ndash;<div class="btn-group pull-right" uib-dropdown>&ndash;&gt;
&lt;!&ndash;<button id="single-button" type="button" class="btn btn-primary" uib-dropdown-toggle ng-disabled="disabled">&ndash;&gt;
&lt;!&ndash;{{choose}} <span class="caret"></span>&ndash;&gt;
&lt;!&ndash;</button>&ndash;&gt;
&lt;!&ndash;<ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="single-button" style="min-width: 80px">&ndash;&gt;
&lt;!&ndash;<li><a href="#" ng-click="choose='all';chooseClient('All')">all</a></li>&ndash;&gt;
&lt;!&ndash;<li ng-repeat="client in clients"><a href="#" ng-click="choose=client.short_name;chooseClient(client.client_id)">{{client.short_name}}</a></li>&ndash;&gt;
&lt;!&ndash;</ul>&ndash;&gt;
&lt;!&ndash;</div>&ndash;&gt;
&lt;!&ndash;</div>&ndash;&gt;
</div>
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">
@ -75,10 +76,10 @@
<i class="fa fa-question-circle-o"
uib-tooltip="Total unsettled amount including transaction fee. Click it,show settlement logs."
uib-tooltip-enable="Total unsettled amount including transaction fee" aria-hidden="true"></i></a></span>
<!--<span class="info-box-number" ng-bind="analysis.not_settled|currency:'AUD '"></span>-->
&lt;!&ndash;<span class="info-box-number" ng-bind="analysis.not_settled|currency:'AUD '"></span>&ndash;&gt;
<span class="info-box-number"><label ng-bind="analysis.not_settled|currency:'AUD '"></label>
<!--<a role="button" ui-sref="settlementlogs"><label style="font-size: smaller;color: green">-->
<!--<i class="fa fa-info" aria-hidden="true" tooltip-placement="left-bottom" uib-tooltip="Click it,show settlement logs"></i></label></a>-->
&lt;!&ndash;<a role="button" ui-sref="settlementlogs"><label style="font-size: smaller;color: green">&ndash;&gt;
&lt;!&ndash;<i class="fa fa-info" aria-hidden="true" tooltip-placement="left-bottom" uib-tooltip="Click it,show settlement logs"></i></label></a>&ndash;&gt;
<a role="button" ng-click="toShowUnSettledDialog()" ng-if="manual_settle&&([1]|withRole)">
<i class="fa fa-info-circle" uib-tooltip="withdraw deposit" aria-hidden="true"></i></a>
<label ng-if="analysis.pre_amount != 0" style="font-size: smaller;color: grey">(preauthorised {{analysis.pre_amount}})</label>
@ -90,7 +91,7 @@
<div class="row">
<div class="col-sm-12">
<div class="box">
<!--<div class="box-header with-border"></div>-->
&lt;!&ndash;<div class="box-header with-border"></div>&ndash;&gt;
<div class="box-footer">
<div class="row">
@ -104,18 +105,18 @@
ng-if="analysis.top_amount_order"></p>
</div>
</div>
<!--<div class="col-sm-3 col-xs-6">-->
<!--<div class="description-block border-right" ng-click="displayCustomersAnalysis()"-->
<!--role="button" title="Click it,Display Customer Quantity History.">-->
<!--<p class="description-header text-bold">Customers</p>-->
<!--<p class="description-header text-green" ng-if="analysis.total_customers!=0">-->
<!--<label>{{analysis.total_customers}}</label> /-->
<!--<label>{{analysis.new_customers}}</label> /-->
<!--<label>{{analysis.old_customers}}</label>-->
<!--</p>-->
<!--<p class="description-text" ng-if="analysis.total_customers!=0">Total/New/Old</p>-->
<!--</div>-->
<!--</div>-->
&lt;!&ndash;<div class="col-sm-3 col-xs-6">&ndash;&gt;
&lt;!&ndash;<div class="description-block border-right" ng-click="displayCustomersAnalysis()"&ndash;&gt;
&lt;!&ndash;role="button" title="Click it,Display Customer Quantity History.">&ndash;&gt;
&lt;!&ndash;<p class="description-header text-bold">Customers</p>&ndash;&gt;
&lt;!&ndash;<p class="description-header text-green" ng-if="analysis.total_customers!=0">&ndash;&gt;
&lt;!&ndash;<label>{{analysis.total_customers}}</label> /&ndash;&gt;
&lt;!&ndash;<label>{{analysis.new_customers}}</label> /&ndash;&gt;
&lt;!&ndash;<label>{{analysis.old_customers}}</label>&ndash;&gt;
&lt;!&ndash;</p>&ndash;&gt;
&lt;!&ndash;<p class="description-text" ng-if="analysis.total_customers!=0">Total/New/Old</p>&ndash;&gt;
&lt;!&ndash;</div>&ndash;&gt;
&lt;!&ndash;</div>&ndash;&gt;
<div class="col-sm-3 col-xs-6">
<div class="description-block border-right">
<p class="description-header text-bold">Customers</p>
@ -170,4 +171,204 @@
</div>
</div>
</div>
</section>
</section>-->
<style>
.card{
background-color: #fff;
}
.mini-stat-info span{
font-size: 18px;
}
</style>
<section class="content-header">
<h1>
Dashboard
</h1>
<ol class="breadcrumb">
<li class="active"><i class="fa fa-dashboard"></i> Dashboard</li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="mini-stat clearfix bg-white">
<span class="mini-stat-icon bg-light"><i class="ion ion-social-usd text-danger"></i></span>
<div class="mini-stat-info text-right text-muted">
<span class="info-box-number text-danger" ng-bind="transcommon.today.trade_amount|currency:'AUD'">15852</span>
TRADING VOLUME
</div>
<p class="mb-0 m-t-20 text-muted">Yesterday: {{transcommon.yes.trade_amount|currency:'AUD'}} <span class="pull-right" ng-class="{'text-red':transcommon.today.trade_amount<transcommon.yes.trade_amount}">
<i class="fa fa-caret-up m-r-5" ng-if="transcommon.today.trade_amount >=transcommon.yes.trade_amount"></i>
<i class="fa fa-caret-down m-r-5" ng-if="transcommon.today.trade_amount<transcommon.yes.trade_amount"></i>
{{((transcommon.today.trade_amount-transcommon.yes.trade_amount)/transcommon.yes.trade_amount)|number:2|abs}}%</span></p>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="mini-stat clearfix bg-success">
<span class="mini-stat-icon bg-light"><i class="fa fa-shopping-cart text-success"></i></span>
<div class="mini-stat-info text-right text-white">
<span class="counter text-white" ng-bind="transcommon.today.trade_count">956</span>
TRANSACTIONS
</div>
<p class="mb-0 m-t-20 text-light">Yesterday: {{transcommon.yes.trade_count}} <span class="pull-right" ng-class="{'text-red':transcommon.today.trade_count<transcommon.yes.trade_count}">
<i class="fa fa-caret-up m-r-5" ng-if="transcommon.today.trade_count >=transcommon.yes.trade_count"></i>
<i class="fa fa-caret-down m-r-5 " ng-if="transcommon.today.trade_count<transcommon.yes.trade_count"></i>
{{((transcommon.today.trade_count-transcommon.yes.trade_count)/transcommon.yes.trade_count)|number:2|abs}}%</span></p>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="mini-stat clearfix bg-white">
<span class="mini-stat-icon bg-light"><i class="fa fa-cube text-warning"></i></span>
<div class="mini-stat-info text-right text-muted">
<span class="counter text-warning" ng-bind="transcommon.today.new_customers">5210</span>
New Customers
</div>
<p class="mb-0 m-t-20 text-muted">Yesterday: {{transcommon.yes.new_customers}} <span class="pull-right" ng-class="{'text-red':transcommon.today.new_customers<transcommon.yes.new_customers}">
<i class="fa fa-caret-up m-r-5" ng-if="transcommon.today.new_customers >=transcommon.yes.new_customers"></i>
<i class="fa fa-caret-down m-r-5" ng-if="transcommon.today.new_customers<transcommon.yes.new_customers"></i>
{{((transcommon.today.trade_count-transcommon.yes.new_customers)/transcommon.yes.new_customers*100)|number:2|abs}}%</span></p>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="mini-stat clearfix bg-info">
<span class="mini-stat-icon bg-light"><i class="glyphicon glyphicon-btc text-info"></i></span>
<div class="mini-stat-info text-right text-light">
<span class="counter text-white" ng-bind="transcommon.today.not_settled|currency:'AUD '">20544</span>
UNSETTLED
</div>
<p class="mb-0 m-t-20 text-light">Latest settle: {{transcommon.yes.not_settled|currency:'AUD '}} <span class="pull-right" ng-class="{'text-red':transcommon.today.not_settled<transcommon.yes.not_settled}">
<i class="fa fa-caret-up m-r-5" ng-if="transcommon.today.not_settled >=transcommon.yes.not_settled"></i>
<i class="fa fa-caret-down m-r-5" ng-if="transcommon.today.not_settled<transcommon.yes.not_settled"></i>
{{((transcommon.today.not_settled-transcommon.yes.not_settled)/transcommon.yes.not_settled)|number:2|abs}}%</span></p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="card m-b-30">
<div class="card-body">
<h4 class="mt-0 header-title">Transaction Time Analysis</h4>
<ul class="list-inline widget-chart m-t-20 text-center">
<li>
<h6 class=""><b>{{basicinfo.rate_value.wechat_rate_value}}%</b></h6>
<img src="/static/images/wechatpay_sign.png"/> Wechat
</li>
<li>
<h6 class=""><b>{{basicinfo.rate_value.ali_rate_value}}%</b></h6>
<img src="/static/images/alipay_sign.png"/> Alipay
</li>
</ul>
<div class="box-body">
<div class="chart" echarts="trade_line" style="height: 300px"
ng-class="{nodata:trade_line.nodata}"></div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="card m-b-30">
<div class="card-body">
<h4 class="mt-0 header-title">Customers Analysis</h4>
<ul class="list-inline widget-chart m-t-20 text-center">
<li>
<p class="text-muted m-b-0">{{avgOrderAndCustomer.old_customers.toFixed(0)||0}}</p>
<h6 class=""><b>AVG OLD CUSTOMER</b></h6>
</li>
<li>
<p class="text-muted m-b-0">{{avgOrderAndCustomer.new_customers.toFixed(0)||0}}</p>
<h6 class=""><b>AVG NEW CUSTOME</b></h6>
</li>
</ul>
<div class="row">
<div class="box-body">
<div class="chart" echarts="customersHistory" style="height: 300px"
ng-class="{nodata:customersHistory.nodata}"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="card m-b-30">
<div class="card-body">
<h4 class="mt-0 header-title">Trading distribution chart</h4>
<div class="row">
<div class="box-body">
<div class="chart" echarts="trade_time" style="height: 430px"
ng-class="{nodata:trade_time.nodata}"></div>
</div>
</div>
</div>
</div>
</div>
</div>-->
<div class="row">
<div class="col-md-8 col-sm-8 col-xs-12">
<div class="card m-b-30">
<div class="card-body">
<h4 class="mt-0 m-b-15 header-title">Settlement Logs</h4>
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead>
<tr>
<th>Date</th>
<th>Transaction Amount</th>
<th>to Merchant</th>
<th>Service Fee</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="log in settlementLogs">
<td ng-bind="log.clearing_time|limitTo:10"></td>
<td ng-bind="log.total"></td>
<td ng-bind="log.income"></td>
<td ng-bind="log.fee"></td>
<td>
<a role="button" class="text-bold" ng-if="(log.clearing_time|limitTo:10) >= '2017-01-12'" ng-click="getClearingTransactions(log.client_id,log.clear_detail_id)" title="Detail">
<i class="fa fa-list-alt"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel-footer" ng-if="settlementLogs.length">
<uib-pagination class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadSettlementLogs()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="card m-b-30">
<div class="card-body">
<h4 class="mt-0 header-title">交易类型分布-交易量</h4>
<div class="chart" style="height: 400px" echarts="trade_type_chart"
ng-class="{nodata:trade_type_chart.nodata}"></div>
</div>
</div>
</div>
</div>
</section>

Loading…
Cancel
Save