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
6dbdb224
Commit
6dbdb224
authored
Aug 14, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化企业端 引用和注释
parent
12430b09
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
254 additions
and
50 deletions
+254
-50
dataMaintenance.ts
src/biz/admin/dataMaintenance.ts
+2
-2
enterprise.ts
src/biz/admin/enterprise/enterprise.ts
+1
-1
financing.ts
src/biz/admin/enterprise/financing.ts
+1
-1
initialTeams.ts
src/biz/mobileEnterprise/base/initialTeams.ts
+2
-2
dataDeclaration.ts
src/biz/mobileEnterprise/quarterTask/dataDeclaration.ts
+1
-1
toExamine.ts
src/biz/mobileFuHuaQi/enterprise/toExamine.ts
+5
-5
policy.ts
src/biz/mobileFuHuaQi/policy.ts
+0
-1
enterprise.ts
src/data/enterprise/enterprise.ts
+27
-6
financingInfo.ts
src/data/enterprise/financingInfo.ts
+41
-5
initialTeam.ts
src/data/enterprise/initialTeam.ts
+47
-10
businessdata.ts
src/data/enterprise/quarterTask/businessdata.ts
+42
-13
team.ts
src/data/enterprise/quarterTask/team.ts
+47
-3
replenish.ts
src/data/enterprise/replenish.ts
+38
-0
No files found.
src/biz/admin/dataMaintenance.ts
View file @
6dbdb224
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
import
{
BUSINESSDATATYPE
,
DATAMAINTENANCETYPE
,
ENTERPRISEBUSINESSTYPE
,
FUHUASTATE
,
MOVEOUTCAUSE
,
MOVEOUTCAUSECLIENT
,
MOVEOUTCAUSENOTCLIENT
,
MOVEOUTTRACE
,
MOVEOUTTYPE
}
from
"../../config/enum"
;
import
{
BUSINESSDATATYPE
,
DATAMAINTENANCETYPE
,
ENTERPRISEBUSINESSTYPE
,
FUHUASTATE
,
MOVEOUTCAUSE
,
MOVEOUTCAUSECLIENT
,
MOVEOUTCAUSENOTCLIENT
,
MOVEOUTTRACE
,
MOVEOUTTYPE
}
from
"../../config/enum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
findEnterpriseByUscc
,
findEnterpriseCount
,
findEnterpriseList
,
findEnterpriseListToPage
}
from
"../../data/enterprise/enterprise"
;
import
{
findEnterpriseByUscc
,
findEnterpriseCount
,
findEnterpriseList
,
findEnterpriseListToPage
}
from
"../../data/enterprise/enterprise"
;
import
{
findBusinessDataByParamsToPage
,
findBusinessDataByTimeAndUscc
,
findBusinessDataCountByParams
ToPage
}
from
"../../data/enterprise/quarterTask/businessdata"
;
import
{
findBusinessDataByParamsToPage
,
findBusinessDataByTimeAndUscc
,
findBusinessDataCountByParams
}
from
"../../data/enterprise/quarterTask/businessdata"
;
import
{
findReplenishDataByParam
,
selectOnceRepleishData
}
from
"../../data/enterprise/replenish"
;
import
{
findReplenishDataByParam
,
selectOnceRepleishData
}
from
"../../data/enterprise/replenish"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
...
@@ -140,7 +140,7 @@ export async function enterpriseBusinessDataList(fuHuaQiUscc:string, year:number
...
@@ -140,7 +140,7 @@ export async function enterpriseBusinessDataList(fuHuaQiUscc:string, year:number
if
(
enterpriseName
)
selectParam
.
name
=
{
"$regex"
:
`
${
enterpriseName
}
`
};
if
(
enterpriseName
)
selectParam
.
name
=
{
"$regex"
:
`
${
enterpriseName
}
`
};
let
dataBaseList
=
await
findBusinessDataByParamsToPage
(
selectParam
,
(
page
-
1
)
*
10
);
let
dataBaseList
=
await
findBusinessDataByParamsToPage
(
selectParam
,
(
page
-
1
)
*
10
);
dataCount
=
await
findBusinessDataCountByParams
ToPage
(
selectParam
);
dataCount
=
await
findBusinessDataCountByParams
(
selectParam
);
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
{
BI
,
RD
,
TXP
,
name
,
uscc
}
=
info
;
let
{
BI
,
RD
,
TXP
,
name
,
uscc
}
=
info
;
...
...
src/biz/admin/enterprise/enterprise.ts
View file @
6dbdb224
...
@@ -442,7 +442,7 @@ export async function getBusinessDataList(name:string, year:number, quarter:numb
...
@@ -442,7 +442,7 @@ export async function getBusinessDataList(name:string, year:number, quarter:numb
}
}
let
dataBaseList
=
await
businessData
.
findBusinessDataByParamsToPage
(
selectParam
,
(
page
-
1
)
*
10
);
let
dataBaseList
=
await
businessData
.
findBusinessDataByParamsToPage
(
selectParam
,
(
page
-
1
)
*
10
);
let
dataCount
=
await
businessData
.
findBusinessDataCountByParams
ToPage
(
selectParam
);
let
dataCount
=
await
businessData
.
findBusinessDataCountByParams
(
selectParam
);
let
dataList
=
[];
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
splitResultConfig
.
EnterpriseBusinessDataConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
splitResultConfig
.
EnterpriseBusinessDataConfig
,
info
,
true
);
...
...
src/biz/admin/enterprise/financing.ts
View file @
6dbdb224
...
@@ -148,7 +148,7 @@ export async function getEnterpriseFinancing(name:string, financingRounds:number
...
@@ -148,7 +148,7 @@ export async function getEnterpriseFinancing(name:string, financingRounds:number
}
}
let
dataBaseList
=
await
financingInfoData
.
selectFinancingListByParamsToPage
(
selectParam
,
page
);
let
dataBaseList
=
await
financingInfoData
.
selectFinancingListByParamsToPage
(
selectParam
,
page
);
let
count
=
await
financingInfoData
.
selectFinancingCountByParams
ToPage
(
selectParam
);
let
count
=
await
financingInfoData
.
selectFinancingCountByParams
(
selectParam
);
let
dataList
=
[];
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
...
...
src/biz/mobileEnterprise/base/initialTeams.ts
View file @
6dbdb224
...
@@ -84,8 +84,8 @@ export async function updateInitialTeamInfo(uscc:string, firstClassTalent:number
...
@@ -84,8 +84,8 @@ export async function updateInitialTeamInfo(uscc:string, firstClassTalent:number
/**修改数据 */
/**修改数据 */
if
(
addList
.
length
)
await
initialTeamData
.
addMoneyEnterpriseInitialTeam
(
addList
);
if
(
addList
.
length
)
await
initialTeamData
.
addMoneyEnterpriseInitialTeam
(
addList
);
if
(
updateList
.
length
)
await
initialTeamData
.
updateM
one
yEnterpriseInitialTeam
(
updateList
);
if
(
updateList
.
length
)
await
initialTeamData
.
updateM
an
yEnterpriseInitialTeam
(
updateList
);
if
(
deleteList
.
length
)
await
initialTeamData
.
deleteM
one
yEnterpriseInitialTeam
(
deleteList
);
if
(
deleteList
.
length
)
await
initialTeamData
.
deleteM
an
yEnterpriseInitialTeam
(
deleteList
);
/**添加埋点 */
/**添加埋点 */
let
oldPointData
=
{
haveFirstClassTalent
:
oldHaveFirstClassTalent
,
teams
:
enterpriseInitialTeamList
||
[]
};
let
oldPointData
=
{
haveFirstClassTalent
:
oldHaveFirstClassTalent
,
teams
:
enterpriseInitialTeamList
||
[]
};
...
...
src/biz/mobileEnterprise/quarterTask/dataDeclaration.ts
View file @
6dbdb224
...
@@ -395,7 +395,7 @@ export async function dataDeclarationTask() {
...
@@ -395,7 +395,7 @@ export async function dataDeclarationTask() {
let
{
declarationQuarter
,
declarationYear
}
=
getDeclarationTime
();
let
{
declarationQuarter
,
declarationYear
}
=
getDeclarationTime
();
let
teamDataCount
=
await
teamData
.
findTeamDataCountByTime
(
declarationYear
,
declarationQuarter
);
let
teamDataCount
=
await
teamData
.
findTeamDataCountByTime
(
declarationYear
,
declarationQuarter
);
let
businessDataCount
=
await
businessData
.
findBusinessDataCountBy
Time
(
declarationYear
,
declarationQuarter
);
let
businessDataCount
=
await
businessData
.
findBusinessDataCountBy
Params
({
year
:
declarationYear
,
quarter
:
declarationQuarter
}
);
if
(
teamDataCount
>
0
&&
businessDataCount
>
0
)
return
;
if
(
teamDataCount
>
0
&&
businessDataCount
>
0
)
return
;
...
...
src/biz/mobileFuHuaQi/enterprise/toExamine.ts
View file @
6dbdb224
...
@@ -77,8 +77,8 @@ export async function unauditedList(uscc:string, state:number, type:number ) {
...
@@ -77,8 +77,8 @@ export async function unauditedList(uscc:string, state:number, type:number ) {
});
});
/**组合dataNumberList */
/**组合dataNumberList */
let
businessSubmitCount
=
await
businessData
.
findBusinessDataCountByParams
ToPage
({
fhqIsSubmit
:
false
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
true
});
let
businessSubmitCount
=
await
businessData
.
findBusinessDataCountByParams
({
fhqIsSubmit
:
false
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
true
});
let
businessNotSubmitCount
=
await
businessData
.
findBusinessDataCountByParams
ToPage
({
fhqIsSubmit
:
false
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
false
});
let
businessNotSubmitCount
=
await
businessData
.
findBusinessDataCountByParams
({
fhqIsSubmit
:
false
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
false
});
let
teamSubmitCount
=
await
teamData
.
findTeamDataCountByParams
({
fhqIsSubmit
:
false
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
true
});
let
teamSubmitCount
=
await
teamData
.
findTeamDataCountByParams
({
fhqIsSubmit
:
false
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
true
});
let
teamNotSubmitCount
=
await
teamData
.
findTeamDataCountByParams
({
fhqIsSubmit
:
false
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
false
});
let
teamNotSubmitCount
=
await
teamData
.
findTeamDataCountByParams
({
fhqIsSubmit
:
false
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
false
});
...
@@ -149,7 +149,7 @@ export async function fuHuaQiReplenishEnterpriseDataDeclaration(fuHuaQiUscc:stri
...
@@ -149,7 +149,7 @@ export async function fuHuaQiReplenishEnterpriseDataDeclaration(fuHuaQiUscc:stri
if
(
type
==
ENTERPRISEDECLARATIONTYPE
.
团队信息
)
{
if
(
type
==
ENTERPRISEDECLARATIONTYPE
.
团队信息
)
{
eccFormParam
(
"孵化器补充企业数据-团队信息"
,
eccFormParamConfig
.
FuHuaQiReplenishEnterpriseTeamDataConfig
,
form
);
eccFormParam
(
"孵化器补充企业数据-团队信息"
,
eccFormParamConfig
.
FuHuaQiReplenishEnterpriseTeamDataConfig
,
form
);
let
teamInfo
=
await
teamData
.
findTeam
Data
ByUsccAndTime
(
uscc
,
year
,
quarter
);
let
teamInfo
=
await
teamData
.
findTeamByUsccAndTime
(
uscc
,
year
,
quarter
);
if
(
teamInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
{}
if
(
teamInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
{}
for
(
let
key
in
eccFormParamConfig
.
FuHuaQiReplenishEnterpriseTeamDataConfig
)
{
for
(
let
key
in
eccFormParamConfig
.
FuHuaQiReplenishEnterpriseTeamDataConfig
)
{
teamInfo
[
key
]
=
form
[
key
];
teamInfo
[
key
]
=
form
[
key
];
...
@@ -188,7 +188,7 @@ export async function fuHuaQiPass(fuHuaQiUscc:string, uscc:string, type:number,
...
@@ -188,7 +188,7 @@ export async function fuHuaQiPass(fuHuaQiUscc:string, uscc:string, type:number,
let
dataInfo
:
any
=
{};
let
dataInfo
:
any
=
{};
if
(
type
==
ENTERPRISEDECLARATIONTYPE
.
团队信息
)
{
if
(
type
==
ENTERPRISEDECLARATIONTYPE
.
团队信息
)
{
dataInfo
=
await
teamData
.
findTeam
Data
ByUsccAndTime
(
uscc
,
year
,
quarter
);
dataInfo
=
await
teamData
.
findTeamByUsccAndTime
(
uscc
,
year
,
quarter
);
}
else
{
}
else
{
dataInfo
=
await
businessData
.
findBusinessDataByTimeAndUscc
(
uscc
,
year
,
quarter
);
dataInfo
=
await
businessData
.
findBusinessDataByTimeAndUscc
(
uscc
,
year
,
quarter
);
}
}
...
@@ -211,7 +211,7 @@ export async function fuHuaQiPass(fuHuaQiUscc:string, uscc:string, type:number,
...
@@ -211,7 +211,7 @@ export async function fuHuaQiPass(fuHuaQiUscc:string, uscc:string, type:number,
* @returns
* @returns
*/
*/
export
async
function
selectFuHuaQiReplenishEnterpriseTeamData
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
export
async
function
selectFuHuaQiReplenishEnterpriseTeamData
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
let
teamInfo
=
await
teamData
.
findTeam
Data
ByUsccAndTime
(
uscc
,
year
,
quarter
);
let
teamInfo
=
await
teamData
.
findTeamByUsccAndTime
(
uscc
,
year
,
quarter
);
let
result
=
{
let
result
=
{
doctor
:
teamInfo
.
doctor
,
//博士
doctor
:
teamInfo
.
doctor
,
//博士
master
:
teamInfo
.
master
,
//硕士
master
:
teamInfo
.
master
,
//硕士
...
...
src/biz/mobileFuHuaQi/policy.ts
View file @
6dbdb224
...
@@ -10,7 +10,6 @@ import { addPoint } from "../point";
...
@@ -10,7 +10,6 @@ import { addPoint } from "../point";
/**
/**
* 获取资讯列表
* 获取资讯列表
*
* @param uscc 预留好 后期做推荐的参数
* @param uscc 预留好 后期做推荐的参数
* @param selectTitle
* @param selectTitle
* @param page 分页
* @param page 分页
...
...
src/data/enterprise/enterprise.ts
View file @
6dbdb224
...
@@ -151,7 +151,6 @@ export async function selectOneEnterpriseByParam(param:object) {
...
@@ -151,7 +151,6 @@ export async function selectOneEnterpriseByParam(param:object) {
}
}
/**
/**
* 通过taskId 获取此次任务添加的企业列表
* 通过taskId 获取此次任务添加的企业列表
* @param taskId 任务id 格式遵循tool中getTaskId
* @param taskId 任务id 格式遵循tool中getTaskId
...
@@ -172,10 +171,17 @@ export async function updateEnterpriseDraftLock(taskId:string) {
...
@@ -172,10 +171,17 @@ export async function updateEnterpriseDraftLock(taskId:string) {
}
}
/**
* 修改企业密码
* @param uscc
* @param pwd
* @returns
*/
export
async
function
updateEnterprisePwd
(
uscc
:
string
,
pwd
:
string
)
{
export
async
function
updateEnterprisePwd
(
uscc
:
string
,
pwd
:
string
)
{
return
await
enterpriseModel
.
updateMany
({
uscc
},
{
$set
:{
pwd
}});
return
await
enterpriseModel
.
updateMany
({
uscc
},
{
$set
:{
pwd
}});
}
}
/**
/**
* 创建新的企业数据
* 创建新的企业数据
* @param fuHuaQiUscc 企业所属孵化器的统一信用代码
* @param fuHuaQiUscc 企业所属孵化器的统一信用代码
...
@@ -241,12 +247,18 @@ export async function findEnterpriseListToPage(selectParam, skipCount) {
...
@@ -241,12 +247,18 @@ export async function findEnterpriseListToPage(selectParam, skipCount) {
return
await
enterpriseModel
.
find
(
selectParam
).
skip
(
skipCount
).
limit
(
10
);
return
await
enterpriseModel
.
find
(
selectParam
).
skip
(
skipCount
).
limit
(
10
);
}
}
/**
* 分页获取所有企业分页数量未5
* @param selectParam
* @param skipCount
* @returns
*/
export
async
function
findEnterpriseListToPage5
(
selectParam
,
skipCount
)
{
export
async
function
findEnterpriseListToPage5
(
selectParam
,
skipCount
)
{
return
await
enterpriseModel
.
find
(
selectParam
).
skip
(
skipCount
).
limit
(
5
);
return
await
enterpriseModel
.
find
(
selectParam
).
skip
(
skipCount
).
limit
(
5
);
}
}
/**
/**
* 获取符合条件的所有企业
* 获取符合条件的所有企业
* @param selectParam 查询参数
* @param selectParam 查询参数
...
@@ -298,6 +310,11 @@ export async function findAllBindFuHuaQiUsccList() {
...
@@ -298,6 +310,11 @@ export async function findAllBindFuHuaQiUsccList() {
return
await
enterpriseModel
.
distinct
(
'fuHuaQiUscc'
);
return
await
enterpriseModel
.
distinct
(
'fuHuaQiUscc'
);
}
}
/**
* 批量创建企业
* @param fuHuaQiList
*/
export
async
function
createEnterpriseToList
(
fuHuaQiList
:
object
)
{
export
async
function
createEnterpriseToList
(
fuHuaQiList
:
object
)
{
await
enterpriseModel
.
insertMany
(
fuHuaQiList
);
await
enterpriseModel
.
insertMany
(
fuHuaQiList
);
}
}
...
@@ -312,7 +329,6 @@ export async function updateEnterpriseState(state:number) {
...
@@ -312,7 +329,6 @@ export async function updateEnterpriseState(state:number) {
}
}
/**
/**
* 补录企业
* 补录企业
* @param fuHuaQiUscc
* @param fuHuaQiUscc
...
@@ -328,10 +344,11 @@ export async function findStats() {
...
@@ -328,10 +344,11 @@ export async function findStats() {
return
await
enterpriseModel
.
find
({
enterpriseIsInPut
:
false
});
return
await
enterpriseModel
.
find
({
enterpriseIsInPut
:
false
});
}
}
export
async
function
getHighTechEnterpriseByFuHuaQiUsccId
(
fuHuaQiUscc
:
string
)
{
return
await
enterpriseModel
.
find
({
"$and"
:[{
"qualification.isHighTech"
:
true
},
{
"qualification.isZjtx"
:
true
},
{
fuHuaQiUscc
}]});
}
/**
* 统计非迁出企业的专利信息数据
* @returns
*/
export
async
function
statsIntellectualPropertyData
()
{
export
async
function
statsIntellectualPropertyData
()
{
let
statsList
=
await
enterpriseModel
.
aggregate
([
let
statsList
=
await
enterpriseModel
.
aggregate
([
{
"$match"
:{
state
:{
"$ne"
:
FUHUASTATE
.
迁出
}}},
{
"$match"
:{
state
:{
"$ne"
:
FUHUASTATE
.
迁出
}}},
...
@@ -346,6 +363,10 @@ export async function statsIntellectualPropertyData() {
...
@@ -346,6 +363,10 @@ export async function statsIntellectualPropertyData() {
}
}
/**
* 统计非迁出企业的 按孵化器分组的数量 即孵化器拥有的企业数
* @returns
*/
export
async
function
statsFHQHaveEnterpriseCount
()
{
export
async
function
statsFHQHaveEnterpriseCount
()
{
let
statsList
=
await
enterpriseModel
.
aggregate
([
let
statsList
=
await
enterpriseModel
.
aggregate
([
{
"$match"
:{
state
:{
"$ne"
:
FUHUASTATE
.
迁出
}}},
{
"$match"
:{
state
:{
"$ne"
:
FUHUASTATE
.
迁出
}}},
...
...
src/data/enterprise/financingInfo.ts
View file @
6dbdb224
...
@@ -60,30 +60,57 @@ export async function selectFinancingListByUscc(uscc:string) {
...
@@ -60,30 +60,57 @@ export async function selectFinancingListByUscc(uscc:string) {
}
}
export
async
function
selectFinancingInfo
(
uscc
:
string
)
{
/**
return
await
financingInfoModel
.
findOne
({
uscc
});
* 根据id查询 融资信息 可用save方法保存
}
* @param id
* @returns
*/
export
async
function
getFinancingById
(
id
:
string
)
{
export
async
function
getFinancingById
(
id
:
string
)
{
return
await
financingInfoModel
.
selectOnceData
({
id
});
return
await
financingInfoModel
.
selectOnceData
({
id
});
}
}
/**
* 根据id删除
* @param id
* @returns
*/
export
async
function
deleteFinancingById
(
id
:
string
)
{
export
async
function
deleteFinancingById
(
id
:
string
)
{
return
await
financingInfoModel
.
deleteOne
({
id
});
return
await
financingInfoModel
.
deleteOne
({
id
});
}
}
/**
* 分页
* @param param
* @param skipNumber
* @returns
*/
export
async
function
selectFinancingListByParamsToPage
(
param
,
skipNumber
)
{
export
async
function
selectFinancingListByParamsToPage
(
param
,
skipNumber
)
{
return
await
financingInfoModel
.
find
(
param
).
skip
(
skipNumber
).
limit
(
10
);
return
await
financingInfoModel
.
find
(
param
).
skip
(
skipNumber
).
limit
(
10
);
}
}
export
async
function
selectFinancingCountByParamsToPage
(
param
)
{
/**
* 获取符合条件的数量
* @param param
* @returns
*/
export
async
function
selectFinancingCountByParams
(
param
)
{
return
await
financingInfoModel
.
find
(
param
).
countDocuments
();
return
await
financingInfoModel
.
find
(
param
).
countDocuments
();
}
}
/**
* 获取符合条件的列表
* @param param
* @returns
*/
export
async
function
selectFinancingListByParams
(
param
)
{
export
async
function
selectFinancingListByParams
(
param
)
{
return
await
financingInfoModel
.
find
(
param
);
return
await
financingInfoModel
.
find
(
param
);
}
}
/**
/**
* 获取两年内的融资金额
* 获取两年内的融资金额
*/
*/
...
@@ -105,6 +132,10 @@ export async function selectEnterpriseTwoYeasFinancing(uscc:string, startTime:nu
...
@@ -105,6 +132,10 @@ export async function selectEnterpriseTwoYeasFinancing(uscc:string, startTime:nu
}
}
/**
* 统计融资各轮次数量
* @returns
*/
export
async
function
statsEnterpriseFinancing
()
{
export
async
function
statsEnterpriseFinancing
()
{
let
statsList
=
await
financingInfoModel
.
aggregate
([
let
statsList
=
await
financingInfoModel
.
aggregate
([
{
"$group"
:{
_id
:
"$financingRounds"
,
count
:{
"$sum"
:
1
}
}}
{
"$group"
:{
_id
:
"$financingRounds"
,
count
:{
"$sum"
:
1
}
}}
...
@@ -113,6 +144,11 @@ export async function statsEnterpriseFinancing() {
...
@@ -113,6 +144,11 @@ export async function statsEnterpriseFinancing() {
}
}
/**
* 统计大于某时间节点的按月份分的融资金额
* @param startTimeMs
* @returns {"月份":{ms:融资时间, count:金额, month:"月份"} }
*/
export
async
function
statsEnterpriseFinancingByTime
(
startTimeMs
:
number
)
{
export
async
function
statsEnterpriseFinancingByTime
(
startTimeMs
:
number
)
{
let
param
=
{
timeToObtainInvestment
:{
"$gt"
:
startTimeMs
}
};
let
param
=
{
timeToObtainInvestment
:{
"$gt"
:
startTimeMs
}
};
let
data
=
await
financingInfoModel
.
find
(
param
);
let
data
=
await
financingInfoModel
.
find
(
param
);
...
...
src/data/enterprise/initialTeam.ts
View file @
6dbdb224
...
@@ -24,30 +24,39 @@ export function initModel(){
...
@@ -24,30 +24,39 @@ export function initModel(){
initialTeamModel
=
baseDB
.
model
(
'enterpriseInitialTeam'
,
initialTeamSchema
);
initialTeamModel
=
baseDB
.
model
(
'enterpriseInitialTeam'
,
initialTeamSchema
);
}
}
/**
/**
*
添加团队成员
*
查询 企业的创始团队列表
* @param uscc
* @param uscc
* @param name
* @returns
* @param teamList
*/
*/
export
async
function
addEnterpriseInitialTeam
(
teamInfo
)
{
return
await
initialTeamModel
.
create
(
teamInfo
);
}
export
async
function
findEnterpriseInitialTeam
(
uscc
:
string
)
{
export
async
function
findEnterpriseInitialTeam
(
uscc
:
string
)
{
return
await
initialTeamModel
.
find
({
uscc
});
return
await
initialTeamModel
.
find
({
uscc
});
}
}
/**
* 根据id删除创始团队数据
* @param id
*/
export
async
function
deleteEnterpriseInitialTeamMember
(
id
:
string
)
{
export
async
function
deleteEnterpriseInitialTeamMember
(
id
:
string
)
{
await
initialTeamModel
.
deleteOne
({
id
});
await
initialTeamModel
.
deleteOne
({
id
});
}
}
/**
* 添加多个创始团队数据
* @param teams
*/
export
async
function
addMoneyEnterpriseInitialTeam
(
teams
)
{
export
async
function
addMoneyEnterpriseInitialTeam
(
teams
)
{
await
initialTeamModel
.
insertMany
(
teams
);
await
initialTeamModel
.
insertMany
(
teams
);
}
}
export
async
function
updateMoneyEnterpriseInitialTeam
(
updateTeams
)
{
/**
* 修改多个创始团队信息
* @param updateTeams
*/
export
async
function
updateManyEnterpriseInitialTeam
(
updateTeams
)
{
for
(
let
i
=
0
;
i
<
updateTeams
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
updateTeams
.
length
;
i
++
)
{
let
info
=
updateTeams
[
i
];
let
info
=
updateTeams
[
i
];
let
id
=
info
.
id
;
let
id
=
info
.
id
;
...
@@ -56,7 +65,12 @@ export async function updateMoneyEnterpriseInitialTeam(updateTeams) {
...
@@ -56,7 +65,12 @@ export async function updateMoneyEnterpriseInitialTeam(updateTeams) {
}
}
}
}
export
async
function
deleteMoneyEnterpriseInitialTeam
(
deleteTeams
)
{
/**
* 删除多个创始团队信息
* @param deleteTeams
*/
export
async
function
deleteManyEnterpriseInitialTeam
(
deleteTeams
)
{
for
(
let
i
=
0
;
i
<
deleteTeams
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
deleteTeams
.
length
;
i
++
)
{
let
info
=
deleteTeams
[
i
];
let
info
=
deleteTeams
[
i
];
let
id
=
info
.
id
;
let
id
=
info
.
id
;
...
@@ -64,18 +78,41 @@ export async function deleteMoneyEnterpriseInitialTeam(deleteTeams) {
...
@@ -64,18 +78,41 @@ export async function deleteMoneyEnterpriseInitialTeam(deleteTeams) {
}
}
}
}
/**
* 分页
* @param param
* @param skipCount
* @returns
*/
export
async
function
findEnterpriseInitialTeamsByParamToPage
(
param
,
skipCount
:
number
)
{
export
async
function
findEnterpriseInitialTeamsByParamToPage
(
param
,
skipCount
:
number
)
{
return
await
initialTeamModel
.
find
(
param
).
skip
(
skipCount
).
limit
(
10
);
return
await
initialTeamModel
.
find
(
param
).
skip
(
skipCount
).
limit
(
10
);
}
}
/**
* 获取符合条件的总数
* @param param
* @returns
*/
export
async
function
findEnterpriseInitialTeamsCountByParamToPage
(
param
)
{
export
async
function
findEnterpriseInitialTeamsCountByParamToPage
(
param
)
{
return
await
initialTeamModel
.
find
(
param
).
countDocuments
();
return
await
initialTeamModel
.
find
(
param
).
countDocuments
();
}
}
/**
* 获取符合条件的列表
* @param param
* @returns
*/
export
async
function
findEnterpriseInitialTeamsByParam
(
param
)
{
export
async
function
findEnterpriseInitialTeamsByParam
(
param
)
{
return
await
initialTeamModel
.
find
(
param
);
return
await
initialTeamModel
.
find
(
param
);
}
}
/**
* 统计人才类型数量
* @returns
*/
export
async
function
statsEnterpriseInitalTeamsType
()
{
export
async
function
statsEnterpriseInitalTeamsType
()
{
let
statsCountList
=
await
initialTeamModel
.
aggregate
([
let
statsCountList
=
await
initialTeamModel
.
aggregate
([
{
"$group"
:{
_id
:
"$type"
,
count
:{
"$sum"
:
1
}
}
}
{
"$group"
:{
_id
:
"$type"
,
count
:{
"$sum"
:
1
}
}
}
...
...
src/data/enterprise/quarterTask/businessdata.ts
View file @
6dbdb224
/**
/**
* 企业经营数据
* 企业经营数据 数据层
*
*/
*/
import
{
Schema
}
from
'mongoose'
;
import
{
Schema
}
from
'mongoose'
;
...
@@ -51,33 +52,51 @@ export async function findBusinessDataByUsccAndYear(uscc:string, year:number) {
...
@@ -51,33 +52,51 @@ export async function findBusinessDataByUsccAndYear(uscc:string, year:number) {
return
await
businessDataModel
.
find
({
uscc
,
year
});
return
await
businessDataModel
.
find
({
uscc
,
year
});
}
}
/**
* 获取单个数据
* @param uscc
* @param year
* @param quarter
* @returns
*/
export
async
function
findBusinessDataByTimeAndUscc
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
export
async
function
findBusinessDataByTimeAndUscc
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
return
await
businessDataModel
.
selectOnceData
({
uscc
,
year
,
quarter
});
return
await
businessDataModel
.
selectOnceData
({
uscc
,
year
,
quarter
});
}
}
/**
* 获取单个数据 (孵化器和企业都未提交的数据)
* @param uscc
* @param year
* @param quarter
* @returns
*/
export
async
function
findNotSubmitBusinessDataByTimeAndUscc
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
export
async
function
findNotSubmitBusinessDataByTimeAndUscc
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
return
await
businessDataModel
.
selectOnceData
({
uscc
,
year
,
quarter
,
isSubmit
:
false
,
fhqIsSubmit
:
false
});
return
await
businessDataModel
.
selectOnceData
({
uscc
,
year
,
quarter
,
isSubmit
:
false
,
fhqIsSubmit
:
false
});
}
}
/**
/**
* 根据条件查询
* 根据条件
分页
查询
* @param param 查询条件
* @param param 查询条件
*/
*/
export
async
function
findBusinessDataByParamsToPage
(
param
,
skipNumber
)
{
export
async
function
findBusinessDataByParamsToPage
(
param
,
skipNumber
)
{
return
await
businessDataModel
.
find
(
param
).
skip
(
skipNumber
).
limit
(
10
);
return
await
businessDataModel
.
find
(
param
).
skip
(
skipNumber
).
limit
(
10
);
}
}
/**
/**
* 根据条件查询总数
* 根据条件查询总数
* @param param 查询条件
* @param param 查询条件
*/
*/
export
async
function
findBusinessDataCountByParams
ToPage
(
param
)
{
export
async
function
findBusinessDataCountByParams
(
param
)
{
return
await
businessDataModel
.
find
(
param
).
countDocuments
()
return
await
businessDataModel
.
find
(
param
).
countDocuments
()
;
}
}
/**
/**
* 根据条件查询
* 根据条件查询
列表
* @param param 查询条件
* @param param 查询条件
*/
*/
export
async
function
findBusinessDataByParams
(
param
)
{
export
async
function
findBusinessDataByParams
(
param
)
{
...
@@ -85,21 +104,22 @@ export async function findBusinessDataByParams(param) {
...
@@ -85,21 +104,22 @@ export async function findBusinessDataByParams(param) {
}
}
/**
* 添加多个数据
* @param addList
*/
export
async
function
addManyBusinessData
(
addList
)
{
export
async
function
addManyBusinessData
(
addList
)
{
await
businessDataModel
.
insertMany
(
addList
);
await
businessDataModel
.
insertMany
(
addList
);
}
}
/**
/**
* 查询特定时间的企业经营数据总和
* 更具年份获取企业的经营数据
* @param year 年度
* @param uscc
* @param quarter 季度
* @param startYear
* @param endYear
* @returns
* @returns
*/
*/
export
async
function
findBusinessDataCountByTime
(
year
:
number
,
quarter
:
number
)
{
return
await
businessDataModel
.
find
({
year
,
quarter
}).
countDocuments
();
}
export
async
function
findBusinessDataByYear
(
uscc
:
string
,
startYear
:
number
,
endYear
:
number
)
{
export
async
function
findBusinessDataByYear
(
uscc
:
string
,
startYear
:
number
,
endYear
:
number
)
{
let
dataList
=
await
businessDataModel
.
find
({
"$or"
:[{
year
:
startYear
},
{
year
:
endYear
}],
uscc
});
let
dataList
=
await
businessDataModel
.
find
({
"$or"
:[{
year
:
startYear
},
{
year
:
endYear
}],
uscc
});
let
count
=
0
;
let
count
=
0
;
...
@@ -112,6 +132,10 @@ export async function findBusinessDataByYear(uscc:string, startYear:number, endY
...
@@ -112,6 +132,10 @@ export async function findBusinessDataByYear(uscc:string, startYear:number, endY
}
}
/**
* 统计所有企业的经营数据
* @returns
*/
export
async
function
statsBusinessDataByParam
()
{
export
async
function
statsBusinessDataByParam
()
{
let
statsList
=
await
businessDataModel
.
aggregate
([
let
statsList
=
await
businessDataModel
.
aggregate
([
{
"$match"
:{
"$or"
:[{
isSubmit
:
true
},
{
fhqIsSubmit
:
true
}]}},
{
"$match"
:{
"$or"
:[{
isSubmit
:
true
},
{
fhqIsSubmit
:
true
}]}},
...
@@ -121,6 +145,11 @@ export async function statsBusinessDataByParam() {
...
@@ -121,6 +145,11 @@ export async function statsBusinessDataByParam() {
}
}
/**
* 根据条件统计经营次数
* @param param
* @returns
*/
export
async
function
statsBusinessCount
(
param
)
{
export
async
function
statsBusinessCount
(
param
)
{
let
statsList
=
await
businessDataModel
.
aggregate
([
let
statsList
=
await
businessDataModel
.
aggregate
([
{
"$match"
:
param
},
{
"$match"
:
param
},
...
...
src/data/enterprise/quarterTask/team.ts
View file @
6dbdb224
...
@@ -47,6 +47,7 @@ export async function save(throwError=false) {
...
@@ -47,6 +47,7 @@ export async function save(throwError=false) {
});
});
}
}
/**
/**
* 查询特定时间的企业团队信息数据
* 查询特定时间的企业团队信息数据
* @param uscc 企业统一信用代码
* @param uscc 企业统一信用代码
...
@@ -58,6 +59,7 @@ export async function findTeamByUsccAndTime(uscc:string, year:number, quarter:nu
...
@@ -58,6 +59,7 @@ export async function findTeamByUsccAndTime(uscc:string, year:number, quarter:nu
return
await
teamModel
.
selectOnceData
({
uscc
,
year
,
quarter
});
return
await
teamModel
.
selectOnceData
({
uscc
,
year
,
quarter
});
}
}
/**
/**
* 查询特定时间的企业团队信息数据总和
* 查询特定时间的企业团队信息数据总和
* @param year 年度
* @param year 年度
...
@@ -68,14 +70,29 @@ export async function findTeamDataCountByTime(year:number, quarter:number) {
...
@@ -68,14 +70,29 @@ export async function findTeamDataCountByTime(year:number, quarter:number) {
return
await
teamModel
.
find
({
year
,
quarter
}).
countDocuments
();
return
await
teamModel
.
find
({
year
,
quarter
}).
countDocuments
();
}
}
/**
* 查询特定时间的企业团队信息数据 (孵化器未提交 企业未提交的数据)
* @param uscc
* @param year
* @param quarter
* @returns
*/
export
async
function
findNotSubmitTeamByUsccAndTime
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
export
async
function
findNotSubmitTeamByUsccAndTime
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
return
await
teamModel
.
selectOnceData
({
uscc
,
year
,
quarter
,
isSubmit
:
false
,
fhqIsSubmit
:
false
});
return
await
teamModel
.
selectOnceData
({
uscc
,
year
,
quarter
,
isSubmit
:
false
,
fhqIsSubmit
:
false
});
}
}
/**
* 获取符合条件的列表
* @param param
* @returns
*/
export
async
function
findTeamDataByParams
(
param
)
{
export
async
function
findTeamDataByParams
(
param
)
{
return
await
teamModel
.
find
(
param
);
return
await
teamModel
.
find
(
param
);
}
}
/**
/**
* 根据条件查询总数
* 根据条件查询总数
* @param param 查询条件
* @param param 查询条件
...
@@ -84,9 +101,6 @@ export async function findTeamDataCountByParams(param) {
...
@@ -84,9 +101,6 @@ export async function findTeamDataCountByParams(param) {
return
await
teamModel
.
find
(
param
).
countDocuments
()
return
await
teamModel
.
find
(
param
).
countDocuments
()
}
}
export
async
function
findTeamDataByUsccAndTime
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
return
await
teamModel
.
selectOnceData
({
uscc
,
year
,
quarter
});
}
/**
/**
* 获取企业最新的团队数据
* 获取企业最新的团队数据
...
@@ -98,15 +112,31 @@ export async function findEnterpriseNewTeamData(uscc:string) {
...
@@ -98,15 +112,31 @@ export async function findEnterpriseNewTeamData(uscc:string) {
return
list
[
0
]
||
{};
return
list
[
0
]
||
{};
}
}
/**
* 添加团队信息数据
* @param addInfo
*/
export
async
function
addTeamData
(
addInfo
)
{
export
async
function
addTeamData
(
addInfo
)
{
await
teamModel
.
create
(
addInfo
);
await
teamModel
.
create
(
addInfo
);
}
}
/**
* 添加多条 团队信息数据
* @param addList
*/
export
async
function
addManyTeamData
(
addList
)
{
export
async
function
addManyTeamData
(
addList
)
{
await
teamModel
.
insertMany
(
addList
);
await
teamModel
.
insertMany
(
addList
);
}
}
/**
* 统计特定时间下已经提交的所有企业经营数据总数
* @param year
* @param quarter
* @returns
*/
export
async
function
statsEnterpriseTeamData
(
year
:
number
,
quarter
:
number
)
{
export
async
function
statsEnterpriseTeamData
(
year
:
number
,
quarter
:
number
)
{
let
statsList
=
await
teamModel
.
aggregate
([
let
statsList
=
await
teamModel
.
aggregate
([
{
"$match"
:{
year
,
quarter
,
"$or"
:[{
isSubmit
:
true
},
{
fhqIsSubmit
:
true
}]
}},
{
"$match"
:{
year
,
quarter
,
"$or"
:[{
isSubmit
:
true
},
{
fhqIsSubmit
:
true
}]
}},
...
@@ -122,6 +152,13 @@ export async function statsEnterpriseTeamData(year:number, quarter:number) {
...
@@ -122,6 +152,13 @@ export async function statsEnterpriseTeamData(year:number, quarter:number) {
return
statsList
[
0
]
?
statsList
[
0
]
:
{
doctorCount
:
0
,
masterCount
:
0
,
undergraduateCount
:
0
,
juniorCollegeCount
:
0
,
otherCount
:
0
};
return
statsList
[
0
]
?
statsList
[
0
]
:
{
doctorCount
:
0
,
masterCount
:
0
,
undergraduateCount
:
0
,
juniorCollegeCount
:
0
,
otherCount
:
0
};
}
}
/**
* 统计特定时间下已经提交的按孵化器分组的经营数据
* @param year
* @param quarter
* @returns
*/
export
async
function
statsEnterTeamDataByFHQ
(
year
:
number
,
quarter
:
number
)
{
export
async
function
statsEnterTeamDataByFHQ
(
year
:
number
,
quarter
:
number
)
{
let
statsList
=
await
teamModel
.
aggregate
([
let
statsList
=
await
teamModel
.
aggregate
([
{
"$match"
:{
year
,
quarter
,
"$or"
:[{
isSubmit
:
true
},
{
fhqIsSubmit
:
true
}]
}},
{
"$match"
:{
year
,
quarter
,
"$or"
:[{
isSubmit
:
true
},
{
fhqIsSubmit
:
true
}]
}},
...
@@ -142,6 +179,13 @@ export async function statsEnterTeamDataByFHQ(year:number, quarter:number) {
...
@@ -142,6 +179,13 @@ export async function statsEnterTeamDataByFHQ(year:number, quarter:number) {
return
map
;
return
map
;
}
}
/**
* 统计特定时间下已经提交的各企业的经营数据和
* @param year
* @param quarter
* @returns
*/
export
async
function
statsEnterpriseTeamCountByNull
(
year
:
number
,
quarter
:
number
)
{
export
async
function
statsEnterpriseTeamCountByNull
(
year
:
number
,
quarter
:
number
)
{
let
statsList
=
await
teamModel
.
aggregate
([
let
statsList
=
await
teamModel
.
aggregate
([
{
"$match"
:{
year
,
quarter
,
"$or"
:[{
isSubmit
:
true
},
{
fhqIsSubmit
:
true
}]
}},
{
"$match"
:{
year
,
quarter
,
"$or"
:[{
isSubmit
:
true
},
{
fhqIsSubmit
:
true
}]
}},
...
...
src/data/enterprise/replenish.ts
View file @
6dbdb224
...
@@ -50,19 +50,50 @@ export async function replenishData(uscc:string, year:number, quarter:number, ty
...
@@ -50,19 +50,50 @@ export async function replenishData(uscc:string, year:number, quarter:number, ty
await
replenishDataModel
.
create
(
addInfo
);
await
replenishDataModel
.
create
(
addInfo
);
}
}
/**
* 获取时间段的补录数据列表
* @param uscc
* @param year
* @returns
*/
export
async
function
selectRepleishData
(
uscc
:
string
,
year
:
number
)
{
export
async
function
selectRepleishData
(
uscc
:
string
,
year
:
number
)
{
return
await
replenishDataModel
.
find
({
uscc
,
year
});
return
await
replenishDataModel
.
find
({
uscc
,
year
});
}
}
/**
* 根据条件获取单个补录数据 可save保存
* @param uscc
* @param type
* @param year
* @param quarter
* @returns
*/
export
async
function
selectOnceRepleishData
(
uscc
:
string
,
type
:
number
,
year
:
number
,
quarter
:
number
)
{
export
async
function
selectOnceRepleishData
(
uscc
:
string
,
type
:
number
,
year
:
number
,
quarter
:
number
)
{
return
await
replenishDataModel
.
selectOnceData
({
uscc
,
year
,
type
,
quarter
});
return
await
replenishDataModel
.
selectOnceData
({
uscc
,
year
,
type
,
quarter
});
}
}
/**
* 获取特定企业下的特定时间特定类型的数据 不支持save保存
* @param uscc
* @param type
* @param year
* @returns
*/
export
async
function
findRepleishDataByTypeAndYear
(
uscc
:
string
,
type
:
number
,
year
:
number
)
{
export
async
function
findRepleishDataByTypeAndYear
(
uscc
:
string
,
type
:
number
,
year
:
number
)
{
return
await
replenishDataModel
.
find
({
uscc
,
type
,
year
});
return
await
replenishDataModel
.
find
({
uscc
,
type
,
year
});
}
}
/**
* 获取企业在某年度的经营数据
* @param uscc
* @param startYear
* @param endYear
* @returns
*/
export
async
function
findReplenishBusinessDataByYear
(
uscc
:
string
,
startYear
:
number
,
endYear
:
number
)
{
export
async
function
findReplenishBusinessDataByYear
(
uscc
:
string
,
startYear
:
number
,
endYear
:
number
)
{
let
dataList
=
await
replenishDataModel
.
find
({
"$or"
:[{
year
:
startYear
},
{
year
:
endYear
}],
uscc
,
type
:
BUSINESSDATATYPE
.
营业收入
});
let
dataList
=
await
replenishDataModel
.
find
({
"$or"
:[{
year
:
startYear
},
{
year
:
endYear
}],
uscc
,
type
:
BUSINESSDATATYPE
.
营业收入
});
let
count
=
0
;
let
count
=
0
;
...
@@ -74,6 +105,12 @@ export async function findReplenishBusinessDataByYear(uscc:string, startYear:num
...
@@ -74,6 +105,12 @@ export async function findReplenishBusinessDataByYear(uscc:string, startYear:num
return
count
;
return
count
;
}
}
/**
* 获取符合条件的列表
* @param param
* @returns
*/
export
async
function
findReplenishDataByParam
(
param
)
{
export
async
function
findReplenishDataByParam
(
param
)
{
return
await
replenishDataModel
.
find
(
param
);
return
await
replenishDataModel
.
find
(
param
);
}
}
\ 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