From 1561c75e50ab2a9ffb738e6330641893e0d267cf Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Sun, 8 Apr 2018 11:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9partner=5Fdashboard.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/analysis/core/impls/DashboardServiceImpl.java | 5 +++++ src/main/ui/static/dashboard/partner-dashboard.js | 6 +++--- .../ui/static/dashboard/templates/partner_dashboard.html | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index 2e6115587..8ec122767 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; +import java.math.BigDecimal; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -236,6 +237,10 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT params.put("end",DateUtils.addDays(params.getDate("end"),-1)); JSONObject yes = getTransJSONO(params); res.put("today",today); + 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("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",yes.getBigDecimal("not_settled").compareTo(BigDecimal.ZERO)>0 ? (today.getBigDecimal("not_settled").subtract(yes.getBigDecimal("not_settled"))).divide(yes.getBigDecimal("not_settled"),4):BigDecimal.ZERO); res.put("yes",yes); return res; } diff --git a/src/main/ui/static/dashboard/partner-dashboard.js b/src/main/ui/static/dashboard/partner-dashboard.js index f95757588..3c93d7418 100644 --- a/src/main/ui/static/dashboard/partner-dashboard.js +++ b/src/main/ui/static/dashboard/partner-dashboard.js @@ -711,7 +711,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct $scope.trade_type_chart = chartParser.parse(tradeInTypeConfig, resp.data); }); } - loadTradeAmountInTypes($scope.scales[4].params()); + loadTradeAmountInTypes($scope.scales[2].params()); function getAvgOrderAndCustomer() { $http.get('/dashboard/partner/' + $scope.clientMoniker + '/avg_order_customer').then(function (resp) { $scope.avgOrderAndCustomer = resp.data; @@ -776,7 +776,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct $scope.trade_line = chartParser.parse(analysisConfig, resp.data); }) } - loadFeeAnalysis($scope.scales[4].params()); + loadFeeAnalysis($scope.scales[2].params()); function getOrderCustomerChartAnalysis(params) { $http.get('/dashboard/partner/customers',{params:params}).then(function (resp) { @@ -795,7 +795,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct $scope.customersHistory = customersHistoryConfig(dates, old_customers, new_customers, orders); }); } - getOrderCustomerChartAnalysis($scope.scales[4].params()); + getOrderCustomerChartAnalysis($scope.scales[2].params()); var customersHistoryConfig = function (date, old_customers, new_customers, orders) { return { color: colors, diff --git a/src/main/ui/static/dashboard/templates/partner_dashboard.html b/src/main/ui/static/dashboard/templates/partner_dashboard.html index a153e6a79..244b84572 100644 --- a/src/main/ui/static/dashboard/templates/partner_dashboard.html +++ b/src/main/ui/static/dashboard/templates/partner_dashboard.html @@ -202,7 +202,7 @@

Yesterday: {{transcommon.yes.trade_amount|currency:'AUD'}} - {{((transcommon.today.trade_amount-transcommon.yes.trade_amount)/transcommon.yes.trade_amount)|number:2|abs}}%

+ {{transcommon.trade_amount_rise|abs}}%

@@ -215,7 +215,7 @@

Yesterday: {{transcommon.yes.trade_count}} - {{((transcommon.today.trade_count-transcommon.yes.trade_count)/transcommon.yes.trade_count)|number:2|abs}}%

+ {{transcommon.trade_count_rise|number:2|abs}}%

@@ -228,7 +228,7 @@

Yesterday: {{transcommon.yes.new_customers}} - {{((transcommon.today.trade_count-transcommon.yes.new_customers)/transcommon.yes.new_customers*100)|number:2|abs}}%

+ {{transcommon.new_customers_rise|abs}}%

@@ -241,7 +241,7 @@

Latest settle: {{transcommon.yes.not_settled|currency:'AUD '}} - {{((transcommon.today.not_settled-transcommon.yes.not_settled)/transcommon.yes.not_settled)|number:2|abs}}%

+ {{transcommon.not_settled_rise|number:2|abs}}%