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
9a7db531
Commit
9a7db531
authored
Feb 08, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
b5792850
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
+20
-17
month.ts
src/biz/fuHuqQi/month.ts
+9
-9
monthTable.ts
src/data/fuHuaQi/monthTable.ts
+7
-4
public.ts
src/routers/public.ts
+4
-4
No files found.
src/biz/fuHuqQi/month.ts
View file @
9a7db531
...
@@ -16,15 +16,14 @@ import moment = require("moment");
...
@@ -16,15 +16,14 @@ import moment = require("moment");
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
createReport
(
uscc
:
string
,
occupancyRate
:
number
)
{
export
async
function
createReport
(
uscc
:
string
,
occupancyRate
:
number
)
{
//不允许有重复的
const
TaskId
=
getTaskId
(
uscc
);
const
TaskId
=
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findmonthTable
List
ByTaskId
(
TaskId
);
let
dataBaseInfo
=
await
monthData
.
findmonthTableByTaskId
(
TaskId
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
taskId
)
throw
new
BizError
(
ERRORENUM
.
该孵化器月度填报已存在
,
`
${
uscc
}
重复提交了月度填报值为
${
occupancyRate
}
`
);
if
(
dataBaseInfo
)
throw
new
BizError
(
ERRORENUM
.
该孵化器月度填报已存在
,
`
${
uscc
}
重复提交了月度填报值为
${
occupancyRate
}
`
);
const
MonthNumber
=
moment
().
subtract
(
1
,
'months'
).
month
()
+
1
;
const
MonthNumber
=
moment
().
subtract
(
1
,
'months'
).
month
()
+
1
;
const
MonthTableName
=
`
${
MonthNumber
}
月孵化器月度填报`
;
const
MonthTableName
=
`
${
MonthNumber
}
月孵化器月度填报`
;
await
monthData
.
addOnceReport
(
MonthTableName
,
uscc
,
occupancyRate
);
await
monthData
.
addOnceReport
(
TaskId
,
MonthTableName
,
uscc
,
occupancyRate
);
return
{
isSuccess
:
true
};
return
{
isSuccess
:
true
};
}
}
...
@@ -37,8 +36,8 @@ export async function createReport(uscc:string, occupancyRate:number) {
...
@@ -37,8 +36,8 @@ export async function createReport(uscc:string, occupancyRate:number) {
*/
*/
export
async
function
updateReport
(
uscc
:
string
,
occupancyRate
:
number
)
{
export
async
function
updateReport
(
uscc
:
string
,
occupancyRate
:
number
)
{
const
TaskId
=
getTaskId
(
uscc
);
const
TaskId
=
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findmonthTable
List
ByTaskId
(
TaskId
);
let
dataBaseInfo
=
await
monthData
.
findmonthTableByTaskId
(
TaskId
);
if
(
dataBaseInfo
||
dataBaseInfo
.
taskId
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
taskId
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
dataBaseInfo
.
occupancyRate
=
occupancyRate
;
dataBaseInfo
.
occupancyRate
=
occupancyRate
;
await
dataBaseInfo
.
save
();
await
dataBaseInfo
.
save
();
...
@@ -53,10 +52,10 @@ export async function updateReport(uscc:string, occupancyRate:number) {
...
@@ -53,10 +52,10 @@ export async function updateReport(uscc:string, occupancyRate:number) {
*/
*/
export
async
function
deleteReport
(
uscc
:
string
)
{
export
async
function
deleteReport
(
uscc
:
string
)
{
const
TaskId
=
getTaskId
(
uscc
);
const
TaskId
=
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findmonthTable
List
ByTaskId
(
TaskId
);
let
dataBaseInfo
=
await
monthData
.
findmonthTableByTaskId
(
TaskId
);
if
(
dataBaseInfo
||
dataBaseInfo
.
taskId
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
taskId
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
);
await
monthData
.
deleteReport
(
uscc
);
await
monthData
.
deleteReport
(
uscc
,
dataBaseInfo
.
name
);
return
{
isSuccess
:
true
};
return
{
isSuccess
:
true
};
}
}
\ No newline at end of file
src/data/fuHuaQi/monthTable.ts
View file @
9a7db531
...
@@ -61,21 +61,23 @@ export async function findmonthTableByTaskId(taskId:string) {
...
@@ -61,21 +61,23 @@ export async function findmonthTableByTaskId(taskId:string) {
/**
/**
* 孵化器月度填报 新增报表
* 孵化器月度填报 新增报表
* @param taskId 任务Id
* @param name 任务名称 系统生成
* @param name 任务名称 系统生成
* @param uscc 孵化器统一信用代码
* @param uscc 孵化器统一信用代码
* @param occupancyRate 出租率
* @param occupancyRate 出租率
* @param createTime 创建时间
* @param createTime 创建时间
*
*
*/
*/
export
async
function
addOnceReport
(
name
:
string
,
uscc
:
string
,
occupancyRate
:
number
)
{
export
async
function
addOnceReport
(
taskId
:
string
,
name
:
string
,
uscc
:
string
,
occupancyRate
:
number
)
{
let
monthInfo
=
{
name
,
fuHuaQiUscc
:
uscc
,
occupancyRate
,
createTime
:
new
Date
().
valueOf
()}
let
monthInfo
=
{
taskId
,
name
,
fuHuaQiUscc
:
uscc
,
occupancyRate
,
createTime
:
new
Date
().
valueOf
()}
await
monthTableModel
.
create
(
monthInfo
);
await
monthTableModel
.
create
(
monthInfo
);
}
}
/**
/**
* 孵化器月度填报 删除报表
* 孵化器月度填报 删除报表
* @param uscc 孵化器统一信用代码
* @param uscc 孵化器统一信用代码
* @param name 表名称
*/
*/
export
async
function
deleteReport
(
uscc
:
string
)
{
export
async
function
deleteReport
(
uscc
:
string
,
name
:
string
)
{
return
await
monthTableModel
.
remove
({
fuHuaQiUscc
:
uscc
}).
exec
();
return
await
monthTableModel
.
deleteOne
({
fuHuaQiUscc
:
uscc
,
name
}).
exec
();
}
}
\ No newline at end of file
src/routers/public.ts
View file @
9a7db531
...
@@ -7,10 +7,10 @@ import { FUHUAQILV, INSTITUTIONALNATURE, FUHUAINDUSTRY, INDUSTRY } from '../conf
...
@@ -7,10 +7,10 @@ import { FUHUAQILV, INSTITUTIONALNATURE, FUHUAINDUSTRY, INDUSTRY } from '../conf
import
{
checkFuHuaQiToken
}
from
'../middleware/user'
;
import
{
checkFuHuaQiToken
}
from
'../middleware/user'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
httpServer
.
post
(
'/public/fuhuaqilv'
,
checkFuHuaQiToken
,
asyncHandler
(
getFuHuaQiLv
));
httpServer
.
post
(
'/public/fuhuaqilv'
,
asyncHandler
(
getFuHuaQiLv
));
httpServer
.
post
(
'/public/institutionalnature'
,
checkFuHuaQiToken
,
asyncHandler
(
getInstitutionalNature
));
httpServer
.
post
(
'/public/institutionalnature'
,
asyncHandler
(
getInstitutionalNature
));
httpServer
.
post
(
'/public/fuhuaqiindustry'
,
checkFuHuaQiToken
,
asyncHandler
(
getFuHuaQiIndustry
));
httpServer
.
post
(
'/public/fuhuaqiindustry'
,
asyncHandler
(
getFuHuaQiIndustry
));
httpServer
.
post
(
'/public/industry'
,
checkFuHuaQiToken
,
asyncHandler
(
getIndustry
));
httpServer
.
post
(
'/public/industry'
,
asyncHandler
(
getIndustry
));
}
}
/**
/**
...
...
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