明树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
97afd353
Commit
97afd353
authored
Dec 01, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
fbd84ce0
Pipeline
#103940
passed with stage
in 3 seconds
Changes
25
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
410 additions
and
53 deletions
+410
-53
index.js
db/index.js
+2
-0
projectBjtj.js
db/model/jt/projectBjtj.js
+21
-5
projectCwpjbjtj.js
db/model/jt/projectCwpjbjtj.js
+17
-2
projectCwpjzb.js
db/model/jt/projectCwpjzb.js
+16
-0
projectFile.js
db/model/jt/projectFile.js
+18
-2
projectFxgl.js
db/model/jt/projectFxgl.js
+19
-3
projectGdxx.js
db/model/jt/projectGdxx.js
+16
-0
projectJczt.js
db/model/jt/projectJczt.js
+16
-0
projectJsgm.js
db/model/jt/projectJsgm.js
+16
-0
projectLcbjd.js
db/model/jt/projectLcbjd.js
+20
-4
projectSpyj.js
db/model/jt/projectSpyj.js
+22
-4
projectTjjh.js
db/model/jt/projectTjjh.js
+19
-3
projectTzsyzb.js
db/model/jt/projectTzsyzb.js
+21
-5
projectTzzjll.js
db/model/jt/projectTzzjll.js
+19
-3
projectTzzt.js
db/model/jt/projectTzzt.js
+19
-3
projectXmtzze.js
db/model/jt/projectXmtzze.js
+20
-4
resources.js
db/model/jt/resources.js
+16
-0
depart.js
db/model/system/depart.js
+16
-0
excel.js
db/model/system/excel.js
+17
-1
file.js
db/model/system/file.js
+16
-0
position.js
db/model/system/position.js
+18
-2
role.js
db/model/system/role.js
+16
-0
user.js
db/model/system/user.js
+18
-1
userPosition.js
db/model/system/userPosition.js
+3
-2
userModule.js
module/userModule.js
+9
-9
No files found.
db/index.js
View file @
97afd353
...
...
@@ -10,6 +10,7 @@ const UserDepart = require("./model/system/userDepart");
const
RequestLog
=
require
(
"./model/system/requestLog"
);
const
File
=
require
(
"./model/system/file"
);
const
Position
=
require
(
"./model/system/position"
);
const
UserPosition
=
require
(
"./model/system/userPosition"
);
const
Message
=
require
(
"./model/system/message"
);
const
FlowRecord
=
require
(
"./model/system/flowRecord"
);
...
...
@@ -48,6 +49,7 @@ global.DB = {
UserDepart
,
File
,
Position
,
UserPosition
,
Project
,
Resources
,
ResourcesInfo
,
...
...
db/model/jt/projectBjtj.js
View file @
97afd353
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
const
Project
=
require
(
'./project'
);
const
Project
=
require
(
'./project'
);
// 核心边界条件
const
projectBjtj
=
sequelize
.
define
(
'projectBjtj'
,
{
id
:
{
...
...
@@ -66,7 +66,7 @@ const projectBjtj = sequelize.define('projectBjtj', {
},
bcsm
:
{
type
:
DataTypes
.
STRING
,
comment
:
"核心边界条件补充说明"
comment
:
"核心边界条件补充说明"
},
projectId
:
{
...
...
@@ -76,13 +76,29 @@ const projectBjtj = sequelize.define('projectBjtj', {
model
:
Project
,
// 关联的表名
key
:
'id'
,
// 关联的字段
}
},
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_bjtj'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -90,7 +106,7 @@ const projectBjtj = sequelize.define('projectBjtj', {
// 同步模型到数据库(创建表)
projectBjtj
.
sync
({
force
:
false
,
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
db/model/jt/projectCwpjbjtj.js
View file @
97afd353
...
...
@@ -26,9 +26,24 @@ const projectCwpjbjtj = sequelize.define('projectCwpjbjtj', {
},
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
comment
:
"所属项目ID"
,
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_cwpjbjtj'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/jt/projectCwpjzb.js
View file @
97afd353
...
...
@@ -24,6 +24,22 @@ const projectCwpjzb = sequelize.define('projectCwpjzb', {
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_cwpjzb'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/jt/projectFile.js
View file @
97afd353
...
...
@@ -21,7 +21,23 @@ const ProjectFile = sequelize.define('ProjectFile', {
},
proFieldKey
:
{
type
:
DataTypes
.
STRING
,
//项目表中文件字段key
}
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_file'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -29,7 +45,7 @@ const ProjectFile = sequelize.define('ProjectFile', {
// 同步模型到数据库(创建表)
ProjectFile
.
sync
({
force
:
false
,
//
force
:
false
,
//
// force: true //会删除已存在表并重新创建
// alter: true
})
...
...
db/model/jt/projectFxgl.js
View file @
97afd353
...
...
@@ -19,16 +19,32 @@ const ProjectFxgl = sequelize.define('ProjectFxgl', {
ydcs
:
{
type
:
DataTypes
.
TEXT
,
comment
:
"应对措施"
},
},
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_fxgl'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -36,7 +52,7 @@ const ProjectFxgl = sequelize.define('ProjectFxgl', {
// 同步模型到数据库(创建表)
ProjectFxgl
.
sync
({
force
:
false
,
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
db/model/jt/projectGdxx.js
View file @
97afd353
...
...
@@ -50,6 +50,22 @@ const ProjectGdxx = sequelize.define('ProjectGdxx', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_gdxx'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/jt/projectJczt.js
View file @
97afd353
...
...
@@ -24,6 +24,22 @@ const ProjectJczt = sequelize.define('ProjectJczt', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_jczt'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/jt/projectJsgm.js
View file @
97afd353
...
...
@@ -33,6 +33,22 @@ const ProjectJsgm = sequelize.define('ProjectJsgm', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_jsgm'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/jt/projectLcbjd.js
View file @
97afd353
...
...
@@ -17,18 +17,18 @@ const ProjectLcbjd = sequelize.define('ProjectLcbjd', {
primaryKey
:
true
,
autoIncrement
:
true
},
lcbjdmc
:
{
type
:
DataTypes
.
STRING
,
comment
:
"里程碑节点名称"
comment
:
"里程碑节点名称"
},
jdwcms
:
{
type
:
DataTypes
.
TEXT
,
comment
:
"节点完成描述"
comment
:
"节点完成描述"
},
yjwcsj
:
{
type
:
DataTypes
.
DATE
,
comment
:
"预计完成时间"
comment
:
"预计完成时间"
},
projectId
:
{
...
...
@@ -40,6 +40,22 @@ const ProjectLcbjd = sequelize.define('ProjectLcbjd', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_lcbjd'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/jt/projectSpyj.js
View file @
97afd353
...
...
@@ -31,10 +31,12 @@ const ProjectSpyj = sequelize.define('ProjectSpyj', {
},
zxhf
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"执行回复"
},
zxhfsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"执行回复时间"
},
zxhffj
:
{
type
:
DataTypes
.
INTEGER
,
references
:
{
model
:
File
,
key
:
'id'
},
allowNull
:
true
,
comment
:
"执行回复附件"
},
zxhffj
:
{
type
:
DataTypes
.
INTEGER
,
references
:
{
model
:
File
,
key
:
'id'
},
allowNull
:
true
,
comment
:
"执行回复附件"
},
wlsqksm
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"未落实情况说明"
},
projectId
:
{
...
...
@@ -46,6 +48,22 @@ const ProjectSpyj = sequelize.define('ProjectSpyj', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_spyj'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/jt/projectTjjh.js
View file @
97afd353
...
...
@@ -13,16 +13,32 @@ const ProjectTjjh = sequelize.define('ProjectTjjh', {
sjx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"数据项"
},
hj
:
{
type
:
DataTypes
.
DECIMAL
(
20
,
4
),
allowNull
:
true
,
comment
:
"数据项"
},
sz
:
{
type
:
DataTypes
.
JSON
,
allowNull
:
true
,
comment
:
"数值"
},
rawNum
:
{
type
:
DataTypes
.
INTEGER
},
//行数
rawNum
:
{
type
:
DataTypes
.
INTEGER
},
//行数
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_tzzjll'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -30,7 +46,7 @@ const ProjectTjjh = sequelize.define('ProjectTjjh', {
// 同步模型到数据库(创建表)
ProjectTjjh
.
sync
({
force
:
false
,
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
db/model/jt/projectTzsyzb.js
View file @
97afd353
...
...
@@ -9,18 +9,34 @@ const ProjectTzsyzb = sequelize.define('ProjectTzsyzb', {
primaryKey
:
true
,
autoIncrement
:
true
},
pjzb
:{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"评价指标"
},
jczb
:
{
type
:
DataTypes
.
STRING
,
comment
:
'决策指标'
},
xzzb
:
{
type
:
DataTypes
.
STRING
,
comment
:
'现状指标'
},
pjzb
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"评价指标"
},
jczb
:
{
type
:
DataTypes
.
STRING
,
comment
:
'决策指标'
},
xzzb
:
{
type
:
DataTypes
.
STRING
,
comment
:
'现状指标'
},
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_tzsyzb'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -28,7 +44,7 @@ const ProjectTzsyzb = sequelize.define('ProjectTzsyzb', {
// 同步模型到数据库(创建表)
ProjectTzsyzb
.
sync
({
force
:
false
,
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
db/model/jt/projectTzzjll.js
View file @
97afd353
...
...
@@ -13,16 +13,32 @@ const ProjectTzzjll = sequelize.define('ProjectTzzjll', {
sdsqjxjll
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"所得税前净现金流量"
},
tzsds
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"调整所得税"
},
sdshjxjll
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"所得税后净现金流量"
},
year
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"年份"
},
year
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"年份"
},
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_tzzjll'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -30,7 +46,7 @@ const ProjectTzzjll = sequelize.define('ProjectTzzjll', {
// 同步模型到数据库(创建表)
ProjectTzzjll
.
sync
({
force
:
false
,
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
db/model/jt/projectTzzt.js
View file @
97afd353
...
...
@@ -8,7 +8,7 @@ const ProjectTzzt = sequelize.define('ProjectTzzt', {
primaryKey
:
true
,
autoIncrement
:
true
},
hylx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"会议类型"
},
hylx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"会议类型"
},
jc
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"届次"
},
zkrq
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"召开日期"
},
jl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"结论"
},
...
...
@@ -16,12 +16,28 @@ const ProjectTzzt = sequelize.define('ProjectTzzt', {
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_tzzt'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -29,7 +45,7 @@ const ProjectTzzt = sequelize.define('ProjectTzzt', {
// 同步模型到数据库(创建表)
ProjectTzzt
.
sync
({
force
:
false
,
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
db/model/jt/projectXmtzze.js
View file @
97afd353
...
...
@@ -18,7 +18,7 @@ const ProjectXmtzze = sequelize.define('ProjectXmtzze', {
},
zb
:
{
type
:
DataTypes
.
STRING
,
comment
:
"指标"
comment
:
"指标"
},
dw
:
{
type
:
DataTypes
.
STRING
,
...
...
@@ -37,13 +37,29 @@ const ProjectXmtzze = sequelize.define('ProjectXmtzze', {
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_project_xmtzze'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -51,7 +67,7 @@ const ProjectXmtzze = sequelize.define('ProjectXmtzze', {
// 同步模型到数据库(创建表)
ProjectXmtzze
.
sync
({
force
:
false
,
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
db/model/jt/resources.js
View file @
97afd353
...
...
@@ -33,6 +33,22 @@ const Resources = sequelize.define('Resources', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_resources'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/system/depart.js
View file @
97afd353
...
...
@@ -25,6 +25,22 @@ const Depart = sequelize.define('Depart', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'system_depart'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/system/excel.js
View file @
97afd353
...
...
@@ -40,7 +40,7 @@ const ExcelRecord = sequelize.define('ExcelRecord', {
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"查询条件"
},
},
status
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"1.未完成 2. 完成"
...
...
@@ -53,6 +53,22 @@ const ExcelRecord = sequelize.define('ExcelRecord', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'system_excel_record'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/system/file.js
View file @
97afd353
...
...
@@ -37,6 +37,22 @@ const File = sequelize.define('File', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'system_file'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/system/position.js
View file @
97afd353
...
...
@@ -19,12 +19,28 @@ const Position = sequelize.define('Position', {
type
:
DataTypes
.
STRING
,
commnet
:
"职位名称"
,
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'system_position'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -32,7 +48,7 @@ const Position = sequelize.define('Position', {
// 同步模型到数据库(创建表)
Position
.
sync
({
force
:
false
,
// force: true 会删除已存在表并重新创建
force
:
false
,
// force: true 会删除已存在表并重新创建
// alter: true
})
.
then
(()
=>
{
...
...
db/model/system/role.js
View file @
97afd353
...
...
@@ -27,6 +27,22 @@ const Role = sequelize.define('Role', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'system_role'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
db/model/system/user.js
View file @
97afd353
// models/User.js
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
const
moment
=
require
(
'moment'
);
const
User
=
sequelize
.
define
(
'User'
,
{
// 定义字段
...
...
@@ -41,6 +42,22 @@ const User = sequelize.define('User', {
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
createdAt
:
{
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
):
''
;
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
defaultValue
:
new
Date
(),
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
):
''
;
}
}
},
{
tableName
:
'system_user'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
...
...
@@ -48,7 +65,7 @@ const User = sequelize.define('User', {
// 同步模型到数据库(创建表)
User
.
sync
({
force
:
false
,
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
db/model/system/userPosition.js
View file @
97afd353
...
...
@@ -17,7 +17,7 @@ const UserPosition = sequelize.define('UserPosition', {
},
posiId
:
{
type
:
DataTypes
.
INTEGER
,
references
:
{
model
:
User
Position
,
key
:
'id'
}
references
:
{
model
:
Position
,
key
:
'id'
}
}
},
{
tableName
:
'system_user_position'
,
// 指定表名(如果与模型名不同)
...
...
@@ -26,7 +26,8 @@ const UserPosition = sequelize.define('UserPosition', {
// 同步模型到数据库(创建表)
UserPosition
.
sync
({
// force: false, // force: true 会删除已存在表并重新创建
// force: false,
force
:
true
//会删除已存在表并重新创建
// alter: true
})
.
then
(()
=>
{
...
...
module/userModule.js
View file @
97afd353
...
...
@@ -10,10 +10,10 @@ async function setUserRole(userId, roleIds, roles) {
let
dbIds
=
[],
needAddIds
=
[],
needDelIds
=
[];
for
(
let
index
=
0
;
index
<
roles
.
length
;
index
++
)
{
const
element
=
roles
[
index
];
dbIds
.
push
(
element
.
roleI
d
);
if
(
!
roleIds
.
includes
(
element
.
roleI
d
))
{
dbIds
.
push
(
element
.
i
d
);
if
(
!
roleIds
.
includes
(
element
.
i
d
))
{
// 1. roleIds里面没有 但是关系表里有的 需要删除
needDelIds
.
push
(
element
.
roleI
d
);
needDelIds
.
push
(
element
.
i
d
);
}
}
for
(
let
index
=
0
;
index
<
roleIds
.
length
;
index
++
)
{
...
...
@@ -43,10 +43,10 @@ async function setUserDepart(userId, departIds, departs) {
let
dbIds
=
[],
needAddIds
=
[],
needDelIds
=
[];
for
(
let
index
=
0
;
index
<
departs
.
length
;
index
++
)
{
const
element
=
departs
[
index
];
dbIds
.
push
(
element
.
roleI
d
);
if
(
!
departIds
.
includes
(
element
.
roleI
d
))
{
dbIds
.
push
(
element
.
i
d
);
if
(
!
departIds
.
includes
(
element
.
i
d
))
{
// 1. departIds里面没有 但是关系表里有的 需要删除
needDelIds
.
push
(
element
.
roleI
d
);
needDelIds
.
push
(
element
.
i
d
);
}
}
for
(
let
index
=
0
;
index
<
departIds
.
length
;
index
++
)
{
...
...
@@ -76,10 +76,10 @@ async function setUserPosition(userId, positionIds, positions) {
let
dbIds
=
[],
needAddIds
=
[],
needDelIds
=
[];
for
(
let
index
=
0
;
index
<
positions
.
length
;
index
++
)
{
const
element
=
positions
[
index
];
dbIds
.
push
(
element
.
roleI
d
);
if
(
!
positionIds
.
includes
(
element
.
roleI
d
))
{
dbIds
.
push
(
element
.
i
d
);
if
(
!
positionIds
.
includes
(
element
.
i
d
))
{
// 1. departIds里面没有 但是关系表里有的 需要删除
needDelIds
.
push
(
element
.
roleI
d
);
needDelIds
.
push
(
element
.
i
d
);
}
}
for
(
let
index
=
0
;
index
<
positionIds
.
length
;
index
++
)
{
...
...
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