|
|
@@ -236,6 +236,18 @@ public class StorePlatformMenuServiceImpl extends ServiceImpl<StorePlatformMenuM
|
|
|
currentMenu.setUpdatedTime(new Date());
|
|
|
currentMenu.setUpdateBy("admin");
|
|
|
|
|
|
+ // 4. 校验菜单名称是否重复(同一父菜单下不能有重名)
|
|
|
+ LambdaQueryWrapper<StorePlatformMenu> nameCheck = new LambdaQueryWrapper<>();
|
|
|
+ nameCheck.eq(StorePlatformMenu::getMenuName, currentMenu.getMenuName())
|
|
|
+ .eq(StorePlatformMenu::getParentId, currentMenu.getParentId())
|
|
|
+ .eq(StorePlatformMenu::getDelFlag, "0");
|
|
|
+ StorePlatformMenu duplicateMenu = storePlatformMenuMapper.selectOne(nameCheck);
|
|
|
+ if (duplicateMenu != null) {
|
|
|
+ log.warn("更新菜单失败:菜单名称已存在,菜单名称={}, parentId={}",
|
|
|
+ currentMenu.getMenuName(), currentMenu.getParentId());
|
|
|
+ return R.fail("该菜单名称在同级菜单中已存在,请更换其他名称");
|
|
|
+ }
|
|
|
+
|
|
|
boolean result = this.updateById(currentMenu);
|
|
|
if (result) {
|
|
|
log.info("更新菜单信息成功,菜单ID={}, 菜单名称={}, 路径={}, 状态={}",
|