明树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
76b3edcb
Commit
76b3edcb
authored
Feb 02, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2d8b7b29
Pipeline
#106875
passed with stage
in 4 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
363 additions
and
2 deletions
+363
-2
projectRcController.js
controller/projectRcController.js
+174
-0
index.js
db/index.js
+4
-0
rcTzdagl.js
db/model/jt/rcTzdagl.js
+92
-0
rcTzjh.js
db/model/jt/rcTzjh.js
+1
-1
rcXxhjs.js
db/model/jt/rcXxhjs.js
+82
-0
projectRouter.js
router/projectRouter.js
+10
-1
No files found.
controller/projectRcController.js
View file @
76b3edcb
...
...
@@ -541,6 +541,168 @@ async function deleteTwhgl(req, res, next) {
}
}
// ---------------- 信息化建设管理 RcTwhgl ----------------
// 创建信息化建设
async
function
createXxhjs
(
req
,
res
,
next
)
{
try
{
req
.
body
.
creator
=
req
.
user
.
id
;
let
ret
=
await
DB
.
RcXxhjs
.
create
(
req
.
body
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
// 更新信息化建设
async
function
updateXxhjs
(
req
,
res
,
next
)
{
try
{
if
(
!
req
.
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
}
let
ret
=
await
DB
.
RcXxhjs
.
findOne
({
where
:
{
id
:
req
.
body
.
id
},
raw
:
true
});
if
(
!
(
ret
&&
ret
.
id
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
await
DB
.
RcXxhjs
.
update
(
req
.
body
,
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
}
catch
(
error
)
{
next
(
error
);
}
}
// 获取单个信息化建设
async
function
getXxhjs
(
req
,
res
,
next
)
{
try
{
if
(
!
req
.
body
.
id
)
return
res
.
sendError
(
errorMessage
.
paramsError
);
let
info
=
await
DB
.
RcXxhjs
.
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
getXxhjsList
(
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
.
meetingName
)
{
where
.
meetingName
=
{
[
Op
.
like
]:
`%
${
req
.
body
.
meetingName
}
%`
};
}
if
(
req
.
body
.
projectId
)
{
where
.
projectId
=
req
.
body
.
projectId
;
}
search
.
where
=
where
;
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
search
.
attributes
=
req
.
body
.
attributes
;
}
let
ret
=
await
DB
.
RcXxhjs
.
findAndCountAll
(
search
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
// 删除信息化建设
async
function
deleteXxhjs
(
req
,
res
,
next
)
{
try
{
await
DB
.
RcXxhjs
.
update
({
del
:
1
},
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
}
catch
(
error
)
{
next
(
error
);
}
}
// ---------------- 投资档案管理管理 RcTwhgl ----------------
// 创建投资档案管理
async
function
createTzdagl
(
req
,
res
,
next
)
{
try
{
req
.
body
.
creator
=
req
.
user
.
id
;
let
ret
=
await
DB
.
RcTzdagl
.
create
(
req
.
body
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
// 更新投资档案管理
async
function
updateTzdagl
(
req
,
res
,
next
)
{
try
{
if
(
!
req
.
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
}
let
ret
=
await
DB
.
RcTzdagl
.
findOne
({
where
:
{
id
:
req
.
body
.
id
},
raw
:
true
});
if
(
!
(
ret
&&
ret
.
id
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
await
DB
.
RcTzdagl
.
update
(
req
.
body
,
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
}
catch
(
error
)
{
next
(
error
);
}
}
// 获取单个投资档案管理
async
function
getTzdagl
(
req
,
res
,
next
)
{
try
{
if
(
!
req
.
body
.
id
)
return
res
.
sendError
(
errorMessage
.
paramsError
);
let
info
=
await
DB
.
RcTzdagl
.
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
getTzdaglList
(
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
.
meetingName
)
{
where
.
meetingName
=
{
[
Op
.
like
]:
`%
${
req
.
body
.
meetingName
}
%`
};
}
if
(
req
.
body
.
projectId
)
{
where
.
projectId
=
req
.
body
.
projectId
;
}
search
.
where
=
where
;
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
search
.
attributes
=
req
.
body
.
attributes
;
}
let
ret
=
await
DB
.
RcTzdagl
.
findAndCountAll
(
search
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
// 删除投资档案管理
async
function
deleteTzdagl
(
req
,
res
,
next
)
{
try
{
await
DB
.
RcTzdagl
.
update
({
del
:
1
},
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
}
catch
(
error
)
{
next
(
error
);
}
}
module
.
exports
=
{
createTxjs
,
updateTxjs
,
...
...
@@ -577,4 +739,16 @@ module.exports = {
getTzjh
,
getTzjhList
,
deleteTzjh
,
createXxhjs
,
updateXxhjs
,
getXxhjs
,
getXxhjsList
,
deleteXxhjs
,
createTzdagl
,
updateTzdagl
,
getTzdagl
,
getTzdaglList
,
deleteTzdagl
,
}
\ No newline at end of file
db/index.js
View file @
76b3edcb
...
...
@@ -87,6 +87,8 @@ const RcTzgh = require('./model/jt/rcTzgh');
const
RcXxbs
=
require
(
'./model/jt/rcXxbs'
);
const
RcTwhgl
=
require
(
'./model/jt/rcTwhgl'
);
const
RcTzjh
=
require
(
'./model/jt/rcTzjh'
);
const
RcXxhjs
=
require
(
'./model/jt/rcXxhjs'
);
const
RcTzdagl
=
require
(
'./model/jt/rcTzdagl'
);
/**
* 业务表
*/
...
...
@@ -172,6 +174,8 @@ global.DB = {
RcTwhgl
,
RcXxbs
,
RcTzjh
,
RcXxhjs
,
RcTzdagl
,
}
...
...
db/model/jt/rcTzdagl.js
0 → 100644
View file @
76b3edcb
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
const
moment
=
require
(
'moment'
);
//投中管理- 投资规划
const
RcTzdagl
=
sequelize
.
define
(
'RcTzdagl'
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
archiveCategory
:
{
type
:
DataTypes
.
STRING
(
100
),
allowNull
:
false
,
comment
:
'档案分类'
},
archiveName
:
{
type
:
DataTypes
.
STRING
(
200
),
allowNull
:
false
,
comment
:
'档案名称'
},
archiveNumber
:
{
type
:
DataTypes
.
STRING
(
100
),
allowNull
:
true
,
comment
:
'档案编号'
},
archiveDate
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
'档案日期'
,
get
()
{
const
rawValue
=
this
.
getDataValue
(
'archiveDate'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD'
)
:
''
;
}
},
remark
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
'备注'
},
fjsc
:
{
type
:
DataTypes
.
JSON
,
comment
:
"附件上传"
},
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
creator
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"创建人"
},
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_tzdagl'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
RcTzdagl
.
sync
({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter
:
true
})
.
then
(()
=>
{
console
.
log
(
'RcTzdagl 表同步成功'
);
});
module
.
exports
=
RcTzdagl
;
\ No newline at end of file
db/model/jt/rcTzjh.js
View file @
76b3edcb
...
...
@@ -2,7 +2,7 @@ const { DataTypes } = require('sequelize');
const
sequelize
=
require
(
'../index'
);
const
moment
=
require
(
'moment'
);
//投中管理- 投资
规
划
//投中管理- 投资
计
划
const
RcTzjh
=
sequelize
.
define
(
'RcTzjh'
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
...
...
db/model/jt/rcXxhjs.js
0 → 100644
View file @
76b3edcb
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
const
moment
=
require
(
'moment'
);
//投中管理- 投资规划
const
RcXxhjs
=
sequelize
.
define
(
'RcXxhjs'
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
issueTitle
:
{
type
:
DataTypes
.
STRING
(
200
),
allowNull
:
false
,
comment
:
'问题标题'
},
issueCategory
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
comment
:
'问题类别'
},
issueDescription
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
false
,
comment
:
'问题描述'
},
remark
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
'备注'
},
fjsc
:
{
type
:
DataTypes
.
JSON
,
comment
:
"附件上传"
},
// projectId: {
// type: DataTypes.INTEGER,
// comment: "所属项目ID",
// },
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
},
creator
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"创建人"
},
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_xxhjs'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
RcXxhjs
.
sync
({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter
:
true
})
.
then
(()
=>
{
console
.
log
(
'RcXxhjs 表同步成功'
);
});
module
.
exports
=
RcXxhjs
;
\ No newline at end of file
router/projectRouter.js
View file @
76b3edcb
...
...
@@ -184,6 +184,11 @@ router.post('/getTwhglList', projectRcController.getTwhglList);
router
.
post
(
'/deleteTwhgl'
,
projectRcController
.
deleteTwhgl
);
//4.6 投资档案管理
router
.
post
(
'/createTzdagl'
,
projectRcController
.
createTzdagl
);
router
.
post
(
'/updateTzdagl'
,
projectRcController
.
updateTzdagl
);
router
.
post
(
'/getTzdagl'
,
projectRcController
.
getTzdagl
);
router
.
post
(
'/getTzdaglList'
,
projectRcController
.
getTzdaglList
);
router
.
post
(
'/deleteTzdagl'
,
projectRcController
.
deleteTzdagl
);
//4.7 参股企业管理 z
router
.
post
(
'/createCgqygl'
,
projectRcController
.
createCgqygl
);
...
...
@@ -193,7 +198,11 @@ router.post('/getCgqyglList', projectRcController.getCgqyglList);
router
.
post
(
'/deleteCgqygl'
,
projectRcController
.
deleteCgqygl
);
//4.8 信息化建设
router
.
post
(
'/createXxhjs'
,
projectRcController
.
createXxhjs
);
router
.
post
(
'/updateXxhjs'
,
projectRcController
.
updateXxhjs
);
router
.
post
(
'/getXxhjs'
,
projectRcController
.
getXxhjs
);
router
.
post
(
'/getXxhjsList'
,
projectRcController
.
getXxhjsList
);
router
.
post
(
'/deleteXxhjs'
,
projectRcController
.
deleteXxhjs
);
...
...
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