Commit 2f3fc0c2 by zhangzhencai

no message

parent c8e156b2
/**
* 公共资源
*/
import * as enumConfig from '../config/enum';
const config = {
"/public/selectparam":enumConfig.SELECTPARAM, //企业搜索下拉框选择
}
export function publicRouter(req, res) {
let ret:any = {};
ret['selectparam'] = getEnumItf(config['/public/selectparam']);
res.send(ret);
}
/**
*
* @param req
* @param res
*/
function getEnumItf(enumCof) {
let dataList = [];
for (let key in enumCof) {
let anyKey:any = key;
if (isNaN(anyKey)) {
dataList.push({key, value:enumCof[key]});
}
}
return dataList;
}
\ No newline at end of file
import { systemConfig } from '../config/serverConfig';
import { getEnterprise } from '../data/db/qyfw';
import { getEnterprise, getEnterpriseDetails } from '../data/db/qyfw';
import { qyfwTableData } from '../data/table/qyfwData';
import { doubleYBarCharPackage, keyValuePackage, onceYBarChartPackage, rankPackage, tablePackage } from '../dataPackage/inFrontOut';
import { getDoubleYBarChartOut, getKeyValueOut, getOnceYBarChartOut, getTableOut } from '../dataPackage/out';
......@@ -106,6 +106,18 @@ export async function getData(req, res) {
}
export async function getEnterpriseByName(req, res) {
let {name, type} = req.body;
let dbData = await getEnterpriseDetails(name, type);
let ret:any = {};
ret['qylist'] = {data:dbData, count:dbData.length};
res.send(ret);
}
export async function get备份(req, res) {
let dbData = await getEnterprise();
......
......@@ -315,3 +315,20 @@ export enum STATE {
= 0,
}
/**
* 企业类型
*/
export enum SELECTPARAM {
在孵企业=1,
融资企业,
知识产权,
专利,
科小 = 5,
专精特新,
小巨人,
小巨人培育,
高新技术,
}
......@@ -3,9 +3,10 @@
*/
import moment = require("moment");
import { FUHUASTATE, INDUSTRY, MOVEOUTTYPE, OPERATIONALDATATYPE, STATE, TABLENAME } from "../../config/enum";
import { FUHUASTATE, INDUSTRY, MOVEOUTTYPE, OPERATIONALDATATYPE, SELECTPARAM, STATE, TABLENAME } from "../../config/enum";
import { selectData, selectManyTableData } from "./operationalData";
import { getChart, getKeyValue, getMonthList, getYearList } from "./out";
import { Console, log } from "console";
export async function getEnterprise() {
......@@ -23,7 +24,7 @@ export async function getEnterprise() {
本月融资企业:[], //本月融资企业
本月融资金额:[], //本月融资金额
在孵企业总营收:{dataList:[], titleList:['key', 'value']}, //在孵企业总营收
金融服务企业:{bodyList:[], headerList:[['企业名称', '融资金额', '融资时间']]}, //金融服务企业 todo
金融服务企业:{bodyList:[], headerList:[['企业名称', '融资金额(万元)', '融资时间']]}, //金融服务企业 todo
知识产权:{dataList:[], titleList:['key', 'value']}, //知识产权
知识产权饼图:{dataList:[], titleList:['key', 'value']}, //知识产权饼图
知识产权详情:{bodyList:[], headerList:[['企业名称', '专利数量', '知识产权数']]}, //知识产权详情 todo
......@@ -165,6 +166,59 @@ export async function getEnterprise() {
}
export async function getEnterpriseDetails(name, type) {
let nowTime = new Date().valueOf();
let selectParam = {};
if (name) selectParam["enterpriseName"] = {"%like%":name};
let manyTableInfo:any = {}
if (type) {
switch (type) {
case SELECTPARAM.在孵企业:
manyTableInfo[TABLENAME.企业孵化信息] = {column:[], where:{"endTime":{"%gt%":nowTime}} };
break;
case SELECTPARAM.融资企业:
manyTableInfo[TABLENAME.企业融资] = {column:[], where:{"financingAmount":{"%ne%":null}} };
break;
case SELECTPARAM.知识产权:
manyTableInfo[TABLENAME.知识产权] = {column:[], where:{} };
break;
case SELECTPARAM.专利:
manyTableInfo[TABLENAME.企业专利表] = {column:[], where:{} };
break;
case SELECTPARAM.科小:
manyTableInfo[TABLENAME.企业资质] = {column:[], where:{"kxTime":{"%ne%":null}} };
break;
case SELECTPARAM.专精特新:
manyTableInfo[TABLENAME.企业资质] = {column:[], where:{"zjtxTime":{"%ne%":null}} };
break;
case SELECTPARAM.小巨人:
manyTableInfo[TABLENAME.企业资质] = {column:[], where:{"xjrTime":{"%ne%":null}} };
break;
case SELECTPARAM.小巨人培育:
manyTableInfo[TABLENAME.企业资质] = {column:[], where:{"xjrPyTime":{"%ne%":null}} };
break;
case SELECTPARAM.高新技术:
manyTableInfo[TABLENAME.企业资质] = {column:[], where:{"gaoXinJiShuTime":{"%ne%":null}} };
break;
}
}
let dbList = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, selectParam, ["eId","enterpriseName"], manyTableInfo);
let dataList = [];
dbList.forEach( item => {
let {eId, enterpriseName} = item;
dataList.push({eId, enterpriseName});
})
return dataList;
}
/**
* 变化趋势分析
* @param data
......@@ -241,12 +295,14 @@ async function getQyfwhzsj() {
let 企业专利dbList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.企业专利表, {}, null);
企业专利dbList.forEach( info => {
qyfwhzsj.企业专利 += parseFloat(info.alienPatent);
qyfwhzsj.企业专利 += parseFloat(info.classIPatent);
qyfwhzsj.企业专利 += parseFloat(info.secondClassPatent);
qyfwhzsj.企业专利 += parseFloat(info.thirdPentent);
qyfwhzsj.企业专利 += parseFloat(info.alienPatent) || 0;
qyfwhzsj.企业专利 += parseFloat(info.classIPatent) || 0;
qyfwhzsj.企业专利 += parseFloat(info.secondClassPatent) || 0;
qyfwhzsj.企业专利 += parseFloat(info.thirdPentent) || 0;
qyfwhzsj.企业专利 += parseFloat(info.thirdPentent) || 0;
})
return qyfwhzsj;
}
......@@ -386,7 +442,7 @@ async function getByrzqy(企业融资dbList){
})
金额count = 金额count / 100000000; //单位换算成万亿
byrzqy.融资企业.push({key:month[i], value:企业count});
byrzje.融资金额.push({key:month[i], value:金额count});
byrzje["融资金额"].push({key:month[i], value:金额count});
}
let byrzqybhqs = getChart(byrzqy);
......
......@@ -201,11 +201,13 @@ async function get企业员工画像(data) {
let degree = DEGREE[key];
data.forEach( info => {
let {enterprise_teams} = info;
if (enterprise_teams && Array.isArray(enterprise_teams)) {
enterprise_teams.forEach( team => {
if (degree == team.degree) {
qyyghx[keyStr] += 1;
}
})
}
})
}
......@@ -308,10 +310,12 @@ function get服务需求(data) {
let fwxq = {
融资金额:newestFinancing.financingAmount,
融资轮次:changeEnumValue(FINANCINGROUNDS, newestFinancing.financingRounds),
融资时间:moment(newestFinancing.investmentDate).format("YYYY-MM-DD"),
融资时间:"-",
投资机构:newestFinancing.investmentInstitutionsName
};
if (newestFinancing.investmentDate) fwxq.融资时间 = moment(newestFinancing.investmentDate).format("YYYY-MM-DD");
return fwxq;
}
......
......@@ -86,29 +86,50 @@ export async function getZhyy() {
let fuWuQiYeCountMap = {};//服务覆盖企业
let fuWuQiYeTypeMap = {};//
let fuWuList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.企业服务表, {}, null);
// //添加日志输出以调试
// console.log("fuWuList:", fuWuList);
fuWuList.forEach(info => {
let { followUpStatus, eId, needCategory } = info;
if (followUpStatus != FOLLOWUPSTATUS.未受理) {
// console.log(`Processing service record:`, info); // 记录每一条服务记录
if (followUpStatus == FOLLOWUPSTATUS.已完成) {
fuWuCount += 1;
if (!fuWuQiYeCountMap[eId]) {
fuWuQiYeCountMap[eId] = 0;
}
fuWuQiYeCountMap[eId] += 1;
// console.log(`Service count for enterprise ${eId} incremented to: ${fuWuQiYeCountMap[eId]}`); // 记录企业服务数变化
let needCategoryStr = changeEnumValue( NEEDCATEGORY, needCategory)
// console.log(`Converted needCategory ${needCategory} to ${needCategoryStr}`); // 记录枚举值转换
if (!fuWuQiYeTypeMap[needCategoryStr]) fuWuQiYeTypeMap[needCategoryStr] = 0;
fuWuQiYeTypeMap[needCategoryStr] += 1;
}
});
let fuWuQiYeCount = Object.keys(fuWuQiYeCountMap).length;//服务覆盖企业
// console.log("fuWuQiYeCountMap:", fuWuQiYeCountMap);
// console.log("fuWuQiYeTypeMap:", fuWuQiYeTypeMap);
let fuWuQiYeTypeList = [];
for (let key in fuWuQiYeTypeMap) {
// 遍历 NEEDCATEGORY 枚举
const allNeedCategories = Object.values(NEEDCATEGORY);
allNeedCategories.forEach(category => {
const categoryStr = changeEnumValue(NEEDCATEGORY, category);
if (fuWuQiYeTypeMap[categoryStr]) {
// console.log(`Found category ${categoryStr}: ${fuWuQiYeTypeMap[categoryStr]}`);
fuWuQiYeTypeList.push({
key,
value:fuWuQiYeTypeMap[key]
key: categoryStr,
value: fuWuQiYeTypeMap[categoryStr] || 0
});
}
});
// // 添加日志输出以调试
// console.log("fuWuQiYeTypeList:", fuWuQiYeTypeList);
let 在孵企业数据 = [
{key:"在孵企业面积占比", value:"3%"},
......
......@@ -9,6 +9,8 @@ import * as qyfwBiz from '../biz/qyfw';
import * as zhyyBiz from '../biz/zhyy';
import * as publicBiz from '../biz/public';
export function setRouter(httpServer){
//======post
......@@ -18,8 +20,11 @@ export function setRouter(httpServer){
httpServer.post('/yuyi/viewserver/jxgljsc', asyncHandler(jxgljscBiz.getData));
httpServer.post('/yuyi/viewserver/qyfw', asyncHandler(qyfwBiz.getData));
httpServer.post('/yuyi/viewserver/qyfwbyname', asyncHandler(qyfwBiz.getEnterpriseByName));
httpServer.post('/yuyi/viewserver/zhyy', asyncHandler(zhyyBiz.getData));
httpServer.post('/yuyi/viewserver/public/selectparam', asyncHandler(publicBiz.publicRouter));
}
\ No newline at end of file
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