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