|
@@ -0,0 +1,49 @@
|
|
|
+package com.yonge.cooleshow.teacher.controller;
|
|
|
+
|
|
|
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
+import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
+import com.yonge.cooleshow.biz.dal.dto.search.HomeworkSearch;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
|
|
|
+import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Description 老师课后作业相关接口
|
|
|
+ *
|
|
|
+ * @author liujunchi
|
|
|
+ * @date 2022-04-13
|
|
|
+ */
|
|
|
+@Api(tags = "老师课后作业相关接口")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/homework")
|
|
|
+public class CourseHomeworkController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleService courseScheduleService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "未布置的课后作业数量")
|
|
|
+ @GetMapping(value="/count")
|
|
|
+ public HttpResponseResult<Integer> countTeacherNoDecorateHomework() {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null || sysUser.getId() == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ HomeworkSearch homeworkSearch = new HomeworkSearch();
|
|
|
+ // 默认查当前老师,陪练课 课程状态为完成,有学生考勤记录 没有学生课程记录
|
|
|
+ homeworkSearch.setTeacherId(sysUser.getId());
|
|
|
+ homeworkSearch.setCourseStatus(CourseScheduleEnum.COMPLETE);
|
|
|
+ homeworkSearch.setCourseType(CourseScheduleEnum.PRACTICE);
|
|
|
+ return succeed(courseScheduleService.countTeacherNoDecorateHomework(homeworkSearch));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|