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
2b2b1a30
Commit
2b2b1a30
authored
Feb 09, 2023
by
孙香冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台
parent
4bc34a76
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
311 additions
and
11 deletions
+311
-11
enterprise.ts
src/biz/enterprise/enterprise.ts
+34
-2
financing.ts
src/biz/enterprise/financing.ts
+60
-3
user.ts
src/biz/fuHuqQi/user.ts
+33
-1
ojbectResultKeyConfig.ts
src/config/ojbectResultKeyConfig.ts
+43
-2
enterprise.ts
src/data/enterprise/enterprise.ts
+20
-1
financing.ts
src/data/enterprise/financing.ts
+55
-1
fuhuaqi.ts
src/data/fuHuaQi/fuhuaqi.ts
+35
-0
fuhuaqi.ts
src/routers/fuhuaqi.ts
+31
-1
No files found.
src/biz/enterprise/enterprise.ts
View file @
2b2b1a30
...
...
@@ -7,9 +7,10 @@
import
{
MoveInEnterpriseParamConfig
,
RegisterEnterpriseParamConfig
}
from
"../../config/checkParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
createEnterprise
,
findEnterpriseByUscc
}
from
"../../data/enterprise/enterprise"
;
import
{
EnterpriseListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
createEnterprise
,
findEnterpriseByUscc
,
findEnterpriseCount
,
findEnterpriseList
,
groupFindEnterprise
}
from
"../../data/enterprise/enterprise"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
checkChange
,
checkParamater
,
getTaskId
}
from
"../../util/tools"
import
{
checkChange
,
checkParamater
,
extractData
,
getTaskId
}
from
"../../util/tools"
/**
...
...
@@ -101,3 +102,33 @@ export async function updateMoveInEnterprise(uscc:string, param) {
}
/**
* 获取在孵企业信息列表
* @param logonTime 新注册时间
* @param timeOfImmigration 迁入时间
* @param fuHuaQiUscc 孵化器统一信用代码 实际参数是所属孵化器
* @param industry 行业领域
* @param isNaturalPersonHolding 自然人控股
* @param page 页数
* @returns
*/
export
async
function
enterpriseList
(
logonTime
:
number
,
timeOfImmigration
:
number
,
fuHuaQiUscc
:
string
,
industry
:
number
,
isNaturalPersonHolding
:
boolean
,
page
:
number
)
{
let
selectParam
:
any
=
{};
if
(
logonTime
)
selectParam
.
logonTime
=
logonTime
;
if
(
timeOfImmigration
)
selectParam
.
timeOfImmigration
=
timeOfImmigration
;
if
(
fuHuaQiUscc
)
selectParam
.
fuHuaQiUscc
=
fuHuaQiUscc
;
if
(
industry
)
selectParam
.
industry
=
industry
;
if
(
isNaturalPersonHolding
)
selectParam
.
isNaturalPersonHolding
=
isNaturalPersonHolding
;
let
enterpriseMap
=
await
groupFindEnterprise
();
let
dataBaseList
=
await
findEnterpriseList
(
selectParam
,
(
page
-
1
)
*
10
);
let
count
=
await
findEnterpriseCount
(
selectParam
);
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
=
extractData
(
EnterpriseListConfig
,
info
);
const
Count
=
enterpriseMap
[
info
.
uscc
]
||
0
;
dataList
.
push
(
changeData
);
});
return
{
count
,
dataList
};
}
\ No newline at end of file
src/biz/enterprise/financing.ts
View file @
2b2b1a30
...
...
@@ -7,9 +7,10 @@
import
{
FinancingParamConfig
}
from
"../../config/checkParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
createFinancing
,
findFinancingInfoByTaskIdAndSucc
}
from
"../../data/enterprise/financing"
;
import
{
FinancingListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
createFinancing
,
findAddByName
,
findFinancingByName
,
findFinancingCount
,
findFinancingInfoByTaskIdAndSucc
,
findFinancingList
,
groupFindFinancing
}
from
"../../data/enterprise/financing"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
checkChange
,
checkParamater
,
getTaskId
}
from
"../../util/tools"
;
import
{
checkChange
,
checkParamater
,
extractData
,
getTaskId
}
from
"../../util/tools"
;
/**
...
...
@@ -41,7 +42,7 @@ export async function createFinancingInfo(uscc, param) {
export
async
function
updateFinancingInfo
(
uscc
,
param
)
{
const
TaskId
=
getTaskId
(
uscc
);
checkParamater
(
"
录入企业融资
信息"
,
FinancingParamConfig
,
param
);
checkParamater
(
"
更新融资企业
信息"
,
FinancingParamConfig
,
param
);
let
dataBaseInfo
=
await
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
param
.
uscc
);
let
changeList
=
checkChange
(
param
,
dataBaseInfo
);
...
...
@@ -56,3 +57,58 @@ export async function updateFinancingInfo(uscc, param) {
return
{
isSuccess
:
true
};
}
/**
* 融资企业名称模糊查询
* @param name 融资企业名称
*/
export
async
function
getFinancingByName
(
name
:
string
)
{
let
financingInfo
=
await
findFinancingByName
(
name
);
let
dataList
=
[];
financingInfo
.
forEach
(
info
=>
{
dataList
.
push
(
info
.
name
);
});
return
dataList
;
}
/**
* 根据融资企业名称获取注册地址、经营地址
* @param name
*/
export
async
function
getAddByName
(
name
:
string
)
{
let
financingInfo
=
await
findAddByName
(
name
);
let
dataList
=
[];
let
keyList
=
[
"logonAdd"
,
"operatingAdd"
];
keyList
.
forEach
(
key
=>
{
dataList
[
key
]
=
financingInfo
[
key
];
})
return
dataList
;
}
/**
* 融资企业信息列表
* @param 数据月份 目前数据库没有该字段
* @param fuHuaQiUscc 孵化器统一信用代码 实际参数是所属孵化器
* @param 行业领域 目前数据库没有该字段
* @param fuHuaQiInvestment 孵化器是否参与投资
* @param 实体孵化 目前数据库没有该字段
* @param page 页数
* @returns
*/
export
async
function
financingList
(
fuHuaQiUscc
:
string
,
fuHuaQiInvestment
:
boolean
,
page
:
number
)
{
let
selectParam
:
any
=
{};
if
(
fuHuaQiUscc
)
selectParam
.
fuHuaQiUscc
=
fuHuaQiUscc
;
if
(
fuHuaQiInvestment
)
selectParam
.
fuHuaQiInvestment
=
fuHuaQiInvestment
;
let
enterpriseMap
=
await
groupFindFinancing
();
let
dataBaseList
=
await
findFinancingList
(
selectParam
,
(
page
-
1
)
*
10
);
let
count
=
await
findFinancingCount
(
selectParam
);
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
=
extractData
(
FinancingListConfig
,
info
);
const
Count
=
enterpriseMap
[
info
.
uscc
]
||
0
;
dataList
.
push
(
changeData
);
});
return
{
count
,
dataList
};
}
\ No newline at end of file
src/biz/fuHuqQi/user.ts
View file @
2b2b1a30
...
...
@@ -5,9 +5,10 @@
* 预留好 重置密码 退出登录 接口
*/
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
FuHuaQiListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
import
{
BizError
}
from
"../../util/bizError"
;
import
{
getPwdMd5
,
getToken
}
from
"../../util/tools"
;
import
{
extractData
,
getPwdMd5
,
getToken
}
from
"../../util/tools"
;
/**
* 登录
...
...
@@ -94,4 +95,34 @@ export async function logout(uscc:string):Promise<object> {
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
await
fuhuaqiInfo
.
save
();
return
{
isSuccess
:
true
};
}
/**
* 孵化器账号信息列表
* @param operationName 运营机构名称
* @param page 页数
* @returns
*/
export
async
function
fuHuaQiUserList
(
operationName
:
string
,
page
:
number
)
{
let
selectParam
:
any
=
{};
if
(
operationName
)
selectParam
.
operationName
=
operationName
;
let
enterpriseMap
=
await
fuhuaqiData
.
groupFindFuHuaQi
();
let
dataBaseList
=
await
fuhuaqiData
.
findFuHuaQiUserList
(
selectParam
,
(
page
-
1
)
*
10
);
let
count
=
await
fuhuaqiData
.
findFuHuaQiUserCount
(
selectParam
);
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
=
extractData
(
FuHuaQiListConfig
,
info
);
const
Count
=
enterpriseMap
[
info
.
uscc
]
||
0
;
dataList
.
push
(
changeData
);
});
return
{
count
,
dataList
};
}
/**
* 修改账号状态
*/
export
async
function
updateState
()
{
}
\ No newline at end of file
src/config/ojbectResultKeyConfig.ts
View file @
2b2b1a30
...
...
@@ -22,4 +22,46 @@ export const FuHuaQiBaseListConfig = {
personInChargeAdd
:{
key
:
"孵化场地地址"
},
siteAcreage
:{
key
:
"孵化场地面积(㎡)"
},
leasePrice
:{
key
:
"孵化场地出租单价"
},
};
\ No newline at end of file
};
/**
* 在孵企业列表 参数转换配置
*/
export
const
EnterpriseListConfig
=
{
name
:{
key
:
"企业 名称"
},
createTime
:{
key
:
"入库时间 不可修改"
},
// 新注册/迁入
fuhuaqiUscc
:{
key
:
"孵化器统一信用代码 不可修改 这里显示运营机构的名称"
},
uscc
:{
key
:
"统一信用代码 也是登录账号 不可修改"
},
industry
:{
key
:
"行业领域[] 最多 选择三个"
},
logonTime
:{
key
:
"注册时间"
,
changeDate
:
true
},
firstIncubationTime
:{
key
:
"首次入孵时间"
},
timeOfImmigration
:{
key
:
"迁入时间"
,
changeDate
:
true
},
isNaturalPersonHolding
:{
key
:
"是否自然人控股"
},
oldLogonAdd
:{
key
:
"迁入前注册地址"
},
logonAdd
:{
key
:
"注册地址"
},
operatingAdd
:{
key
:
"经营地址"
},
leasedArea
:{
key
:
"租赁面积(平方米)"
},
};
export
const
FinancingListConfig
=
{
name
:{
key
:
"企业名称"
},
logonAdd
:{
key
:
"注册地址"
},
operatingAdd
:{
key
:
"经营地址"
},
financingAmount
:{
key
:
"融资金额(万元)"
},
investmentInstitutionsName
:{
key
:
"投资机构名称"
},
timeToObtainInvestment
:{
key
:
"获得投资时间"
},
fuHuaQiInvestment
:{
key
:
"孵化器是否投资"
},
fuHuaQiInvestmentAmount
:{
key
:
"孵化器投资金额(万元)"
},
fuHuaQiInvestmentStyle
:{
key
:
"孵化器投资方式"
},
createTime
:{
key
:
"录入时间 不可修改"
},
}
export
const
FuHuaQiListConfig
=
{
operationName
:{
key
:
"运营机构名称 不可修改"
},
uscc
:{
key
:
"营业执照"
},
liaison
:{
key
:
"联系人"
},
liaisonPhone
:{
key
:
"负责人"
},
personInChargePhone
:{
key
:
"负责人联系电话"
},
}
src/data/enterprise/enterprise.ts
View file @
2b2b1a30
...
...
@@ -95,7 +95,6 @@ export async function findEnterpriseCountByFuHuaQiUscc(fuHuaQiUscc:string) {
return
await
enterpriseModel
.
count
({
fuHuaQiUscc
}).
exec
();
}
/**
* 聚合查询 孵化器所拥有的企业数量
* @returns {} key=孵化器统一信用 value=企业数量
...
...
@@ -109,4 +108,23 @@ export async function groupFindEnterprise() {
result
[
_id
]
=
count
;
});
return
result
;
}
/**
* 获取所有孵化器
* @param selectParam 查询参数
* @param skipCount 跳过数量
* @returns [] 孵化器列表
*/
export
async
function
findEnterpriseList
(
selectParam
,
skipCount
)
{
return
await
enterpriseModel
.
find
(
selectParam
).
skip
(
skipCount
).
limit
(
10
);
}
/**
* 获取所有孵化器
* @param selectParam 查询参数
* @returns number 数据数量
*/
export
async
function
findEnterpriseCount
(
selectParam
)
{
return
await
enterpriseModel
.
find
(
selectParam
).
count
();
}
\ No newline at end of file
src/data/enterprise/financing.ts
View file @
2b2b1a30
...
...
@@ -52,7 +52,7 @@ export async function save(throwError=false) {
* @returns [{}]
*/
export
async
function
findFinancingListByTaskId
(
taskId
:
string
)
{
return
await
financingModel
.
find
({
taskId
})
.
exec
()
;
return
await
financingModel
.
find
({
taskId
});
}
/**
...
...
@@ -83,4 +83,57 @@ export async function updateFinancingDraftLock(taskId:string) {
export
async
function
createFinancing
(
fuHuaQiUscc
:
string
,
taskId
:
string
,
param
)
{
let
addInfo
=
Object
.
assign
({
fuHuaQiUscc
,
taskId
,
createTime
:
new
Date
().
valueOf
()},
param
);
await
financingModel
.
create
(
addInfo
);
}
/**
* 融资企业名称模糊查询
* @param name 融资企业名称
* @returns
*/
export
async
function
findFinancingByName
(
name
:
string
)
{
return
await
financingModel
.
find
({
name
:
"/"
+
name
+
"/"
});
}
/**
* 根据融资企业名称获取融资数据
* @param name
* @returns
*/
export
async
function
findAddByName
(
name
:
string
)
{
return
await
financingModel
.
selectOnceData
({
name
});
}
/**
* 聚合查询 孵化器所拥有的企业数量
* @returns {} key=孵化器统一信用 value=企业数量
*/
export
async
function
groupFindFinancing
()
{
let
match
=
{
draftLock
:
true
};
//前置条件
let
dataList
=
await
financingModel
.
aggregate
([{
$match
:
match
},{
$group
:{
_id
:
"$fuHuaQiUscc"
,
count
:{
$sum
:
1
}}}]).
exec
();
let
result
=
{};
dataList
.
forEach
(
info
=>
{
let
{
_id
,
count
}
=
info
;
result
[
_id
]
=
count
;
});
return
result
;
}
/**
* 获取所有融资企业
* @param selectParam 查询参数
* @param skipCount 跳过数量
* @returns [] 孵化器列表
*/
export
async
function
findFinancingList
(
selectParam
,
skipCount
)
{
return
await
financingModel
.
find
(
selectParam
).
skip
(
skipCount
).
limit
(
10
);
}
/**
* 获取所有融资企业
* @param selectParam 查询参数
* @returns number 数据数量
*/
export
async
function
findFinancingCount
(
selectParam
)
{
return
await
financingModel
.
find
(
selectParam
).
count
();
}
\ No newline at end of file
src/data/fuHuaQi/fuhuaqi.ts
View file @
2b2b1a30
...
...
@@ -114,4 +114,38 @@ export async function findFuHuaQiList(selectParam, skipCount) {
*/
export
async
function
findFuHuaQiCount
(
selectParam
)
{
return
await
fuHuaQiModel
.
find
(
selectParam
).
count
();
}
/**
* 聚合查询 孵化器所拥有的企业数量
* @returns {} key=孵化器统一信用 value=企业数量
*/
export
async
function
groupFindFuHuaQi
()
{
let
match
=
{
draftLock
:
true
};
//前置条件
let
dataList
=
await
fuHuaQiModel
.
aggregate
([{
$match
:
match
},{
$group
:{
_id
:
"$fuHuaQiUscc"
,
count
:{
$sum
:
1
}}}]).
exec
();
let
result
=
{};
dataList
.
forEach
(
info
=>
{
let
{
_id
,
count
}
=
info
;
result
[
_id
]
=
count
;
});
return
result
;
}
/**
* 获取所有孵化器
* @param selectParam 查询参数
* @param skipCount 跳过数量
* @returns [] 孵化器列表
*/
export
async
function
findFuHuaQiUserList
(
selectParam
,
skipCount
)
{
return
await
fuHuaQiModel
.
find
(
selectParam
).
skip
(
skipCount
).
limit
(
10
);
}
/**
* 获取所有孵化器
* @param selectParam 查询参数
* @returns number 数据数量
*/
export
async
function
findFuHuaQiUserCount
(
selectParam
)
{
return
await
fuHuaQiModel
.
find
(
selectParam
).
count
();
}
\ No newline at end of file
src/routers/fuhuaqi.ts
View file @
2b2b1a30
...
...
@@ -29,7 +29,9 @@ export function setRouter(httpServer) {
/**融资企业填报 */
httpServer
.
post
(
'/fuhuaqi/financing/create'
,
checkFuHuaQiToken
,
asyncHandler
(
createFinancingInfo
));
httpServer
.
post
(
'/fuhuaqi/financing/update'
,
checkFuHuaQiToken
,
asyncHandler
(
updateFinancingInfo
));
httpServer
.
post
(
'/fuhuaqi/financing/namelist'
,
checkFuHuaQiToken
,
asyncHandler
(
getFinancingInfoByName
));
httpServer
.
post
(
'/fuhuaqi/financing/add'
,
checkFuHuaQiToken
,
asyncHandler
(
getAddInfoByName
));
/**新注册或迁入企业 */
httpServer
.
post
(
'/fuhuaqi/enterprise/register'
,
checkFuHuaQiToken
,
asyncHandler
(
registerEnterprise
));
httpServer
.
post
(
'/fuhuaqi/enterprise/updateregister'
,
checkFuHuaQiToken
,
asyncHandler
(
updateRegisterEnterprise
));
...
...
@@ -66,6 +68,34 @@ export function setRouter(httpServer) {
}
/**
* 根据融资企业名称获取融资企业名称
* @param req
* @param res
*/
async
function
getFinancingInfoByName
(
req
,
res
)
{
let
reqConf
=
{
name
:
'String'
};
let
{
name
}
=
checkReqParam
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
financingBiz
.
getFinancingByName
(
name
);
res
.
success
(
result
);
}
/**
* 根据融资企业名称获取注册地址和经营地址
* @param req
* @param res
*/
async
function
getAddInfoByName
(
req
,
res
)
{
let
reqConf
=
{
name
:
'String'
};
let
{
name
}
=
checkReqParam
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
financingBiz
.
getAddByName
(
name
);
res
.
success
(
result
);
}
/**
* 新注册企业
* @param req
* @param res
...
...
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