master
yuan 7 years ago
parent 33b3795a58
commit d367f9c615

@ -244,17 +244,14 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
params.put("end",DateUtils.addDays(params.getDate("end"),-1)); params.put("end",DateUtils.addDays(params.getDate("end"),-1));
JSONObject yes = getTransJSONO(params); JSONObject yes = getTransJSONO(params);
res.put("today",today); res.put("today",today);
BigDecimal not_settled = new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)); res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
res.put("not_settled", not_settled);
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("client_id", partner.getIntValue("client_id")); object.put("client_id", partner.getIntValue("client_id"));
PageList<JSONObject> logs = transactionMapper.listSettlementLog(object, new PageBounds(1, 1, Order.formString("clearing_time.desc"))); PageList<JSONObject> logs = transactionMapper.listSettlementLog(object, new PageBounds(1, 1, Order.formString("clearing_time.desc")));
BigDecimal latest_settle = logs.isEmpty()?BigDecimal.ZERO:logs.get(0).getBigDecimal("income"); res.put("latest_settle",logs.isEmpty()?BigDecimal.ZERO:logs.get(0).getBigDecimal("income"));
res.put("latest_settle",latest_settle);
res.put("trade_amount_rise",yes.getBigDecimal("trade_amount").compareTo(BigDecimal.ZERO)>0 ? (today.getBigDecimal("trade_amount").subtract(yes.getBigDecimal("trade_amount"))).divide(yes.getBigDecimal("trade_amount"),4):BigDecimal.ZERO); res.put("trade_amount_rise",yes.getBigDecimal("trade_amount").compareTo(BigDecimal.ZERO)>0 ? (today.getBigDecimal("trade_amount").subtract(yes.getBigDecimal("trade_amount"))).divide(yes.getBigDecimal("trade_amount"),4):BigDecimal.ZERO);
res.put("trade_count_rise", yes.getIntValue("trade_count") > 0 ? (today.getIntValue("trade_count")-yes.getIntValue("trade_count"))/yes.getIntValue("trade_count") : 0); res.put("trade_count_rise", yes.getIntValue("trade_count") > 0 ? (today.getIntValue("trade_count")-yes.getIntValue("trade_count"))/yes.getIntValue("trade_count") : 0);
res.put("new_customers_rise", yes.getIntValue("new_customers") > 0 ? (today.getIntValue("new_customers")-yes.getIntValue("new_customers"))/yes.getIntValue("new_customers") : 0); res.put("new_customers_rise", yes.getIntValue("new_customers") > 0 ? (today.getIntValue("new_customers")-yes.getIntValue("new_customers"))/yes.getIntValue("new_customers") : 0);
res.put("not_settled_rise",not_settled.compareTo(BigDecimal.ZERO)>0 ? (not_settled.subtract(latest_settle)).divide(latest_settle,4):BigDecimal.ZERO);
res.put("yes",yes); res.put("yes",yes);
return res; return res;
} }

@ -1082,7 +1082,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
$scope.loadSettlementLogs = function (page) { $scope.loadSettlementLogs = function (page) {
var params = angular.copy($scope.params); var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1; params.page = page || $scope.pagination.page || 1;
params.limit = 8; params.limit = 10;
$http.get('/dashboard/partner/' + $scope.clientMoniker + '/settlement_logs', {params: params}).then(function (resp) { $http.get('/dashboard/partner/' + $scope.clientMoniker + '/settlement_logs', {params: params}).then(function (resp) {
$scope.settlementLogs = resp.data.data; $scope.settlementLogs = resp.data.data;
$scope.pagination = resp.data.pagination; $scope.pagination = resp.data.pagination;
@ -1284,7 +1284,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
}]); }]);
app.filter('abs', function () { app.filter('abs', function () {
return function (value) { return function (value) {
return Math.abs(value); return Math.abs(value*100);
} }
}); });
return app; return app;

@ -215,7 +215,7 @@
<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}"> <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-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> <i class="fa fa-caret-down m-r-5 " ng-if="transcommon.today.trade_count<transcommon.yes.trade_count"></i>
{{transcommon.trade_count_rise|number:2|abs}}%</span></p> {{transcommon.trade_count_rise|abs}}%</span></p>
</div> </div>
</div> </div>
<div class="col-md-3 col-sm-6 col-xs-12"> <div class="col-md-3 col-sm-6 col-xs-12">
@ -235,15 +235,13 @@
<div class="mini-stat clearfix bg-info"> <div class="mini-stat clearfix bg-info">
<span class="mini-stat-icon bg-light"><i class="glyphicon glyphicon-btc text-info"></i></span> <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"> <div class="mini-stat-info text-right text-light">
<span class="counter text-white" ng-bind="transcommon.not_settled|currency:'AUD '">20544</span> <span class="counter text-white">
{{transcommon.not_settled|currency:'AUD '}} <a role="button" ng-click="toShowUnSettledDialog()" ng-if="manual_settle&&([1]|withRole)">
<i class="fa fa-info-circle text-black" uib-tooltip="withdraw deposit" aria-hidden="true"></i></a>
</span>
UNSETTLED UNSETTLED
</div> </div>
<p class="mb-0 m-t-20 text-light">Latest: {{transcommon.latest_settle|currency:'AUD '}} <span class="pull-right" ng-class="{'text-red':transcommon.not_settled<transcommon.latest_settle}"> <p class="mb-0 m-t-20 text-light">Latest settlement: {{transcommon.latest_settle|currency:'AUD '}}
<i class="fa fa-caret-up m-r-5" ng-if="transcommon.not_settled >=transcommon.latest_settle"></i>
<i class="fa fa-caret-down m-r-5" ng-if="transcommon.not_settled<transcommon.latest_settle"></i>
{{transcommon.not_settled_rise|number:2|abs}}% </span>
<a role="button" ng-click="toShowUnSettledDialog()" ng-if="manual_settle&&([1]|withRole)">
<i class="fa fa-info-circle text-black" uib-tooltip="withdraw deposit" aria-hidden="true"></i></a>
</p> </p>
</div> </div>
</div> </div>
@ -321,7 +319,12 @@
<div class="col-md-8 col-sm-8 col-xs-12" > <div class="col-md-8 col-sm-8 col-xs-12" >
<div class="card m-b-30"> <div class="card m-b-30">
<div class="card-body" style="height: 500px"> <div class="card-body" style="height: 500px">
<h4 class="mt-0 m-b-15 header-title">Settlement Logs</h4> <h4 class="mt-0 m-b-15 header-title">
Settlement Logs
<a style="float: right" role="button" ui-sref="settlementlogs">+ more</a>
</h4>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover mb-0"> <table class="table table-hover mb-0">
@ -350,22 +353,6 @@
</tbody> </tbody>
</table> </table>
</div> </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>
</div> </div>

Loading…
Cancel
Save