fix: 菜单图标查询重复

This commit is contained in:
Bunny 2024-11-09 10:08:13 +08:00
parent 151a2027ae
commit f16e46ff33
2 changed files with 4 additions and 2 deletions

View File

@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
@ -62,11 +63,11 @@ public class MenuIconServiceImpl extends ServiceImpl<MenuIconMapper, MenuIcon> i
@Override
public List<MenuIconVo> getIconNameList(String iconName) {
return list(Wrappers.<MenuIcon>lambdaQuery().like(MenuIcon::getIconName, iconName))
.stream().map(menuIcon -> {
.stream().collect(Collectors.toMap(MenuIcon::getIconName, menuIcon -> {
MenuIconVo menuIconVo = new MenuIconVo();
BeanUtils.copyProperties(menuIcon, menuIconVo);
return menuIconVo;
}).toList();
}, (existing, replacement) -> existing)).values().stream().toList();
}
/**

View File

@ -37,6 +37,7 @@
and icon.icon_name like CONCAT('%',#{dto.iconName},'%')
</if>
</where>
order by update_time desc
</select>
<!-- 物理删除系统菜单图标 -->