Upd:运营端用户数据分析增加金额于订单量删选排序

master
dulingling 5 years ago
parent 2d8fdaece4
commit 96b5139d97

@ -37,6 +37,8 @@ public class AnalysisBean {
private String amount_to;
private String bd_name;
private String timezone;
private boolean orderAmountFlag;
private boolean orderOrdersFlag;
public JSONObject toParams(String timezone) {
JSONObject params = new JSONObject();
if (timezone != null) {
@ -89,9 +91,8 @@ public class AnalysisBean {
if (amount_from != null && amount_from.length() > 0){
params.put("amount_from", new BigDecimal(amount_from));
}
if (amount_to != null && amount_to.length() > 0){
params.put("amount_to", new BigDecimal(amount_to));
}
params.put("orderAmountFlag", orderAmountFlag);
params.put("orderOrdersFlag", orderOrdersFlag);
return params;
}
@ -238,4 +239,21 @@ public class AnalysisBean {
public void setTimezone(String timezone) {
this.timezone = timezone;
}
public boolean isOrderAmountFlag() {
return orderAmountFlag;
}
public void setOrderAmountFlag(boolean orderAmountFlag) {
this.orderAmountFlag = orderAmountFlag;
}
public boolean isOrderOrdersFlag() {
return orderOrdersFlag;
}
public void setOrderOrdersFlag(boolean orderOrdersFlag) {
this.orderOrdersFlag = orderOrdersFlag;
}
}

@ -109,7 +109,11 @@ public class CustomersAnalysisServiceImp implements CustomersAnalysisService {
@Override
public JSONObject getCustomersRanking(JSONObject params, int page, int limit) {
PageList<JSONObject> logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit, Order.formString("amount.desc")));
PageList<JSONObject> logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit,
Order.formString(
(params.getBoolean("orderAmountFlag")?"orders.desc":"amount.desc")
)
));
if (logs.size() > 0) {
for (JSONObject log : logs) {
generatorUserProfile(log, params);

@ -14,6 +14,8 @@ 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.orderOrdersFlag = true;
var echartsConfig = function (graph) {
var categories = [];
var c = 0;
@ -229,7 +231,16 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
$scope.refundOrder = function (order) {
refunder.refunded(order.order_id)
};
$scope.clickOrderAmount = function () {
$scope.params.orderAmountFlag = !$scope.orderAmountFlag;
$scope.params.orderOrdersFlag = true;
$scope.listCustomers(1);
};
$scope.clickOrderOrders = function () {
$scope.params.orderOrdersFlag = !$scope.orderOrdersFlag;
$scope.params.orderAmountFlag = true;
$scope.listCustomers(1);
}
}]);
return app;

@ -61,7 +61,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul
$scope.chooseLast7Days = function () {
$scope.params.end = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
day.setDate(day.getDate() - 6);
$scope.params.begin = day;
$scope.doAnalysis(1);
};

@ -121,9 +121,13 @@
<tr>
<th style="width: 200px">Nick Name</th>
<th>Customer openId</th>
<th>Amount(AUD)</th>
<th ng-click="orderAmount()">Amount(AUD)
<i ng-click="clickOrderAmount()" ng-class="params.orderAmountFlag?'glyphicon glyphicon-chevron-up':'glyphicon glyphicon-chevron-down'"></i>
</th>
<!-- <th>Points</th>-->
<th>Orders</th>
<th >Orders
<i ng-click="clickOrderOrders()" ng-class="params.orderOrdersFlag?'glyphicon glyphicon-chevron-up':'glyphicon glyphicon-chevron-down'"></i>
</th>
<th>Max Order(AUD)</th>
</tr>
</thead>

Loading…
Cancel
Save