|
@@ -3,9 +3,11 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ym.mec.biz.dal.dao.StudentLessonTrainingDetailMapper;
|
|
|
+import com.ym.mec.biz.dal.dao.SubjectDao;
|
|
|
import com.ym.mec.biz.dal.dao.SysMusicScoreDao;
|
|
|
import com.ym.mec.biz.dal.dto.StudentLessonTrainingDetailWrapper;
|
|
|
import com.ym.mec.biz.dal.entity.StudentLessonTrainingDetail;
|
|
|
+import com.ym.mec.biz.dal.entity.Subject;
|
|
|
import com.ym.mec.biz.dal.entity.SysMusicScore;
|
|
|
import com.ym.mec.biz.dal.enums.ELessonTrainingType;
|
|
|
import com.ym.mec.biz.dal.enums.StandardEnum;
|
|
@@ -32,6 +34,10 @@ public class StudentLessonTrainingDetailServiceImpl extends ServiceImpl<StudentL
|
|
|
|
|
|
@Autowired
|
|
|
private SysMusicScoreDao sysMusicScoreDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SubjectDao subjectDao;
|
|
|
+
|
|
|
/**
|
|
|
* 查询详情
|
|
|
* @param id 详情ID
|
|
@@ -160,6 +166,33 @@ public class StudentLessonTrainingDetailServiceImpl extends ServiceImpl<StudentL
|
|
|
studentLessonTrainingDetail.setMusicScoreName(sysMusicScore.getName());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 声部
|
|
|
+ List<Integer> subjectIdList = studentLessonTrainingDetails.stream()
|
|
|
+ .map(o -> {
|
|
|
+ if (o.getSubjectId() != null) {
|
|
|
+ return o.getSubjectId().intValue();
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<Subject> subjectList = subjectDao.findBySubjectIds(subjectIdList);
|
|
|
+
|
|
|
+ // id 分组
|
|
|
+ Map<Integer, Subject> subjectMap = subjectList.stream()
|
|
|
+ .collect(Collectors.toMap(Subject::getId, Function.identity()));
|
|
|
+
|
|
|
+ for (StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail studentLessonTrainingDetail : studentLessonTrainingDetails) {
|
|
|
+ if (studentLessonTrainingDetail.getSubjectId() == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Subject subject = subjectMap.get(studentLessonTrainingDetail.getSubjectId().intValue());
|
|
|
+ if (subject != null) {
|
|
|
+ studentLessonTrainingDetail.setSubjectName(subject.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return studentLessonTrainingDetails;
|
|
|
}
|
|
|
}
|