基于Java的学生管理系统
生活随笔
收集整理的這篇文章主要介紹了
基于Java的学生管理系统
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
學生管理系統ManageSystem
一、系統架構與環境
1.1 springboot2.3.4
1.2 maven3.3.9
1.3 jdk1.8
1.4 mysql5.7
1.5 ssm架構單服務節點
二、具備的功能
1. 用戶管理
2. 文件上傳下載
3. 菜單管理
4. 學生管理
5. 日志管理
6. 個人中心
7. 教師管理
8. 課程管理
9. 班級管理
10. 授課管理
11. 成績管理
三、系統截圖
3.1登錄頁面
3.2管理員登錄功能
3.3教師登錄功能
3.4學生登錄功能
3.5個人中心截圖
四、代碼展示
4.1 上傳文件代碼
@RequestMapping("/uploadFile")@ResponseBodypublic ResponseResult upload(@RequestParam("file")MultipartFile file){System.out.println(file.toString());// 1.創建返回對象ResponseResult responseResult = new ResponseResult();// 2.創建一個json對象 用于存儲返回數據信息 // JSONObject result = new JSONObject();Map<String,Object> result = new HashMap<>();try{// 3.判斷文件是否為空if(file.isEmpty()){responseResult.setInfo("上傳文件不存在!!!");responseResult.setSuccess(false);return responseResult;}// 4.定義文件存放的路徑String rootPath = fileConfiguration.getResourceDir();// 5.獲取當前系統日期SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");String currentDate = sdf.format(new Date());// 6.查詢系統配置表,獲取上傳文件夾名稱SystemConfig systemConfig = systemService.getSystem();String uploadDir = systemConfig.getUploaddir();// 7.構建文件存放的全目錄File directory = new File(rootPath + File.separator+ uploadDir + File.separator + currentDate);// 8.判斷這個目錄是否存在 不存在則創建if(!directory.exists()){directory.mkdirs();}// 9.生成新的文件名稱String newFileName = UUIDUtils.getPrimaryKey() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));// 10.獲取創建好的絕對路徑String absolutePath = directory.getAbsolutePath();// 11.構建上傳路徑File uploadpath = new File(absolutePath + File.separator + newFileName);// 12.上傳文件file.transferTo(uploadpath);// 13.封裝返回信息result.put("filepath", currentDate+File.separator + newFileName);result.put("name", newFileName);result.put("originalFilename", file.getOriginalFilename());result.put("filesize", file.getSize());result.put("filetype", file.getContentType());result.put("url", "http://localhost:8866/" + File.separator + uploadDir + File.separator + currentDate + File.separator + newFileName);responseResult.setSuccess(true);responseResult.setInfo("上傳文件成功!!!");responseResult.setData(result);System.out.println(responseResult);return responseResult;}catch (Exception e){responseResult.setInfo("上傳文件失敗!!!");responseResult.setSuccess(false);return responseResult;}}歡迎留言—LOVE
總結
以上是生活随笔為你收集整理的基于Java的学生管理系统的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 用HTML+CSS仿网易云音乐网站(6个
- 下一篇: 【笔记目录1】【jessetalk 】A