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
d4f678ed
Commit
d4f678ed
authored
Feb 10, 2023
by
孙香冬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://123.207.147.179:8888/node_server/zjxcxServer
parents
95aafa04
163e6563
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
18 deletions
+44
-18
month.ts
src/biz/fuHuqQi/month.ts
+9
-9
task.ts
src/biz/fuHuqQi/task.ts
+27
-6
monthTable.ts
src/data/fuHuaQi/monthTable.ts
+8
-3
No files found.
src/biz/fuHuqQi/month.ts
View file @
d4f678ed
...
@@ -23,11 +23,15 @@ export async function createReport(uscc:string, occupancyRate:number) {
...
@@ -23,11 +23,15 @@ export async function createReport(uscc:string, occupancyRate:number) {
const
TaskId
=
getTaskId
(
uscc
);
const
TaskId
=
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findmonthTableByTaskId
(
TaskId
);
let
dataBaseInfo
=
await
monthData
.
findmonthTableByTaskId
(
TaskId
);
if
(
dataBaseInfo
)
throw
new
BizError
(
ERRORENUM
.
该孵化器月度填报已存在
,
`
${
uscc
}
重复提交了月度填报值为
${
occupancyRate
}
`
);
if
(
dataBaseInfo
.
state
==
2
)
throw
new
BizError
(
ERRORENUM
.
该孵化器月度填报已存在
,
`
${
uscc
}
重复提交了月度填报值为
${
occupancyRate
}
`
);
const
MonthNumber
=
moment
().
subtract
(
1
,
'months'
).
month
()
+
1
;
dataBaseInfo
.
state
=
2
;
const
MonthTableName
=
`
${
MonthNumber
}
月孵化器月度填报`
;
dataBaseInfo
.
createTime
=
new
Date
().
valueOf
();
await
monthData
.
addOnceReport
(
TaskId
,
MonthTableName
,
uscc
,
occupancyRate
);
dataBaseInfo
.
occupancyRate
=
occupancyRate
;
await
dataBaseInfo
.
save
();
// const MonthNumber = moment().subtract(1, 'months').month() + 1;
// const MonthTableName = `${MonthNumber}月孵化器月度填报`;
// await monthData.addOnceReport(TaskId, MonthTableName, uscc, occupancyRate);
return
{
isSuccess
:
true
};
return
{
isSuccess
:
true
};
}
}
...
@@ -75,10 +79,10 @@ export async function deleteReport(uscc:string) {
...
@@ -75,10 +79,10 @@ export async function deleteReport(uscc:string) {
*/
*/
export
async
function
monthTableList
(
state
:
number
,
year
:
number
,
month
:
number
,
page
:
number
)
{
export
async
function
monthTableList
(
state
:
number
,
year
:
number
,
month
:
number
,
page
:
number
)
{
let
selectParam
:
any
=
{};
let
selectParam
:
any
=
{};
if
(
state
)
selectParam
.
state
=
state
;
if
(
year
)
selectParam
.
year
=
year
;
if
(
year
)
selectParam
.
year
=
year
;
if
(
month
)
selectParam
.
month
=
month
;
if
(
month
)
selectParam
.
month
=
month
;
let
taskList
=
findTaskListByType
(
TASKTYPEENUM
.
孵化器月度填报
);
let
dataBaseList
=
await
monthData
.
findMonthTableList
(
selectParam
,
(
page
-
1
)
*
10
);
let
dataBaseList
=
await
monthData
.
findMonthTableList
(
selectParam
,
(
page
-
1
)
*
10
);
let
count
=
await
monthData
.
findMonthTableListCount
(
selectParam
);
let
count
=
await
monthData
.
findMonthTableListCount
(
selectParam
);
...
@@ -96,10 +100,6 @@ export async function monthTableList(state:number, year:number, month:number, pa
...
@@ -96,10 +100,6 @@ export async function monthTableList(state:number, year:number, month:number, pa
dataList
.
push
(
onceInfo
);
dataList
.
push
(
onceInfo
);
});
});
//==
return
{
count
,
dataList
}
return
{
count
,
dataList
}
}
}
...
...
src/biz/fuHuqQi/task.ts
View file @
d4f678ed
...
@@ -5,12 +5,13 @@
...
@@ -5,12 +5,13 @@
*
*
*/
*/
import
moment
=
require
(
"moment"
);
import
{
TASKTYPEENUM
}
from
"../../config/enum"
;
import
{
TASKTYPEENUM
}
from
"../../config/enum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
findEnterpriseListByTaskId
,
updateEnterpriseDraftLock
}
from
"../../data/enterprise/enterprise"
;
import
{
findEnterpriseListByTaskId
,
updateEnterpriseDraftLock
}
from
"../../data/enterprise/enterprise"
;
import
{
findFinancingListByTaskId
,
updateFinancingDraftLock
}
from
"../../data/enterprise/financing"
;
import
{
findFinancingListByTaskId
,
updateFinancingDraftLock
}
from
"../../data/enterprise/financing"
;
import
{
findAllFuHuaQi
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
findAllFuHuaQi
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
findmonthTableByTaskId
,
findmonthTableListByTaskId
}
from
"../../data/fuHuaQi/monthTable"
;
import
{
createMonthTableToList
,
findmonthTableByTaskId
,
findmonthTableListByTaskId
}
from
"../../data/fuHuaQi/monthTable"
;
import
{
findEnterpriseByTaskIdAndType
,
createTaskToList
,
findFuHuaQiTaskByTaskId
,
findTaskCountByKey
}
from
"../../data/fuHuaQi/task"
;
import
{
findEnterpriseByTaskIdAndType
,
createTaskToList
,
findFuHuaQiTaskByTaskId
,
findTaskCountByKey
}
from
"../../data/fuHuaQi/task"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
logConsole
,
logHandle
}
from
"../../util/log"
;
import
{
logConsole
,
logHandle
}
from
"../../util/log"
;
...
@@ -118,33 +119,53 @@ export async function provideTask() {
...
@@ -118,33 +119,53 @@ export async function provideTask() {
let
fuHuaQiList
=
await
findAllFuHuaQi
();
let
fuHuaQiList
=
await
findAllFuHuaQi
();
const
Month
=
new
Date
().
getMonth
()
+
1
;
const
Month
=
new
Date
().
getMonth
()
+
1
;
let
addList
=
[];
let
addList
=
[];
//任务列表
let
monthList
=
[];
//月度填报列表
const
MonthNumber
=
moment
().
subtract
(
1
,
'months'
).
month
()
+
1
;
const
YearNumber
=
new
Date
().
getFullYear
();
const
MonthTableName
=
`
${
MonthNumber
}
月孵化器月度填报`
;
fuHuaQiList
.
forEach
(
info
=>
{
fuHuaQiList
.
forEach
(
info
=>
{
let
{
uscc
}
=
info
;
let
{
uscc
}
=
info
;
let
taskId
=
getTaskId
(
uscc
);
addList
.
push
({
addList
.
push
({
key
:
TimeKey
,
key
:
TimeKey
,
type
:
TASKTYPEENUM
.
孵化器月度填报
,
type
:
TASKTYPEENUM
.
孵化器月度填报
,
taskId
:
getTaskId
(
uscc
)
,
taskId
,
fuHuaQiUscc
:
uscc
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
false
isSubmit
:
false
},{
},{
key
:
TimeKey
,
key
:
TimeKey
,
type
:
TASKTYPEENUM
.
新注册或迁入企业登记
,
type
:
TASKTYPEENUM
.
新注册或迁入企业登记
,
taskId
:
getTaskId
(
uscc
)
,
taskId
,
fuHuaQiUscc
:
uscc
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
false
isSubmit
:
false
},{
},{
key
:
TimeKey
,
key
:
TimeKey
,
type
:
TASKTYPEENUM
.
融资企业填报
,
type
:
TASKTYPEENUM
.
融资企业填报
,
taskId
:
getTaskId
(
uscc
)
,
taskId
,
fuHuaQiUscc
:
uscc
,
fuHuaQiUscc
:
uscc
,
isSubmit
:
false
isSubmit
:
false
});
});
monthList
.
push
({
taskId
,
name
:
MonthTableName
,
fuHuaQiUscc
:
uscc
,
month
:
MonthNumber
,
year
:
YearNumber
,
state
:
1
});
});
});
try
{
try
{
await
createTaskToList
(
addList
);
await
createTaskToList
(
addList
);
logHandle
(
`添加了
${
addList
.
length
}
`
)
/**添加月度填报表 */
await
createMonthTableToList
(
monthList
);
logHandle
(
`添加了
${
addList
.
length
}
`
);
}
catch
(
err
)
{
}
catch
(
err
)
{
//todo添加异常了
//todo添加异常了
}
}
...
...
src/data/fuHuaQi/monthTable.ts
View file @
d4f678ed
...
@@ -15,10 +15,11 @@ const monthTableSchema = new Schema({
...
@@ -15,10 +15,11 @@ const monthTableSchema = new Schema({
fuHuaQiUscc
:
String
,
//任务所属孵化器id
fuHuaQiUscc
:
String
,
//任务所属孵化器id
occupancyRate
:
Number
,
//出租率 单位为%
occupancyRate
:
Number
,
//出租率 单位为%
createTime
:
Number
,
//创建时间
createTime
:
Number
,
//创建时间
state
:{
type
:
Number
,
default
:
1
},
//状态 初始状态=1 1表示未填报
/**不下发字段 */
/**不下发字段 */
draftLock
:{
type
:
Boolean
,
default
:
false
},
//草稿锁,true为提交之后,false为草稿
draftLock
:{
type
:
Boolean
,
default
:
false
},
//草稿锁,true为提交之后,false为草稿
year
:{
type
:
Number
,
index
:
true
},
month
:{
type
:
Number
,
index
:
true
},
month
:{
type
:
Number
,
index
:
true
},
year
:{
type
:
Number
,
index
:
true
}
});
});
var
monthTableModel
;
var
monthTableModel
;
...
@@ -104,4 +105,9 @@ export async function findMonthTableList(selectParam:object, skipNum:number) {
...
@@ -104,4 +105,9 @@ export async function findMonthTableList(selectParam:object, skipNum:number) {
*/
*/
export
async
function
findMonthTableListCount
(
selectParam
:
object
)
{
export
async
function
findMonthTableListCount
(
selectParam
:
object
)
{
return
await
monthTableModel
.
find
(
selectParam
).
count
();
return
await
monthTableModel
.
find
(
selectParam
).
count
();
}
}
\ No newline at end of file
export
async
function
createMonthTableToList
(
tableList
:
object
)
{
await
monthTableModel
.
insertMany
(
tableList
);
}
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