基于java ssm springboot+mybatis酒莊內(nèi)部管理系統(tǒng)設計和實現(xiàn)
更新時間:2021年08月31日 09:49:13 作者:java李陽勇
這篇文章主要為大家詳細介紹了java ssm springboot+mybatis實現(xiàn)酒店管理系統(tǒng),文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
咱們廢話不多說進入主題、系統(tǒng)主頁展示:
用戶登錄后進行系統(tǒng)首頁:主要功能模塊如下、分角色管理、超級管理員擁有最高權限、可以進行菜單靈活控制、
用戶信息管理;
角色權限控制管理:
管理員查看靈活配置;
插入一小部分代碼段
/** * . * * * * */ package io.renren.modules.sys.controller; import io.renren.common.annotation.SysLog; import io.renren.common.exception.RRException; import io.renren.common.utils.Constant; import io.renren.common.utils.R; import io.renren.modules.sys.entity.SysMenuEntity; import io.renren.modules.sys.service.SysMenuService; import org.apache.commons.lang.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * 系統(tǒng)菜單 * * @author Mark s.com */ @RestController @RequestMapping("/sys/menu") public class SysMenuController extends AbstractController { @Autowired private SysMenuService sysMenuService; /** * 導航菜單 */ @RequestMapping("/nav") public R nav(){ List<SysMenuEntity> menuList = sysMenuService.getUserMenuList(getUserId()); return R.ok().put("menuList", menuList); } /** * 所有菜單列表 */ @RequestMapping("/list") @RequiresPermissions("sys:menu:list") public List<SysMenuEntity> list(){ List<SysMenuEntity> menuList = sysMenuService.list(); for(SysMenuEntity sysMenuEntity : menuList){ SysMenuEntity parentMenuEntity = sysMenuService.getById(sysMenuEntity.getParentId()); if(parentMenuEntity != null){ sysMenuEntity.setParentName(parentMenuEntity.getName()); } } return menuList; } /** * 選擇菜單(添加、修改菜單) */ @RequestMapping("/select") @RequiresPermissions("sys:menu:select") public R select(){ //查詢列表數(shù)據(jù) List<SysMenuEntity> menuList = sysMenuService.queryNotButtonList(); //添加頂級菜單 SysMenuEntity root = new SysMenuEntity(); root.setMenuId(0L); root.setName("一級菜單"); root.setParentId(-1L); root.setOpen(true); menuList.add(root); return R.ok().put("menuList", menuList); } /** * 菜單信息 */ @RequestMapping("/info/{menuId}") @RequiresPermissions("sys:menu:info") public R info(@PathVariable("menuId") Long menuId){ SysMenuEntity menu = sysMenuService.getById(menuId); return R.ok().put("menu", menu); } /** * 保存 */ @SysLog("保存菜單") @RequestMapping("/save") @RequiresPermissions("sys:menu:save") public R save(@RequestBody SysMenuEntity menu){ //數(shù)據(jù)校驗 verifyForm(menu); sysMenuService.save(menu); return R.ok(); } /** * 修改 */ @SysLog("修改菜單") @RequestMapping("/update") @RequiresPermissions("sys:menu:update") public R update(@RequestBody SysMenuEntity menu){ //數(shù)據(jù)校驗 verifyForm(menu); sysMenuService.updateById(menu); return R.ok(); } /** * 刪除 */ @SysLog("刪除菜單") @RequestMapping("/delete") @RequiresPermissions("sys:menu:delete") public R delete(long menuId){ if(menuId <= 31){ return R.error("系統(tǒng)菜單,不能刪除"); } //判斷是否有子菜單或按鈕 List<SysMenuEntity> menuList = sysMenuService.queryListParentId(menuId); if(menuList.size() > 0){ return R.error("請先刪除子菜單或按鈕"); } sysMenuService.delete(menuId); return R.ok(); } /** * 驗證參數(shù)是否正確 */ private void verifyForm(SysMenuEntity menu){ if(StringUtils.isBlank(menu.getName())){ throw new RRException("菜單名稱不能為空"); } if(menu.getParentId() == null){ throw new RRException("上級菜單不能為空"); } //菜單 if(menu.getType() == Constant.MenuType.MENU.getValue()){ if(StringUtils.isBlank(menu.getUrl())){ throw new RRException("菜單URL不能為空"); } } //上級菜單類型 int parentType = Constant.MenuType.CATALOG.getValue(); if(menu.getParentId() != 0){ SysMenuEntity parentMenu = sysMenuService.getById(menu.getParentId()); parentType = parentMenu.getType(); } //目錄、菜單 if(menu.getType() == Constant.MenuType.CATALOG.getValue() || menu.getType() == Constant.MenuType.MENU.getValue()){ if(parentType != Constant.MenuType.CATALOG.getValue()){ throw new RRException("上級菜單只能為目錄類型"); } return ; } //按鈕 if(menu.getType() == Constant.MenuType.BUTTON.getValue()){ if(parentType != Constant.MenuType.MENU.getValue()){ throw new RRException("上級菜單只能為菜單類型"); } return ; } } }
簡單模擬實現(xiàn)郵件群發(fā)給所有用戶
紅酒信息管理
通知公告信息管理
總結(jié)
本片文章就到這里了,希望能夠給你帶來幫助,也希望您能夠多多關注腳本之家的更多內(nèi)容!
您可能感興趣的文章:
- 前端?el-table?本地搜索的實現(xiàn)代碼
- SpringBoot+Mybatis plus實現(xiàn)多數(shù)據(jù)源整合的實踐
- SpringBoot+Mybatis分頁插件PageHelper實現(xiàn)分頁效果
- springboot+mybatis-plus基于攔截器實現(xiàn)分表的示例代碼
- SpringBoot+mybatis+Vue實現(xiàn)前后端分離項目的示例
- springboot+mybatis報錯找不到實體類的問題
- SpringBoot+MybatisPlus+Mysql+Sharding-JDBC分庫分表
- Springboot+Mybatis實現(xiàn)分頁加條件查詢功能
- springboot+mybatis攔截器方法實現(xiàn)水平分表操作
相關文章
Java JDK動態(tài)代理(AOP)的實現(xiàn)原理與使用詳析
所謂代理,就是一個人或者一個機構代表另一個人或者另一個機構采取行動。下面這篇文章主要給大家介紹了關于Java JDK動態(tài)代理(AOP)實現(xiàn)原理與使用的相關資料,文中通過示例代碼介紹的非常詳細,需要的朋友可以參考借鑒,下面來一起看看吧。2017-07-07SpringBoot實現(xiàn)項目健康檢查與監(jiān)控
這篇文章主要介紹了SpringBoot實現(xiàn)項目健康檢查與監(jiān)控,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2018-06-06Hadoop MultipleOutputs輸出到多個文件中的實現(xiàn)方法
這篇文章主要介紹了 Hadoop MultipleOutputs輸出到多個文件中的實現(xiàn)方法的相關資料,希望通過本文能幫助到大家,需要的朋友可以參考下2017-10-10java 使用ImageIO.writer從BufferedImage生成jpeg圖像遇到問題總結(jié)及解決
這篇文章主要介紹了java 使用ImageIO.writer從BufferedImage生成jpeg圖像遇到問題總結(jié)及解決的相關資料,需要的朋友可以參考下2017-03-03