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
29b05dd5
Commit
29b05dd5
authored
Feb 10, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
e07fd5c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
32 deletions
+14
-32
financing.ts
src/biz/enterprise/financing.ts
+13
-11
financing.ts
src/data/enterprise/financing.ts
+0
-18
admin.ts
src/routers/admin.ts
+1
-3
No files found.
src/biz/enterprise/financing.ts
View file @
29b05dd5
...
...
@@ -7,12 +7,13 @@
import
{
FinancingParamConfig
,
FinancingParamUpdateConfig
}
from
"../../config/checkParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
EnterpriseFinancingInfoConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
createFinancing
,
deleteEnterpriseFinancing
,
findFinancingCount
,
findFinancingInfoByTaskIdAndSucc
,
findFinancingList
,
groupFindFinancing
}
from
"../../data/enterprise/financing"
;
import
{
createFinancing
,
deleteEnterpriseFinancing
,
findFinancingCount
,
findFinancingInfoByTaskIdAndSucc
,
findFinancingList
}
from
"../../data/enterprise/financing"
;
import
{
FinancingListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
checkChange
,
checkParamater
,
extractData
,
getTaskId
}
from
"../../util/tools"
;
import
{
findEnterpriseInfoByName
,
findEnterpriseListByFuHuaQiUsccName
}
from
"../../data/enterprise/enterprise"
;
import
{
findFuHuaQiByName
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
moment
=
require
(
"moment"
);
/**
...
...
@@ -142,24 +143,25 @@ export async function getFuHuaQiEnterpriseForSelect(uscc:string) {
* @param page 页数
* @returns
*/
export
async
function
financingList
(
monthData
:
string
,
fuHuaQiName
:
string
,
industry
:[
Number
]
,
fuHuaQiInvestment
:
boolean
,
page
:
number
)
{
export
async
function
financingList
(
monthData
:
string
,
fuHuaQiName
:
string
,
industry
,
fuHuaQiInvestment
:
boolean
,
page
:
number
)
{
let
fuHuaQiInfo
=
await
findFuHuaQiByName
(
fuHuaQiName
);
if
(
!
fuHuaQiInfo
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
fuHuaQiName
}
这个孵化器`
);
let
selectParam
:
any
=
{};
let
year
=
monthData
.
substring
(
0
,
5
);
let
month
=
monthData
.
slice
(
5
,
monthData
.
length
);
if
(
monthData
)
selectParam
.
year
=
year
;
selectParam
.
month
=
month
;
if
(
fuHuaQiName
)
selectParam
.
fuHuaQiUscc
=
fuHuaQiInfo
.
uscc
;
if
(
industry
)
selectParam
.
industry
=
industry
;
if
(
fuHuaQiInvestment
)
selectParam
.
fuHuaQiInvestment
=
fuHuaQiInvestment
;
let
enterpriseMap
=
await
groupFindFinancing
();
if
(
monthData
.
length
>
0
)
{
let
startT
=
moment
(
monthData
).
startOf
(
'month'
).
valueOf
();
let
endT
=
moment
(
monthData
).
endOf
(
'month'
).
valueOf
();
selectParam
.
createTime
=
{
'$gt'
:
startT
,
'$lt'
:
endT
};
}
if
(
fuHuaQiName
.
length
>
0
)
selectParam
.
fuHuaQiUscc
=
fuHuaQiInfo
.
uscc
;
if
(
industry
.
length
>
0
)
selectParam
.
industry
=
industry
;
selectParam
.
fuHuaQiInvestment
=
fuHuaQiInvestment
;
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
);
});
...
...
src/data/enterprise/financing.ts
View file @
29b05dd5
...
...
@@ -22,8 +22,6 @@ const financingSchema = new Schema({
fuHuaQiInvestmentStyle
:
Number
,
//孵化器投资方式
draftLock
:{
type
:
Boolean
,
default
:
false
},
//草稿锁,true为提交之后,false为草稿
createTime
:
Number
,
//录入时间
year
:
String
,
//数据年份
month
:
String
,
//数据月份
industry
:[
Number
],
//领域
});
...
...
@@ -103,22 +101,6 @@ export async function deleteEnterpriseFinancing(uscc:string, taskId:string) {
/**
* 聚合查询 孵化器所拥有的企业数量
* @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 跳过数量
...
...
src/routers/admin.ts
View file @
29b05dd5
...
...
@@ -77,7 +77,6 @@ async function getMonthList(req, res) {
async
function
getFuHuaQiUserList
(
req
,
res
)
{
let
reqConf
=
{
operationName
:
'String'
,
page
:
'Number'
};
let
{
operationName
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
userBiz
.
fuHuaQiUserList
(
operationName
,
page
);
res
.
success
(
result
);
...
...
@@ -104,7 +103,7 @@ async function getMonthList(req, res) {
* @param res
*/
async
function
getEnterpriseList
(
req
,
res
)
{
let
reqConf
=
{
time
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'
Number
'
,
isNaturalPersonHolding
:
'Boolean'
,
page
:
'Number'
};
let
reqConf
=
{
time
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'
[Number]
'
,
isNaturalPersonHolding
:
'Boolean'
,
page
:
'Number'
};
let
{
time
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
result
=
await
enterpriseBiz
.
enterpriseList
(
time
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
);
...
...
@@ -120,7 +119,6 @@ async function getMonthList(req, res) {
async
function
updateState
(
req
,
res
)
{
let
reqConf
=
{
userState
:
'Boolean'
,
uscc
:
'String'
};
let
{
userState
,
uscc
}
=
checkReqParam
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
userBiz
.
updateState
(
uscc
,
userState
);
res
.
success
(
result
);
...
...
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