|
|
@@ -4,19 +4,20 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.dz.service.IDzControlService;
|
|
|
import com.ruoyi.dz.service.IDzSubjectService;
|
|
|
import com.ruoyi.learn.domain.LearnTest;
|
|
|
import com.ruoyi.learn.service.ILearnTestService;
|
|
|
+import com.ruoyi.web.service.LearnStatService;
|
|
|
import com.ruoyi.web.service.LearnTeacherService;
|
|
|
+import com.ruoyi.web.service.StudentService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -28,19 +29,24 @@ public class FrontTeacherController extends BaseController {
|
|
|
private final IDzSubjectService dzSubjectService;
|
|
|
private final ILearnTestService learnTestService;
|
|
|
private final LearnTeacherService learnTeacherService;
|
|
|
+ private final StudentService studentService;
|
|
|
+ private final LearnStatService learnStatService;
|
|
|
|
|
|
- public FrontTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, ILearnTestService learnTestService, LearnTeacherService learnTeacherService) {
|
|
|
+ public FrontTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, ILearnTestService learnTestService, LearnTeacherService learnTeacherService, StudentService studentService, LearnStatService learnStatService) {
|
|
|
this.dzControlService = dzControlService;
|
|
|
this.dzSubjectService = dzSubjectService;
|
|
|
this.learnTestService = learnTestService;
|
|
|
this.learnTeacherService = learnTeacherService;
|
|
|
+ this.studentService = studentService;
|
|
|
+ this.learnStatService = learnStatService;
|
|
|
}
|
|
|
|
|
|
@ApiOperation("10 查询班级列表")
|
|
|
@GetMapping("classes")
|
|
|
public AjaxResult getClasses()
|
|
|
{
|
|
|
- return AjaxResult.success(learnTeacherService.getClasses(getUserId()));
|
|
|
+ SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+ return AjaxResult.success(learnTeacherService.getClasses(sysUser.getUserTypeId()));
|
|
|
}
|
|
|
|
|
|
@ApiOperation("10 查询批次列表")
|
|
|
@@ -101,69 +107,43 @@ public class FrontTeacherController extends BaseController {
|
|
|
|
|
|
@ApiOperation("记录-计划刷题 有班级显示学生")
|
|
|
@GetMapping("record/planStudy")
|
|
|
- public AjaxResult getRecordStudy()
|
|
|
+ public TableDataInfo getRecordStudy(@ApiParam("班级") @RequestParam Long classId, @ApiParam("排序字段total/time/rate") @RequestParam String sortField, @ApiParam("升序") @RequestParam Boolean asc)
|
|
|
{
|
|
|
- JSONObject data = JSONObject.of("seq", "1", "name", "XM", "total", "658", "study", 20, "rate", 39);
|
|
|
- List<JSONObject> list = Lists.newArrayList(data);
|
|
|
- return AjaxResult.success(list);
|
|
|
+ return getDataTable(learnStatService.getClassRecordPlanStudy(classId, sortField, asc));
|
|
|
}
|
|
|
|
|
|
@ApiOperation("记录-计划刷题明细")
|
|
|
- @GetMapping("record/planStudy/{id}")
|
|
|
- public AjaxResult getRecordPlanStudyDetail(Integer year, Integer monthSeq, Integer weekSeq, @ApiParam("记录sid") @PathVariable("recordId") Integer recordId)
|
|
|
+ @GetMapping("record/planStudy/{recordId}")
|
|
|
+ public AjaxResult getRecordPlanStudyDetail(@ApiParam("年份") @RequestParam Integer year, @ApiParam("月份") @RequestParam(required = false) Long month, @ApiParam("记录sid") @PathVariable("recordId") Long recordId)
|
|
|
{
|
|
|
- JSONObject result = new JSONObject();
|
|
|
- result.put("total", 140);
|
|
|
- result.put("rate", 85);
|
|
|
- result.put("studyDays", 3);
|
|
|
- JSONObject data = JSONObject.of("date", "2025.09.03", "study", "90", "rate", "80", "pass", true);
|
|
|
- List<JSONObject> list = Lists.newArrayList(data);
|
|
|
- result.put("list", list);
|
|
|
- return AjaxResult.success(result);
|
|
|
+ return AjaxResult.success(learnStatService.getRecordPlanStudy(recordId, year, month));
|
|
|
}
|
|
|
|
|
|
@ApiOperation("知识点")
|
|
|
@GetMapping("record/knowledge")
|
|
|
- public AjaxResult getRecordKnowledge(@ApiParam("班级id") Integer classId)
|
|
|
+ public AjaxResult getRecordKnowledge(@ApiParam("班级id") @RequestParam Long classId)
|
|
|
{
|
|
|
- JSONObject result = new JSONObject();
|
|
|
- result.put("rate", 48);
|
|
|
- JSONObject data = JSONObject.of("seq", "1", "name", "XM", "total", "658", "rate", 39);
|
|
|
- List<JSONObject> list = Lists.newArrayList(data);
|
|
|
- result.put("list", list);
|
|
|
- return AjaxResult.success(result);
|
|
|
+ return AjaxResult.success(learnStatService.getClassRecordKnowledge(classId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation("知识点")
|
|
|
@GetMapping("record/knowledge/{recordId}")
|
|
|
- public TableDataInfo getRecordKnowledgeDetail(@ApiParam("记录sid") @PathVariable("recordId") Integer recordId)
|
|
|
+ public TableDataInfo getRecordKnowledgeDetail(@ApiParam("记录sid") @PathVariable("recordId") Long recordId)
|
|
|
{
|
|
|
- JSONObject data = JSONObject.of("name", "", "directed", true, "rate", 82, "total", 1470);
|
|
|
- List<JSONObject> list = Lists.newArrayList(data);
|
|
|
- return getDataTable(list);
|
|
|
+ return getDataTable(learnStatService.getRecordKnowledge(recordId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation("视频记录")
|
|
|
@GetMapping("record/video")
|
|
|
- public AjaxResult getRecordVideo(@ApiParam("班级id") Integer classId)
|
|
|
+ public TableDataInfo getRecordVideo(@ApiParam("班级id") Long classId, @ApiParam("排序") boolean asc)
|
|
|
{
|
|
|
- JSONObject result = new JSONObject();
|
|
|
- JSONObject data = JSONObject.of("seq", "1", "name", "XM", "total", "658", "study", 20);
|
|
|
- List<JSONObject> list = Lists.newArrayList(data);
|
|
|
- result.put("list", list);
|
|
|
- return AjaxResult.success(result);
|
|
|
+ return getDataTable(learnStatService.getClassRecordVideo(classId, asc));
|
|
|
}
|
|
|
|
|
|
@ApiOperation("视频记录")
|
|
|
@GetMapping("record/video/{recordId}")
|
|
|
- public AjaxResult getRecordVideoDetail(@ApiParam("记录sid") @PathVariable("recordId") Integer recordId)
|
|
|
+ public AjaxResult getRecordVideoDetail(@ApiParam("记录sid") @PathVariable("recordId") Long recordId)
|
|
|
{
|
|
|
- JSONObject result = new JSONObject();
|
|
|
- result.put("total", 98);
|
|
|
- result.put("study", 759);
|
|
|
- JSONObject data = JSONObject.of("name", "充分条件", "date", "2025.09.11", "study", "02:46");
|
|
|
- List<JSONObject> list = Lists.newArrayList(data);
|
|
|
- result.put("list", list);
|
|
|
- return AjaxResult.success(result);
|
|
|
+ return AjaxResult.success(learnStatService.getRecordVideo(recordId));
|
|
|
}
|
|
|
}
|