| | |
| | | ISysMenuService menuService; |
| | | @Autowired |
| | | NoticeClient noticeClient; |
| | | |
| | | /** |
| | | * |
| | | * @description: 通过id获取menumapping |
| | | * @param id menumapping id |
| | | * @return: menumapping数据 |
| | | * |
| | | */ |
| | | @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) |
| | | public Result<MenuMapping> get(@PathVariable String id, HttpServletRequest request) { |
| | | return menuMappingService.getMapping(request.getSession(),id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @description: 保存主题的详细信息 |
| | | * @return: 是否保存成功 |
| | | * |
| | | */ |
| | | @RequestMapping(value = "/add", method = RequestMethod.POST) |
| | | public Result<Object> insert(@RequestBody MenuMapping menuMapping, HttpServletRequest request) { |
| | | String menuId = menuMapping.getMenuId(); |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @description: 保存主题的详细信息 |
| | | * @return: 是否保存成功 |
| | | * |
| | | */ |
| | | @RequestMapping(value = "/update", method = RequestMethod.POST) |
| | | public Result<Object> update(@RequestBody MenuMapping menuMapping, HttpServletRequest request) { |
| | | menuMapping.setUpdateTime(new Date()); |
| | | String menuId = menuMapping.getMenuId(); |
| | | SysMenu menu = menuService.selectById(menuId); |
| | | String preParentId = menu.getParentId(); |
| | | menu.setName(menuMapping.getName()).updateById(); |
| | | |
| | | String themeId = menuMapping.getThemeId(); |
| | | // if (!preParentId.equalsIgnoreCase(themeId)) { |
| | | //// menu.setParentId(themeId); |
| | | //// menu.updateById(); |
| | | //// } |
| | | if (!preParentId.equalsIgnoreCase(themeId)) { |
| | | menu.setParentId(themeId); |
| | | menu.updateById(); |
| | | } |
| | | boolean updated = menuMapping.updateById(); |
| | | if (updated) { |
| | | |
| | | |
| | | |
| | | TUser user = DbUtils.getUser(request); |
| | | if (menu != null) { |
| | | LinkedHashSet<String> parentIdSet = new LinkedHashSet<>(); |
| | |
| | | return Result.error(CodeMsg.UPDATE_ERROR); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @description: 通过主题删除主题详细信息 |
| | | * @return: 是否删除menumapping |
| | | * |
| | | */ |
| | | @RequestMapping(value = "/delete/{menuid}", method = RequestMethod.GET) |
| | | public Result<Object> delete(@PathVariable String menuid) throws Exception { |
| | | boolean deleted = menuMappingService.deleteById(menuid); |