Skip to content

Commit

Permalink
task definition log save only once. (#15016)
Browse files Browse the repository at this point in the history
  • Loading branch information
HomminLee authored Nov 8, 2023
1 parent b40a737 commit f4fae98
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2551,8 +2551,11 @@ public int saveTaskDefine(User operator, long projectCode, List<TaskDefinitionLo
// and update the origin one if exist
int updateResult = 0;
int insertResult = 0;
if (CollectionUtils.isNotEmpty(newTaskDefinitionLogs)) {
insertResult += taskDefinitionLogMapper.batchInsert(newTaskDefinitionLogs);
List<TaskDefinitionLog> newInsertTaskDefinitionLogs = newTaskDefinitionLogs.stream()
.filter(taskDefinitionLog -> !updateTaskDefinitionLogs.contains(taskDefinitionLog))
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(newInsertTaskDefinitionLogs)) {
insertResult += taskDefinitionLogMapper.batchInsert(newInsertTaskDefinitionLogs);
}
if (CollectionUtils.isNotEmpty(updateTaskDefinitionLogs)) {
insertResult += taskDefinitionLogMapper.batchInsert(updateTaskDefinitionLogs);
Expand Down

0 comments on commit f4fae98

Please sign in to comment.