Skip to content

Commit

Permalink
[Fix-3728][admin] Fix the issue with the saveOrUpdate method in the g…
Browse files Browse the repository at this point in the history
…it project module (DataLinkDC#3730)
  • Loading branch information
gphwxhq authored Aug 21, 2024
1 parent 4c8ffcf commit 8201d87
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,13 @@ public void saveOrUpdate(GitProjectDTO gitProjectDTO) {

GitProject gitProject = BeanUtil.toBean(gitProjectDTO, GitProject.class);
if (gitProject.getOrderLine() == null) {
Integer maxOrderLine = Opt.ofNullable(baseMapper
.selectOne(new LambdaQueryWrapper<GitProject>()
.orderByAsc(GitProject::getOrderLine)
.last(" limit 1"))
.getOrderLine())
.orElse(999);
Integer maxOrderLine = Opt.ofNullable(baseMapper.selectOne(new LambdaQueryWrapper<GitProject>()
.orderByDesc(GitProject::getOrderLine)
.last(" limit 1")))
.map(GitProject::getOrderLine)
.orElse(0);
gitProject.setOrderLine(maxOrderLine + 1);
}
BeanUtil.copyProperties(gitProjectDTO, gitProject);

gitProject.insertOrUpdate();

Expand Down

0 comments on commit 8201d87

Please sign in to comment.