| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.highdatas.mdm.entity.DeletedTableLog; |
| | | import com.highdatas.mdm.entity.MenuMapping; |
| | | import com.highdatas.mdm.entity.SysMenu; |
| | | import com.highdatas.mdm.pojo.CodeMsg; |
| | | import com.highdatas.mdm.pojo.MaintainDataType; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.service.IDeletedTableLogService; |
| | | import com.highdatas.mdm.service.IMenuMappingService; |
| | | import com.highdatas.mdm.service.ISysMenuService; |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | |
| | | @RequestMapping("/menu") |
| | | public class SysMenuController { |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | IMenuMappingService menuMappingService; |
| | | |
| | | @Autowired |
| | | IDeletedTableLogService deletedTableLogService; |
| | | |
| | | |
| | | @RequestMapping(value = "/all", method = RequestMethod.GET) |
| | | public Result<List<SysMenu>> getAll() { |
| | |
| | | HashSet<SysMenu> sysMenus = deleteMenuByParentId(data, menuid); |
| | | |
| | | for (SysMenu sysMenu : sysMenus) { |
| | | List<MenuMapping> menuMappingList = menuMappingService.selectList(new EntityWrapper<MenuMapping>().eq("menu_id", sysMenu.getId())); |
| | | for (MenuMapping menuMapping : menuMappingList) { |
| | | // 添加待删除表的日志 |
| | | DeletedTableLog deletedTableLog = new DeletedTableLog(); |
| | | deletedTableLog.setId(DbUtils.getUUID()).setTableName(menuMapping.getTableName()).setCreateTime(new Date()); |
| | | deletedTableLog.insert(); |
| | | menuMapping.deleteById(); |
| | | } |
| | | sysMenu.deleteById(); |
| | | } |
| | | boolean delete = menuService.deleteById(menuid); |