明树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
b016712b
Commit
b016712b
authored
Feb 03, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
9b2d8967
Pipeline
#106926
passed with stage
in 3 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
projectController.js
controller/projectController.js
+4
-0
projectThController.js
controller/projectThController.js
+10
-10
index.js
db/index.js
+2
-1
No files found.
controller/projectController.js
View file @
b016712b
...
...
@@ -362,6 +362,7 @@ async function approvalLixiang(req, res, next) {
userId
:
req
.
user
.
id
,
actionName
:
'立项审批通过'
,
projectId
:
project
.
id
,
content
:
req
.
body
.
approvalMessage
,
});
}
else
{
//待立项
...
...
@@ -370,6 +371,7 @@ async function approvalLixiang(req, res, next) {
userId
:
req
.
user
.
id
,
actionName
:
'立项审批未通过'
,
projectId
:
project
.
id
,
content
:
req
.
body
.
approvalMessage
,
});
}
return
res
.
sendData
(
proInfo
);
...
...
@@ -611,6 +613,7 @@ async function approvalJuece(req, res, next) {
userId
:
req
.
user
.
id
,
actionName
:
'决策审批通过'
,
projectId
:
project
.
id
,
content
:
req
.
body
.
approvalMessage
,
});
}
else
{
//回到 已立项
...
...
@@ -619,6 +622,7 @@ async function approvalJuece(req, res, next) {
userId
:
req
.
user
.
id
,
actionName
:
'决策审批未通过'
,
projectId
:
project
.
id
,
content
:
req
.
body
.
approvalMessage
,
});
}
return
res
.
sendData
(
proInfo
);
...
...
controller/projectThController.js
View file @
b016712b
...
...
@@ -17,7 +17,7 @@ async function createYyqtzhs(req, res, next) {
if
(
!
req
.
body
.
projectId
)
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
}
let
ret
=
await
DB
.
Th
Tz
Yyqtzhs
.
create
(
req
.
body
);
let
ret
=
await
DB
.
ThYyqtzhs
.
create
(
req
.
body
);
// //处理财务指标
// let flattenArr = [];
...
...
@@ -35,7 +35,7 @@ async function createYyqtzhs(req, res, next) {
// }
// delete req.body.yyqtzhss;
// await DB.Th
Tz
Yyqtzhszb.bulkCreate(flattenArr);
// await DB.ThYyqtzhszb.bulkCreate(flattenArr);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
...
...
@@ -51,11 +51,11 @@ async function getYyqtzhsInfo(req, res, next) {
if
(
_
.
isEmpty
(
search
))
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
}
let
tzhs
=
await
DB
.
Th
Tz
Yyqtzhs
.
findOne
({
where
:
search
,
raw
:
true
});
let
tzhs
=
await
DB
.
ThYyqtzhs
.
findOne
({
where
:
search
,
raw
:
true
});
if
(
!
(
tzhs
&&
tzhs
.
id
&&
tzhs
.
projectId
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
// let yyqtzhss = await DB.Th
Tz
Yyqtzhszb.findAll({ where: { projectId: tzhs.projectId, sourceId: req.body.id }, raw: true });
// let yyqtzhss = await DB.ThYyqtzhszb.findAll({ where: { projectId: tzhs.projectId, sourceId: req.body.id }, raw: true });
// tzhs.yyqtzhss = _.values(_.groupBy(yyqtzhss, 'groupBy')) || [[]]
return
res
.
sendData
(
tzhs
);
}
catch
(
error
)
{
...
...
@@ -85,12 +85,12 @@ async function updateYyqtzhs(req, res, next) {
// }
// }
// }
// await DB.Th
Tz
Yyqtzhszb.destroy({ where: { projectId: req.body.projectId, sourceId: req.body.id, id: { [Op.notIn]: ids3 } } }); // 删除id不在传入id数组里面的(用户在界面删除的)
// await DB.Th
Tz
Yyqtzhszb.bulkCreate(newtyyqtzhss);//创建新的 没有id的
// await Promise.all(infos3.map(item => { DB.Th
Tz
Yyqtzhszb.update(item, { where: { id: item.id } }) }));
// await DB.ThYyqtzhszb.destroy({ where: { projectId: req.body.projectId, sourceId: req.body.id, id: { [Op.notIn]: ids3 } } }); // 删除id不在传入id数组里面的(用户在界面删除的)
// await DB.ThYyqtzhszb.bulkCreate(newtyyqtzhss);//创建新的 没有id的
// await Promise.all(infos3.map(item => { DB.ThYyqtzhszb.update(item, { where: { id: item.id } }) }));
// delete req.body.yyqtzhss;
await
DB
.
Th
Tz
Yyqtzhs
.
update
(
req
.
body
,
{
where
:
{
id
:
req
.
body
.
id
}
});
await
DB
.
ThYyqtzhs
.
update
(
req
.
body
,
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
}
catch
(
error
)
{
next
(
error
);
...
...
@@ -121,7 +121,7 @@ async function getYyqtzhsList(req, res, next) {
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
search
.
attributes
=
req
.
body
.
attributes
;
}
let
ret
=
await
DB
.
Th
Tz
Yyqtzhs
.
findAndCountAll
(
search
);
let
ret
=
await
DB
.
ThYyqtzhs
.
findAndCountAll
(
search
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
...
...
@@ -538,7 +538,7 @@ async function getYjglInfo(req, res, next) {
async
function
deleteYyqtzhs
(
req
,
res
,
next
)
{
try
{
await
DB
.
Th
Tz
Yyqtzhs
.
update
({
del
:
1
},
{
where
:
{
id
:
req
.
body
.
id
}
});
await
DB
.
ThYyqtzhs
.
update
({
del
:
1
},
{
where
:
{
id
:
req
.
body
.
id
}
});
return
res
.
sendData
({});
}
catch
(
error
)
{
next
(
error
);
...
...
db/index.js
View file @
b016712b
...
...
@@ -61,6 +61,7 @@ const TzJsqtzjcTzfx = require("./model/jt/tzJsqtzjcTzfx");
const
TzJsqtzjcrcjc
=
require
(
"./model/jt/tzJsqtzjcrcjc"
);
const
TzJsqtzjcZxjc
=
require
(
"./model/jt/tzJsqtzjcZxjc"
);
const
TzJsqtzhs
=
require
(
"./model/jt/tzJsqtzhs"
);
const
TzZdsxsp
=
require
(
"./model/jt/tzZdsxsp"
);
const
TzZdsxspfl
=
require
(
"./model/jt/tzZdsxspfl"
);
...
...
@@ -146,7 +147,7 @@ global.DB = {
TzZdfxcz
,
// TzZdfxcwzb,
// TzZdfxqk,
TzJsqtzhs
,
TzJsqtzjc
,
TzJsqtzjcTzfx
,
// TzJsqtzjcrcjc,
...
...
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