
import { getJxgljsc } from '../data/db/jxgljsc';
import { jxgljscTableData } from '../data/table/jxgljscData';
import { doubleYBarCharPackage, keyValuePackage, onceYBarChartPackage, rankPackage, tablePackage } from '../dataPackage/inFrontOut';
import { getDoubleYBarChartOut, getKeyValueOut, getOnceYBarChartOut, getTableOut } from '../dataPackage/out';

/*                            绩效管理驾驶舱                    */

export async function getData(req, res) {
    let dbList = await getJxgljsc();
    let excelData = jxgljscTableData();

    let ret:any = {};

    let zfqymjqkfxPackageData = keyValuePackage(excelData['在孵企业面积情况分析'].dataList);
    ret['zfqymjqkfx'] = getKeyValueOut('在孵企业面积情况分析', zfqymjqkfxPackageData);
          
    let zfqymjbhqsPackageData = onceYBarChartPackage( excelData['在孵企业面积变化趋势'], '','');
    ret['zfqymjbhqs'] = getOnceYBarChartOut('在孵企业面积变化趋势', zfqymjbhqsPackageData);
    
                    
    let cyjgPackageData = keyValuePackage(dbList['产业结构'].dataList);
    ret['cyjg'] = getKeyValueOut('产业结构', cyjgPackageData);
                    
    let ykjqypyqkTableData = tablePackage(excelData["硬科技企业培育情况"].headerList[0], excelData["硬科技企业培育情况"].bodyList);
    ret['ykjqypyqk'] = getTableOut( '硬科技企业培育情况', ykjqypyqkTableData);
                    
    let rcyjPackageData = keyValuePackage(dbList['人才引进'].dataList);
    ret['rcyj'] = getKeyValueOut('人才引进', rcyjPackageData);
                    
    let fhqhzsjPackageData = keyValuePackage(dbList['孵化器汇总数据'].dataList);
    ret['fhqhzsj'] = getKeyValueOut('孵化器汇总数据', fhqhzsjPackageData);
                    
    let xzzfqyqkPackageData = keyValuePackage(excelData['新增在孵企业情况'].dataList);
    ret['xzzfqyqk'] = getKeyValueOut('新增在孵企业情况', xzzfqyqkPackageData);
                    
    let zyjjnlPackageData = keyValuePackage(excelData['资源集聚能力'].dataList);
    ret['zyjjnl'] = getKeyValueOut('资源集聚能力', zyjjnlPackageData);
                    
    let zhnlPackageData = keyValuePackage(excelData['综合能力'].dataList);
    ret['zhnl'] = getKeyValueOut('综合能力', zhnlPackageData);
                    
    let byqyqkPackageData = keyValuePackage(excelData['毕业企业情况'].dataList);
    ret['byqyqk'] = getKeyValueOut('毕业企业情况', byqyqkPackageData);
                    
    let qycxfsddnlPackageData = keyValuePackage(excelData['区域创新辐射带动能力'].dataList);
    ret['qycxfsddnl'] = getKeyValueOut('区域创新辐射带动能力', qycxfsddnlPackageData);
                    
    let yjPackageData = keyValuePackage(excelData['预警'].dataList);
    ret['yj'] = getKeyValueOut('预警', yjPackageData);
                    
    let qyyjPackageData = keyValuePackage(excelData['企业预警'].dataList);
    ret['qyyj'] = getKeyValueOut('企业预警', qyyjPackageData);
                    
    let qydtPackageData = keyValuePackage(dbList['企业动态'].dataList);
    ret['qydt'] = getKeyValueOut('企业动态', qydtPackageData);
                    
    let zfqybhqsPackageData = onceYBarChartPackage( dbList['在孵企业变化趋势'], '家','');
    ret['zfqybhqs'] = getOnceYBarChartOut('在孵企业变化趋势', zfqybhqsPackageData);
                    
    let jrfwPackageData = keyValuePackage(excelData['金融服务'].dataList);
    ret['jrfw'] = getKeyValueOut('金融服务', jrfwPackageData);
                    
    let zysjePackageData = keyValuePackage(dbList['总营收金额'].dataList);
    ret['zysje'] = getKeyValueOut('总营收金额', zysjePackageData);
                    
    let zfqyzysPackageData = keyValuePackage(dbList['在孵企业总营收'].dataList);
    ret['zfqyzys'] = getKeyValueOut('在孵企业总营收', zfqyzysPackageData);
                    
    let tzlxPackageData = keyValuePackage(excelData['投资类型'].dataList);
    ret['tzlx'] = getKeyValueOut('投资类型', tzlxPackageData);
                    
    let zfqyrzqkPackageData = keyValuePackage(dbList['在孵企业融资情况'].dataList);
    ret['zfqyrzqk'] = getKeyValueOut('在孵企业融资情况', zfqyrzqkPackageData);
                    
    let ggjsfwPackageData = keyValuePackage(excelData['公共技术服务'].dataList);
    ret['ggjsfw'] = getKeyValueOut('公共技术服务', ggjsfwPackageData);
                    
    let qyfhlPackageData = keyValuePackage(excelData['企业孵化率'].dataList);
    ret['qyfhl'] = getKeyValueOut('企业孵化率', qyfhlPackageData);
                    
    let qyfhsPackageData = keyValuePackage(dbList['企业孵化数'].dataList);
    ret['qyfhs'] = getKeyValueOut('企业孵化数', qyfhsPackageData);
                     
    res.send(ret);
}



export async function get备份(req, res) {
    let dbList = await getJxgljsc();
    let excelData = jxgljscTableData();

    let ret:any = {};

    let zfqymjqkfxPackageData = keyValuePackage(excelData['在孵企业面积情况分析'].dataList);
    ret['zfqymjqkfx'] = getKeyValueOut('在孵企业面积情况分析', zfqymjqkfxPackageData);
          
    let zfqymjbhqsPackageData = onceYBarChartPackage( excelData['在孵企业面积变化趋势'], '','');
    ret['zfqymjbhqs'] = getOnceYBarChartOut('在孵企业面积变化趋势', zfqymjbhqsPackageData);
    
                    
    let cyjgPackageData = keyValuePackage(excelData['产业结构'].dataList);
    ret['cyjg'] = getKeyValueOut('产业结构', cyjgPackageData);
                    
    let ykjqypyqkTableData = tablePackage(excelData["硬科技企业培育情况"].headerList[0], excelData["硬科技企业培育情况"].bodyList);
    ret['ykjqypyqk'] = getTableOut( '硬科技企业培育情况', ykjqypyqkTableData);
                    
    let rcyjPackageData = keyValuePackage(excelData['人才引进'].dataList);
    ret['rcyj'] = getKeyValueOut('人才引进', rcyjPackageData);
                    
    let fhqhzsjPackageData = keyValuePackage(excelData['孵化器汇总数据'].dataList);
    ret['fhqhzsj'] = getKeyValueOut('孵化器汇总数据', fhqhzsjPackageData);
                    
    let xzzfqyqkPackageData = keyValuePackage(excelData['新增在孵企业情况'].dataList);
    ret['xzzfqyqk'] = getKeyValueOut('新增在孵企业情况', xzzfqyqkPackageData);
                    
    let zyjjnlPackageData = keyValuePackage(excelData['资源集聚能力'].dataList);
    ret['zyjjnl'] = getKeyValueOut('资源集聚能力', zyjjnlPackageData);
                    
    let zhnlPackageData = keyValuePackage(excelData['综合能力'].dataList);
    ret['zhnl'] = getKeyValueOut('综合能力', zhnlPackageData);
                    
    let byqyqkPackageData = keyValuePackage(excelData['毕业企业情况'].dataList);
    ret['byqyqk'] = getKeyValueOut('毕业企业情况', byqyqkPackageData);
                    
    let qycxfsddnlPackageData = keyValuePackage(excelData['区域创新辐射带动能力'].dataList);
    ret['qycxfsddnl'] = getKeyValueOut('区域创新辐射带动能力', qycxfsddnlPackageData);
                    
    let yjPackageData = keyValuePackage(excelData['预警'].dataList);
    ret['yj'] = getKeyValueOut('预警', yjPackageData);
                    
    let qyyjPackageData = keyValuePackage(excelData['企业预警'].dataList);
    ret['qyyj'] = getKeyValueOut('企业预警', qyyjPackageData);
                    
    let qydtPackageData = keyValuePackage(excelData['企业动态'].dataList);
    ret['qydt'] = getKeyValueOut('企业动态', qydtPackageData);
                    
    let zfqybhqsPackageData = onceYBarChartPackage( excelData['在孵企业变化趋势'], '家','');
    ret['zfqybhqs'] = getOnceYBarChartOut('在孵企业变化趋势', zfqybhqsPackageData);
                    
    let jrfwPackageData = keyValuePackage(excelData['金融服务'].dataList);
    ret['jrfw'] = getKeyValueOut('金融服务', jrfwPackageData);
                    
    let zysjePackageData = keyValuePackage(excelData['总营收金额'].dataList);
    ret['zysje'] = getKeyValueOut('总营收金额', zysjePackageData);
                    
    let zfqyzysPackageData = keyValuePackage(excelData['在孵企业总营收'].dataList);
    ret['zfqyzys'] = getKeyValueOut('在孵企业总营收', zfqyzysPackageData);
                    
    let tzlxPackageData = keyValuePackage(excelData['投资类型'].dataList);
    ret['tzlx'] = getKeyValueOut('投资类型', tzlxPackageData);
                    
    let zfqyrzqkPackageData = keyValuePackage(excelData['在孵企业融资情况'].dataList);
    ret['zfqyrzqk'] = getKeyValueOut('在孵企业融资情况', zfqyrzqkPackageData);
                    
    let ggjsfwPackageData = keyValuePackage(excelData['公共技术服务'].dataList);
    ret['ggjsfw'] = getKeyValueOut('公共技术服务', ggjsfwPackageData);
                    
    let qyfhlPackageData = keyValuePackage(excelData['企业孵化率'].dataList);
    ret['qyfhl'] = getKeyValueOut('企业孵化率', qyfhlPackageData);
                    
    let qyfhsPackageData = keyValuePackage(excelData['企业孵化数'].dataList);
    ret['qyfhs'] = getKeyValueOut('企业孵化数', qyfhsPackageData);
                     
    res.send(ret);
} 


