|
@@ -14,10 +14,7 @@ import com.ym.mec.education.enums.TeachTypeEnum;
|
|
|
import com.ym.mec.education.mapper.CourseScheduleMapper;
|
|
|
import com.ym.mec.education.req.ClassGroupReq;
|
|
|
import com.ym.mec.education.resp.CourseScheduleResp;
|
|
|
-import com.ym.mec.education.service.IClassGroupService;
|
|
|
-import com.ym.mec.education.service.IClassGroupTeacherMapperService;
|
|
|
-import com.ym.mec.education.service.ICourseScheduleService;
|
|
|
-import com.ym.mec.education.service.ISysUserService;
|
|
|
+import com.ym.mec.education.service.*;
|
|
|
import com.ym.mec.education.utils.DateUtil;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -42,6 +39,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
|
|
|
private IClassGroupTeacherMapperService classGroupTeacherMapperService;
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
+ @Autowired
|
|
|
+ private ISubjectService subjectService;
|
|
|
|
|
|
@Override
|
|
|
public PageResponse getPage(ClassGroupReq classGroupReq) {
|
|
@@ -53,19 +52,19 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
|
|
|
List<CourseScheduleResp> courseScheduleRespList = Lists.newArrayList();
|
|
|
BeanUtils.copyProperties(courseScheduleIPage, pageResult);
|
|
|
ClassGroup classGroup = groupService.getById(classGroupReq.getGroupId());
|
|
|
- courseScheduleIPage.getRecords().forEach(item ->{
|
|
|
+ courseScheduleIPage.getRecords().forEach(item -> {
|
|
|
CourseScheduleResp courseScheduleResp = new CourseScheduleResp();
|
|
|
courseScheduleResp.setClassDate(DateUtil.date2String(item.getClassDate())
|
|
|
+ " " + DateUtil.date2Week(item.getClassDate()))
|
|
|
.setClassTime(DateUtil.time2String(item.getStartClassTime()) + "-" + DateUtil.time2String(item.getEndClassTime()))
|
|
|
- .setClassGroupName(classGroup.getName());
|
|
|
+ .setSubjectName(subjectService.getSubjectNameList(classGroup.getSubjectIdList()));
|
|
|
QueryWrapper<ClassGroupTeacherMapper> classGroupTeacherMapperQueryWrapper = new QueryWrapper<>();
|
|
|
classGroupTeacherMapperQueryWrapper.lambda().eq(true, ClassGroupTeacherMapper::getClassGroupId, item.getClassGroupId())
|
|
|
.eq(true, ClassGroupTeacherMapper::getTeacherRole, TeachTypeEnum.BISHOP.getCode());
|
|
|
ClassGroupTeacherMapper classGroupTeacherMapper = classGroupTeacherMapperService.getOne(classGroupTeacherMapperQueryWrapper);
|
|
|
- if (Objects.nonNull(classGroupTeacherMapper)){
|
|
|
+ if (Objects.nonNull(classGroupTeacherMapper)) {
|
|
|
SysUser sysUser = sysUserService.getById(classGroupTeacherMapper.getUserId());
|
|
|
- if (Objects.nonNull(sysUser)){
|
|
|
+ if (Objects.nonNull(sysUser)) {
|
|
|
courseScheduleResp.setTeacher(sysUser.getRealName());
|
|
|
}
|
|
|
}
|