|
|
|
@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.analysis.web;
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
|
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
|
|
|
|
|
import au.com.royalpay.payment.manage.organizations.core.OrgManager;
|
|
|
|
|
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
|
|
|
|
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
|
|
|
|
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
|
|
|
|
@ -20,32 +21,28 @@ import java.util.List;
|
|
|
|
|
public class DashboardController {
|
|
|
|
|
@Resource
|
|
|
|
|
private DashboardService dashboardService;
|
|
|
|
|
@Resource
|
|
|
|
|
private OrgManager orgManager;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping("/common_analysis_1")
|
|
|
|
|
public JSONObject commonAnalysis1(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
orgManager.checkOrg(manager,params);
|
|
|
|
|
return dashboardService.getCommonAnalysis1(params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ManagerMapping("/common_analysis_2")
|
|
|
|
|
public JSONObject commonAnalysis2(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
orgManager.checkOrg(manager,params);
|
|
|
|
|
return dashboardService.getCommonAnalysis2(params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ManagerMapping("/trade_in_types")
|
|
|
|
|
public List<JSONObject> tradeInTypes(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
orgManager.checkOrg(manager,params);
|
|
|
|
|
return dashboardService.getTradeInTypes(params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -53,18 +50,14 @@ public class DashboardController {
|
|
|
|
|
public List<JSONObject> topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
|
|
|
|
|
@RequestParam(defaultValue = "10") int limit) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
orgManager.checkOrg(manager,params);
|
|
|
|
|
return dashboardService.getTopTradePartners(params, limit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ManagerMapping("/rank_trade_partners")
|
|
|
|
|
public List<JSONObject> rankTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
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){
|
|
|
|
@ -77,9 +70,7 @@ public class DashboardController {
|
|
|
|
|
@ManagerMapping("/trade_in_hours")
|
|
|
|
|
public List<JSONObject> tradeInHours(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
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){
|
|
|
|
@ -92,18 +83,14 @@ public class DashboardController {
|
|
|
|
|
@ManagerMapping("/fee_analysis")
|
|
|
|
|
public List<JSONObject> tradeInDays(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
orgManager.checkOrg(manager,params);
|
|
|
|
|
return dashboardService.getTradeAnalysisInDays(params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ManagerMapping("/partners_in_types")
|
|
|
|
|
public List<JSONObject> partnersInTypes(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
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){
|
|
|
|
@ -118,9 +105,7 @@ public class DashboardController {
|
|
|
|
|
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
params.put("trade_type", trade_type);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
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){
|
|
|
|
@ -134,9 +119,7 @@ public class DashboardController {
|
|
|
|
|
@ManagerMapping("/trade_in_time")
|
|
|
|
|
public List<JSONObject> tradeInTime(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
orgManager.checkOrg(manager,params);
|
|
|
|
|
return dashboardService.getTradeAnalysisInTime(params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -154,9 +137,7 @@ public class DashboardController {
|
|
|
|
|
@ManagerMapping("/Total_platform_amount")
|
|
|
|
|
public JSONObject getPlatformAmount(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){
|
|
|
|
|
JSONObject params = analysis.toParams(null);
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
}
|
|
|
|
|
orgManager.checkOrg(manager,params);
|
|
|
|
|
return dashboardService.getPlatformAmount(params);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|