明树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
22bcd01f
Commit
22bcd01f
authored
Jan 29, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2ceedc38
Pipeline
#106720
passed with stage
in 3 seconds
Changes
9
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
186 additions
and
160 deletions
+186
-160
a.js
a.js
+0
-0
projectRcController.js
controller/projectRcController.js
+102
-45
index.js
db/index.js
+12
-11
rcTwhgl.js
db/model/jt/rcTwhgl.js
+1
-3
rcTxjs.js
db/model/jt/rcTxjs.js
+28
-7
rcTxjswj.js
db/model/jt/rcTxjswj.js
+0
-77
rcTzgh.js
db/model/jt/rcTzgh.js
+10
-10
rcXxbs.js
db/model/jt/rcXxbs.js
+28
-3
projectRouter.js
router/projectRouter.js
+5
-4
No files found.
a.js
0 → 100644
View file @
22bcd01f
controller/projectRcController.js
View file @
22bcd01f
...
@@ -3,6 +3,89 @@ const _ = require("lodash");
...
@@ -3,6 +3,89 @@ const _ = require("lodash");
const
{
Op
}
=
require
(
'sequelize'
);
const
{
Op
}
=
require
(
'sequelize'
);
// ---------------- 信息报送 RcXxbs ----------------
// 创建信息报送
async
function
createXxbs
(
req
,
res
,
next
)
{
try
{
req
.
body
.
creator
=
req
.
user
.
id
;
let
ret
=
await
DB
.
RcXxbs
.
create
(
req
.
body
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
// 更新信息报送
async
function
updateXxbs
(
req
,
res
,
next
)
{
try
{
if
(
!
req
.
body
.
id
)
return
res
.
sendError
(
errorMessage
.
paramsError
);
let
ret
=
await
DB
.
RcXxbs
.
findOne
({
where
:
{
id
:
req
.
body
.
id
},
raw
:
true
});
if
(
!
(
ret
&&
ret
.
id
))
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
await
DB
.
RcXxbs
.
update
(
req
.
body
,
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
}
catch
(
error
)
{
next
(
error
);
}
}
// 获取单个信息报送
async
function
getXxbs
(
req
,
res
,
next
)
{
try
{
if
(
!
req
.
body
.
id
)
return
res
.
sendError
(
errorMessage
.
paramsError
);
let
info
=
await
DB
.
RcXxbs
.
findOne
({
where
:
{
id
:
req
.
body
.
id
,
del
:
0
},
raw
:
true
});
if
(
!
(
info
&&
info
.
id
))
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
return
res
.
sendData
(
info
);
}
catch
(
error
)
{
next
(
error
);
}
}
// 获取信息报送列表
async
function
getXxbsList
(
req
,
res
,
next
)
{
try
{
let
page
=
req
.
body
.
page
||
1
;
let
limit
=
req
.
body
.
pagesize
||
req
.
body
.
pageSize
||
10
;
let
offset
=
(
page
-
1
)
*
limit
;
let
search
=
{};
search
.
order
=
[[
'createdAt'
,
'DESC'
]];
search
.
limit
=
limit
;
search
.
offset
=
offset
;
let
where
=
{
del
:
0
};
if
(
req
.
body
.
wjmc
)
{
where
.
wjmc
=
{
[
Op
.
like
]:
`%
${
req
.
body
.
wjmc
}
%`
};
}
if
(
req
.
body
.
bzr
)
{
where
.
bzr
=
{
[
Op
.
like
]:
`%
${
req
.
body
.
bzr
}
%`
};
}
if
(
req
.
body
.
projectId
)
{
where
.
projectId
=
req
.
body
.
projectId
;
}
if
(
req
.
body
.
nd
)
{
where
.
nd
=
req
.
body
.
nd
;
}
search
.
where
=
where
;
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
search
.
attributes
=
req
.
body
.
attributes
;
}
let
ret
=
await
DB
.
RcXxbs
.
findAndCountAll
(
search
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
// 删除信息报送
async
function
deleteXxbs
(
req
,
res
,
next
)
{
try
{
await
DB
.
RcXxbs
.
update
({
del
:
1
},
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
}
catch
(
error
)
{
next
(
error
);
}
}
// ---------------- 投资规划 RcTzgh ----------------
// ---------------- 投资规划 RcTzgh ----------------
// 创建投资规划
// 创建投资规划
async
function
createTzgh
(
req
,
res
,
next
)
{
async
function
createTzgh
(
req
,
res
,
next
)
{
...
@@ -95,20 +178,8 @@ async function deleteTzgh(req, res, next) {
...
@@ -95,20 +178,8 @@ async function deleteTzgh(req, res, next) {
async
function
createTxjs
(
req
,
res
,
next
)
{
async
function
createTxjs
(
req
,
res
,
next
)
{
try
{
try
{
req
.
body
.
creator
=
req
.
user
.
id
;
req
.
body
.
creator
=
req
.
user
.
id
;
if
(
!
req
.
body
.
projectId
)
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
}
// 创建主表
let
ret
=
await
DB
.
RcTxjs
.
create
(
req
.
body
);
let
ret
=
await
DB
.
RcTxjs
.
create
(
req
.
body
);
// 处理附件/子表
let
wjs
=
(
req
.
body
.
rcTxjsWjs
||
[]).
map
(
o
=>
{
o
.
projectId
=
req
.
body
.
projectId
;
o
.
sourceId
=
ret
.
id
;
return
o
});
if
(
wjs
.
length
)
{
await
DB
.
RcTxjsWj
.
bulkCreate
(
wjs
);
}
return
res
.
sendData
(
ret
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
}
}
...
@@ -116,27 +187,13 @@ async function createTxjs(req, res, next) {
...
@@ -116,27 +187,13 @@ async function createTxjs(req, res, next) {
async
function
updateTxjs
(
req
,
res
,
next
)
{
async
function
updateTxjs
(
req
,
res
,
next
)
{
try
{
try
{
if
(
!
(
req
.
body
.
id
&&
req
.
body
.
projectId
)
)
{
if
(
!
req
.
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
return
res
.
sendError
(
errorMessage
.
paramsError
);
}
}
let
ret
=
await
DB
.
RcTxjs
.
findOne
({
where
:
{
id
:
req
.
body
.
id
},
raw
:
true
});
let
ret
=
await
DB
.
RcTxjs
.
findOne
({
where
:
{
id
:
req
.
body
.
id
},
raw
:
true
});
if
(
!
(
ret
&&
ret
.
id
))
{
if
(
!
(
ret
&&
ret
.
id
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
}
// 处理子表 rc 文件
let
arr
=
req
.
body
.
rcTxjsWjs
||
[];
let
ids
=
[],
infos
=
[],
newArr
=
[];
(
arr
||
[]).
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
req
.
body
.
projectId
;
o
.
sourceId
=
ret
.
id
;
newArr
.
push
(
o
);
}
}
else
{
ids
.
push
(
o
.
id
);
infos
.
push
(
o
);
}
return
o
;
});
await
DB
.
RcTxjsWj
.
destroy
({
where
:
{
projectId
:
req
.
body
.
projectId
,
sourceId
:
ret
.
id
,
id
:
{
[
Op
.
notIn
]:
ids
}
}
});
if
(
newArr
.
length
)
await
DB
.
RcTxjsWj
.
bulkCreate
(
newArr
);
await
Promise
.
all
(
infos
.
map
(
item
=>
{
return
DB
.
RcTxjsWj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
await
DB
.
RcTxjs
.
update
(
req
.
body
,
{
where
:
{
id
:
req
.
body
.
id
}
});
await
DB
.
RcTxjs
.
update
(
req
.
body
,
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
return
res
.
sendData
({});
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -145,18 +202,13 @@ async function updateTxjs(req, res, next) {
...
@@ -145,18 +202,13 @@ async function updateTxjs(req, res, next) {
}
}
async
function
getTxjs
(
req
,
res
,
next
)
{
async
function
getTxjs
(
req
,
res
,
next
)
{
try
{
try
{
let
search
=
{};
if
(
!
req
.
body
.
id
)
{
if
(
req
.
body
.
id
)
search
.
id
=
req
.
body
.
id
;
if
(
req
.
body
.
projectId
)
search
.
projectId
=
req
.
body
.
projectId
;
if
(
_
.
isEmpty
(
search
))
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
return
res
.
sendError
(
errorMessage
.
paramsError
);
}
}
let
tx
=
await
DB
.
RcTxjs
.
findOne
({
where
:
search
,
raw
:
true
});
let
tx
=
await
DB
.
RcTxjs
.
findOne
({
where
:
{
id
:
req
.
body
.
id
}
,
raw
:
true
});
if
(
!
(
tx
&&
tx
.
id
&&
tx
.
projectId
))
{
if
(
!
(
tx
&&
tx
.
id
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
}
let
wjs
=
await
DB
.
RcTxjsWj
.
findAll
({
where
:
{
projectId
:
tx
.
projectId
,
sourceId
:
tx
.
id
},
raw
:
true
});
tx
.
rcTxjsWjs
=
wjs
||
[];
return
res
.
sendData
(
tx
);
return
res
.
sendData
(
tx
);
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
...
@@ -169,23 +221,21 @@ async function getTxjsList(req, res, next) {
...
@@ -169,23 +221,21 @@ async function getTxjsList(req, res, next) {
let
page
=
req
.
body
.
page
||
1
;
let
page
=
req
.
body
.
page
||
1
;
let
limit
=
req
.
body
.
pagesize
||
req
.
body
.
pageSize
||
10
;
let
limit
=
req
.
body
.
pagesize
||
req
.
body
.
pageSize
||
10
;
let
offset
=
(
page
-
1
)
*
limit
;
let
offset
=
(
page
-
1
)
*
limit
;
let
search
=
{};
let
search
=
{};
search
.
order
=
[[
'createdAt'
,
'DESC'
]];
search
.
order
=
[[
'createdAt'
,
'DESC'
]];
search
.
limit
=
limit
;
search
.
limit
=
limit
;
search
.
offset
=
offset
;
search
.
offset
=
offset
;
let
where
=
{
del
:
0
};
let
where
=
{
del
:
0
};
if
(
req
.
body
.
projectName
)
{
if
(
req
.
body
.
wjmc
)
{
where
=
{
where
.
wjmc
=
{
[
Op
.
like
]:
`%
${
req
.
body
.
wjmc
}
%`
};
[
Op
.
or
]:
[
}
{
projectName
:
{
[
Op
.
like
]:
`%
${
req
.
body
.
projectName
}
%`
}
},
if
(
req
.
body
.
wjcj
)
{
],
where
.
wjcj
=
req
.
body
.
wjcj
;
del
:
0
}
}
if
(
req
.
body
.
wjlb
)
{
where
.
wjlb
=
req
.
body
.
wjlb
;
}
}
search
.
where
=
where
;
search
.
where
=
where
;
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
search
.
attributes
=
req
.
body
.
attributes
;
search
.
attributes
=
req
.
body
.
attributes
;
}
}
...
@@ -421,4 +471,11 @@ module.exports = {
...
@@ -421,4 +471,11 @@ module.exports = {
getTzgh
,
getTzgh
,
getTzghList
,
getTzghList
,
deleteTzgh
,
deleteTzgh
,
// 信息报送
createXxbs
,
updateXxbs
,
getXxbs
,
getXxbsList
,
deleteXxbs
,
}
}
\ No newline at end of file
db/index.js
View file @
22bcd01f
...
@@ -75,15 +75,17 @@ const ThYyqtzhszb = require('./model/jt/thYyqtzhszb');
...
@@ -75,15 +75,17 @@ const ThYyqtzhszb = require('./model/jt/thYyqtzhszb');
const
ThYyqtzjc
=
require
(
'./model/jt/thYyqtzjc'
);
const
ThYyqtzjc
=
require
(
'./model/jt/thYyqtzjc'
);
const
ThYyqtzjcTzfx
=
require
(
'./model/jt/thYyqtzjcTzfx'
);
const
ThYyqtzjcTzfx
=
require
(
'./model/jt/thYyqtzjcTzfx'
);
const
ThYyqtzjcZxjc
=
require
(
'./model/jt/thYyqtzjcZxjc'
);
const
ThYyqtzjcZxjc
=
require
(
'./model/jt/thYyqtzjcZxjc'
);
const
ThYyqtzjcrcjc
=
require
(
'./model/jt/thYyqtzjcrcjc'
);
//
const ThYyqtzjcrcjc = require('./model/jt/thYyqtzjcrcjc');
const
ThYjgl
=
require
(
"./model/jt/thYjgl"
);
const
ThYjgl
=
require
(
"./model/jt/thYjgl"
);
const
RcTxjs
=
require
(
'./model/jt/rcTxjs'
);
const
RcTxjs
=
require
(
'./model/jt/rcTxjs'
);
const
RcTxjsWj
=
require
(
'./model/jt/rcTxjswj'
);
const
RcCgqygl
=
require
(
'./model/jt/rcCgqygl'
);
const
RcCgqygl
=
require
(
'./model/jt/rcCgqygl'
);
const
RcCgqyglTzfh
=
require
(
'./model/jt/rcCgqyglTzfh'
);
const
RcCgqyglTzfh
=
require
(
'./model/jt/rcCgqyglTzfh'
);
const
RcCgqyglWtyy
=
require
(
'./model/jt/rcCgqyglWtyy'
);
const
RcCgqyglWtyy
=
require
(
'./model/jt/rcCgqyglWtyy'
);
const
RcTzgh
=
require
(
'./model/jt/rcTzgh'
);
const
RcXxbs
=
require
(
'./model/jt/rcXxbs'
);
const
RcTwhgl
=
require
(
'./model/jt/rcTwhgl'
);
/**
/**
* 业务表
* 业务表
*/
*/
...
@@ -139,15 +141,15 @@ global.DB = {
...
@@ -139,15 +141,15 @@ global.DB = {
TzZdfx
,
TzZdfx
,
TzZdfxcz
,
TzZdfxcz
,
TzZdfxcwzb
,
//
TzZdfxcwzb,
TzZdfxqk
,
//
TzZdfxqk,
TzJsqtzjc
,
TzJsqtzjc
,
TzJsqtzjcTzfx
,
TzJsqtzjcTzfx
,
TzJsqtzjcrcjc
,
//
TzJsqtzjcrcjc,
TzJsqtzjcZxjc
,
TzJsqtzjcZxjc
,
TzZdsxsp
,
TzZdsxsp
,
TzZdsxspfl
,
//
TzZdsxspfl,
TzXmtc
,
TzXmtc
,
TzXmtcCwzb
,
TzXmtcCwzb
,
...
@@ -158,17 +160,16 @@ global.DB = {
...
@@ -158,17 +160,16 @@ global.DB = {
ThYyqtzjc
,
ThYyqtzjc
,
ThYyqtzjcTzfx
,
ThYyqtzjcTzfx
,
ThYyqtzjcZxjc
,
ThYyqtzjcZxjc
,
ThYyqtzjcrcjc
,
//
ThYyqtzjcrcjc,
ThYjgl
,
ThYjgl
,
RcTxjs
,
RcTxjs
,
RcTxjsWj
,
RcCgqygl
,
RcCgqygl
,
RcCgqyglTzfh
,
RcCgqyglTzfh
,
RcCgqyglWtyy
,
RcCgqyglWtyy
,
RcTzgh
,
RcTwhgl
,
RcXxbs
,
}
}
...
...
db/model/jt/rcTwhgl.js
View file @
22bcd01f
...
@@ -32,9 +32,7 @@ const RcTwhgl = sequelize.define('RcTwhgl', {
...
@@ -32,9 +32,7 @@ const RcTwhgl = sequelize.define('RcTwhgl', {
comment
:
'会议地点'
comment
:
'会议地点'
},
},
meetingLevel
:
{
meetingLevel
:
{
type
:
DataTypes
.
ENUM
(
'company'
,
'department'
,
'project'
),
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
defaultValue
:
'company'
,
comment
:
'会议层级:company-公司级,department-部门级,project-项目级'
comment
:
'会议层级:company-公司级,department-部门级,project-项目级'
},
},
attendingLeaders
:
{
attendingLeaders
:
{
...
...
db/model/jt/rcTxjs.js
View file @
22bcd01f
...
@@ -9,19 +9,40 @@ const RcTxjs = sequelize.define('RcTxjs', {
...
@@ -9,19 +9,40 @@ const RcTxjs = sequelize.define('RcTxjs', {
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
autoIncrement
:
true
},
},
projectName
:
{
wjmc
:
{
type
:
DataTypes
.
STRING
,
type
:
DataTypes
.
STRING
,
comment
:
"
项目
名称"
,
comment
:
"
文件
名称"
,
},
},
bbsj
:
{
type
:
DataTypes
.
DATE
,
get
()
{
const
rawValue
=
this
.
getDataValue
(
'bbsj'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD'
)
:
''
;
}
},
wjcj
:
{
type
:
DataTypes
.
STRING
,
comment
:
"文件层级"
,
},
wjlb
:
{
type
:
DataTypes
.
STRING
,
comment
:
"文件类别"
,
},
fjsc
:
{
type
:
DataTypes
.
JSON
,
comment
:
"附件上传"
,
},
creator
:
{
creator
:
{
type
:
DataTypes
.
INTEGER
,
type
:
DataTypes
.
INTEGER
,
comment
:
"创建人"
comment
:
"创建人"
},
},
projectId
:
{
//
projectId: {
type
:
DataTypes
.
INTEGER
,
//
type: DataTypes.INTEGER,
comment
:
"所属项目ID"
,
//
comment: "所属项目ID",
},
//
},
del
:
{
del
:
{
type
:
DataTypes
.
INTEGER
,
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
defaultValue
:
0
,
...
...
db/model/jt/rcTxjswj.js
deleted
100644 → 0
View file @
2ceedc38
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
const
moment
=
require
(
'moment'
);
//投中管理- 建设期投资检查
const
RcTxjsWj
=
sequelize
.
define
(
'RcTxjsWj'
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
wjlx
:
{
type
:
DataTypes
.
STRING
,
comment
:
"文件类型"
},
wj
:
{
type
:
DataTypes
.
JSON
,
comment
:
"文件上传"
},
wjsm
:
{
type
:
DataTypes
.
TEXT
,
comment
:
"文件说明"
},
cj
:
{
type
:
DataTypes
.
STRING
,
comment
:
"层级"
},
sourceId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属主表id"
},
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
(
'updatedAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
}
}
},
{
tableName
:
'jt_rc_rctxwj'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
RcTxjsWj
.
sync
({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter
:
true
})
.
then
(()
=>
{
console
.
log
(
'RcTxjsWj 表同步成功'
);
});
module
.
exports
=
RcTxjsWj
;
\ No newline at end of file
db/model/jt/rcTzgh.js
View file @
22bcd01f
...
@@ -2,8 +2,8 @@ const { DataTypes } = require('sequelize');
...
@@ -2,8 +2,8 @@ const { DataTypes } = require('sequelize');
const
sequelize
=
require
(
'../index'
);
const
sequelize
=
require
(
'../index'
);
const
moment
=
require
(
'moment'
);
const
moment
=
require
(
'moment'
);
//投中管理-
建设期投资检查
//投中管理-
投资规划
const
RcT
xjsWj
=
sequelize
.
define
(
'RcTxjsWj
'
,
{
const
RcT
zgh
=
sequelize
.
define
(
'RcTzgh
'
,
{
id
:
{
id
:
{
type
:
DataTypes
.
INTEGER
,
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
primaryKey
:
true
,
...
@@ -66,10 +66,10 @@ const RcTxjsWj = sequelize.define('RcTxjsWj', {
...
@@ -66,10 +66,10 @@ const RcTxjsWj = sequelize.define('RcTxjsWj', {
projectId
:
{
//
projectId: {
type
:
DataTypes
.
INTEGER
,
//
type: DataTypes.INTEGER,
comment
:
"所属项目ID"
,
//
comment: "所属项目ID",
},
//
},
del
:
{
del
:
{
type
:
DataTypes
.
INTEGER
,
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
defaultValue
:
0
,
...
@@ -96,19 +96,19 @@ const RcTxjsWj = sequelize.define('RcTxjsWj', {
...
@@ -96,19 +96,19 @@ const RcTxjsWj = sequelize.define('RcTxjsWj', {
}
}
}
}
},
{
},
{
tableName
:
'jt_rc_
rctxwj
'
,
// 指定表名(如果与模型名不同)
tableName
:
'jt_rc_
tzgh
'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
});
// 同步模型到数据库(创建表)
// 同步模型到数据库(创建表)
RcT
xjsWj
.
sync
({
RcT
zgh
.
sync
({
// force: false,
// force: false,
// force: true ,//会删除已存在表并重新创建
// force: true ,//会删除已存在表并重新创建
alter
:
true
alter
:
true
})
})
.
then
(()
=>
{
.
then
(()
=>
{
console
.
log
(
'RcT
xjsWj
表同步成功'
);
console
.
log
(
'RcT
zgh
表同步成功'
);
});
});
module
.
exports
=
RcTxjsWj
;
module
.
exports
=
RcTzgh
;
\ No newline at end of file
\ No newline at end of file
db/model/jt/rcXxbs.js
View file @
22bcd01f
...
@@ -10,7 +10,32 @@ const RcXxbs = sequelize.define('RcXxbs', {
...
@@ -10,7 +10,32 @@ const RcXxbs = sequelize.define('RcXxbs', {
autoIncrement
:
true
autoIncrement
:
true
},
},
nd
:
{
type
:
DataTypes
.
DATE
,
get
()
{
const
rawValue
=
this
.
getDataValue
(
'nd'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY'
)
:
''
;
}
},
wjmc
:
{
type
:
DataTypes
.
STRING
,
comment
:
"文件名称"
,
},
fjsc
:
{
type
:
DataTypes
.
JSON
,
comment
:
"附件上传"
,
},
bzr
:
{
type
:
DataTypes
.
STRING
,
comment
:
"编制人"
,
},
bzrbm
:
{
type
:
DataTypes
.
STRING
(
500
),
comment
:
"编制人部门"
,
},
sourceId
:
{
sourceId
:
{
...
...
router/projectRouter.js
View file @
22bcd01f
...
@@ -166,10 +166,11 @@ router.post('/deleteTzgh', projectRcController.deleteTzgh);
...
@@ -166,10 +166,11 @@ router.post('/deleteTzgh', projectRcController.deleteTzgh);
//4.4 信息报送
//4.4 信息报送
router
.
post
(
'/createXxbs'
,
projectRcController
.
createXxbs
);
router
.
post
(
'/updateXxbs'
,
projectRcController
.
updateXxbs
);
router
.
post
(
'/getXxbs'
,
projectRcController
.
getXxbs
);
router
.
post
(
'/getXxbsList'
,
projectRcController
.
getXxbsList
);
router
.
post
(
'/deleteXxbs'
,
projectRcController
.
deleteXxbs
);
//4.5 投委会管理
//4.5 投委会管理
router
.
post
(
'/createTwhgl'
,
projectRcController
.
createTwhgl
);
router
.
post
(
'/createTwhgl'
,
projectRcController
.
createTwhgl
);
router
.
post
(
'/updateTwhgl'
,
projectRcController
.
updateTwhgl
);
router
.
post
(
'/updateTwhgl'
,
projectRcController
.
updateTwhgl
);
...
...
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