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 6e4ea254e..97ef7c216 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 @@ -163,16 +163,15 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT @Override public List getTopTradePartners(JSONObject params, int limit) { - return clientAnalysisMapper.listPartnersTradeAmount(params, new PageBounds(1, limit, Order.formString("aud_fee.desc"))); + params.put("rankType", "aud_fee"); + params.put("limit", limit); + return clientAnalysisMapper.listPartnersTradeAmount(params); } @Override public List getTopTradePartners(JSONObject params) { - String rankType = "aud_fee"; - if (params.getString("rankType")!=null){ - rankType = params.getString("rankType"); - } - return clientAnalysisMapper.listPartnersTradeAmount(params, new PageBounds(Order.formString(rankType+".desc"))); + params.putIfAbsent("rankType", "aud_fee"); + return clientAnalysisMapper.listPartnersTradeAmount(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 dd4272dd2..93913f7e4 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,7 @@ public interface ClientAnalysisMapper { List countTradePartnersHistory(JSONObject params); - List listPartnersTradeAmount(JSONObject params, PageBounds pageBounds); + List listPartnersTradeAmount(JSONObject params); 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 86cb29a46..a0000005a 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 @@ -75,11 +75,11 @@ public class DashboardController { @ManagerMapping("/rank_trade_partners") public List rankTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { JSONObject params = analysis.toParams(null); - orgManager.checkOrg(manager,params); + 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){ - params.put("bd_group_bd",analysis.getGroup_bd()); + params.put("bd_group_bd", analysis.getGroup_bd()); } } return dashboardService.getTopTradePartners(params); 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 6afef4190..1f14033e4 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 @@ -97,30 +97,100 @@ GROUP BY date(o.create_time) + + + +