|
@@ -14,6 +14,7 @@ import com.yonge.cooleshow.biz.dal.dto.search.HomeworkSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.CourseHomework;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.CourseSchedule;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.CourseScheduleStudentPayment;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.ImGroup;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
|
|
@@ -57,6 +58,9 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private ImGroupService imGroupService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
|
|
|
|
|
|
@Override
|
|
@@ -72,16 +76,21 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
|
|
|
if (CollectionUtils.isEmpty(records)) {
|
|
|
return courseHomeworkVoIPage;
|
|
|
}
|
|
|
- List<CourseHomeworkVo> practiceRecord = records.stream()
|
|
|
- .filter(courseHomeworkVo -> courseHomeworkVo.getType().getCode().equals(CourseScheduleEnum.PRACTICE.getCode()))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ List<Long> practiceRecordIdList = records.stream()
|
|
|
+ .filter(courseHomeworkVo -> courseHomeworkVo.getType().getCode().equals(CourseScheduleEnum.PRACTICE.getCode()))
|
|
|
+ .map(CourseHomeworkVo::getCourseId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<Long> recordIdList = records.stream()
|
|
|
+ .map(CourseHomeworkVo::getCourseId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
|
// 学生信息 陪练课展示
|
|
|
- List<CourseHomeworkVo> studentInfoList = new ArrayList<>();
|
|
|
- if (CollectionUtils.isEmpty(practiceRecord)) {
|
|
|
+ List<CourseHomeworkVo> studentInfoList;
|
|
|
+ if (CollectionUtils.isEmpty(practiceRecordIdList)) {
|
|
|
studentInfoList = new ArrayList<>();
|
|
|
} else{
|
|
|
- baseMapper.selectStudentInfo(practiceRecord);
|
|
|
+ studentInfoList = baseMapper.selectStudentInfo(practiceRecordIdList);
|
|
|
}
|
|
|
if (CollectionUtils.isEmpty(studentInfoList)) {
|
|
|
studentInfoList = new ArrayList<>();
|
|
@@ -90,7 +99,7 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
|
|
|
.collect(Collectors.groupingBy( CourseHomeworkVo::getCourseId));
|
|
|
|
|
|
// 老师信息
|
|
|
- List<CourseHomeworkVo> teacherInfoList = baseMapper.selectTeacherInfo(records);
|
|
|
+ List<CourseHomeworkVo> teacherInfoList = baseMapper.selectTeacherInfo(practiceRecordIdList);
|
|
|
if (CollectionUtils.isEmpty(teacherInfoList)) {
|
|
|
teacherInfoList = new ArrayList<>();
|
|
|
}
|
|
@@ -100,7 +109,7 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
|
|
|
// 旷课状态 学生端展示
|
|
|
Map<Long, List<CourseHomeworkVo>> absenteeismCollect = new HashMap<>();
|
|
|
if (query.getStudentId() != null) {
|
|
|
- List<CourseHomeworkVo> absenteeismList = baseMapper.selectAbsenteeism(records,query.getStudentId());
|
|
|
+ List<CourseHomeworkVo> absenteeismList = baseMapper.selectAbsenteeism(practiceRecordIdList,query.getStudentId());
|
|
|
if (CollectionUtils.isEmpty(absenteeismList)) {
|
|
|
absenteeismList = new ArrayList<>();
|
|
|
}
|
|
@@ -109,12 +118,12 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
|
|
|
|
|
|
|
|
|
// 声部信息
|
|
|
- List<CourseHomeworkVo> subjectList = baseMapper.selectSubjectAndGroupInfoList(records);
|
|
|
+ List<CourseHomeworkVo> subjectList = baseMapper.selectSubjectAndGroupInfoList(recordIdList);
|
|
|
|
|
|
if (CollectionUtils.isEmpty(subjectList)) {
|
|
|
subjectList = new ArrayList<>();
|
|
|
}
|
|
|
- Map<Long, List<CourseHomeworkVo>>subjectCollect = subjectList.stream()
|
|
|
+ Map<Long, List<CourseHomeworkVo>> subjectCollect = subjectList.stream()
|
|
|
.collect(Collectors.groupingBy( CourseHomeworkVo::getCourseId));
|
|
|
|
|
|
for (CourseHomeworkVo record : records) {
|
|
@@ -365,12 +374,19 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
|
|
|
if (courseScheduleHomeworkVo == null) {
|
|
|
return courseScheduleHomeworkVo;
|
|
|
}
|
|
|
+ // 课程组的群聊
|
|
|
+ ImGroup imGroup = imGroupService.getByCourseGroupId(courseScheduleHomeworkVo.getCourseGroupId());
|
|
|
+ if (imGroup != null) {
|
|
|
+ courseScheduleHomeworkVo.setImGroupId(imGroup.getId());
|
|
|
+ }
|
|
|
|
|
|
// 课程人员作业
|
|
|
IPage<StudentHomeworkVo> studentHomeworkList = baseMapper
|
|
|
.selectStudentHomeworkByCourseId(PageUtil.getPage(query),query.getCourseId());
|
|
|
|
|
|
+
|
|
|
courseScheduleHomeworkVo.setStudentHomeworkList(studentHomeworkList);
|
|
|
+ courseScheduleHomeworkVo.setStudentNum(studentHomeworkList.getTotal());
|
|
|
return courseScheduleHomeworkVo;
|
|
|
|
|
|
}
|