Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yuyiAdminServer
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
yuyiAdminServer
Commits
6b0e04e8
Commit
6b0e04e8
authored
May 15, 2025
by
Zllgogo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
36456682
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
170 additions
and
54 deletions
+170
-54
fuhua.ts
src/biz/fuhua.ts
+85
-20
ruFu.ts
src/biz/ruFu.ts
+21
-18
userRuFu.ts
src/biz/userRuFu.ts
+32
-9
zaiFu.ts
src/biz/zaiFu.ts
+0
-0
enterprise.ts
src/config/eccParam/enterprise.ts
+3
-3
enum.ts
src/config/enum/enum.ts
+1
-0
main.ts
src/main.ts
+2
-0
admin.ts
src/routers/admin.ts
+4
-4
dbinit.ts
src/routers/dbinit.ts
+22
-0
No files found.
src/biz/fuhua.ts
View file @
6b0e04e8
...
...
@@ -4,7 +4,7 @@
import
moment
=
require
(
"moment"
);
import
{
OPERATIONALDATATYPE
,
TABLEID
,
TABLENAME
}
from
"../config/enum/dbEnum"
;
import
{
BUILDING
,
CHANGETYPE
,
EMIGRATIONTYPE
,
FUHUASTATE
,
INCOME
,
INDUSTRY
,
OFFLINEPROMOTION
,
ONLINEPROMOTION
,
PROMOTIONTYPE
,
STATE
}
from
"../config/enum/enum"
;
import
{
BUILDING
,
CHANGETYPE
,
DEGREE
,
EMIGRATIONTYPE
,
FUHUASTATE
,
INCOME
,
INDUSTRY
,
OFFLINEPROMOTION
,
ONLINEPROMOTION
,
PROMOTIONTYPE
,
STATE
}
from
"../config/enum/enum"
;
import
{
operationalData
,
selectData
,
selectManyTableData
}
from
"../data/operationalData"
;
import
{
getMySqlMs
,
randomId
}
from
"../tools/system"
;
import
{
changeEnumValue
}
from
"../util/verificationEnum"
;
...
...
@@ -308,8 +308,12 @@ export async function getOperateData(year) {
"毕业企业数变化趋势"
:
{
"毕业企业"
:
[]
},
"出租率变化趋势"
:
[],
// "出租率变化趋势": [],//换成在孵企业面积变化趋势
// "在孵企业面积变化趋势":{
// "在孵面积":[]
// },
"在孵企业行业领域"
:
[],
"在孵企业学历分布"
:
[]
// "孵化器收入": []
};
let
qushiConf
=
{
"01"
:
0
,
"02"
:
0
,
"03"
:
0
,
"04"
:
0
,
"05"
:
0
,
"06"
:
0
,
"07"
:
0
,
"08"
:
0
,
"09"
:
0
,
"10"
:
0
,
"11"
:
0
,
"12"
:
0
};
...
...
@@ -371,20 +375,17 @@ export async function getOperateData(year) {
.
sort
((
a
,
b
)
=>
parseInt
(
a
.
key
)
-
parseInt
(
b
.
key
));
/**出租率 */
let
chuzulvParam
=
{
startTime
:{
"%lt%"
:
yearTime
},
endTime
:{
"%gt%"
:
yearTime
}};
// let chuzulvList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME., chuzulvParam);
let
chuzulvInfo
=
qushiConf
;
for
(
let
key
in
chuzulvInfo
)
{
operateData
.
出租率变化趋势
.
push
({
key
,
value
:
chuzulvInfo
[
key
].
toString
()});
}
//X轴排序
operateData
.
出租率变化趋势
.
sort
(
(
a
,
b
)
=>
{
return
a
.
key
-
b
.
key
;
})
/**在孵企业行业领域 */
// let araeParam = { column: ["area", "unitPrice", "roomNumber", "rent"], where: {} };
// let chuzulvParam = {startTime:{"%lt%":yearTime}, endTime:{"%gt%":yearTime}};
// // let chuzulvList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME., chuzulvParam);
// let chuzulvInfo = qushiConf;
// for(let key in chuzulvInfo) {
// operateData.出租率变化趋势.push({key, value:chuzulvInfo[key].toString()});
// }
// //X轴排序
// operateData.出租率变化趋势.sort( (a, b) => {
// return a.key - b.key;
// })
/**在孵企业租赁面积 */
let
araeParam
=
{
column
:
[
"area"
,
"building"
,
"roomNumber"
,
"rent"
],
where
:
{}
};
let
zaifuTableInfo
:
any
=
{};
zaifuTableInfo
[
TABLENAME
.
租赁信息
]
=
araeParam
;
...
...
@@ -392,8 +393,35 @@ export async function getOperateData(year) {
column
:
[
"state"
,
"startTime"
,
"endTime"
],
where
:
{
startTime
:
{
"%lt%"
:
yearTime
},
endTime
:
{
"%gt%"
:
yearTime
},
state
:
{
"%notIn%"
:
FUHUASTATE
.
迁出
}
},
};
// zaifuTableInfo[TABLENAME.参保记录] = { column: ["zhuanKe", "benKe", "shuoshi", "boShi", "boshiyishang", "qiTa"], where: {} };
let
zaifuResList
=
await
selectManyTableData
(
OPERATIONALDATATYPE
.
多表联查
,
TABLENAME
.
企业基础信息表
,
{},
[
"eId"
,
"industry"
],
zaifuTableInfo
);
// console.log("zaifuResList:", zaifuResList);
// // 新增:在孵企业面积变化趋势
// let zaifuAreaTrend = { ...qushiConf }; // 初始化每月累计面积为0
// zaifuResList.forEach(info => {
// info.enterprise_leases.forEach(lease => {
// let leaseEndTime = moment(lease.endTime);
// let year = leaseEndTime.format("YYYY");
// let month = leaseEndTime.format("MM");
// if (year === moment(yearTime).format("YYYY")) {
// zaifuAreaTrend[month] += parseFloat(lease.area);
// }
// });
// });
// // 转换为数组并排序
// for (let key in zaifuAreaTrend) {
// operateData.在孵企业面积变化趋势.在孵面积.push({ key, value: zaifuAreaTrend[key].toString() });
// }
// operateData.在孵企业面积变化趋势.在孵面积.sort((a, b) => parseInt(a.key) - parseInt(b.key));
/**在孵企业行业领域 */
// let araeParam = { column: ["area", "unitPrice", "roomNumber", "rent"], where: {} };
//将 industry 字符串转换为数组
zaifuResList
.
forEach
(
info
=>
{
...
...
@@ -424,6 +452,31 @@ export async function getOperateData(year) {
}
/**在孵企业学历分布(参保记录) */
let
educationDistribution
=
{};
for
(
let
key
in
DEGREE
)
{
if
(
!
isNaN
(
Number
(
key
)))
continue
;
// 跳过数字键
educationDistribution
[
key
]
=
0
;
}
let
canbaoYear
=
moment
(
yearTime
).
format
(
"YYYY"
);
let
canbaoList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
参保记录
,{
annual
:
canbaoYear
},
null
);
canbaoList
.
forEach
(
cb
=>
{
if
(
cb
.
zhuanKe
)
educationDistribution
[
"专科"
]
+=
parseInt
(
cb
.
zhuanKe
);
if
(
cb
.
benKe
)
educationDistribution
[
"本科"
]
+=
parseInt
(
cb
.
benKe
);
if
(
cb
.
shuoshi
)
educationDistribution
[
"硕士"
]
+=
parseInt
(
cb
.
shuoshi
);
if
(
cb
.
boShi
)
educationDistribution
[
"博士"
]
+=
parseInt
(
cb
.
boShi
);
if
(
cb
.
boshiyishang
)
educationDistribution
[
"博士以上"
]
+=
parseInt
(
cb
.
boshiyishang
);
if
(
cb
.
qiTa
)
educationDistribution
[
"其他"
]
+=
parseInt
(
cb
.
qiTa
);
});
// 转换为数组并推入 operateData
operateData
.
在孵企业学历分布
=
Object
.
entries
(
educationDistribution
).
map
(([
key
,
value
])
=>
({
key
,
value
:
value
.
toString
()
}));
// /**孵化器收入 */
// for (let key in INCOME) {
// let anyKey: any = key;
...
...
@@ -755,12 +808,24 @@ export async function updateYuYi(yId, param) {
for
(
let
key
in
promotionInfo
)
{
for
(
let
app
in
promotionInfo
[
key
])
{
let
updateInfo
=
{
promotionNum
:
promotionInfo
[
key
][
app
]};
let
updateParam
=
{
promotionType
:
key
,
promotionApp
:
app
}
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
入驻信息表
,
updateInfo
,
updateParam
);
let
updateParam
=
{
promotionType
:
PROMOTIONTYPE
[
key
],
promotionApp
:
promotionInfo
[
key
][
app
]}
let
运营推广
dbInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
运营推广信息表
,
updateParam
,
[
"opId"
,
"promotionType"
,
"promotionApp"
,
"promotionNum"
]);
if
(
!
运营推广
dbInfo
||
!
运营推广
dbInfo
.
opId
)
{
let
addInfo
=
{
opId
:
randomId
(
TABLENAME
.
运营推广信息表
),
promotionType
:
updateParam
.
promotionType
,
promotionApp
:
updateParam
.
promotionApp
,
promotionNum
:
updateInfo
.
promotionNum
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
运营推广信息表
,
addInfo
,
{});
}
else
{
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
运营推广信息表
,
updateInfo
,
updateParam
);
}
}
}
// await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.入驻信息表, param, {info_enterId:yuyiInfo.info_enterId});
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
运营推广信息表
,
param
,
{
opId
:
yuyiInfo
.
opId
});
//
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.运营推广信息表, param, {opId:yuyiInfo.opId});
return
{
isSuccess
:
true
};
}
...
...
src/biz/ruFu.ts
View file @
6b0e04e8
...
...
@@ -377,24 +377,7 @@ export async function enterpriseRegisterExamineList(enterpriseName, page) {
return
{
dataList
,
dataCount
:
allResList
.
length
};
}
// 辅助函数:获取文件名和格式
// function getFileNameAndFormat(fileName: string | null | undefined): string {
// if (fileName === null || fileName === undefined || fileName === "未提交") {
// return "未提交";
// }
// // 提取文件名(去掉路径)
// const basename = fileName.split('/').pop() || fileName;
// // 分割文件名和格式
// const parts = basename.split('.');
// if (parts.length < 2) {
// return basename; // 如果没有找到 . 则直接返回原字符串
// }
// const name = parts.slice(0, -1).join('.');
// const format = parts.pop();
// return `${name}.${format}`;
// }
function
getFileNameAndFormat
(
fileName
:
string
|
null
|
undefined
):
string
{
if
(
fileName
===
null
||
fileName
===
undefined
||
fileName
===
"未提交"
)
{
return
"未提交"
;
...
...
@@ -416,6 +399,26 @@ function getFileNameAndFormat(fileName: string | null | undefined): string {
return
`
${
name
.
trim
()}
.
${
format
}
`
;
}
function
formatFileDisplay
(
fileName
:
string
|
null
|
undefined
):
string
{
if
(
!
fileName
||
fileName
===
"未提交"
)
return
"未提交"
;
const
{
name
,
ext
}
=
extractFileNameAndExt
(
fileName
);
return
`
${
name
.
trim
()}
.
${
ext
}
`
;
}
function
extractFileNameAndExt
(
fullName
:
string
)
{
const
baseName
=
fullName
.
split
(
'/'
).
pop
()
||
fullName
;
const
cleanName
=
baseName
.
replace
(
/
(\d{8}
_
\d{6})
/
,
''
);
// 移除时间戳
const
parts
=
cleanName
.
split
(
'.'
);
if
(
parts
.
length
<
2
)
{
return
{
name
:
cleanName
,
ext
:
''
};
}
const
ext
=
parts
.
pop
()
!
;
const
name
=
parts
.
join
(
'.'
);
return
{
name
,
ext
};
}
/**
* 入孵材料审核通过
...
...
src/biz/userRuFu.ts
View file @
6b0e04e8
...
...
@@ -123,7 +123,6 @@ export async function createRuFu(uId, param) {
register
:
0
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业基础信息表
,
addEInfo
,
{});
console
.
log
(
"addEInfo"
,
addEInfo
);
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
企业用户表
,
{
eId
:
addEInfo
.
eId
},
{
uId
});
...
...
@@ -154,14 +153,14 @@ export async function createRuFu(uId, param) {
}
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
租赁信息
,
leaseInfo
,
{});
let
addUInfo
=
{
eId
:
addEInfo
.
eId
,
uId
:
randomId
(
TABLEID
.
企业用户表
),
phone
:
param
.
phone
,
pwd
:
param
.
pwd
,
userName
:
param
.
userName
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业用户表
,
addUInfo
,
{});
//
let addUInfo = {
//
eId:addEInfo.eId,
//
uId:randomId(TABLEID.企业用户表),
//
phone:param.phone,
//
pwd:param.pwd,
//
userName:param.userName
//
};
//
await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.企业用户表, addUInfo, {});
return
{
eId
:
addEInfo
.
eId
};
...
...
@@ -200,6 +199,11 @@ export async function getRuFu(eId:string) {
dataInfo
.
businessLicense
=
leaseInfo
.
businessLicense
;
dataInfo
.
agreement
=
leaseInfo
.
agreement
;
// dataInfo.leaseContract = getFileNameAndFormat(leaseInfo.leaseContract);
// dataInfo.entryPlan = getFileNameAndFormat(leaseInfo.entryPlan);
// dataInfo.businessLicense = getFileNameAndFormat(leaseInfo.businessLicense);
// dataInfo.agreement = getFileNameAndFormat(leaseInfo.agreement);
dataInfo
.
leaseContractModelUrl
=
"/yuyi/files/房屋租赁合同模板.docx"
;
dataInfo
.
entryPlanModelUrl
=
"/yuyi/files/孵化企业入驻计划.xlsx"
;
dataInfo
.
businessLicenseUrl
=
"/yuyi/files/营业执照复印件.docx"
;
...
...
@@ -235,5 +239,24 @@ export async function updateRuFu(eId:string, param) {
function
getFileNameAndFormat
(
fileName
:
string
|
null
|
undefined
):
string
{
if
(
fileName
===
null
||
fileName
===
undefined
||
fileName
===
"未提交"
)
{
return
"未提交"
;
}
// 提取文件名(去掉路径)
let
basename
=
fileName
.
split
(
'/'
).
pop
()
||
fileName
;
// 移除时间戳(假设时间戳格式为 YYYYMMDD_HHMMSS)
basename
=
basename
.
replace
(
/
(\d{8}
_
\d{6})
/
,
''
);
// 分割文件名和格式
const
parts
=
basename
.
split
(
'.'
);
if
(
parts
.
length
<
2
)
{
return
basename
;
// 如果没有找到 . 则直接返回原字符串
}
const
name
=
parts
.
slice
(
0
,
-
1
).
join
(
'.'
);
const
format
=
parts
.
pop
();
return
`
${
name
.
trim
()}
.
${
format
}
`
;
}
src/biz/zaiFu.ts
View file @
6b0e04e8
This diff is collapsed.
Click to expand it.
src/config/eccParam/enterprise.ts
View file @
6b0e04e8
...
...
@@ -136,9 +136,9 @@ export const UserRegisterAddConfig = {
leaseStartTime
:
{
type
:
'string'
,
required
:
true
,
message
:
'租赁开始时间不能为空'
},
leaseEndTime
:
{
type
:
'string'
,
required
:
true
,
message
:
'租赁结束时间不能为空'
},
mail
:
{
type
:
'string'
,
required
:
true
,
message
:
'邮箱地址不能为空'
},
userName
:
{
type
:
'string'
,
required
:
true
,
message
:
'联系人不能为空'
},
phone
:
{
type
:
'string'
,
required
:
true
,
message
:
'登录手机号码不能为空'
},
pwd
:
{
type
:
'string'
,
required
:
true
,
message
:
'登录密码不能为空'
},
//
userName: { type: 'string', required: true, message: '联系人不能为空' },
//
phone: { type: 'string', required: true, message: '登录手机号码不能为空' },
//
pwd: { type: 'string', required: true, message: '登录密码不能为空' },
building
:
{
type
:
'string'
,
required
:
false
},
// 租赁楼号非必填
roomNumber
:
{
type
:
'string'
,
required
:
false
},
// 租赁室号非必填
area
:
{
type
:
'number'
,
required
:
false
},
// 租赁面积非必填
...
...
src/config/enum/enum.ts
View file @
6b0e04e8
...
...
@@ -37,6 +37,7 @@ export enum DEGREE {
硕士
,
博士
,
博士以上
,
其他
}
/**
...
...
src/main.ts
View file @
6b0e04e8
import
{
qccData
}
from
"./biz/dataInit"
;
import
{
TABLEID
}
from
"./config/enum/dbEnum"
;
import
{
initConfig
,
systemConfig
}
from
"./config/serverConfig"
;
import
{
httpServer
}
from
"./net/http_server"
;
import
{
randomId
}
from
"./tools/system"
;
async
function
lanuch
()
{
await
initConfig
();
...
...
src/routers/admin.ts
View file @
6b0e04e8
...
...
@@ -429,10 +429,10 @@ async function enterpriseDetails(req, res) {
* @param res
*/
async
function
dwEnterpriseList
(
req
,
res
)
{
// let {enterpriseName, type, files,logonStartTime, logonEndTime, startTime,
endTime, building } = req.body
// let result = await zaiFuBiz.dwEnterpriseTable(enterpriseName, type, files,logonStartTime, logonEndTime, startTime,
endTime, building );
let
{
enterpriseName
,
type
,
files
}
=
req
.
body
let
result
=
await
zaiFuBiz
.
dwEnterpriseTable
(
enterpriseName
,
type
,
files
);
let
{
enterpriseName
,
type
,
logonStartTime
,
logonEndTime
,
startTime
,
endTime
,
building
}
=
req
.
body
let
result
=
await
zaiFuBiz
.
dwEnterpriseTable
(
enterpriseName
,
type
,
logonStartTime
,
logonEndTime
,
startTime
,
endTime
,
building
);
//
let {enterpriseName, type, files} = req.body
//
let result = await zaiFuBiz.dwEnterpriseTable(enterpriseName, type, files);
res
.
success
(
result
);
}
...
...
src/routers/dbinit.ts
View file @
6b0e04e8
...
...
@@ -20,6 +20,28 @@ export function setRouter(httpServer) {
export
async
function
data1210
(
req
,
res
)
{
let
入驻信息
add
=
[
{
info_enterId
:
randomId
(
TABLEID
.
入驻信息表
),
building
:
'1'
,
occupancyRate
:
""
,
enteredEnterprises
:
""
},
{
info_enterId
:
randomId
(
TABLEID
.
入驻信息表
),
building
:
'3'
,
occupancyRate
:
""
,
enteredEnterprises
:
""
},
{
info_enterId
:
randomId
(
TABLEID
.
入驻信息表
),
building
:
'4'
,
occupancyRate
:
""
,
enteredEnterprises
:
""
},
]
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
入驻信息表
,
入驻信息
add
,
{});
//读取文件
let
{
sheetMap
}
=
getExcel
(
path
.
join
(
__dirname
.
substring
(
0
,
__dirname
.
indexOf
(
"out"
)),
"res"
,
'在孵企业导入1210.xlsx'
));
let
dataList
=
sheetMap
[
'Sheet1'
];
...
...
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