fix: 优化逻辑
This commit is contained in:
parent
d30d873fa4
commit
85b4a1fdbd
@ -74,7 +74,7 @@ public class MapLegendServiceImpl extends ServiceImpl<MsMaplegendBMapper, MsMapl
|
||||
// 判断父级是否存在
|
||||
if (StrUtil.isBlank(legend.getParentId())) {
|
||||
this.removeById(id); // 逻辑删除
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 删除数据
|
||||
@ -85,7 +85,8 @@ public class MapLegendServiceImpl extends ServiceImpl<MsMaplegendBMapper, MsMapl
|
||||
MsMaplegendB parent = this.getById(legend.getParentId());
|
||||
if (parent != null) {
|
||||
LambdaQueryWrapper<MsMaplegendB> siblingWrapper = new LambdaQueryWrapper<>();
|
||||
siblingWrapper.eq(MsMaplegendB::getParentId, parent.getId());
|
||||
siblingWrapper.eq(MsMaplegendB::getParentId, parent.getId())
|
||||
.eq(MsMaplegendB::getIsDeleted, 0);
|
||||
List<MsMaplegendB> siblings = this.list(siblingWrapper);
|
||||
if (siblings.size() == 1 && id.equals(siblings.get(0).getId())) {
|
||||
MsMaplegendB updateParent = new MsMaplegendB();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user