基于java ssm springboot+mybatis酒莊內(nèi)部管理系統(tǒng)設(shè)計和實現(xiàn)
咱們廢話不多說進(jìn)入主題、系統(tǒng)主頁展示:

用戶登錄后進(jìn)行系統(tǒng)首頁:主要功能模塊如下、分角色管理、超級管理員擁有最高權(quán)限、可以進(jìn)行菜單靈活控制、

用戶信息管理;

角色權(quán)限控制管理:

管理員查看靈活配置;

插入一小部分代碼段
/**
* .
*
*
*
*
*/
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;
/**
* 導(dǎo)航菜單
*/
@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é)
本片文章就到這里了,希望能夠給你帶來幫助,也希望您能夠多多關(guān)注腳本之家的更多內(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)水平分表操作
相關(guān)文章
Java實現(xiàn)圖片與Base64編碼互轉(zhuǎn)
這篇文章主要介紹了Java中實現(xiàn)圖片與Base64編碼互轉(zhuǎn)的方法,比較實用,需要的朋友可以參考下。2016-06-06
最有價值的50道java面試題 適用于準(zhǔn)入職Java程序員
這篇文章主要為大家分享了最有價值的50道java面試題,涵蓋內(nèi)容全面,包括數(shù)據(jù)結(jié)構(gòu)和算法相關(guān)的題目、經(jīng)典面試編程題等,對hashCode方法的設(shè)計、垃圾收集的堆和代進(jìn)行剖析,感興趣的小伙伴們可以參考一下2016-05-05
SpringBoot使用Redis對用戶IP進(jìn)行接口限流的示例詳解
使用接口限流的主要目的在于提高系統(tǒng)的穩(wěn)定性,防止接口被惡意打擊,這篇文章主要介紹了SpringBoot使用Redis對用戶IP進(jìn)行接口限流的示例代碼,需要的朋友可以參考下2023-07-07
JAVA解決在@autowired,@Resource注入為null的情況
這篇文章主要介紹了JAVA解決在@autowired,@Resource注入為null的情況,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-10-10
SpringBoot使用Apache Tika實現(xiàn)多種文檔的內(nèi)容解析
在日常開發(fā)中,我們經(jīng)常需要解析不同類型的文檔,如PDF、Word、Excel、HTML、TXT等,Apache Tika是一個強(qiáng)大的內(nèi)容解析工具,可以輕松地提取文檔中的內(nèi)容和元數(shù)據(jù)信息,本文將通過SpringBoot和Apache Tika的結(jié)合,介紹如何實現(xiàn)對多種文檔格式的內(nèi)容解析2024-12-12
在Spring Boot中使用Spark Streaming進(jìn)行實時數(shù)據(jù)處理和流式計算的步驟
這篇文章主要介紹了在Spring Boot中使用Spark Streaming進(jìn)行實時數(shù)據(jù)處理和流式計算,通過本文的介紹,我們了解了在Spring Boot中使用Spark Streaming進(jìn)行實時數(shù)據(jù)處理和流式計算的詳細(xì)步驟,需要的朋友可以參考下2024-03-03

