明树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
370c50af
Commit
370c50af
authored
Nov 19, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ce22feb2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
+44
-3
index.js
db/index.js
+38
-0
projectBjtj.js
db/model/jt/projectBjtj.js
+5
-1
projectGdxx.js
db/model/jt/projectGdxx.js
+1
-2
No files found.
db/index.js
View file @
370c50af
...
...
@@ -15,6 +15,14 @@ const Position = require("./model/system/position");
const
Project
=
require
(
"./model/jt/project"
);
const
Resources
=
require
(
"./model/jt/resources"
);
const
ResourcesInfo
=
require
(
"./model/jt/resourcesInfo"
);
const
ProjectBjtj
=
require
(
"./model/jt/projectBjtj"
);
const
ProjectCwpjzb
=
require
(
"./model/jt/projectCwpjzb"
);
const
ProjectFile
=
require
(
"./model/jt/projectFile"
);
const
ProjectGdxx
=
require
(
"./model/jt/projectGdxx"
);
const
ProjectJsgm
=
require
(
"./model/jt/projectJsgm"
);
const
ProjectSpyj
=
require
(
"./model/jt/projectSpyj"
);
const
ProjectXmtzze
=
require
(
"./model/jt/projectXmtzze"
);
/**
* 业务表
...
...
@@ -36,6 +44,13 @@ global.DB = {
Project
,
Resources
,
ResourcesInfo
,
ProjectBjtj
,
ProjectCwpjzb
,
ProjectFile
,
ProjectGdxx
,
ProjectJsgm
,
ProjectSpyj
,
ProjectXmtzze
,
}
...
...
@@ -107,3 +122,26 @@ Position.belongsToMany(User, {
Resources
.
hasMany
(
ResourcesInfo
,
{
foreignKey
:
'resourceId'
,
as
:
'resourcesInfos'
});
ResourcesInfo
.
belongsTo
(
Resources
,
{
foreignKey
:
'resourceId'
});
/**项目-核心边界条件 1:n */
Project
.
hasMany
(
ProjectBjtj
,
{
foreignKey
:
'projectId'
,
as
:
'projectBjtjs'
});
ProjectBjtj
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
/**项目-财务评价指标 1:n */
Project
.
hasMany
(
ProjectCwpjzb
,
{
foreignKey
:
'projectId'
,
as
:
'projectCwpjzbs'
});
ProjectCwpjzb
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
/**项目-项目附件 1:n */
Project
.
hasMany
(
File
,
{
through
:
'jt_project_file'
,
foreignKey
:
'projectId'
,
as
:
'files'
,
otherKey
:
'fileId'
});
File
.
belongsTo
(
Project
,
{
through
:
'jt_project_file'
,
foreignKey
:
'fileId'
,
otherKey
:
'projectId'
});
/**项目-股东信息 1:n */
Project
.
hasMany
(
ProjectGdxx
,
{
foreignKey
:
'projectId'
,
as
:
'projectGdxxs'
});
ProjectGdxx
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
/**项目-建设规模 1:n */
Project
.
hasMany
(
ProjectJsgm
,
{
foreignKey
:
'projectId'
,
as
:
'projectJsgms'
});
ProjectJsgm
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
/**项目-审批意见 1:n */
Project
.
hasMany
(
ProjectSpyj
,
{
foreignKey
:
'projectId'
,
as
:
'projectSpyjs'
});
ProjectSpyj
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
/**项目-项目投资总额 1:n */
Project
.
hasMany
(
ProjectXmtzze
,
{
foreignKey
:
'projectId'
,
as
:
'projectXmtzzes'
});
ProjectXmtzze
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
\ No newline at end of file
db/model/jt/projectBjtj.js
View file @
370c50af
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
const
Project
=
require
(
'./project'
);
// 核心边界条件
const
projectBjtj
=
sequelize
.
define
(
'projectBjtj'
,
{
id
:
{
...
...
@@ -75,6 +75,10 @@ const projectBjtj = sequelize.define('projectBjtj', {
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
references
:
{
model
:
Project
,
// 关联的表名
key
:
'id'
,
// 关联的字段
}
},
del
:
{
...
...
db/model/jt/projectGdxx.js
View file @
370c50af
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
//
建设规模
//
股东信息
const
projectGdxx
=
sequelize
.
define
(
'projectGdxx'
,
{
// 定义字段
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
...
...
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