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
b7e9d031
Commit
b7e9d031
authored
Feb 09, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a79ab03d
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
119 deletions
+58
-119
financing.ts
src/biz/enterprise/financing.ts
+17
-18
month.ts
src/biz/fuHuqQi/month.ts
+9
-31
task.ts
src/biz/fuHuqQi/task.ts
+1
-1
errorEnum.ts
src/config/errorEnum.ts
+2
-1
enterprise.ts
src/data/enterprise/enterprise.ts
+20
-0
financing.ts
src/data/enterprise/financing.ts
+0
-25
fuhuaqi.ts
src/data/fuHuaQi/fuhuaqi.ts
+0
-14
task.ts
src/data/fuHuaQi/task.ts
+8
-10
fuhuaqi.ts
src/routers/fuhuaqi.ts
+1
-19
No files found.
src/biz/enterprise/financing.ts
View file @
b7e9d031
...
...
@@ -8,10 +8,11 @@
import
{
FinancingParamConfig
}
from
"../../config/checkParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
EnterpriseFinancingInfoConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
createFinancing
,
deleteEnterpriseFinancing
,
findAddByName
,
findEnterpriseFinancingByUscc
,
findFinancing
ByName
,
findFinancing
Count
,
findFinancingInfoByTaskIdAndSucc
,
findFinancingList
,
groupFindFinancing
}
from
"../../data/enterprise/financing"
;
import
{
createFinancing
,
deleteEnterpriseFinancing
,
findAddByName
,
findEnterpriseFinancingByUscc
,
findFinancingCount
,
findFinancingInfoByTaskIdAndSucc
,
findFinancingList
,
groupFindFinancing
}
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"
;
/**
...
...
@@ -25,6 +26,11 @@ export async function createFinancingInfo(uscc, param) {
checkParamater
(
"录入企业融资信息"
,
FinancingParamConfig
,
param
);
let
enterpriseInfo
=
await
findEnterpriseInfoByName
(
param
.
name
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
uscc
,
param
.
name
);
param
.
uscc
=
enterpriseInfo
.
uscc
;
let
dataBaseInfo
=
await
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业当月数据已存在
,
`
${
param
.
uscc
}
的融资信息已经存在`
);
...
...
@@ -90,32 +96,25 @@ export async function deleteEnterpriseFinancingByUscc(fuHuaQiUscc:string, uscc:s
return
{
isSuccess
:
true
};
}
/**
* 融资企业名称模糊查询
*
@param name 融资企业名称
*
*/
export
async
function
getFinancingByName
(
name
:
string
)
{
let
financingInfo
=
await
find
FinancingByName
(
name
);
export
async
function
getFinancingByName
(
uscc
:
string
)
{
let
financingInfo
=
await
find
EnterpriseListByFuHuaQiUsccName
(
uscc
);
let
dataList
=
[];
financingInfo
.
forEach
(
info
=>
{
dataList
.
push
(
info
.
name
);
dataList
.
push
({
name
:
info
.
name
,
logonAdd
:
info
.
logonAdd
,
operatingAdd
:
info
.
operatingAdd
});
});
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
;
}
/**
* 融资企业信息列表
...
...
src/biz/fuHuqQi/month.ts
View file @
b7e9d031
...
...
@@ -8,8 +8,9 @@ import { BizError } from "../../util/bizError";
import
*
as
monthData
from
"../../data/fuHuaQi/monthTable"
;
import
{
extractData
,
getTaskId
}
from
"../../util/tools"
;
import
moment
=
require
(
"moment"
);
import
{
findAllFuHuaQiOperationNameMap
,
getFuHuaQiCreateDataTimeMap
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
findAllFuHuaQiOperationNameMap
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
MonthListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
TASKTYPEENUM
}
from
"../../config/enum"
;
/**
* 新添加孵化器月度填报
...
...
@@ -76,37 +77,8 @@ export async function monthTableList(state:number, year:number, month:number, pa
if
(
year
)
selectParam
.
year
=
year
;
if
(
month
)
selectParam
.
month
=
month
;
if
(
state
==
1
)
{
let
{
dataList
,
count
}
=
await
getCompleted
(
selectParam
,
page
);
return
{
dataList
,
count
};
}
else
if
(
state
==
2
)
{
// findTaskListByType(TASKTYPEENUM.孵化器月度填报);
}
else
{
let
{
dataList
,
count
}
=
await
getCompleted
(
selectParam
,
page
);
/**组合未填报 */
}
// let 需要组合未填报数 = 10 - dataList.length;
// return {count, dataList};
}
async
function
getNotCompleted
(
year
,
month
)
{
/** 算总数 */
getFuHuaQiCreateDataTimeMap
();
}
/**
* 获取已填报数据
* @param selectParam
* @param page
* @returns
*/
async
function
getCompleted
(
selectParam
,
page
)
{
let
dataBaseList
=
await
monthData
.
findMonthTableList
(
selectParam
,
(
page
-
1
)
*
10
);
let
count
=
await
monthData
.
findMonthTableListCount
(
selectParam
);
...
...
@@ -122,10 +94,16 @@ async function getCompleted(selectParam, page) {
};
dataList
.
push
(
onceInfo
);
});
//==
return
{
count
,
dataList
}
}
/**
* 根据uscc查询任务信息
* @param uscc 企业统一信用代码
...
...
src/biz/fuHuqQi/task.ts
View file @
b7e9d031
...
...
@@ -11,7 +11,7 @@ import { findEnterpriseListByTaskId, updateEnterpriseDraftLock } from "../../dat
import
{
findFinancingListByTaskId
,
updateFinancingDraftLock
}
from
"../../data/enterprise/financing"
;
import
{
findAllFuHuaQi
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
findmonthTableByTaskId
,
findmonthTableListByTaskId
}
from
"../../data/fuHuaQi/monthTable"
;
import
{
findEnterpriseByTaskIdAndType
,
createTaskToList
,
findFuHuaQiTaskByTaskId
,
findTask
ByTaskId
,
findTask
CountByKey
}
from
"../../data/fuHuaQi/task"
;
import
{
findEnterpriseByTaskIdAndType
,
createTaskToList
,
findFuHuaQiTaskByTaskId
,
findTaskCountByKey
}
from
"../../data/fuHuaQi/task"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
logConsole
,
logHandle
}
from
"../../util/log"
;
import
{
extractData
,
getTaskId
,
getTimeKey
}
from
"../../util/tools"
;
...
...
src/config/errorEnum.ts
View file @
b7e9d031
...
...
@@ -18,7 +18,8 @@ export enum ERRORENUM {
密码长度不能超过
24
个字符
,
账号不存在
,
已入库的企业不能删除
,
任务不存在
任务不存在
,
该企业不存在
}
export
enum
ERRORCODEENUM
{
...
...
src/data/enterprise/enterprise.ts
View file @
b7e9d031
...
...
@@ -138,3 +138,23 @@ export async function deleteEnterprise(uscc:string) {
export
async
function
findEnterpriseCount
(
selectParam
)
{
return
await
enterpriseModel
.
find
(
selectParam
).
count
();
}
/**
* 通过企业名称获取企业信息
* @param selectParam 查询参数
* @returns number 数据数量
*/
export
async
function
findEnterpriseInfoByName
(
name
:
string
)
{
return
await
enterpriseModel
.
findOne
({
name
});
}
/**
* todo 注释后加
* @param selectParam 查询参数
* @returns number 数据数量
*/
export
async
function
findEnterpriseListByFuHuaQiUsccName
(
fuHuaQiUscc
:
string
)
{
return
await
enterpriseModel
.
find
({
fuHuaQiUscc
});
}
src/data/enterprise/financing.ts
View file @
b7e9d031
...
...
@@ -101,15 +101,6 @@ export async function deleteEnterpriseFinancing(uscc:string, taskId:string) {
/**
* 融资企业名称模糊查询
* @param name 融资企业名称
* @returns
*/
export
async
function
findFinancingByName
(
name
:
string
)
{
return
await
financingModel
.
find
({
name
:
"/"
+
name
+
"/"
});
}
/**
* 根据融资企业名称获取融资数据
* @param name
* @returns
...
...
@@ -163,17 +154,3 @@ export async function findEnterpriseFinancingByUscc(uscc:string, taskId:string)
export
async
function
findFinancingCount
(
selectParam
)
{
return
await
financingModel
.
find
(
selectParam
).
count
();
}
\ No newline at end of file
export
async
function
superSelect
(
selectParam
)
{
await
financingModel
.
aggregate
([
{
'$lookup'
:{
from
:
'enterprise'
,
localField
:
''
}
}
]);
}
\ No newline at end of file
src/data/fuHuaQi/fuhuaqi.ts
View file @
b7e9d031
...
...
@@ -135,20 +135,6 @@ export async function findAllFuHuaQiOperationNameMap() {
/**
* 获取所有企业创建时间
* @returns {} key:企业统一信用代码
*/
export
async
function
getFuHuaQiCreateDataTimeMap
()
{
let
list
=
await
fuHuaQiModel
.
find
({});
let
result
=
{};
list
.
forEach
(
info
=>
{
result
[
info
.
uscc
]
=
info
.
createTime
;
});
return
result
;
}
/**
* 聚合查询 孵化器所拥有的企业数量
* @returns {} key=孵化器统一信用 value=企业数量
*/
...
...
src/data/fuHuaQi/task.ts
View file @
b7e9d031
...
...
@@ -78,14 +78,11 @@ export async function createTaskToList(taskList:object) {
await
fuHuaQiTaskModel
.
insertMany
(
taskList
);
}
/**
* 通过任务id获取任务信息
* 支持.save方法保存对象修改
* @param taskId 任务id
* @returns {}
*/
export
async
function
findTaskByTaskId
(
taskId
:
string
)
{
return
await
fuHuaQiTaskModel
.
selectOnceData
({
taskId
});
export
async
function
findTaskListByType
(
taskType
:
number
)
{
let
taskList
=
await
fuHuaQiTaskModel
.
find
({
taskType
});
let
map
=
{};
taskList
.
forEach
(
info
=>
{
map
[
info
.
taskId
]
=
info
.
isSubmit
});
return
map
;
}
\ No newline at end of file
src/routers/fuhuaqi.ts
View file @
b7e9d031
...
...
@@ -35,7 +35,6 @@ export function setRouter(httpServer) {
httpServer
.
post
(
'/fuhuaqi/financing/select'
,
checkFuHuaQiToken
,
asyncHandler
(
selectFinancingInfo
));
httpServer
.
post
(
'/fuhuaqi/financing/delete'
,
checkFuHuaQiToken
,
asyncHandler
(
delFinancingInfo
));
httpServer
.
post
(
'/admin/financing/namelist'
,
asyncHandler
(
getFinancingInfoByName
));
httpServer
.
post
(
'/admin/financing/add'
,
asyncHandler
(
getAddInfoByName
));
/**新注册或迁入企业 */
httpServer
.
post
(
'/fuhuaqi/enterprise/register'
,
checkFuHuaQiToken
,
asyncHandler
(
registerEnterprise
));
...
...
@@ -170,26 +169,9 @@ async function delFinancingInfo(req, res) {
* @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
);
let
result
=
await
financingBiz
.
getFinancingByName
(
Uscc
);
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