Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yuyiViewServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
yuyiViewServer
Commits
2f3fc0c2
Commit
2f3fc0c2
authored
Feb 20, 2025
by
zhangzhencai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
c8e156b2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
169 additions
and
19 deletions
+169
-19
public.ts
src/biz/public.ts
+35
-0
qyfw.ts
src/biz/qyfw.ts
+13
-1
enum.ts
src/config/enum.ts
+18
-2
qyfw.ts
src/data/db/qyfw.ts
+64
-8
qyszhx.ts
src/data/db/qyszhx.ts
+5
-1
zhyy.ts
src/data/db/zhyy.ts
+28
-7
router.ts
src/routers/router.ts
+6
-0
No files found.
src/biz/public.ts
0 → 100644
View file @
2f3fc0c2
/**
* 公共资源
*/
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
src/biz/qyfw.ts
View file @
2f3fc0c2
import
{
systemConfig
}
from
'../config/serverConfig'
;
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
{
qyfwTableData
}
from
'../data/table/qyfwData'
;
import
{
doubleYBarCharPackage
,
keyValuePackage
,
onceYBarChartPackage
,
rankPackage
,
tablePackage
}
from
'../dataPackage/inFrontOut'
;
import
{
doubleYBarCharPackage
,
keyValuePackage
,
onceYBarChartPackage
,
rankPackage
,
tablePackage
}
from
'../dataPackage/inFrontOut'
;
import
{
getDoubleYBarChartOut
,
getKeyValueOut
,
getOnceYBarChartOut
,
getTableOut
}
from
'../dataPackage/out'
;
import
{
getDoubleYBarChartOut
,
getKeyValueOut
,
getOnceYBarChartOut
,
getTableOut
}
from
'../dataPackage/out'
;
...
@@ -106,6 +106,18 @@ export async function getData(req, res) {
...
@@ -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
)
{
export
async
function
get
备份
(
req
,
res
)
{
let
dbData
=
await
getEnterprise
();
let
dbData
=
await
getEnterprise
();
...
...
src/config/enum.ts
View file @
2f3fc0c2
...
@@ -314,4 +314,21 @@ export enum FINANCINGROUNDS {
...
@@ -314,4 +314,21 @@ export enum FINANCINGROUNDS {
export
enum
STATE
{
export
enum
STATE
{
否
=
0
,
否
=
0
,
是
是
}
}
\ No newline at end of file
/**
* 企业类型
*/
export
enum
SELECTPARAM
{
在孵企业
=
1
,
融资企业
,
知识产权
,
专利
,
科小
=
5
,
专精特新
,
小巨人
,
小巨人培育
,
高新技术
,
}
src/data/db/qyfw.ts
View file @
2f3fc0c2
...
@@ -3,9 +3,10 @@
...
@@ -3,9 +3,10 @@
*/
*/
import
moment
=
require
(
"moment"
);
import
moment
=
require
(
"moment"
);
import
{
FUHUASTATE
,
INDUSTRY
,
MOVEOUTTYPE
,
OPERATIONALDATATYPE
,
STATE
,
TABLENAME
}
from
"../../config/enum"
;
import
{
FUHUASTATE
,
INDUSTRY
,
MOVEOUTTYPE
,
OPERATIONALDATATYPE
,
S
ELECTPARAM
,
S
TATE
,
TABLENAME
}
from
"../../config/enum"
;
import
{
selectData
,
selectManyTableData
}
from
"./operationalData"
;
import
{
selectData
,
selectManyTableData
}
from
"./operationalData"
;
import
{
getChart
,
getKeyValue
,
getMonthList
,
getYearList
}
from
"./out"
;
import
{
getChart
,
getKeyValue
,
getMonthList
,
getYearList
}
from
"./out"
;
import
{
Console
,
log
}
from
"console"
;
export
async
function
getEnterprise
()
{
export
async
function
getEnterprise
()
{
...
@@ -23,7 +24,7 @@ export async function getEnterprise() {
...
@@ -23,7 +24,7 @@ export async function getEnterprise() {
本月融资企业
:[],
//本月融资企业
本月融资企业
:[],
//本月融资企业
本月融资金额
:[],
//本月融资金额
本月融资金额
:[],
//本月融资金额
在孵企业总营收
:{
dataList
:[],
titleList
:[
'key'
,
'value'
]},
//在孵企业总营收
在孵企业总营收
:{
dataList
:[],
titleList
:[
'key'
,
'value'
]},
//在孵企业总营收
金融服务企业
:{
bodyList
:[],
headerList
:[[
'企业名称'
,
'融资金额'
,
'融资时间'
]]},
//金融服务企业 todo
金融服务企业
:{
bodyList
:[],
headerList
:[[
'企业名称'
,
'融资金额
(万元)
'
,
'融资时间'
]]},
//金融服务企业 todo
知识产权
:{
dataList
:[],
titleList
:[
'key'
,
'value'
]},
//知识产权
知识产权
:{
dataList
:[],
titleList
:[
'key'
,
'value'
]},
//知识产权
知识产权饼图
:{
dataList
:[],
titleList
:[
'key'
,
'value'
]},
//知识产权饼图
知识产权饼图
:{
dataList
:[],
titleList
:[
'key'
,
'value'
]},
//知识产权饼图
知识产权详情
:{
bodyList
:[],
headerList
:[[
'企业名称'
,
'专利数量'
,
'知识产权数'
]]},
//知识产权详情 todo
知识产权详情
:{
bodyList
:[],
headerList
:[[
'企业名称'
,
'专利数量'
,
'知识产权数'
]]},
//知识产权详情 todo
...
@@ -165,6 +166,59 @@ export async function getEnterprise() {
...
@@ -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
* @param data
...
@@ -241,11 +295,13 @@ async function getQyfwhzsj() {
...
@@ -241,11 +295,13 @@ async function getQyfwhzsj() {
let
企业专利
dbList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业专利表
,
{},
null
);
let
企业专利
dbList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业专利表
,
{},
null
);
企业专利
dbList
.
forEach
(
info
=>
{
企业专利
dbList
.
forEach
(
info
=>
{
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
alienPatent
);
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
alienPatent
)
||
0
;
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
classIPatent
);
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
classIPatent
)
||
0
;
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
secondClassPatent
);
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
secondClassPatent
)
||
0
;
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
thirdPentent
);
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
thirdPentent
)
||
0
;
qyfwhzsj
.
企业专利
+=
parseFloat
(
info
.
thirdPentent
)
||
0
;
})
})
return
qyfwhzsj
;
return
qyfwhzsj
;
}
}
...
@@ -262,7 +318,7 @@ async function getQyxqdt(入孵申请dbList, 企业服务Count) {
...
@@ -262,7 +318,7 @@ async function getQyxqdt(入孵申请dbList, 企业服务Count) {
}
}
qyxqdt
.
入孵申请
=
入孵申请
dbList
.
length
;
qyxqdt
.
入孵申请
=
入孵申请
dbList
.
length
;
qyxqdt
.
企业需求数
=
企业服务
Count
;
qyxqdt
.
企业需求数
=
企业服务
Count
;
let
qyxqdtxx
=
[];
let
qyxqdtxx
=
[];
入孵申请
dbList
.
forEach
(
info
=>
{
入孵申请
dbList
.
forEach
(
info
=>
{
qyxqdtxx
.
push
([
info
.
enterpriseName
,
"入孵申请"
,
info
.
eId
]);
qyxqdtxx
.
push
([
info
.
enterpriseName
,
"入孵申请"
,
info
.
eId
]);
...
@@ -386,7 +442,7 @@ async function getByrzqy(企业融资dbList){
...
@@ -386,7 +442,7 @@ async function getByrzqy(企业融资dbList){
})
})
金额
count
=
金额
count
/
100000000
;
//单位换算成万亿
金额
count
=
金额
count
/
100000000
;
//单位换算成万亿
byrzqy
.
融资企业
.
push
({
key
:
month
[
i
],
value
:
企业
count
});
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
);
let
byrzqybhqs
=
getChart
(
byrzqy
);
...
...
src/data/db/qyszhx.ts
View file @
2f3fc0c2
...
@@ -201,11 +201,13 @@ async function get企业员工画像(data) {
...
@@ -201,11 +201,13 @@ async function get企业员工画像(data) {
let
degree
=
DEGREE
[
key
];
let
degree
=
DEGREE
[
key
];
data
.
forEach
(
info
=>
{
data
.
forEach
(
info
=>
{
let
{
enterprise_teams
}
=
info
;
let
{
enterprise_teams
}
=
info
;
if
(
enterprise_teams
&&
Array
.
isArray
(
enterprise_teams
))
{
enterprise_teams
.
forEach
(
team
=>
{
enterprise_teams
.
forEach
(
team
=>
{
if
(
degree
==
team
.
degree
)
{
if
(
degree
==
team
.
degree
)
{
qyyghx
[
keyStr
]
+=
1
;
qyyghx
[
keyStr
]
+=
1
;
}
}
})
})
}
})
})
}
}
...
@@ -308,10 +310,12 @@ function get服务需求(data) {
...
@@ -308,10 +310,12 @@ function get服务需求(data) {
let
fwxq
=
{
let
fwxq
=
{
融资金额
:
newestFinancing
.
financingAmount
,
融资金额
:
newestFinancing
.
financingAmount
,
融资轮次
:
changeEnumValue
(
FINANCINGROUNDS
,
newestFinancing
.
financingRounds
),
融资轮次
:
changeEnumValue
(
FINANCINGROUNDS
,
newestFinancing
.
financingRounds
),
融资时间
:
moment
(
newestFinancing
.
investmentDate
).
format
(
"YYYY-MM-DD"
)
,
融资时间
:
"-"
,
投资机构
:
newestFinancing
.
investmentInstitutionsName
投资机构
:
newestFinancing
.
investmentInstitutionsName
};
};
if
(
newestFinancing
.
investmentDate
)
fwxq
.
融资时间
=
moment
(
newestFinancing
.
investmentDate
).
format
(
"YYYY-MM-DD"
);
return
fwxq
;
return
fwxq
;
}
}
...
...
src/data/db/zhyy.ts
View file @
2f3fc0c2
...
@@ -86,29 +86,50 @@ export async function getZhyy() {
...
@@ -86,29 +86,50 @@ export async function getZhyy() {
let
fuWuQiYeCountMap
=
{};
//服务覆盖企业
let
fuWuQiYeCountMap
=
{};
//服务覆盖企业
let
fuWuQiYeTypeMap
=
{};
//
let
fuWuQiYeTypeMap
=
{};
//
let
fuWuList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业服务表
,
{},
null
);
let
fuWuList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业服务表
,
{},
null
);
// //添加日志输出以调试
// console.log("fuWuList:", fuWuList);
fuWuList
.
forEach
(
info
=>
{
fuWuList
.
forEach
(
info
=>
{
let
{
followUpStatus
,
eId
,
needCategory
}
=
info
;
let
{
followUpStatus
,
eId
,
needCategory
}
=
info
;
if
(
followUpStatus
!=
FOLLOWUPSTATUS
.
未受理
)
{
// console.log(`Processing service record:`, info); // 记录每一条服务记录
if
(
followUpStatus
==
FOLLOWUPSTATUS
.
已完成
)
{
fuWuCount
+=
1
;
fuWuCount
+=
1
;
if
(
!
fuWuQiYeCountMap
[
eId
])
{
if
(
!
fuWuQiYeCountMap
[
eId
])
{
fuWuQiYeCountMap
[
eId
]
=
0
;
fuWuQiYeCountMap
[
eId
]
=
0
;
}
}
fuWuQiYeCountMap
[
eId
]
+=
1
;
fuWuQiYeCountMap
[
eId
]
+=
1
;
// console.log(`Service count for enterprise ${eId} incremented to: ${fuWuQiYeCountMap[eId]}`); // 记录企业服务数变化
let
needCategoryStr
=
changeEnumValue
(
NEEDCATEGORY
,
needCategory
)
let
needCategoryStr
=
changeEnumValue
(
NEEDCATEGORY
,
needCategory
)
// console.log(`Converted needCategory ${needCategory} to ${needCategoryStr}`); // 记录枚举值转换
if
(
!
fuWuQiYeTypeMap
[
needCategoryStr
])
fuWuQiYeTypeMap
[
needCategoryStr
]
=
0
;
if
(
!
fuWuQiYeTypeMap
[
needCategoryStr
])
fuWuQiYeTypeMap
[
needCategoryStr
]
=
0
;
fuWuQiYeTypeMap
[
needCategoryStr
]
+=
1
;
fuWuQiYeTypeMap
[
needCategoryStr
]
+=
1
;
}
}
});
});
let
fuWuQiYeCount
=
Object
.
keys
(
fuWuQiYeCountMap
).
length
;
//服务覆盖企业
let
fuWuQiYeCount
=
Object
.
keys
(
fuWuQiYeCountMap
).
length
;
//服务覆盖企业
// console.log("fuWuQiYeCountMap:", fuWuQiYeCountMap);
// console.log("fuWuQiYeTypeMap:", fuWuQiYeTypeMap);
let
fuWuQiYeTypeList
=
[];
let
fuWuQiYeTypeList
=
[];
for
(
let
key
in
fuWuQiYeTypeMap
)
{
// 遍历 NEEDCATEGORY 枚举
fuWuQiYeTypeList
.
push
({
const
allNeedCategories
=
Object
.
values
(
NEEDCATEGORY
);
key
,
allNeedCategories
.
forEach
(
category
=>
{
value
:
fuWuQiYeTypeMap
[
key
]
const
categoryStr
=
changeEnumValue
(
NEEDCATEGORY
,
category
);
});
if
(
fuWuQiYeTypeMap
[
categoryStr
])
{
}
// console.log(`Found category ${categoryStr}: ${fuWuQiYeTypeMap[categoryStr]}`);
fuWuQiYeTypeList
.
push
({
key
:
categoryStr
,
value
:
fuWuQiYeTypeMap
[
categoryStr
]
||
0
});
}
});
// // 添加日志输出以调试
// console.log("fuWuQiYeTypeList:", fuWuQiYeTypeList);
let
在孵企业数据
=
[
let
在孵企业数据
=
[
{
key
:
"在孵企业面积占比"
,
value
:
"3%"
},
{
key
:
"在孵企业面积占比"
,
value
:
"3%"
},
...
...
src/routers/router.ts
View file @
2f3fc0c2
...
@@ -8,6 +8,8 @@ import * as jxgljscBiz from '../biz/jxgljsc';
...
@@ -8,6 +8,8 @@ import * as jxgljscBiz from '../biz/jxgljsc';
import
*
as
qyfwBiz
from
'../biz/qyfw'
;
import
*
as
qyfwBiz
from
'../biz/qyfw'
;
import
*
as
zhyyBiz
from
'../biz/zhyy'
;
import
*
as
zhyyBiz
from
'../biz/zhyy'
;
import
*
as
publicBiz
from
'../biz/public'
;
export
function
setRouter
(
httpServer
){
export
function
setRouter
(
httpServer
){
...
@@ -18,8 +20,11 @@ export function setRouter(httpServer){
...
@@ -18,8 +20,11 @@ export function setRouter(httpServer){
httpServer
.
post
(
'/yuyi/viewserver/jxgljsc'
,
asyncHandler
(
jxgljscBiz
.
getData
));
httpServer
.
post
(
'/yuyi/viewserver/jxgljsc'
,
asyncHandler
(
jxgljscBiz
.
getData
));
httpServer
.
post
(
'/yuyi/viewserver/qyfw'
,
asyncHandler
(
qyfwBiz
.
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/zhyy'
,
asyncHandler
(
zhyyBiz
.
getData
));
httpServer
.
post
(
'/yuyi/viewserver/public/selectparam'
,
asyncHandler
(
publicBiz
.
publicRouter
));
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment