From 365516cb03b2dedcc2b23bc0bd94693a0fcb4ebd Mon Sep 17 00:00:00 2001 From: dulingling Date: Tue, 18 Feb 2020 15:17:48 +0800 Subject: [PATCH] =?UTF-8?q?Upd:=E8=BF=90=E8=90=A5=E7=AB=AF=E6=B6=88?= =?UTF-8?q?=E8=B4=B9=E8=80=85=E6=8E=92=E5=90=8D=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/analysis/beans/AnalysisBean.java | 25 ++++++------------- .../impls/CustomersAnalysisServiceImp.java | 7 ++---- .../ui/static/analysis/customer_analysis.js | 14 +++++++---- .../analysis/templates/customer_analysis.html | 4 +-- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java index 5bff89475..27bb22f0d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java @@ -37,8 +37,9 @@ public class AnalysisBean { private String amount_to; private String bd_name; private String timezone; - private boolean orderAmountFlag; - private boolean orderOrdersFlag; + private String orderValue; + + public JSONObject toParams(String timezone) { JSONObject params = new JSONObject(); if (timezone != null) { @@ -91,8 +92,7 @@ public class AnalysisBean { if (amount_from != null && amount_from.length() > 0){ params.put("amount_from", new BigDecimal(amount_from)); } - params.put("orderAmountFlag", orderAmountFlag); - params.put("orderOrdersFlag", orderOrdersFlag); + params.put("orderValue", orderValue); return params; } @@ -240,20 +240,11 @@ public class AnalysisBean { this.timezone = timezone; } - public boolean isOrderAmountFlag() { - - return orderAmountFlag; - } - - public void setOrderAmountFlag(boolean orderAmountFlag) { - this.orderAmountFlag = orderAmountFlag; - } - - public boolean isOrderOrdersFlag() { - return orderOrdersFlag; + public String getOrderValue() { + return orderValue; } - public void setOrderOrdersFlag(boolean orderOrdersFlag) { - this.orderOrdersFlag = orderOrdersFlag; + public void setOrderValue(String orderValue) { + this.orderValue = orderValue; } } diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java index 3f0d53399..e130ad037 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java @@ -109,11 +109,8 @@ public class CustomersAnalysisServiceImp implements CustomersAnalysisService { @Override public JSONObject getCustomersRanking(JSONObject params, int page, int limit) { - PageList logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit, - Order.formString( - (params.getBoolean("orderAmountFlag")?"orders.desc":"amount.desc") - ) - )); + + PageList logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit, Order.formString( params.getString("orderValue") ))); if (logs.size() > 0) { for (JSONObject log : logs) { generatorUserProfile(log, params); diff --git a/src/main/ui/static/analysis/customer_analysis.js b/src/main/ui/static/analysis/customer_analysis.js index 336ab122b..a4a2719b6 100644 --- a/src/main/ui/static/analysis/customer_analysis.js +++ b/src/main/ui/static/analysis/customer_analysis.js @@ -14,8 +14,9 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', ' }]); app.controller('customersListCtrl', ['$scope', '$http','$filter', '$uibModal', 'commonDialog', 'orderService', 'refunder', function ($scope, $http,$filter, $uibModal, commonDialog, orderService, refunder) { $scope.one_customer = {}; - $scope.orderAmountFlag = true; + $scope.orderAmountFlag = false; $scope.orderOrdersFlag = true; + var echartsConfig = function (graph) { var categories = []; var c = 0; @@ -68,6 +69,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', ' }; $scope.pagination = {}; $scope.params = {}; + $scope.params.orderValue = "amount.desc"; $scope.params.openid_type = '0'; $scope.today = new Date(); @@ -232,13 +234,15 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', ' refunder.refunded(order.order_id) }; $scope.clickOrderAmount = function () { - $scope.params.orderAmountFlag = !$scope.orderAmountFlag; - $scope.params.orderOrdersFlag = true; + $scope.orderAmountFlag = !$scope.orderAmountFlag; + $scope.params.orderValue = "amount"+($scope.orderAmountFlag?".asc":".desc") + $scope.orderOrdersFlag = true; $scope.listCustomers(1); }; $scope.clickOrderOrders = function () { - $scope.params.orderOrdersFlag = !$scope.orderOrdersFlag; - $scope.params.orderAmountFlag = true; + $scope.orderOrdersFlag = !$scope.orderOrdersFlag; + $scope.params.orderValue = "orders"+($scope.orderOrdersFlag?".asc":".desc") + $scope.orderAmountFlag = true; $scope.listCustomers(1); } }]); diff --git a/src/main/ui/static/analysis/templates/customer_analysis.html b/src/main/ui/static/analysis/templates/customer_analysis.html index 8e1216dec..e291bb9e4 100644 --- a/src/main/ui/static/analysis/templates/customer_analysis.html +++ b/src/main/ui/static/analysis/templates/customer_analysis.html @@ -122,11 +122,11 @@ Nick Name Customer openId Amount(AUD) - + Orders - + Max Order(AUD)