diff --git a/src/main/java/cn/teammodel/controller/admin/controller/TeacherController.java b/src/main/java/cn/teammodel/controller/admin/controller/TeacherController.java index 351e905..10c5740 100644 --- a/src/main/java/cn/teammodel/controller/admin/controller/TeacherController.java +++ b/src/main/java/cn/teammodel/controller/admin/controller/TeacherController.java @@ -61,4 +61,18 @@ public class TeacherController { return R.success(res); } + @PostMapping("getTeachingAndResearch") + @ApiOperation("获取教师教研数据") + public R> getTeachingAndResearch(@Valid @RequestBody TeacherDto teacherDto, HttpServletRequest request) { + Map res = teacherService.getTeachingAndResearch(teacherDto,request); + return R.success(res); + } + @PostMapping("getTeachingOfTeacher") + @ApiOperation("获取教师教学法数据") + public R>>> getTeachingOfTeacher(@Valid @RequestBody TeacherDto teacherDto, HttpServletRequest request) { + List>> res = teacherService.getTeachingOfTeacher(teacherDto,request); + return R.success(res); + } + + } diff --git a/src/main/java/cn/teammodel/controller/admin/service/TeacherService.java b/src/main/java/cn/teammodel/controller/admin/service/TeacherService.java index b3425e8..a1ebbff 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/TeacherService.java +++ b/src/main/java/cn/teammodel/controller/admin/service/TeacherService.java @@ -14,4 +14,6 @@ public interface TeacherService { Map getTeacherLearningCategory(TeacherDto teacherDto); Map getTeacherGradeCount(TeacherDto teacherDto, HttpServletRequest request); List>> getDistributionOfTeachers(TeacherDto teacherDto, HttpServletRequest request); + Map getTeachingAndResearch(TeacherDto teacherDto, HttpServletRequest request); + List>> getTeachingOfTeacher(TeacherDto teacherDto, HttpServletRequest request); } diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java index 29eaf5b..12c5fe0 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/TeacherServiceImpl.java @@ -728,6 +728,78 @@ public class TeacherServiceImpl implements TeacherService { return distributionList; } + @Override + public Map getTeachingAndResearch(TeacherDto teacherDto, HttpServletRequest request) { + Map map = new HashMap<>(); + //录课数 + map.put("Lessons",new Random().nextInt(100) + 1); + //T(数据) + map.put("TData",new Random().nextInt(100) + 1); + //T(绿灯) + map.put("TGreen",new Random().nextInt(100) + 1); + //双绿灯 + map.put("DoubleGreen",new Random().nextInt(100) + 1); + //观课数 + map.put("WLessons",new Random().nextInt(100) + 1); + //议课数 + map.put("TLessons",new Random().nextInt(100) + 1); + //频道数 + map.put("Channels",new Random().nextInt(20) + 1); + //公开课 + map.put("OLessons",new Random().nextInt(100) + 1); + //课件数 + map.put("Coursewares",new Random().nextInt(100) + 1); + //教案数 + map.put("TeachingPlan",new Random().nextInt(40) + 1); + //公开标记 + map.put("OMarkers",new Random().nextInt(30) + 1); + //个人标记 + map.put("PMarkers",new Random().nextInt(30) + 1); + //被标记数 + map.put("TMarkers",new Random().nextInt(30) + 1); + //被点阅数 + map.put("ClickAndRead",new Random().nextInt(100) + 1); + return map; + } + + @Override + public List>> getTeachingOfTeacher(TeacherDto teacherDto, HttpServletRequest request) { + List>> list = new ArrayList<>(); + if(teacherDto.getGrade() != null) { + Map> map = new HashMap<>(); + Map mapTeach = new HashMap<>(); + mapTeach.put("interaction", new Random().nextInt(50) + 1); + mapTeach.put("test", new Random().nextInt(50) + 1); + mapTeach.put("differentiation", new Random().nextInt(50) + 1); + map.put(teacherDto.getGrade(), mapTeach); + list.add(map); + }else { + + List school = schoolRepository.findBaseById(teacherDto.getCode()); + List grades = new ArrayList<>(); + if(school != null && !school.isEmpty()) { + for (School base : school) { + for (School.Period period : base.getPeriod()) { + if(period.getId().equals(teacherDto.getPeriodId())) { + grades = period.getGrades(); + } + } + } + } + Map> map = new HashMap<>(); + for (String grade : grades) { + Map mapTeach = new HashMap<>(); + mapTeach.put("interaction", new Random().nextInt(50) + 1); + mapTeach.put("test", new Random().nextInt(50) + 1); + mapTeach.put("differentiation", new Random().nextInt(50) + 1); + map.put(grade, mapTeach); + } + list.add(map); + } + + return list; + } + public Map getTeacherBase(GpTeacherDto gpTeacherDto, HttpServletRequest request) { Map gradeMap;