Commit 09ecacb7 by guojuxing

编辑权限项接口修复:编辑的时候不设置排序值

parent 4764f14e
......@@ -432,16 +432,24 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO.setMenuType(MenuTypeEnum.PAGE.getCode());
}
private void setNormalFieldValue(MenuDTO menuDTO, TabSysMenu record) {
/**
* 新增子页面、操作项、权限项的时候设置常规字段值
* @param menuDTO
* @param parent 父级页面
*/
private void setNormalFieldValue(MenuDTO menuDTO, TabSysMenu parent) {
//project
menuDTO.setProject(record.getProject());
menuDTO.setProject(parent.getProject());
//sort
int maxSort = menuService.getMaxSortByParentId(menuDTO.getParentId(), menuDTO.getProject());
menuDTO.setSort(maxSort + 1);
//level
menuDTO.setLevel(record.getLevel() + 1);
if (menuDTO.getMenuId() == null) {
//新增的时候需要设置sort和level。编辑的时候不需要,因为编辑的时候不能再次选择新的父级页面,所以层级是不变的。
int maxSort = menuService.getMaxSortByParentId(menuDTO.getParentId(), menuDTO.getProject());
menuDTO.setSort(maxSort + 1);
//level
menuDTO.setLevel(parent.getLevel() + 1);
}
//父级code
menuDTO.setParentCode(record.getMenuCode());
menuDTO.setParentCode(parent.getMenuCode());
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment