——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明










基于javaweb的SpringBoot智慧校园管理系统(java+springboot+maven+mybaits+vue+elementui+mysql)
项目介绍
基于Springboot + vue实现的智慧校园管理系统
系统包含学生、老师、管理员三个角色,分为前后台;
学生:登录、注册、查看计算机软件(收藏、下载、留言)、查看课程(在线观看、下载、留言)、查看音乐(收藏、播放、留言)、个人中心、我的收藏、记事本管理、备忘录管理、宿舍管理、成绩管理等
老师:登录、个人中心、计算机软件管理、计算机软件留言管理、课程管理、课程留言管理、宿舍管理、宿舍人员管理、宿舍归寝管理、宿舍报修管理、音乐管理、成绩管理等
管理员:登录、个人中心、基础数据管理、记事本管理、备忘录管理、计算机软件管理、计算机软件留言管理、课程管理、课程留言管理、宿舍管理、宿舍人员管理、宿舍归寝管理、宿舍报修管理、音乐管理、成绩管理、用户管理、轮播图管理等
技术栈
后端:SpringBoot+Mybaits
前端:Vue+elementui
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| 管理员: admin 123456
教师: t1 123456 t2 123456 t3 123456
用户: s1 123456 s2 123456 s3 123456
后端启动类:StartApplication 前端启动命令:npm run serve
|
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){ params.put("orderBy","id"); } PageUtils page = jisuanjizhuanyeruanjianCollectionService.queryPage(params);
List<JisuanjizhuanyeruanjianCollectionView> list =(List<JisuanjizhuanyeruanjianCollectionView>)page.getList(); for(JisuanjizhuanyeruanjianCollectionView c:list) dictionaryService.dictionaryConvert(c, request); return R.ok().put("data", page); }
@RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id, HttpServletRequest request){ logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id); JisuanjizhuanyeruanjianCollectionEntity jisuanjizhuanyeruanjianCollection = jisuanjizhuanyeruanjianCollectionService.selectById(id); if(jisuanjizhuanyeruanjianCollection !=null){
JisuanjizhuanyeruanjianCollectionView view = new JisuanjizhuanyeruanjianCollectionView(); BeanUtils.copyProperties( jisuanjizhuanyeruanjianCollection , view );
JisuanjizhuanyeruanjianEntity jisuanjizhuanyeruanjian = jisuanjizhuanyeruanjianService.selectById(jisuanjizhuanyeruanjianCollection.getJisuanjizhuanyeruanjianId()); if(jisuanjizhuanyeruanjian != null){ BeanUtils.copyProperties( jisuanjizhuanyeruanjian , view ,new String[]{ "id", "createDate"}); view.setJisuanjizhuanyeruanjianId(jisuanjizhuanyeruanjian.getId()); } YonghuEntity yonghu = yonghuService.selectById(jisuanjizhuanyeruanjianCollection.getYonghuId()); if(yonghu != null){ BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"}); view.setYonghuId(yonghu.getId()); } dictionaryService.dictionaryConvert(view, request); return R.ok().put("data", view);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| List<SusheGuiqinView> list =(List<SusheGuiqinView>)page.getList(); for(SusheGuiqinView c:list){ dictionaryService.dictionaryConvert(c, request); } return R.ok().put("data", page); }
@RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id, HttpServletRequest request){ logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id); SusheGuiqinEntity susheGuiqin = susheGuiqinService.selectById(id); if(susheGuiqin !=null){ SusheGuiqinView view = new SusheGuiqinView(); BeanUtils.copyProperties( susheGuiqin , view );
YonghuEntity yonghu = yonghuService.selectById(susheGuiqin.getYonghuId()); if(yonghu != null){ BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"}); view.setYonghuId(yonghu.getId()); } dictionaryService.dictionaryConvert(view, request); return R.ok().put("data", view); }else { return R.error(511,"查不到数据"); }
}
@RequestMapping("/save") public R save(@RequestBody SusheGuiqinEntity susheGuiqin, HttpServletRequest request){ logger.debug("save方法:,,Controller:{},,susheGuiqin:{}",this.getClass().getName(),susheGuiqin.toString());
String role = String.valueOf(request.getSession().getAttribute("role")); if(false) return R.error(511,"永远不会进入"); else if("用户".equals(role)) susheGuiqin.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| }
for(int i =0; i<legend.size(); i++){ yAxis.add(new ArrayList<String>()); }
Set<String> keys = dataMap.keySet(); for(String key:keys){ xAxis.add(key); HashMap<String, String> map = dataMap.get(key); for(int i =0; i<legend.size(); i++){ List<String> data = yAxis.get(i); if(StringUtil.isNotEmpty(map.get(legend.get(i)))){ data.add(map.get(legend.get(i))); }else{ data.add("0"); } } } System.out.println(); }
Map<String, Object> resultMap = new HashMap<>(); resultMap.put("xAxis",xAxis); resultMap.put("yAxis",yAxis); resultMap.put("legend",legend); return R.ok().put("data", resultMap); }
@RequestMapping("/barCount") public R barCount(@RequestParam Map<String,Object> params) { logger.debug("barCount方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params)); Boolean isJoinTableFlag = false; String one = ""; String two = "";
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| ; logger.info("sql语句:"+queryWrapper.getSqlSegment()); KechengCollectionEntity kechengCollectionEntity = kechengCollectionService.selectOne(queryWrapper); if(kechengCollectionEntity==null){ kechengCollection.setInsertTime(new Date()); kechengCollection.setCreateTime(new Date()); kechengCollectionService.insert(kechengCollection); return R.ok(); }else { return R.error(511,"您已经收藏过了"); } }
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| List<Map<String, Object>> result = commonService.barSum(params);
List<String> xAxis = new ArrayList<>(); List<List<String>> yAxis = new ArrayList<>(); List<String> legend = new ArrayList<>();
if(StringUtil.isEmpty(two)){ List<String> yAxis0 = new ArrayList<>(); yAxis.add(yAxis0); legend.add("数值"); for(Map<String, Object> map :result){ String oneValue = String.valueOf(map.get(one)); String value = String.valueOf(map.get("value")); xAxis.add(oneValue); yAxis0.add(value); } }else{ Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>(); if(StringUtil.isNotEmpty(two)){ for(Map<String, Object> map :result){ String oneValue = String.valueOf(map.get(one)); String twoValue = String.valueOf(map.get(two)); String value = String.valueOf(map.get("value")); if(!legend.contains(twoValue)){ legend.add(twoValue); } if(dataMap.containsKey(oneValue)){ dataMap.get(oneValue).put(twoValue,value); }else{ HashMap<String, String> oneData = new HashMap<>(); oneData.put(twoValue,value); dataMap.put(oneValue,oneData); }
} }
for(int i =0; i<legend.size(); i++){ yAxis.add(new ArrayList<String>()); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| KechengLiuyanEntity kechengLiuyanEntity = new KechengLiuyanEntity();
kechengLiuyanList.add(kechengLiuyanEntity);
}
kechengLiuyanService.insertBatch(kechengLiuyanList); return R.ok(); } } } }catch (Exception e){ e.printStackTrace(); return R.error(511,"批量插入数据异常,请联系管理员"); } }
@IgnoreAuth @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){ logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){ params.put("orderBy","id"); } PageUtils page = kechengLiuyanService.queryPage(params);
List<KechengLiuyanView> list =(List<KechengLiuyanView>)page.getList(); for(KechengLiuyanView c:list) dictionaryService.dictionaryConvert(c, request);
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=051524522608201oh
https://javayms.pages.dev?id=051524522608201oh