master
hellolujian 6 years ago
parent 4738df4050
commit 74892d8908

@ -22,9 +22,9 @@ public interface DashboardService {
List<JSONObject> getTradeInTypes(JSONObject params);
//List<JSONObject> getTopTradePartners(JSONObject params, int limit);
List<JSONObject> getTopTradePartners(JSONObject params, int limit);
List<JSONObject> getTopTradePartners(JSONObject params);
List<JSONObject> getTopTradePartnersNew(JSONObject params);
List<JSONObject> getTradeAnalysisInHours(JSONObject params);

@ -161,19 +161,18 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
return transactionAnalysisMapper.getTradeAmountInTypes(params);
}
/*
@Override
public List<JSONObject> 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<JSONObject> getTopTradePartners(JSONObject params) {
public List<JSONObject> getTopTradePartnersNew(JSONObject params) {
params.putIfAbsent("rankType", "aud_fee");
return clientAnalysisMapper.listPartnersTradeAmount(params);
return clientAnalysisMapper.listPartnersTradeAmountNew(params);
}
@Override

@ -33,7 +33,9 @@ public interface ClientAnalysisMapper {
List<JSONObject> countTradePartnersHistory(JSONObject params);
List<JSONObject> listPartnersTradeAmount(JSONObject params);
List<JSONObject> listPartnersTradeAmountNew(JSONObject params);
List<JSONObject> listPartnersTradeAmount(JSONObject params, PageBounds pageBounds);
List<JSONObject> countClientsTypes(JSONObject params);

@ -67,10 +67,11 @@ public class DashboardController {
@ManagerMapping("/top_trade_partners")
public List<JSONObject> 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")

@ -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这一条件
-->
<select id="listPartnersTradeAmount" resultType="com.alibaba.fastjson.JSONObject">
<select id="listPartnersTradeAmountNew" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
p.short_name,
@ -200,7 +200,6 @@
</if>
</select>
<select id="countClientsTypes" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.industry,c.royalpayindustry,count(1) partner_counts FROM sys_clients c
<if test="bd_user!=null">

Loading…
Cancel
Save