明树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
a73316dd
Commit
a73316dd
authored
Mar 13, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
!
parent
d17ecf91
Pipeline
#108294
passed with stage
in 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
projectTzController.js
controller/projectTzController.js
+1
-1
requestLog.js
db/model/system/requestLog.js
+1
-0
No files found.
controller/projectTzController.js
View file @
a73316dd
...
@@ -84,7 +84,7 @@ async function updateTzmbzrs(req, res, next) {
...
@@ -84,7 +84,7 @@ async function updateTzmbzrs(req, res, next) {
tzmbzrsPfyjs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
req
.
body
.
projectId
;
o
.
sourceId
=
ret
.
id
;
newtzmbzrsPfyjs
.
push
(
o
);
}
}
else
{
ids1
.
push
(
o
.
id
);
infos1
.
push
(
o
);
}
return
o
});
tzmbzrsPfyjs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
req
.
body
.
projectId
;
o
.
sourceId
=
ret
.
id
;
newtzmbzrsPfyjs
.
push
(
o
);
}
}
else
{
ids1
.
push
(
o
.
id
);
infos1
.
push
(
o
);
}
return
o
});
await
DB
.
TzTzmbzrsPfyj
.
destroy
({
where
:
{
projectId
:
req
.
body
.
projectId
,
sourceId
:
ret
.
id
,
id
:
{
[
Op
.
notIn
]:
ids1
}
}
});
// 删除id不在传入id数组里面的(用户在界面删除的)
await
DB
.
TzTzmbzrsPfyj
.
destroy
({
where
:
{
projectId
:
req
.
body
.
projectId
,
sourceId
:
ret
.
id
,
id
:
{
[
Op
.
notIn
]:
ids1
}
}
});
// 删除id不在传入id数组里面的(用户在界面删除的)
await
DB
.
TzTzmbzrsPfyj
.
bulkCreate
(
newtzmbzrsPfyjs
);
//创建新的 没有id的
await
DB
.
TzTzmbzrsPfyj
.
bulkCreate
(
newtzmbzrsPfyjs
);
//创建新的 没有id的
await
Promise
.
all
(
infos1
.
map
(
item
=>
{
return
DB
.
TzTzmbzrsPfyj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
await
Promise
.
all
(
infos1
.
map
(
item
=>
{
console
.
log
(
item
,
"----"
);
return
DB
.
TzTzmbzrsPfyj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 更新年度经营
// 更新年度经营
let
ids2
=
[],
infos2
=
[],
newtzmbzrsNds
=
[];
let
ids2
=
[],
infos2
=
[],
newtzmbzrsNds
=
[];
tzmbzrsNds
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
req
.
body
.
projectId
;
o
.
sourceId
=
ret
.
id
;
newtzmbzrsNds
.
push
(
o
);
}
}
else
{
ids2
.
push
(
o
.
id
);
infos2
.
push
(
o
);
}
return
o
});
tzmbzrsNds
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
req
.
body
.
projectId
;
o
.
sourceId
=
ret
.
id
;
newtzmbzrsNds
.
push
(
o
);
}
}
else
{
ids2
.
push
(
o
.
id
);
infos2
.
push
(
o
);
}
return
o
});
...
...
db/model/system/requestLog.js
View file @
a73316dd
// models/User.js
// models/User.js
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
const
sequelize
=
require
(
'../index'
);
const
moment
=
require
(
'moment'
);
const
RequestLog
=
sequelize
.
define
(
'User'
,
{
const
RequestLog
=
sequelize
.
define
(
'User'
,
{
// 定义字段
// 定义字段
...
...
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