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 d28c2ff4a..55c706383 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 @@ -57,7 +57,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT res.put("new_partners", clientAnalysisMapper.countNewClients(params)); res.put("total_partners", clientAnalysisMapper.countClients(params)); res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params)); - res.put("trade_amount", transactionAnalysisMapper.analysisTotalAmount(params)); + res.put("trade_amount", transactionAnalysisMapper.getClientTransaction(params).getBigDecimal("trade_amount")); // res.put("trade_count", transactionAnalysisMapper.analysisTotalCount(params)); // List topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc"))); // if (!topOrders.isEmpty()) { @@ -75,7 +75,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT // res.put("total_partners", clientAnalysisMapper.countClients(params)); // res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params)); // res.put("trade_amount", transactionAnalysisMapper.analysisTotalAmount(params)); - res.put("trade_count", transactionAnalysisMapper.analysisTotalCount(params)); + res.put("trade_count", transactionAnalysisMapper.getClientTransaction(params).getIntValue("trade_count")); List topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc"))); if (!topOrders.isEmpty()) { res.put("top_amount_order", topOrders.get(0)); @@ -212,7 +212,10 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT @Override public List getTradeAnalysisInDays(JSONObject params) { - return transactionAnalysisMapper.tradeAnalysisInDays(params); + if (!params.containsKey("client_ids") && !params.containsKey("org_id")) { + params.put("client_id", 0); + } + return customerAndOrdersStatisticsMapper.getSumCustomersAnalysis(params); } @Override @@ -227,9 +230,10 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT } JSONObject res = new JSONObject(); params.put("client_id", partner.getIntValue("client_id")); - res.put("trade_amount", transactionAnalysisMapper.analysisTotalAmount(params)); - res.put("trade_count", transactionAnalysisMapper.analysisTotalCount(params)); - res.put("refund_amount", transactionAnalysisMapper.analysisRefundAmount(params)); + 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 topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc"))); diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.xml index f5f83a564..886be691b 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/BDAnalysisMapper.xml @@ -1,9 +1,11 @@ + + + + + + + GROUP BY s.date ORDER BY date DESC - + + --> - + + + + + + + + - + + - + + - + + + - + + + + - + + + + + + + + + + - + + --> + + + + + + = #{begin} AND @@ -696,7 +735,8 @@ and t.clearing_amount < #{amount_to} - + + + + + + SELECT temp.* FROM ( @@ -248,7 +250,9 @@ GROUP BY o.order_id,t.refund_id order by o.create_time - + + + + + + + + - + + + + SELECT sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) @@ -516,7 +523,8 @@ GROUP BY so.org_id, trade_date,t.client_id ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC - + +