明树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
40ae8d31
Commit
40ae8d31
authored
Jan 20, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
05ce7a67
Pipeline
#106375
passed with stage
in 3 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
projectQtController.js
controller/projectQtController.js
+3
-0
projectModule.js
module/projectModule.js
+22
-3
No files found.
controller/projectQtController.js
View file @
40ae8d31
...
...
@@ -14,6 +14,7 @@
const
errorMessage
=
require
(
"../utils/errorMessage"
);
const
_
=
require
(
"lodash"
);
const
{
Op
}
=
require
(
'sequelize'
);
const
projectModule
=
require
(
'../module/projectModule'
);
async
function
createCgqygl
(
req
,
res
,
next
)
{
try
{
...
...
@@ -106,6 +107,8 @@ async function getCgqyglList(req, res, next) {
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
search
.
attributes
=
req
.
body
.
attributes
;
let
ret
=
await
DB
.
RcCgqygl
.
findAndCountAll
(
search
);
let
risMap
=
await
projectModule
.
getResourceInfoMapByKeys
([
"xmjd"
]);
ret
.
rows
.
map
(
o
=>
{
o
.
xmscjd
=
risMap
[
o
.
xmscjd
]
||
o
.
xmscjd
;
return
o
;});
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
...
...
module/projectModule.js
View file @
40ae8d31
...
...
@@ -80,13 +80,31 @@ async function handleProjectData(ret, queryAttrs) {
async
function
getResourceInfoByIds
(
resouInfoIds
)
{
let
ris
=
await
DB
.
ResourcesInfo
.
findAll
({
where
:
{
id
:
{
[
Op
.
in
]:
resouInfoIds
}
},
where
:
{
key
:
{
[
Op
.
in
]:
resouInfoIds
}
},
// raw: true,
});
let
risMap
=
{};
for
(
let
index
=
0
;
index
<
ris
.
length
;
index
++
)
{
const
element
=
ris
[
index
];
risMap
[
element
.
id
]
=
element
.
value
;
risMap
[
element
.
key
]
=
element
.
value
||
element
.
name
;
}
// console.log(risMap)
return
risMap
;
}
async
function
getResourceInfoMapByKeys
(
keys
)
{
let
ris
=
await
DB
.
Resources
.
findAll
({
where
:
{
key
:
{
[
Op
.
in
]:
keys
}
},
raw
:
true
,
});
let
rids
=
ris
.
map
(
o
=>
{
return
o
.
id
});
let
risinfos
=
await
DB
.
ResourcesInfo
.
findAll
({
where
:
{
resourceId
:
{
[
Op
.
in
]:
rids
}
},
raw
:
true
,
});
let
risMap
=
{};
for
(
let
index
=
0
;
index
<
risinfos
.
length
;
index
++
)
{
const
element
=
risinfos
[
index
];
risMap
[
element
.
key
]
=
element
.
value
||
element
.
name
;
}
// console.log(risMap)
return
risMap
;
...
...
@@ -325,4 +343,5 @@ module.exports = {
handleProjectData
,
getProjectInfo
,
getProjectInfoByLixiang
,
getResourceInfoMapByKeys
,
}
\ 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