網站首頁 編程語言 正文
一,項目簡介
這是一個基于java的畢業設計項目,畢設課題為springboot框架的知識產權服務平臺系統, 是一個采用b/s結構的javaweb項目, 開發工具eclipsei/eclipse, 項目框架jsp+springboot+mybatis, 知識產權服務平臺系統采用mysql進行數據存儲, 并基于mybatis進行了orm實體關系映射, 該知識產權服務平臺系統系統通過模塊化實現,支持多角色權限管理系統, 提升了管理效率, 知識產權服務平臺系統參考文獻可見附件中的畢業論文與畢設源碼
該知識產權服務平臺系統項目采用mvc設計模式, 其中知識產權服務平臺系統的視圖與知識產權服務平臺系統業務邏輯進行了分層設計, 特別方便后續知識產權服務平臺系統系統的開發
設計這種mvc的架構的好處是完全的可以將業務進行分層, 進行高內聚低耦合, 分為service層, dao層, controller層, 架構清晰
本項目主要基于Springboot 和ruoyi來開發一套專業認證材料管理系統,對各專業相關的文檔材料進行管理,主要包含的功能模塊有:
系統管理:用戶管理、角色管理、菜單管理、操作日志
業務模塊:專業管理、認證材料管理、相關網站管理
二,環境介紹
語言環境:Java:? jdk1.8
數據庫:Mysql: mysql5.7
應用服務器:Tomcat:? tomcat8.5.31
開發工具:IDEA或eclipse
開發技術:Springboot+ruoyi+bootstrap
三,系統展示
用戶登陸:
用戶注冊:
用戶管理
角色管理
菜單管理
操作管理
專業管理
認證材料管理
相關網站
個人中心
修改密碼
四,核心代碼展示
package com.code.project.common;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.code.common.constant.Constants;
import com.code.common.utils.StringUtils;
import com.code.common.utils.file.FileUploadUtils;
import com.code.common.utils.file.FileUtils;
import com.code.common.utils.security.ShiroUtils;
import com.code.framework.config.RuoYiConfig;
import com.code.framework.config.ServerConfig;
import com.code.framework.web.domain.AjaxResult;
/**
?* 通用請求處理
?*
?* @author ruoyi
?*/
@Controller
public class CommonController
{
??? private static final Logger log = LoggerFactory.getLogger(CommonController.class);
??? @Autowired
??? private ServerConfig serverConfig;
??? /**
???? * 通用下載請求
???? *
???? * @param fileName 文件名稱
???? * @param delete 是否刪除
???? */
??? @GetMapping("common/download")
??? public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
??? {
??????? try
??????? {
??????????? if (!FileUtils.isValidFilename(fileName))
??????????? {
??????????????? throw new Exception(StringUtils.format("文件名稱({})非法,不允許下載。 ", fileName));
??????????? }
??????????? String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
??????????? String filePath = System.getProperty("user.dir").replace('\\','/')+RuoYiConfig.getDownloadPath() + fileName;
??????????? System.out.println(filePath);
??????????? response.setCharacterEncoding("utf-8");
??????????? response.setContentType("multipart/form-data");
??????????? response.setHeader("Content-Disposition",
??????????????????? "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName));
??????????? FileUtils.writeBytes(filePath, response.getOutputStream());
??????????? if (delete)
??????????? {
??????????????? FileUtils.deleteFile(filePath);
??????????? }
??????? }
??????? catch (Exception e)
??????? {
??????????? log.error("下載文件失敗", e);
??????? }
??? }
??? /**
???? * 通用上傳請求
???? */
??? @PostMapping("/common/upload")
??? @ResponseBody
??? public AjaxResult uploadFile(MultipartFile file) throws Exception
??? {
??????? try
??????? {
??????????? // 上傳文件路徑
??????????? String filePath = System.getProperty("user.dir").replace('\\','/')+RuoYiConfig.getUploadPath();
??????????? System.out.println(filePath);
??????????? // 上傳并返回新文件名稱
??????????? String fileName = FileUploadUtils.upload(filePath, file);
??????????? String url = serverConfig.getUrl() + fileName;
??????????? AjaxResult ajax = AjaxResult.success();
??????????? ajax.put("fileName", fileName);
??????????? ajax.put("url", url);
??????????? return ajax;
??????? }
??????? catch (Exception e)
??????? {
??????????? return AjaxResult.error(e.getMessage());
??????? }
??? }
??? /**
???? * 本地資源通用下載
???? */
??? @GetMapping("/common/download/resource")
??? public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
??????????? throws Exception
??? {
????? ??// 本地資源路徑
??????? String localPath = System.getProperty("user.dir").replace('\\','/')+RuoYiConfig.getProfile();
??????? // 數據庫資源地址
??????? String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
??????? // 下載名稱
??????? String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
??????? response.setCharacterEncoding("utf-8");
??????? response.setContentType("multipart/form-data");
??????? response.setHeader("Content-Disposition",
??????????????? "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
??????? FileUtils.writeBytes(downloadPath, response.getOutputStream());
??? }
}
package com.code.project.monitor.online.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.code.common.utils.security.ShiroUtils;
import com.code.framework.aspectj.lang.annotation.Log;
import com.code.framework.aspectj.lang.enums.BusinessType;
import com.code.framework.shiro.session.OnlineSessionDAO;
import com.code.framework.web.controller.BaseController;
import com.code.framework.web.domain.AjaxResult;
import com.code.framework.web.page.TableDataInfo;
import com.code.project.monitor.online.domain.OnlineSession;
import com.code.project.monitor.online.domain.UserOnline;
import com.code.project.monitor.online.domain.OnlineSession.OnlineStatus;
import com.code.project.monitor.online.service.IUserOnlineService;
/**
* 在線用戶監控
*
* @author ruoyi
*/
@Controller
@RequestMapping("/monitor/online")
public class UserOnlineController extends BaseController
{
private String prefix = "monitor/online";
@Autowired
private IUserOnlineService userOnlineService;
@Autowired
private OnlineSessionDAO onlineSessionDAO;
@RequiresPermissions("monitor:online:view")
@GetMapping()
public String online()
{
return prefix + "/online";
}
@RequiresPermissions("monitor:online:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(UserOnline userOnline)
{
startPage();
List<UserOnline> list = userOnlineService.selectUserOnlineList(userOnline);
return getDataTable(list);
}
@RequiresPermissions("monitor:online:batchForceLogout")
@Log(title = "在線用戶", businessType = BusinessType.FORCE)
@PostMapping("/batchForceLogout")
@ResponseBody
public AjaxResult batchForceLogout(@RequestParam("ids[]") String[] ids)
{
for (String sessionId : ids)
{
UserOnline online = userOnlineService.selectOnlineById(sessionId);
if (online == null)
{
return error("用戶已下線");
}
OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
if (onlineSession == null)
{
return error("用戶已下線");
}
if (sessionId.equals(ShiroUtils.getSessionId()))
{
return error("當前登陸用戶無法強退");
}
onlineSession.setStatus(OnlineStatus.off_line);
onlineSessionDAO.update(onlineSession);
online.setStatus(OnlineStatus.off_line);
userOnlineService.saveOnline(online);
}
return success();
}
@RequiresPermissions("monitor:online:forceLogout")
@Log(title = "在線用戶", businessType = BusinessType.FORCE)
@PostMapping("/forceLogout")
@ResponseBody
public AjaxResult forceLogout(String sessionId)
{
UserOnline online = userOnlineService.selectOnlineById(sessionId);
if (sessionId.equals(ShiroUtils.getSessionId()))
{
return error("當前登陸用戶無法強退");
}
if (online == null)
{
return error("用戶已下線");
}
OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
if (onlineSession == null)
{
return error("用戶已下線");
}
onlineSession.setStatus(OnlineStatus.off_line);
onlineSessionDAO.update(onlineSession);
online.setStatus(OnlineStatus.off_line);
userOnlineService.saveOnline(online);
return success();
}
}
package com.code.project.monitor.server.controller;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.code.framework.web.controller.BaseController;
import com.code.project.monitor.server.domain.Server;
/**
* 服務器監控
*
* @author ruoyi
*/
@Controller
@RequestMapping("/monitor/server")
public class ServerController extends BaseController
{
private String prefix = "monitor/server";
@RequiresPermissions("monitor:server:view")
@GetMapping()
public String server(ModelMap mmap) throws Exception
{
Server server = new Server();
server.copyTo();
mmap.put("server", server);
return prefix + "/server";
}
}
五,項目總結
??? 本項目界面簡潔大方,功能完整,適合做課程設計和畢業設計使用,另外可以在此項目框架的基礎上自行添加或修改相關的功能。
原文鏈接:https://blog.csdn.net/whirlwind526/article/details/125109973
相關推薦
- 2022-12-08 C語言實現計算圓周長以及面積_C 語言
- 2023-02-08 Pytorch中torch.repeat_interleave()函數使用及說明_python
- 2022-10-01 React?Hook中useState更新延遲問題及解決_React
- 2023-06-19 C語言如何實現BOOL類型_C 語言
- 2022-07-01 Go?數據結構之二叉樹詳情_Golang
- 2022-04-10 Python?tkinter實現計算器功能_python
- 2023-02-12 Pytorch建模過程中的DataLoader與Dataset示例詳解_python
- 2022-08-15 利用calc函數實現簡單的自適應
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支