|
@@ -73,17 +73,17 @@ public class KwsMenuService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//新增菜单时,如果已经有同级菜单,则序号为最大的序号+1
|
|
//新增菜单时,如果已经有同级菜单,则序号为最大的序号+1
|
|
|
- if (params.getType() == MenuTypeEnum.DIRECTORY.getCode()) {
|
|
|
|
|
- KwsMenu kwsMenuParam = new KwsMenu();
|
|
|
|
|
- kwsMenuParam.setType(params.getType());
|
|
|
|
|
- kwsMenuParam.setParentId(params.getParentId());
|
|
|
|
|
- List<KwsMenu> select = kwsMenuDao.select(kwsMenuParam);
|
|
|
|
|
- int sort = 1;
|
|
|
|
|
- if (!CollectionUtils.isEmpty(select)) {
|
|
|
|
|
- sort = select.get(select.size() - 1).getSort() + 1;
|
|
|
|
|
- }
|
|
|
|
|
- params.setSort(sort);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (params.getType() == MenuTypeEnum.DIRECTORY.getCode()) {
|
|
|
|
|
+// KwsMenu kwsMenuParam = new KwsMenu();
|
|
|
|
|
+// kwsMenuParam.setType(params.getType());
|
|
|
|
|
+// kwsMenuParam.setParentId(params.getParentId());
|
|
|
|
|
+// List<KwsMenu> select = kwsMenuDao.select(kwsMenuParam);
|
|
|
|
|
+// int sort = 1;
|
|
|
|
|
+// if (!CollectionUtils.isEmpty(select)) {
|
|
|
|
|
+// sort = select.get(select.size() - 1).getSort() + 1;
|
|
|
|
|
+// }
|
|
|
|
|
+// params.setSort(sort);
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
if (kwsMenuDao.insert(params) <= 0) {
|
|
if (kwsMenuDao.insert(params) <= 0) {
|
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
@@ -326,24 +326,24 @@ public class KwsMenuService {
|
|
|
throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.MENU_NOT_EXISTS);
|
|
throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.MENU_NOT_EXISTS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //查出要被换位置的按钮
|
|
|
|
|
- KwsMenu targetMenu = getTargetMenu(reqVo.getMoveType(), kwsMenu);
|
|
|
|
|
-
|
|
|
|
|
- //修改要换位置的按钮
|
|
|
|
|
|
|
+// //查出要被换位置的按钮
|
|
|
|
|
+// KwsMenu targetMenu = getTargetMenu(reqVo.getMoveType(), kwsMenu);
|
|
|
|
|
+//
|
|
|
|
|
+// //修改要换位置的按钮
|
|
|
kwsMenu.setSort(kwsMenu.getSort() + reqVo.getMoveType());
|
|
kwsMenu.setSort(kwsMenu.getSort() + reqVo.getMoveType());
|
|
|
if (kwsMenuDao.update(kwsMenu) <= 0) {
|
|
if (kwsMenuDao.update(kwsMenu) <= 0) {
|
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (Objects.isNull(targetMenu)) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //更新被换位置的按钮
|
|
|
|
|
- targetMenu.setSort(targetMenu.getSort() - reqVo.getMoveType());
|
|
|
|
|
- if (kwsMenuDao.update(targetMenu) <= 0) {
|
|
|
|
|
- throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+//
|
|
|
|
|
+// if (Objects.isNull(targetMenu)) {
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// //更新被换位置的按钮
|
|
|
|
|
+// targetMenu.setSort(targetMenu.getSort() - reqVo.getMoveType());
|
|
|
|
|
+// if (kwsMenuDao.update(targetMenu) <= 0) {
|
|
|
|
|
+// throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|