import { wrapTreeNode } from "../../options/serveice";
import request from "../../request/request";
import requestCode from "../../request/requestCode";
import requestOld from "../../request/newRequest";
import requestJava from '../../request/requestTest'
import requestPos from "../../request/requestPos";
import requestLocal from "../../request/requestLocal";


// 获得高速头条的内容
export async function handleGetGDNearServiceList(params: any) {
    const data: any = await request.post('/Notice/GetNOTICEINFOList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}

// 获取服务区详情 用来给出天气
export async function handleGetServiceInfo(params: any) {
    const data: any = await requestCode.get('/BaseInfo/GetServerpartInfo', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 获取车辆的排行
export async function handleGetProvinceMonthAnalysis(params: any) {
    const data: any = await requestCode.get('/BigData/GetProvinceMonthAnalysis', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}

// 拿到区域营收数据
export async function handleGetRevenueReport(params: any) {
    const data: any = await request.get('/Revenue/GetRevenueReport', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return wrapTreeNode(data.Result_Data.List)
}

// 拿到对应服务区的车流量数据 小中大也可以拿到
export async function handleGetSPBayonetList(params: any) {
    const data: any = await requestCode.get('/Revenue/GetSPBayonetList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}

// 根据时间拿到客单量数据
export async function handleGetTransactionTimeAnalysis(params: any) {
    const data: any = await requestCode.get('/Revenue/GetTransactionTimeAnalysis', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.CommonScatterList
}

// 获取消费转化对比分析
export async function handleGetTransactionConvert(params: any) {
    const data: any = await requestCode.get('/Revenue/GetTransactionConvert', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 拿到性别数据
export async function handleGetCustomerRatio(params: any) {
    const data: any = await requestCode.get('/Customer/GetCustomerRatio', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 拿到业态客单偏好数据
export async function handleGetBusinessTradeRevenue(params: any) {
    const data: any = await requestCode.get('/Revenue/GetBusinessTradeRevenue', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 今日走势图
export async function handleGetTodaysTrend(params: any) {
    const data: any = await requestOld.get('', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 交易预警
export async function handleGetEarlyWarning(params: any) {
    const data: any = await requestOld.get('', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 新的交易预警
export async function handleGetCurrentEarlyWarning(params: any) {
    const data: any = await requestPos.post('/AbnormalAudit/GetCurrentEarlyWarning', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 服务私乘
export async function handleGetRevenueCompare(params: any) {
    const data: any = await requestOld.get('', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 服务私乘
export async function handleGetSalesRank(params: any) {
    const data: any = await requestOld.get('', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 在线服务区 和 在营收银机 的数据内容
export async function handleGetCurrentCount(params: any) {
    const data: any = await requestOld.get('', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 拿到客群年龄层次
export async function handleGetCustomerAgeRatio(params: any) {
    const data: any = await requestCode.get('/Customer/GetCustomerAgeRatio', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}

// 拿到消费水平的数据
export async function handleGetGetBusinessTradeLevel(params: any) {
    const data: any = await requestCode.get('/Revenue/GetBusinessTradeLevel', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 拿到品牌消费水平的数据
export async function handleGetBusinessBrandLevel(params: any) {
    const data: any = await requestCode.get('/Revenue/GetBusinessBrandLevel', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 拿到实时数据
export async function handleGetRealData(params: any) {
    const data: any = await requestJava.post('/partner/today/data/statistics', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 今日趋势图新的
export async function handleGetRevenueTrendChart(params: any) {
    const data: any = await requestPos.post('/BigData/GetRevenueTrendChart', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 获取服务区繁忙度
export async function handleGetCurHalfCollect(params: any) {
    const data: any = await requestOld.get('', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 获取服务区繁忙度 新
export async function handleGetCurBusyRank(params: any) {
    const data: any = await requestPos.post('/BigData/GetCurBusyRank', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 获取服务区的列表
export async function handleGetServerpartList(params: any) {
    const data: any = await requestCode.get('/BaseInfo/GetServerpartList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}

// java的服务区列表
export async function handleGetServerPartListJava(params: any) {
    const data: any = await requestJava.get('/third-party/getServerPartList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}

// 客群消费能力
export async function handleGetCustomerConsumeRatio(params: any) {
    const data: any = await requestCode.get('/Customer/GetCustomerConsumeRatio', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 节假日营收分析
export async function handleGetHolidayAnalysis(params: any) {
    const data: any = await requestCode.get('/Revenue/GetHolidayAnalysis', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 收款完成进度
export async function handleGetContractExpiredInfo(params: any) {
    const data: any = await request.get('/Contract/GetContractExpiredInfo', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 应收总额完成度
export async function handleGetProjectMonthlyArrearageList(params: any) {
    const data: any = await request.get('/Contract/GetProjectMonthlyArrearageList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 应收账款预警
export async function handleGetProjectSummaryInfo(params: any) {
    const data: any = await request.get('/Contract/GetProjectSummaryInfo', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 经营品牌列表
export async function handleGetCombineBrandList(params: any) {
    const data: any = await request.get('/BaseInfo/GetCombineBrandList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 获取营收同比数据
export async function handleCodeGetRevenueCompare(params: any) {
    const data: any = await requestCode.get('/Revenue/GetRevenueCompare', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 获取营收趋势图
export async function handleGetRevenueTrend(params: any) {
    const data: any = await requestCode.get('/Revenue/GetRevenueTrend', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 获取客群特征分析
export async function handleGetCustomerGroupRatio(params: any) {
    const data: any = await requestCode.get('/Customer/GetCustomerGroupRatio', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 获取客群消费偏好数据
export async function handleGetCustomerSaleRatio(params: any) {
    const data: any = await requestCode.get('/Customer/GetCustomerSaleRatio', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 获取服务区车辆时段停留时长分析
export async function handleGetBayonetSTAList(params: any) {
    const data: any = await requestCode.get('/Revenue/GetBayonetSTAList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}



// 查询经营业态树
export async function handleGetBusinessTradeTree(params: any) {
    const data: any = await request.get('/BaseInfo/GetBusinessTradeTree', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return wrapTreeNode(data.Result_Data.List)
}

// 获取品牌表列表
export async function handleGetBrandList(params: any) {
    const data: any = await request.post('/BaseInfo/GetBrandList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 拿枚举
export async function handleGetFieldEnumTree(params: any) {
    const data: any = await request.get('/FrameWork/GetFieldEnumTree', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return wrapTreeNode(data.Result_Data.List)
}


// 获取月度车流分析数据
export async function handleGetMonthAnalysis(params: any) {
    const data: any = await requestCode.get('/BigData/GetMonthAnalysis', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}

// 车流停留分析/日均
export async function handleGetBayonetSTAnalysis(params: any) {
    const data: any = await requestCode.get('/Revenue/GetBayonetSTAnalysis', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}



// 获取节假日各类项目所有天数对客分析/日均
export async function handleGetHolidayDailyAnalysis(params: any) {
    const data: any = await requestCode.get('/Revenue/GetHolidayDailyAnalysis', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 获取年度应收总额完成度
export async function handleGetProjectYearlyArrearageList(params: any) {
    const data: any = await request.get('/Contract/GetProjectYearlyArrearageList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 获取日常巡检的数据
export async function handleGetPatrolAnalysis(params: any) {
    const data: any = await requestCode.get('/Examine/GetPatrolAnalysis', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}

// 考核考评的数据
export async function handleGetExamineResultList(params: any) {
    const data: any = await requestCode.get('/Examine/GetExamineResultList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}


// 获取服务区基础设施汇总数据
export async function handleGetServerpartServiceSummary(params: any) {
    const data: any = await requestPos.post('/BaseInfo/GetServerpartServiceSummary', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data
}


// 获取经营品牌结构分析
export async function handleGetBrandStructureAnalysis(params: any) {
    const data: any = await requestPos.post('/BaseInfo/GetBrandStructureAnalysis', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}

// 获取供应商的数据
export async function handleGetSupplierList(params: any) {
    const data: any = await requestPos.post('/SupplyChain/GetSupplierList', params)
    if (data.Result_Code !== 100) {
        return data
    }
    return data.Result_Data.List
}
