|
@ -311,12 +311,12 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
if (updateSubPidsFlag) {
|
|
|
list.forEach(child -> {
|
|
|
// 子节点pids组成 = 当前菜单新pids + 当前菜单id + 子节点自己的pids后缀
|
|
|
String oldPCodesPrefix = oldPids + SymbolConstant.LEFT_SQUARE_BRACKETS + oldMenu.getId()
|
|
|
String oldParentCodesPrefix = oldPids + SymbolConstant.LEFT_SQUARE_BRACKETS + oldMenu.getId()
|
|
|
+ SymbolConstant.RIGHT_SQUARE_BRACKETS + SymbolConstant.COMMA;
|
|
|
String oldPCodesSuffix = child.getPids().substring(oldPCodesPrefix.length());
|
|
|
String menuPCodes = newPids + SymbolConstant.LEFT_SQUARE_BRACKETS + oldMenu.getId()
|
|
|
+ SymbolConstant.RIGHT_SQUARE_BRACKETS + SymbolConstant.COMMA + oldPCodesSuffix;
|
|
|
child.setPids(menuPCodes);
|
|
|
String oldParentCodesSuffix = child.getPids().substring(oldParentCodesPrefix.length());
|
|
|
String menuParentCodes = newPids + SymbolConstant.LEFT_SQUARE_BRACKETS + oldMenu.getId()
|
|
|
+ SymbolConstant.RIGHT_SQUARE_BRACKETS + SymbolConstant.COMMA + oldParentCodesSuffix;
|
|
|
child.setPids(menuParentCodes);
|
|
|
});
|
|
|
}
|
|
|
|