Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zjxcxServer
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
zjxcxServer
Commits
1a2d94e1
Commit
1a2d94e1
authored
Feb 13, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
40726340
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
81 additions
and
47 deletions
+81
-47
孵化器原始数据.xlsx
res/孵化器原始数据.xlsx
+0
-0
enterprise.ts
src/biz/enterprise/enterprise.ts
+35
-27
financing.ts
src/biz/enterprise/financing.ts
+26
-3
month.ts
src/biz/fuHuqQi/month.ts
+1
-1
task.ts
src/biz/fuHuqQi/task.ts
+1
-1
user.ts
src/biz/guanWeiHui/user.ts
+1
-0
enterprise.ts
src/data/enterprise/enterprise.ts
+1
-1
financing.ts
src/data/enterprise/financing.ts
+1
-1
monthTable.ts
src/data/fuHuaQi/monthTable.ts
+1
-1
task.ts
src/data/fuHuaQi/task.ts
+2
-2
admin.ts
src/routers/admin.ts
+6
-6
fuhuaqi.ts
src/routers/fuhuaqi.ts
+2
-3
tools.ts
src/util/tools.ts
+4
-1
No files found.
res/孵化器原始数据.xlsx
View file @
1a2d94e1
No preview for this file type
src/biz/enterprise/enterprise.ts
View file @
1a2d94e1
...
...
@@ -12,7 +12,7 @@ import { checkChange, checkParamater, extractData, getTaskId } from "../../util/
import
moment
=
require
(
"moment"
);
import
{
createEnterprise
,
deleteEnterprise
,
findEnterpriseCount
,
findEnterpriseByUscc
,
findEnterpriseListToPage
,
findEnterpriseListByFuHuaQiUsccName
,
查询所有已绑定过的孵化器
id
,
findEnterpriseList
}
from
"../../data/enterprise/enterprise"
;
import
{
EnterpriseListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
findAllFuHuaQi
,
findFuHuaQiByUSCC
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
findAllFuHuaQi
,
find
AllFuHuaQiOperationNameMap
,
find
FuHuaQiByUSCC
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
OUTPUTTYPE
}
from
"../../config/enum"
;
...
...
@@ -148,37 +148,42 @@ export async function deleteEnterpriseByUscc(uscc:string) {
/**
* 获取在孵企业信息列表
* 管理后台端
* @param
time 新注册时间/迁入时间
* @param
createType 新注册/迁入 1:全选 2:新注册 3:迁入 以前是时间 2/23日修改为类型
* @param fuHuaQiUscc 所属孵化器
* @param industry 行业领域
* @param isNaturalPersonHolding 自然人控股
* @param page 页数
* @returns {dataList:[], count:0} dataList=数据列表 count:条件筛选下的数据总数
*/
export
async
function
enterpriseList
(
time
:
string
,
fuHuaQiUscc
:
string
,
industry
,
isNaturalPersonHolding
:
number
,
page
:
number
)
{
export
async
function
enterpriseList
(
createType
:
number
,
fuHuaQiUscc
:
string
,
industry
,
isNaturalPersonHolding
:
number
,
page
:
number
)
{
let
selectParam
:
any
=
{};
if
(
time
.
length
>
0
)
{
let
startT
=
moment
(
time
).
startOf
(
'month'
).
valueOf
();
let
endT
=
moment
(
time
).
endOf
(
'month'
).
valueOf
();
selectParam
[
'$or'
]
=
[
{
"firstIncubationTime"
:{
'$gt'
:
startT
,
'$lt'
:
endT
}},
{
"timeOfImmigration"
:{
'$gt'
:
startT
,
'$lt'
:
endT
}},
];
// if ( time.length > 0 ) {
// let startT = moment(time).startOf('month').valueOf();
// let endT = moment(time).endOf('month').valueOf();
// selectParam['$or'] = [
// {"firstIncubationTime":{'$gt':startT, '$lt':endT}},
// {"timeOfImmigration":{'$gt':startT, '$lt':endT}},
// ];
// }
// if (time) selectParam.logonTime = time; selectParam.timeOfImmigration = time;
if
(
createType
==
2
||
createType
==
3
)
{
selectParam
.
createType
=
createType
==
2
?
true
:
false
;
}
if
(
time
)
selectParam
.
logonTime
=
time
;
selectParam
.
timeOfImmigration
=
time
;
if
(
fuHuaQiUscc
)
selectParam
.
fuHuaQiUscc
=
fuHuaQiUscc
;
if
(
industry
.
length
>
0
)
selectParam
.
industry
=
industry
;
if
(
isNaturalPersonHolding
==
2
||
isNaturalPersonHolding
==
3
)
{
selectParam
.
isNaturalPersonHolding
=
isNaturalPersonHolding
==
2
?
true
:
false
;
}
let
usccMap
=
await
findAllFuHuaQiOperationNameMap
();
let
dataBaseList
=
await
findEnterpriseListToPage
(
selectParam
,
(
page
-
1
)
*
10
);
let
count
=
await
findEnterpriseCount
(
selectParam
);
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
=
extractData
(
EnterpriseListConfig
,
info
);
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
EnterpriseListConfig
,
info
);
changeData
.
fuhuaqiUscc
=
usccMap
[
changeData
.
fuhuaqiUscc
]
||
""
;
dataList
.
push
(
changeData
);
});
...
...
@@ -189,25 +194,27 @@ export async function enterpriseList(time:string, fuHuaQiUscc:string, industry,
/**
* 导出在孵企业信息列表
* 管理后台端
* @param
tim
e 新注册时间/迁入时间
* @param
createTyp
e 新注册时间/迁入时间
* @param fuHuaQiUscc 所属孵化器
* @param industry 行业领域
* @param isNaturalPersonHolding 自然人控股
* @returns dataList
*/
export
async
function
outPutEnterpriseData
(
time
:
string
,
fuHuaQiUscc
:
string
,
industry
,
isNaturalPersonHolding
:
number
,
type
:
Number
)
{
export
async
function
outPutEnterpriseData
(
createType
:
number
,
fuHuaQiUscc
:
string
,
industry
,
isNaturalPersonHolding
:
number
,
type
:
Number
)
{
let
selectParam
:
any
=
{};
if
(
type
==
OUTPUTTYPE
.
当前数据
)
{
if
(
time
.
length
>
0
)
{
let
startT
=
moment
(
time
).
startOf
(
'month'
).
valueOf
();
let
endT
=
moment
(
time
).
endOf
(
'month'
).
valueOf
();
selectParam
[
'$or'
]
=
[
{
"firstIncubationTime"
:{
'$gt'
:
startT
,
'$lt'
:
endT
}},
{
"timeOfImmigration"
:{
'$gt'
:
startT
,
'$lt'
:
endT
}},
];
// if ( time.length > 0 ) {
// let startT = moment(time).startOf('month').valueOf();
// let endT = moment(time).endOf('month').valueOf();
// selectParam['$or'] = [
// {"firstIncubationTime":{'$gt':startT, '$lt':endT}},
// {"timeOfImmigration":{'$gt':startT, '$lt':endT}},
// ];
// }
// if (time) selectParam.logonTime = time; selectParam.timeOfImmigration = time;
if
(
createType
==
2
||
createType
==
3
)
{
selectParam
.
createType
=
createType
==
2
?
true
:
false
;
}
if
(
time
)
selectParam
.
logonTime
=
time
;
selectParam
.
timeOfImmigration
=
time
;
if
(
fuHuaQiUscc
)
selectParam
.
fuHuaQiUscc
=
fuHuaQiUscc
;
if
(
industry
.
length
>
0
)
selectParam
.
industry
=
industry
;
if
(
isNaturalPersonHolding
==
2
||
isNaturalPersonHolding
==
3
)
{
...
...
@@ -216,11 +223,12 @@ export async function outPutEnterpriseData(time:string, fuHuaQiUscc:string, indu
}
let
usccMap
=
await
findAllFuHuaQiOperationNameMap
();
let
dataBaseList
=
await
findEnterpriseList
(
selectParam
);
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
=
extractData
(
EnterpriseListConfig
,
info
);
let
changeData
:
any
=
extractData
(
EnterpriseListConfig
,
info
);
changeData
.
fuhuaqiUscc
=
usccMap
[
changeData
.
fuhuaqiUscc
]
||
""
;
dataList
.
push
(
changeData
);
});
...
...
src/biz/enterprise/financing.ts
View file @
1a2d94e1
...
...
@@ -25,8 +25,19 @@ import { OUTPUTTYPE } from "../../config/enum";
* @returns {isSuccess:true/false}
*/
export
async
function
createFinancingInfo
(
uscc
:
string
,
param
)
{
checkParamater
(
"录入企业融资信息"
,
FinancingParamConfig
,
param
);
checkParamater
(
"录入企业融资信息"
,
FinancingParamConfig
,
param
,
[
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
]);
if
(
param
.
fuHuaQiInvestment
)
{
let
subCheckName
=
"录入企业融资信息_孵化器是否参与"
;
let
subCheckData
=
{
fuHuaQiInvestmentAmount
:
param
.
fuHuaQiInvestmentAmount
,
fuHuaQiInvestmentStyle
:
param
.
fuHuaQiInvestmentStyle
,
};
checkParamater
(
subCheckName
,
{
fuHuaQiInvestmentAmount
:
"String"
,
fuHuaQiInvestmentStyle
:
"String"
},
subCheckData
);
}
else
{
param
.
fuHuaQiInvestmentAmount
=
0
;
param
.
fuHuaQiInvestmentStyle
=
0
;
}
/**校验企业是否存在 */
let
enterpriseInfo
=
await
findEnterpriseInfoByName
(
param
.
name
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
uscc
,
param
.
name
);
...
...
@@ -54,7 +65,19 @@ export async function createFinancingInfo(uscc:string, param) {
* @returns {isSuccess:true/false}
*/
export
async
function
updateFinancingInfo
(
uscc
:
string
,
param
)
{
checkParamater
(
"更新融资企业信息"
,
FinancingParamUpdateConfig
,
param
);
checkParamater
(
"更新融资企业信息"
,
FinancingParamUpdateConfig
,
param
,
[
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
]);
if
(
param
.
fuHuaQiInvestment
)
{
let
subCheckName
=
"录入企业融资信息_孵化器是否参与"
;
let
subCheckData
=
{
fuHuaQiInvestmentAmount
:
param
.
fuHuaQiInvestmentAmount
,
fuHuaQiInvestmentStyle
:
param
.
fuHuaQiInvestmentStyle
,
};
checkParamater
(
subCheckName
,
{
fuHuaQiInvestmentAmount
:
"String"
,
fuHuaQiInvestmentStyle
:
"String"
},
subCheckData
);
}
else
{
param
.
fuHuaQiInvestmentAmount
=
0
;
param
.
fuHuaQiInvestmentStyle
=
0
;
}
const
TaskId
=
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
param
.
uscc
);
...
...
src/biz/fuHuqQi/month.ts
View file @
1a2d94e1
...
...
@@ -65,7 +65,7 @@ export async function deleteReport(uscc:string) {
const
TaskId
=
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
if
(
!
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
);
if
(
!
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
dataBaseInfo
.
isUpdate
=
false
;
//修改编辑状态
...
...
src/biz/fuHuqQi/task.ts
View file @
1a2d94e1
...
...
@@ -28,7 +28,7 @@ export async function fuHuaQiTaskList(uscc:string) {
let
result
=
[];
const
TaskId
=
getTaskId
(
uscc
);
let
taskMap
=
await
findFuHuaQiTaskByTaskId
(
TaskId
);
let
taskMap
=
await
findFuHuaQiTaskByTaskId
(
TaskId
,
false
);
// let taskTypeMapConf = {};
for
(
let
key
in
TASKTYPEENUM
)
{
...
...
src/biz/guanWeiHui/user.ts
View file @
1a2d94e1
...
...
@@ -23,6 +23,7 @@ export async function login(loginId:string, pwd:string) {
if
(
!
userInfo
)
throw
new
BizError
(
ERRORENUM
.
账号不存在
,
loginId
);
let
checkPwd
=
getPwdMd5
(
userInfo
.
loginId
,
pwd
);
console
.
log
(
loginId
,
checkPwd
);
//todo 后面删除
if
(
userInfo
.
pwd
!=
checkPwd
)
throw
new
BizError
(
ERRORENUM
.
密码错误
);
const
Token
=
getToken
(
loginId
);
...
...
src/data/enterprise/enterprise.ts
View file @
1a2d94e1
...
...
@@ -65,7 +65,7 @@ export async function findEnterpriseByUscc(uscc:string) {
* @returns [{}]
*/
export
async
function
findEnterpriseListByTaskId
(
taskId
:
string
)
{
return
await
enterpriseModel
.
find
({
taskId
});
return
await
enterpriseModel
.
find
({
taskId
,
draftLock
:
false
});
}
...
...
src/data/enterprise/financing.ts
View file @
1a2d94e1
...
...
@@ -65,7 +65,7 @@ export async function findFinancingInfoByTaskIdAndSucc(taskId:string, uscc:strin
* @returns [{}]
*/
export
async
function
findFinancingListByTaskId
(
taskId
:
string
)
{
return
await
financingModel
.
find
({
taskId
});
return
await
financingModel
.
find
({
taskId
,
draftLock
:
false
});
}
...
...
src/data/fuHuaQi/monthTable.ts
View file @
1a2d94e1
...
...
@@ -49,7 +49,7 @@ export async function save(throwError=false) {
* @returns {}
*/
export
async
function
findmonthTableListByTaskId
(
taskId
:
string
)
{
return
await
monthTableModel
.
find
({
taskId
});
return
await
monthTableModel
.
find
({
taskId
,
isUpdate
:
true
});
}
...
...
src/data/fuHuaQi/task.ts
View file @
1a2d94e1
...
...
@@ -46,8 +46,8 @@ export async function save(throwError=false) {
* @param taskId 任务id
* @returns {1:{}, 2:{}}
*/
export
async
function
findFuHuaQiTaskByTaskId
(
taskId
:
string
)
{
let
findList
=
await
fuHuaQiTaskModel
.
find
({
taskId
}).
exec
()
||
[];
export
async
function
findFuHuaQiTaskByTaskId
(
taskId
:
string
,
isSubmit
:
boolean
)
{
let
findList
=
await
fuHuaQiTaskModel
.
find
({
taskId
,
isSubmit
}).
exec
()
||
[];
let
taskMap
=
{};
findList
.
forEach
(
item
=>
{
taskMap
[
item
.
type
]
=
item
;
...
...
src/routers/admin.ts
View file @
1a2d94e1
...
...
@@ -110,10 +110,10 @@ async function getMonthList(req, res) {
* @param res
*/
async
function
getEnterpriseList
(
req
,
res
)
{
let
reqConf
=
{
tim
e
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'[Number]'
,
isNaturalPersonHolding
:
'Number'
,
page
:
'Number'
};
let
{
tim
e
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
reqConf
=
{
createTyp
e
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'[Number]'
,
isNaturalPersonHolding
:
'Number'
,
page
:
'Number'
};
let
{
createTyp
e
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
result
=
await
enterpriseBiz
.
enterpriseList
(
tim
e
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
);
let
result
=
await
enterpriseBiz
.
enterpriseList
(
createTyp
e
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
);
res
.
success
(
result
);
}
...
...
@@ -190,10 +190,10 @@ async function outPutFuHuaQiData(req, res) {
async
function
outPutEnterpriseData
(
req
,
res
)
{
let
reqConf
=
{
tim
e
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'[Number]'
,
isNaturalPersonHolding
:
'Number'
,
type
:
'Number'
};
let
{
tim
e
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
,
type
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
reqConf
=
{
createTyp
e
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'[Number]'
,
isNaturalPersonHolding
:
'Number'
,
type
:
'Number'
};
let
{
createTyp
e
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
,
type
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
dataList
=
await
enterpriseBiz
.
outPutEnterpriseData
(
tim
e
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
type
);
let
dataList
=
await
enterpriseBiz
.
outPutEnterpriseData
(
createTyp
e
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
type
);
let
keyList
=
[
"name"
,
"createTime"
,
"fuhuaqiUscc"
,
"uscc"
,
"industry"
,
"logonTime"
,
...
...
src/routers/fuhuaqi.ts
View file @
1a2d94e1
...
...
@@ -348,10 +348,9 @@ async function deleteReport(req, res) {
* @param res
*/
async
function
selectMonthInfo
(
req
,
res
)
{
let
reqConf
=
{
uscc
:
'String'
};
let
{
uscc
}
=
checkReqParam
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
monthBiz
.
getMonthByUscc
(
u
scc
);
let
result
=
await
monthBiz
.
getMonthByUscc
(
U
scc
);
res
.
success
(
result
);
}
...
...
src/util/tools.ts
View file @
1a2d94e1
...
...
@@ -27,8 +27,11 @@ export function getTimeKey() {
* @param config 校验配置
* @param param 需要校验的参数
*/
export
function
checkParamater
(
name
:
string
,
keyTypeConf
:
object
,
param
:
object
)
{
export
function
checkParamater
(
name
:
string
,
keyTypeConf
:
object
,
param
:
object
,
skipKeys
?
)
{
for
(
let
key
in
keyTypeConf
)
{
if
(
skipKeys
&&
skipKeys
.
indexOf
(
key
)
>
-
1
)
{
continue
;
}
if
(
!
param
[
key
]
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`缺失
${
key
}
字段`
);
let
type
=
typeof
param
[
key
];
switch
(
keyTypeConf
[
key
])
{
...
...
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