明树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
57c90c20
Commit
57c90c20
authored
Dec 11, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c0bde601
Pipeline
#104511
passed with stage
in 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
projectController.js
controller/projectController.js
+1
-1
projectXmtzze.js
db/model/jt/projectXmtzze.js
+7
-3
projectModule.js
module/projectModule.js
+2
-2
No files found.
controller/projectController.js
View file @
57c90c20
...
...
@@ -350,7 +350,7 @@ async function xiangmujuecegengxin(body, projectLzType) {
await
Promise
.
all
(
pns2
.
map
(
item
=>
{
DB
.
ProjectGdxx
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectXmtzzes
let
projectXmtzzes
=
body
.
projectXmtzzes
||
[];
projectXmtzzes
=
utils
.
flattenTree
(
projectXmtzzes
,
'
xh'
,
'parentXh
'
);
projectXmtzzes
=
utils
.
flattenTree
(
projectXmtzzes
,
'
key'
,
'parentKey
'
);
let
pnids3
=
[],
pns3
=
[],
newprojectXmtzzes
=
[];
projectXmtzzes
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
projectInfo
.
id
;
newprojectXmtzzes
.
push
(
o
);
}
}
else
{
pnids3
.
push
(
o
.
id
);
pns3
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectXmtzze
.
destroy
({
where
:
{
projectId
:
projectInfo
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids3
}
}
});
...
...
db/model/jt/projectXmtzze.js
View file @
57c90c20
...
...
@@ -29,9 +29,13 @@ const ProjectXmtzze = sequelize.define('ProjectXmtzze', {
type
:
DataTypes
.
DECIMAL
(
19
,
2
),
comment
:
"人民币计价"
},
parentXh
:
{
key
:
{
type
:
DataTypes
.
STRING
,
comment
:
"上级ID"
comment
:
"key"
},
parentKey
:
{
type
:
DataTypes
.
STRING
,
comment
:
"parentKey"
},
projectId
:
{
...
...
@@ -67,7 +71,7 @@ const ProjectXmtzze = sequelize.define('ProjectXmtzze', {
// 同步模型到数据库(创建表)
ProjectXmtzze
.
sync
({
force
:
false
,
//
force: false,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
...
...
module/projectModule.js
View file @
57c90c20
...
...
@@ -216,8 +216,8 @@ async function getProjectInfo({ id }) {
project
.
projectXmtzzes
=
await
DB
.
ProjectXmtzze
.
findAll
({
where
:
{
projectId
:
id
},
raw
:
true
});
project
.
projectXmtzzes
=
utils
.
buildTree2
(
project
.
projectXmtzzes
,
{
keyName
:
"
xh
"
,
parentKeyName
:
'parent
Xh
'
,
keyName
:
"
key
"
,
parentKeyName
:
'parent
Key
'
,
});
//处理文件 还原成项目各个字段拥有的文件
...
...
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