Commit 763a14f4 authored by ml's avatar ml

资管后台-手续费相关增加 昨日数据

parent 4977e47e
......@@ -44,6 +44,27 @@ export const getFeeData = async (req: any, commonParam: CommonParam) => {
}
};
/**
* 昨日数据页签-查询手续费数据
* query_type 1 现货 2 U本位合约 3 币本位合约 4 全部(包含提现)
* @param req
* @param commonParam
*/
export const getYesTabFeeData = async (req: any, commonParam: CommonParam) => {
let func_name = "abkFeeStatistics.control.getYesTabFeeData";
try {
setPageAndSize(commonParam);
beforeQueryCheckTime(commonParam);
let type = Number(commonParam.query_type) || 4;
let res = await abkFeeStatisticsService.getYesTabFeeData(commonParam.from_time, commonParam.to_time, commonParam.page, commonParam.size, type);
return Res3Utils.result(res);
}
catch (e) {
logger.error(`${func_name} error:${e}`);
return Res3Utils.getErrorResult(e);
}
};
/**
* 查询手续费数据详情(分用户)
......@@ -101,6 +122,9 @@ export const withdrawDataDetails = async (req: any, commonParam: CommonParam) =>
let func_name = "abkFeeStatistics.control.withdrawDataDetails";
try {
setPageAndSize(commonParam);
if (!commonParam.from_time) {
throw ErrorCode.PARAM_MISS;
}
let user_id = Number(commonParam.user_id || 0);
let res = await abkFeeStatisticsService.withdrawDataDetails(commonParam.from_time, commonParam.to_time, commonParam.page, commonParam.size, user_id);
return Res3Utils.result(res);
......
......@@ -122,6 +122,34 @@ export async function getFeeData(from_time: any, to_time: any, page: any, size:
return pageData;
}
/**
* 昨日数据页签-手续费数据
* @param from_time
* @param to_time
* @param page
* @param size
* @param type 1 现货 2 U本位合约 3 币本位合约 4 全部(包含提现)
*/
export async function getYesTabFeeData(from_time: any, to_time: any, page: any, size: any, type: number) {
//查询总体数据
let total_obj = await getTotalFeeDataOfPeriodByType(from_time, to_time, type);
//查询全部时要查询提现手续费
if (type == 4) {
let { withdrawDtFeeMap, withdraw_total_fee, withdraw_common_user_fee, withdraw_crm_user_fee } = await getTotalWithdrawFeeByDtGroup(from_time, to_time);
//加上提现手续费
total_obj.total_fee = total_obj.total_fee.add(withdraw_total_fee);
total_obj.common_user.fee = total_obj.common_user.fee.add(withdraw_common_user_fee);
total_obj.crm_user.fee = total_obj.crm_user.fee.add(withdraw_crm_user_fee);
}
//查询详细数据
let pageData = await getFeeDataDetails(from_time, to_time, page, size, type, 3, 0);
pageData["total_data"] = total_obj;
return pageData;
}
/**
* 手续费数据详情
* @param from_time
......@@ -129,7 +157,7 @@ export async function getFeeData(from_time: any, to_time: any, page: any, size:
* @param page
* @param size
* @param type 1 现货 2 U本位合约 3 币本位合约 4 全部(不含提现,提现单独接口)
* @param user_type 用户类型:1:普通用户;2:代理用户(crm用户)
* @param user_type 用户类型:1:普通用户;2:代理用户(crm用户);3:全部用户;
* @param user_id
*/
export async function getFeeDataDetails(from_time: any, to_time: any, page: any, size: any, type: number, user_type: number, user_id: number) {
......@@ -170,8 +198,15 @@ export async function getFeeDataDetails(from_time: any, to_time: any, page: any,
cond_common_user_ids.push(item);
}
}
let cond_user_ids: any = [];
//全部用户
if (user_type == 3) {
cond_user_ids = _.union(cond_common_user_ids, cond_crm_user_ids);
}
else {
cond_user_ids = user_type == 1 ? cond_common_user_ids : cond_crm_user_ids;
}
let cond_user_ids = user_type == 1 ? cond_common_user_ids : cond_crm_user_ids;
if (!cond_user_ids.length) {
return {
......
......@@ -42,6 +42,7 @@ const postFunc = {
//收入分析
'abkFeeStatistics/home/gatherData': feeStatisticsCtrl.gatherData,//首页数据概览
'abkFeeStatistics/getFeeData': feeStatisticsCtrl.getFeeData,//平台、现货、合约 手续费查询
'abkFeeStatistics/getYesTabFeeData': feeStatisticsCtrl.getYesTabFeeData,//昨日数据页签-平台、现货、合约 手续费查询
'abkFeeStatistics/getFeeDataDetails': feeStatisticsCtrl.getFeeDataDetails,//平台、现货、合约 手续费查询详情
'abkFeeStatistics/withdrawData': feeStatisticsCtrl.withdrawData,//提现手续费
'abkFeeStatistics/withdrawDataDetails': feeStatisticsCtrl.withdrawDataDetails,//提现手续费详情
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment