diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardService.java index 53202d7a1..5501d2c26 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardService.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/DashboardService.java @@ -22,9 +22,9 @@ public interface DashboardService { List getTradeInTypes(JSONObject params); - //List getTopTradePartners(JSONObject params, int limit); + List getTopTradePartners(JSONObject params, int limit); - List getTopTradePartners(JSONObject params); + List getTopTradePartnersNew(JSONObject params); List getTradeAnalysisInHours(JSONObject params); 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 5887c83ea..c63347edc 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 @@ -161,19 +161,18 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT return transactionAnalysisMapper.getTradeAmountInTypes(params); } - /* + @Override public List getTopTradePartners(JSONObject params, int limit) { - params.put("rankType", "aud_fee"); - params.put("limit", limit); - return clientAnalysisMapper.listPartnersTradeAmount(params); + return clientAnalysisMapper.listPartnersTradeAmount(params, + new PageBounds(1, limit, Order.formString("aud_fee.desc"))); } - */ + @Override - public List getTopTradePartners(JSONObject params) { + public List getTopTradePartnersNew(JSONObject params) { params.putIfAbsent("rankType", "aud_fee"); - return clientAnalysisMapper.listPartnersTradeAmount(params); + return clientAnalysisMapper.listPartnersTradeAmountNew(params); } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java index 93913f7e4..13c421880 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java @@ -33,7 +33,9 @@ public interface ClientAnalysisMapper { List countTradePartnersHistory(JSONObject params); - List listPartnersTradeAmount(JSONObject params); + List listPartnersTradeAmountNew(JSONObject params); + + List listPartnersTradeAmount(JSONObject params, PageBounds pageBounds); List countClientsTypes(JSONObject params); diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java index 87738f269..9035b0485 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java @@ -67,10 +67,11 @@ public class DashboardController { @ManagerMapping("/top_trade_partners") public List topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestParam(defaultValue = "10") int limit) { + JSONObject params = analysis.toParams(analysis.getTimezone()); - orgManager.checkOrg(manager,params); + orgManager.checkOrg(manager, params); params.put("limit", limit); - return dashboardService.getTopTradePartners(params); + return dashboardService.getTopTradePartnersNew(params); } @ManagerMapping("/rank_trade_partners") @@ -79,11 +80,11 @@ public class DashboardController { orgManager.checkOrg(manager, params); if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { params.put("bd_group", manager.getString("manager_id")); - if (analysis.getGroup_bd()>0){ + if (analysis.getGroup_bd() > 0){ params.put("bd_group_bd", analysis.getGroup_bd()); } } - return dashboardService.getTopTradePartners(params); + return dashboardService.getTopTradePartnersNew(params); } @ManagerMapping("/trade_in_hours") diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml index 2373135bf..2a9443ed6 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml @@ -148,9 +148,9 @@ 优化后的SQL语句 在之前的SQL语句中,与transaction表内连接时加了and (t.transaction_type = 'Credit' or t.refund_id is not null)这个条件 是因为在transaction_type = 'Debit'的记录中,有的并没有refund_id,所以剔除这些记录 - 优化后的SQL语句去掉了这个条件,而是在需要的字段中天健t.refund_id IS NOT NULL这一条件 + 优化后的SQL语句去掉了这个条件,而是在需要的字段中添加t.refund_id IS NOT NULL这一条件 --> - -