3.4 授课管理模块
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询授课") public Result<IPage<GiveLessons>> getByPage(@ModelAttribute GiveLessons giveLessons ,@ModelAttribute PageVo page){ QueryWrapper<GiveLessons> qw = new QueryWrapper<>(); if(!ZwzNullUtils.isNull(giveLessons.getCurriculumName())) { qw.like("curriculum_name",giveLessons.getCurriculumName()); } if(!ZwzNullUtils.isNull(giveLessons.getTeaName())) { qw.like("tea_name",giveLessons.getTeaName()); } IPage<GiveLessons> data = iGiveLessonsService.page(PageUtil.initMpPage(page),qw); return new ResultUtil<IPage<GiveLessons>>().setData(data); }
@RequestMapping(value = "/update", method = RequestMethod.POST) @ApiOperation(value = "编辑授课") public Result<GiveLessons> update(GiveLessons giveLessons){ Curriculum c = iCurriculumService.getById(giveLessons.getCurriculumId()); if(c == null) { return ResultUtil.error("课程不存在"); } giveLessons.setCurriculumName(c.getTitle()); giveLessons.setImage(c.getImage()); User t = iUserService.getById(giveLessons.getTeaId()); if(t == null) { return ResultUtil.error("老师不存在"); } giveLessons.setTeaName(t.getNickname()); iGiveLessonsService.saveOrUpdate(giveLessons); return new ResultUtil<GiveLessons>().setData(giveLessons); }
3.5 课程考勤模块
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询课程考勤") public Result<IPage<Attendance>> getByPage(@ModelAttribute Attendance attendance ,@ModelAttribute PageVo page){ QueryWrapper<Attendance> qw = new QueryWrapper<>(); User currUser = securityUtil.getCurrUser(); QueryWrapper<User> userQw = new QueryWrapper<>(); userQw.eq("id",currUser.getId()); userQw.inSql("id","SELECT user_id FROM a_user_role WHERE del_flag = 0 AND (role_id = '1667344323877933056' OR role_id = '1536606659751841799')"); if(iUserService.count(userQw) < 1L) { qw.eq("stu_id",currUser.getId()); } if(!ZwzNullUtils.isNull(attendance.getCurriculumName())) { qw.like("curriculum_name",attendance.getCurriculumName()); } if(!ZwzNullUtils.isNull(attendance.getStuName())) { qw.like("stu_name",attendance.getStuName()); } IPage<Attendance> data = iAttendanceService.page(PageUtil.initMpPage(page),qw); return new ResultUtil<IPage<Attendance>>().setData(data); }
@RequestMapping(value = "/insert", method = RequestMethod.POST) @ApiOperation(value = "新增课程考勤") public Result<Attendance> insert(Attendance attendance){ Curriculum c = iCurriculumService.getById(attendance.getCurriculumId()); if(c == null) { return ResultUtil.error("课程不存在"); } attendance.setCurriculumName(c.getTitle()); attendance.setImage(c.getImage()); User s = iUserService.getById(attendance.getStuId()); if(s == null) { return ResultUtil.error("学生不存在"); } attendance.setStuName(s.getNickname()); iAttendanceService.saveOrUpdate(attendance); return new ResultUtil<Attendance>().setData(attendance); }
3.6 课程评价模块
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询课程评价") public Result<IPage<Appraise>> getByPage(@ModelAttribute Appraise appraise ,@ModelAttribute PageVo page){ QueryWrapper<Appraise> qw = new QueryWrapper<>(); if(!ZwzNullUtils.isNull(appraise.getCurriculumName())) { qw.like("curriculum_name",appraise.getCurriculumName()); } if(!ZwzNullUtils.isNull(appraise.getStuName())) { qw.like("stu_name",appraise.getStuName()); } IPage<Appraise> data = iAppraiseService.page(PageUtil.initMpPage(page),qw); return new ResultUtil<IPage<Appraise>>().setData(data); }
@RequestMapping(value = "/addOne", method = RequestMethod.GET) @ApiOperation(value = "添加评价") public Result<Object> addOne(@RequestParam String id,@RequestParam String content){ Curriculum c = iCurriculumService.getById(id); if(c == null) { return ResultUtil.error("课程不存在"); } User currUser = securityUtil.getCurrUser(); Appraise a = new Appraise(); a.setCurriculumId(c.getId()); a.setCurriculumName(c.getTitle()); a.setImage(c.getImage()); a.setStuId(currUser.getId()); a.setStuName(currUser.getNickname()); a.setContent(content); iAppraiseService.saveOrUpdate(a); return ResultUtil.success(); }
3.7 课程成绩模块
@RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "查询课程成绩") public Result<IPage<Achievement>> getByPage(@ModelAttribute Achievement achievement ,@ModelAttribute PageVo page){ QueryWrapper<Achievement> qw = new QueryWrapper<>(); User currUser = securityUtil.getCurrUser(); QueryWrapper<User> userQw = new QueryWrapper<>(); userQw.eq("id",currUser.getId()); userQw.inSql("id","SELECT user_id FROM a_user_role WHERE del_flag = 0 AND (role_id = '1667344323877933056' OR role_id = '1536606659751841799')"); if(iUserService.count(userQw) < 1L) { qw.eq("stu_id",currUser.getId()); } if(!ZwzNullUtils.isNull(achievement.getCurriculumName())) { qw.like("curriculum_name",achievement.getCurriculumName()); } if(!ZwzNullUtils.isNull(achievement.getStuName())) { qw.like("stu_name",achievement.getStuName()); } if(!ZwzNullUtils.isNull(achievement.getTeaName())) { qw.like("tea_name",achievement.getTeaName()); } IPage<Achievement> data = iAchievementService.page(PageUtil.initMpPage(page),qw); return new ResultUtil<IPage<Achievement>>().setData(data); }
@RequestMapping(value = "/makeGrade", method = RequestMethod.GET) @ApiOperation(value = "打分") public Result<Object> makeGrade(@RequestParam String id,@RequestParam BigDecimal grade){ Achievement a = iAchievementService.getById(id); if(a == null) { return ResultUtil.error("成绩单不存在"); } a.setNumber1(grade); a.setNumberSum(a.getNumber1().multiply(BigDecimal.valueOf(0.6)).add(a.getNumber2().multiply(BigDecimal.valueOf(0.4)))); iAchievementService.saveOrUpdate(a); return ResultUtil.success(); }
3.8 可视化图表
@RequestMapping(value = "/getAntvVoList2", method = RequestMethod.GET) @ApiOperation(value = "教龄分析") public Result<List<AntvVo>> getAntvVoList2(){ List<AntvVo> ansList = new ArrayList<>(); QueryWrapper<User> userQw = new QueryWrapper<>(); userQw.eq("type",1); List<User> teacherList = iUserService.list(userQw); for (User o : teacherList) { boolean flag = false; for (AntvVo vo : ansList) { if(Objects.equals(vo.getTitle(),o.getAge().toString())) { flag = true; vo.setValue(vo.getValue().add(BigDecimal.ONE)); break; } } if(!flag) { AntvVo vo = new AntvVo(); vo.setTitle(o.getAge().toString()); vo.setType("教龄"); vo.setValue(BigDecimal.ONE); ansList.add(vo); } } return new ResultUtil<List<AntvVo>>().setData(ansList); }
@RequestMapping(value = "/getAntvVoList1", method = RequestMethod.GET) @ApiOperation(value = "工资分析") public Result<List<AntvVo>> getAntvVoList1(){ List<AntvVo> ansList = new ArrayList<>(); QueryWrapper<User> userQw = new QueryWrapper<>(); userQw.eq("type",1); List<User> teacherList = iUserService.list(userQw); for (User o : teacherList) { String title = change1(o.getMoneyData()); boolean flag = false; for (AntvVo vo : ansList) { if(Objects.equals(vo.getTitle(),title)) { flag = true; vo.setValue(vo.getValue().add(BigDecimal.ONE)); break; } } if(!flag) { AntvVo vo = new AntvVo(); vo.setTitle(title); vo.setType("工资"); vo.setValue(BigDecimal.ONE); ansList.add(vo); } } return new ResultUtil<List<AntvVo>>().setData(ansList); }
截止现在,大学兼职教师管理系统终于开发完成,在大学兼职教师管理系统的开发过程中,我首先对大学兼职教师管理系统的研究背景和意义进行了评估,然后去图书馆查阅大量关于大学兼职教师管理系统的国内外现状,最后得出大学兼职教师管理系统的主要研究内容,完成了论文的第一章。接着上网查阅了现有的大学兼职教师管理系统产品,确定了大学兼职教师管理系统采用的关键技术,接着对大学兼职教师管理系统的功能需求和使用群体进行了分析和总结,最后完成了大学兼职教师管理系统的设计和实现。
未来,我将会花费更多时间,完善大学兼职教师管理系统的其他功能模块,比如提供第三方的API接口,开发和企业微信和钉钉进行免登整合等功能,让大学兼职教师管理系统变得更强大。