明树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
ec07c517
Commit
ec07c517
authored
Apr 03, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
16f9f1e9
Pipeline
#109218
passed with stage
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
projectThController.js
controller/projectThController.js
+18
-10
No files found.
controller/projectThController.js
View file @
ec07c517
...
...
@@ -48,16 +48,24 @@ async function getYyqtzhsInfo(req, res, next) {
if
(
req
.
body
.
id
)
{
search
.
id
=
req
.
body
.
id
;
}
if
(
_
.
isEmpty
(
search
))
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
if
(
req
.
body
.
nd
)
{
ndYear
=
Number
(
req
.
body
.
nd
);
search
.
nd
=
sequelize
.
where
(
sequelize
.
fn
(
'YEAR'
,
sequelize
.
col
(
'nd'
)),
// 调用SQL的YEAR函数取nd字段的年份
ndYear
);
}
let
tzhs
=
await
DB
.
ThYyqtzhs
.
findOne
({
where
:
search
});
console
.
log
(
search
,
"==="
)
// if (_.isEmpty(search)) {
// return res.sendError(errorMessage.paramsError);
// }
let
tzhs
=
await
DB
.
ThYyqtzhs
.
findOne
({
where
:
search
});
if
(
!
(
tzhs
&&
tzhs
.
id
&&
tzhs
.
projectId
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
tzhs
=
tzhs
.
toJSON
();
let
lastyear
=
moment
().
subtract
(
1
,
'year'
).
format
(
'YYYY'
);
let
lastyeartzhs
=
await
DB
.
ThYyqtzhs
.
findOne
({
where
:
{
projectId
:
tzhs
.
projectId
,
nd
:
lastyear
}
});
let
lastyeartzhs
=
await
DB
.
ThYyqtzhs
.
findOne
({
where
:
{
projectId
:
tzhs
.
projectId
,
nd
:
lastyear
}
});
tzhs
.
lastyeartzhs
=
lastyeartzhs
||
null
;
// let yyqtzhss = await DB.ThYyqtzhszb.findAll({ where: { projectId: tzhs.projectId, sourceId: req.body.id }, raw: true });
// tzhs.yyqtzhss = _.values(_.groupBy(yyqtzhss, 'groupBy')) || [[]]
...
...
@@ -424,7 +432,7 @@ async function getTzhpjInfo(req, res, next) {
if
(
_
.
isEmpty
(
search
))
{
return
res
.
sendError
(
errorMessage
.
paramsError
);
}
let
tzhpj
=
await
DB
.
ThTzhpj
.
findOne
({
where
:
search
});
let
tzhpj
=
await
DB
.
ThTzhpj
.
findOne
({
where
:
search
});
if
(
!
(
tzhpj
&&
tzhpj
.
id
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
...
...
@@ -441,7 +449,7 @@ async function getTzhpjInfo(req, res, next) {
tzhpj
.
hpjbg
=
tzhpj
.
hpjbg
.
map
(
o
=>
{
return
fileMap
[
o
]
});
tzhpj
.
qsmzqpj
=
tzhpj
.
qsmzqpj
.
map
(
o
=>
{
return
fileMap
[
o
]
});
tzhpj
.
tzhpjwtzgs
=
await
DB
.
ThTzhpjwtzg
.
findAll
({
where
:
{
projectId
:
tzhpj
.
projectId
,
sourceId
:
req
.
body
.
id
}
});
tzhpj
.
tzhpjwtzgs
=
await
DB
.
ThTzhpjwtzg
.
findAll
({
where
:
{
projectId
:
tzhpj
.
projectId
,
sourceId
:
req
.
body
.
id
}
});
return
res
.
sendData
(
tzhpj
);
}
catch
(
error
)
{
next
(
error
);
...
...
@@ -601,9 +609,9 @@ module.exports = {
updateYjgl
,
getYjglList
,
getYjglInfo
,
deleteYyqtzhs
,
deleteYyqtzjc
,
deleteTzhpj
,
deleteYjgl
,
deleteYyqtzhs
,
deleteYyqtzjc
,
deleteTzhpj
,
deleteYjgl
,
}
\ No newline at end of file
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