明树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
bf539628
Commit
bf539628
authored
Jan 29, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
22bcd01f
Pipeline
#106729
passed with stage
in 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
19 deletions
+29
-19
projectRcController.js
controller/projectRcController.js
+13
-5
rcXxbs.js
db/model/jt/rcXxbs.js
+8
-8
projectModule.js
module/projectModule.js
+8
-6
No files found.
controller/projectRcController.js
View file @
bf539628
const
errorMessage
=
require
(
"../utils/errorMessage"
);
const
errorMessage
=
require
(
"../utils/errorMessage"
);
const
_
=
require
(
"lodash"
);
const
_
=
require
(
"lodash"
);
const
{
Op
}
=
require
(
'sequelize'
);
const
{
Op
}
=
require
(
'sequelize'
);
const
projectModule
=
require
(
'../module/projectModule'
);
// ---------------- 信息报送 RcXxbs ----------------
// ---------------- 信息报送 RcXxbs ----------------
...
@@ -119,7 +120,7 @@ async function updateTzgh(req, res, next) {
...
@@ -119,7 +120,7 @@ async function updateTzgh(req, res, next) {
async
function
getTzgh
(
req
,
res
,
next
)
{
async
function
getTzgh
(
req
,
res
,
next
)
{
try
{
try
{
if
(
!
req
.
body
.
id
)
return
res
.
sendError
(
errorMessage
.
paramsError
);
if
(
!
req
.
body
.
id
)
return
res
.
sendError
(
errorMessage
.
paramsError
);
let
info
=
await
DB
.
RcTzgh
.
findOne
({
where
:
{
id
:
req
.
body
.
id
,
del
:
0
}});
let
info
=
await
DB
.
RcTzgh
.
findOne
({
where
:
{
id
:
req
.
body
.
id
,
del
:
0
}
});
if
(
!
(
info
&&
info
.
id
))
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
if
(
!
(
info
&&
info
.
id
))
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
return
res
.
sendData
(
info
);
return
res
.
sendData
(
info
);
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -144,9 +145,6 @@ async function getTzghList(req, res, next) {
...
@@ -144,9 +145,6 @@ async function getTzghList(req, res, next) {
if
(
req
.
body
.
planYear
)
{
if
(
req
.
body
.
planYear
)
{
where
.
planYear
=
req
.
body
.
planYear
;
where
.
planYear
=
req
.
body
.
planYear
;
}
}
if
(
req
.
body
.
projectId
)
{
where
.
projectId
=
req
.
body
.
projectId
;
}
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
;
...
@@ -239,7 +237,17 @@ async function getTxjsList(req, res, next) {
...
@@ -239,7 +237,17 @@ async function getTxjsList(req, res, next) {
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
;
}
}
// 获取资源库映射
const
wjcjMap
=
await
projectModule
.
getResourceInfoMapByKey
(
'fileHierarchy'
);
const
wjlbMap
=
await
projectModule
.
getResourceInfoMapByKey
(
'fileType'
);
// console.log(risMap, "====")
let
ret
=
await
DB
.
RcTxjs
.
findAndCountAll
(
search
);
let
ret
=
await
DB
.
RcTxjs
.
findAndCountAll
(
search
);
// 字典映射
ret
.
rows
=
ret
.
rows
.
map
(
row
=>
{
row
.
wjcj
=
wjcjMap
[
row
.
wjcj
]
||
row
.
wjcj
;
row
.
wjlb
=
wjlbMap
[
row
.
wjlb
]
||
row
.
wjlb
;
return
row
;
});
return
res
.
sendData
(
ret
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
...
@@ -349,7 +357,7 @@ async function getCgqyglList(req, res, next) {
...
@@ -349,7 +357,7 @@ async function getCgqyglList(req, res, next) {
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
search
.
attributes
=
req
.
body
.
attributes
;
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
search
.
attributes
=
req
.
body
.
attributes
;
let
ret
=
await
DB
.
RcCgqygl
.
findAndCountAll
(
search
);
let
ret
=
await
DB
.
RcCgqygl
.
findAndCountAll
(
search
);
let
risMap
=
await
projectModule
.
getResourceInfoMapByKey
s
([
"xmjd"
]
);
let
risMap
=
await
projectModule
.
getResourceInfoMapByKey
(
"xmjd"
);
ret
.
rows
.
map
(
o
=>
{
o
.
xmscjd
=
risMap
[
o
.
xmscjd
]
||
o
.
xmscjd
;
return
o
;
});
ret
.
rows
.
map
(
o
=>
{
o
.
xmscjd
=
risMap
[
o
.
xmscjd
]
||
o
.
xmscjd
;
return
o
;
});
return
res
.
sendData
(
ret
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
db/model/jt/rcXxbs.js
View file @
bf539628
...
@@ -38,14 +38,14 @@ const RcXxbs = sequelize.define('RcXxbs', {
...
@@ -38,14 +38,14 @@ const RcXxbs = sequelize.define('RcXxbs', {
},
},
sourceId
:
{
//
sourceId: {
type
:
DataTypes
.
INTEGER
,
//
type: DataTypes.INTEGER,
comment
:
"所属主表id"
//
comment: "所属主表id"
},
//
},
projectId
:
{
//
projectId: {
type
:
DataTypes
.
INTEGER
,
//
type: DataTypes.INTEGER,
comment
:
"所属项目ID"
,
//
comment: "所属项目ID",
},
//
},
del
:
{
del
:
{
type
:
DataTypes
.
INTEGER
,
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
defaultValue
:
0
,
...
...
module/projectModule.js
View file @
bf539628
...
@@ -91,14 +91,16 @@ async function getResourceInfoByIds(resouInfoIds) {
...
@@ -91,14 +91,16 @@ async function getResourceInfoByIds(resouInfoIds) {
// console.log(risMap)
// console.log(risMap)
return
risMap
;
return
risMap
;
}
}
async
function
getResourceInfoMapByKey
s
(
keys
)
{
async
function
getResourceInfoMapByKey
(
key
)
{
let
ris
=
await
DB
.
Resources
.
find
All
({
let
ris
=
await
DB
.
Resources
.
find
One
({
where
:
{
key
:
{
[
Op
.
in
]:
keys
}
},
where
:
{
key
},
raw
:
true
,
raw
:
true
,
});
});
let
rids
=
ris
.
map
(
o
=>
{
return
o
.
id
});
if
(
!
(
ris
&&
ris
.
id
))
{
return
{};
}
let
risinfos
=
await
DB
.
ResourcesInfo
.
findAll
({
let
risinfos
=
await
DB
.
ResourcesInfo
.
findAll
({
where
:
{
resourceId
:
{
[
Op
.
in
]:
rids
}
},
where
:
{
resourceId
:
ris
.
id
},
raw
:
true
,
raw
:
true
,
});
});
let
risMap
=
{};
let
risMap
=
{};
...
@@ -343,5 +345,5 @@ module.exports = {
...
@@ -343,5 +345,5 @@ module.exports = {
handleProjectData
,
handleProjectData
,
getProjectInfo
,
getProjectInfo
,
getProjectInfoByLixiang
,
getProjectInfoByLixiang
,
getResourceInfoMapByKey
s
,
getResourceInfoMapByKey
,
}
}
\ 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