明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jt_backend
Project
Project
Details
Activity
Releases
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
zengfanpei
jt_backend
Commits
3c714327
Commit
3c714327
authored
Dec 01, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2074bb58
Pipeline
#103935
passed with stage
in 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
resourceController.js
controller/resourceController.js
+7
-4
project.js
db/model/jt/project.js
+4
-4
No files found.
controller/resourceController.js
View file @
3c714327
...
@@ -9,14 +9,17 @@ const { Op } = require('sequelize');
...
@@ -9,14 +9,17 @@ const { Op } = require('sequelize');
async
function
createResource
(
req
,
res
,
next
)
{
async
function
createResource
(
req
,
res
,
next
)
{
try
{
try
{
const
body
=
req
.
body
;
const
body
=
req
.
body
;
const
ret
=
await
DB
.
Resources
.
create
(
body
);
let
ret
=
await
DB
.
Resources
.
create
(
body
);
if
(
body
.
resourcesInfos
&&
body
.
resourcesInfos
.
length
&&
ret
.
id
)
{
ret
=
ret
.
toJSON
();
console
.
log
(
ret
);
if
(
body
.
resourceInfos
&&
body
.
resourceInfos
.
length
&&
ret
.
id
)
{
let
ris
=
[];
let
ris
=
[];
for
(
let
index
=
0
;
index
<
array
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
body
.
resourceInfos
.
length
;
index
++
)
{
const
element
=
array
[
index
];
const
element
=
body
.
resourceInfos
[
index
];
element
.
resourceId
=
ret
.
id
;
element
.
resourceId
=
ret
.
id
;
ris
.
push
(
element
);
ris
.
push
(
element
);
}
}
console
.
log
(
ris
,
"==="
)
await
DB
.
ResourcesInfo
.
bulkCreate
(
ris
);
await
DB
.
ResourcesInfo
.
bulkCreate
(
ris
);
}
}
return
res
.
sendData
(
ret
);
return
res
.
sendData
(
ret
);
...
...
db/model/jt/project.js
View file @
3c714327
...
@@ -107,7 +107,7 @@ const Project = sequelize.define('Project', {
...
@@ -107,7 +107,7 @@ const Project = sequelize.define('Project', {
zsqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"直属企业"
},
zsqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"直属企业"
},
sfnjzdhzytz
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否能建重大或重要投资"
},
sfnjzdhzytz
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否能建重大或重要投资"
},
sfzzjc
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否自主决策"
},
sfzzjc
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否自主决策"
},
financialStatementType
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"财务报表类型"
},
//TODO:下拉
cwbblx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"财务报表类型"
},
//TODO:下拉
zfsphzbajb
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"政府审批(核准、备案)级别"
},
//TODO:下拉
zfsphzbajb
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"政府审批(核准、备案)级别"
},
//TODO:下拉
sflxbqyscx
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否履行标前预审程序"
},
sflxbqyscx
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否履行标前预审程序"
},
xmztz
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目总投资"
},
xmztz
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目总投资"
},
...
@@ -119,7 +119,7 @@ const Project = sequelize.define('Project', {
...
@@ -119,7 +119,7 @@ const Project = sequelize.define('Project', {
xmlx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目类型"
},
//TODO:下拉
xmlx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目类型"
},
//TODO:下拉
sfpppxm
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否PPP项目"
},
sfpppxm
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否PPP项目"
},
//项目所在地
//项目所在地
domesticOrOverseas
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"境内/外"
},
//TODO:下拉
jnw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"境内/外"
},
//TODO:下拉
sjnzjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"省(境内)/洲际(境外)"
},
//TODO:下拉
sjnzjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"省(境内)/洲际(境外)"
},
//TODO:下拉
cityOrCountry
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"地市(境内)/国家(境外)"
},
//TODO:下拉
cityOrCountry
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"地市(境内)/国家(境外)"
},
//TODO:下拉
qxjngjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"区县(境内)/国家(境外)"
},
//TODO:下拉
qxjngjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"区县(境内)/国家(境外)"
},
//TODO:下拉
...
@@ -1765,9 +1765,9 @@ const Project = sequelize.define('Project', {
...
@@ -1765,9 +1765,9 @@ const Project = sequelize.define('Project', {
// 同步模型到数据库(创建表)
// 同步模型到数据库(创建表)
Project
.
sync
({
Project
.
sync
({
force
:
false
,
//
force: false,
// force: true ,//会删除已存在表并重新创建
// force: true ,//会删除已存在表并重新创建
//
alter: true
alter
:
true
})
})
.
then
(()
=>
{
.
then
(()
=>
{
console
.
log
(
'Project 表同步成功'
);
console
.
log
(
'Project 表同步成功'
);
...
...
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