|
@@ -11,6 +11,7 @@ import com.ym.mec.education.enums.ReturnCodeEnum;
|
|
|
import com.ym.mec.education.mapper.StudentCourseHomeworkMapper;
|
|
|
import com.ym.mec.education.req.HomeWorkDetailReq;
|
|
|
import com.ym.mec.education.req.HomeWorkReq;
|
|
|
+import com.ym.mec.education.resp.CourseHomeworkResp;
|
|
|
import com.ym.mec.education.resp.HomeWrokDetailResp;
|
|
|
import com.ym.mec.education.resp.HomeWrokResp;
|
|
|
import com.ym.mec.education.resp.HomeworkReplyResp;
|
|
@@ -49,6 +50,12 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
|
|
|
@Autowired
|
|
|
private IStudentCourseHomeworkReplyService studentCourseHomeworkReplyService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseScheduleService courseScheduleService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICourseHomeworkService courseHomeworkService;
|
|
|
+
|
|
|
@Override
|
|
|
public PageResponse workList(HomeWorkReq req) {
|
|
|
|
|
@@ -144,4 +151,44 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
|
|
|
}
|
|
|
return BaseResponse.success(resp);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作业列表
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public PageResponse homeWorkList(HomeWorkReq req) {
|
|
|
+ PageResponse response = new PageResponse();
|
|
|
+ IPage ipage = new Page(req.getPageNo() == null ? 1: req.getPageNo(),req.getPageSize() == null ? 10:req.getPageSize());
|
|
|
+ QueryWrapper<CourseHomework> queryWrapper = new QueryWrapper<>();
|
|
|
+ IPage<CourseHomework> courseScheduleIPage = courseHomeworkService.page(ipage,queryWrapper);
|
|
|
+
|
|
|
+ List<CourseHomework> courseSchedules = courseScheduleIPage.getRecords();
|
|
|
+ List<CourseHomeworkResp> courseHomeworkRespList = new ArrayList<>();
|
|
|
+ if(!CollectionUtils.isEmpty(courseSchedules)){
|
|
|
+ courseSchedules.forEach(e ->{
|
|
|
+ CourseHomeworkResp resp = new CourseHomeworkResp();
|
|
|
+ BeanUtils.copyProperties(e,resp);
|
|
|
+ CourseSchedule courseSchedule = courseScheduleService.getById(e.getCourseScheduleId());
|
|
|
+ if(courseSchedule != null){
|
|
|
+ resp.setCourseName(courseSchedule.getName());
|
|
|
+
|
|
|
+ }
|
|
|
+ ClassGroup classGroup = classGroupService.getById(e.getClassGroupId());
|
|
|
+ if(classGroup != null){
|
|
|
+ resp.setTotalClassTimes(classGroup.getTotalClassTimes());
|
|
|
+ resp.setCurrentClassTimes(classGroup.getCurrentClassTimes());
|
|
|
+ }
|
|
|
+ courseHomeworkRespList.add(resp);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ response.setRecords(courseHomeworkRespList);
|
|
|
+ response.setTotal(Math.toIntExact(courseScheduleIPage.getTotal()));
|
|
|
+ response.setCurrent(Math.toIntExact(courseScheduleIPage.getCurrent()));
|
|
|
+ response.setSize(Math.toIntExact(courseScheduleIPage.getSize()));
|
|
|
+ response.setReturnCode(ReturnCodeEnum.CODE_200.getCode());
|
|
|
+ response.setMessage(ReturnCodeEnum.CODE_200.getValue());
|
|
|
+ return response;
|
|
|
+ }
|
|
|
}
|