|
@@ -3,8 +3,10 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.ClassGroupStudentInfoDto;
|
|
|
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
+import com.ym.mec.biz.dal.wrapper.StudentWrapper;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
@@ -15,7 +17,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
@@ -24,42 +28,42 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, ClassGroupStudentMapper> implements ClassGroupStudentMapperService {
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ClassGroupStudentMapperDao classGroupStudentMapperDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleService courseScheduleService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentRegistrationService studentRegistrationService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ClassGroupService classGroupService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ClassGroupRelationService classGroupRelationService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ImGroupMemberService imGroupMemberService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ClassGroupTeacherMapperService classGroupTeacherMapperService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private TeacherDefaultMusicGroupSalaryService teacherDefaultMusicGroupSalaryService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private StudentDao studentDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleDao courseScheduleDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ClassGroupDao classGroupDao;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MusicGroupDao musicGroupDao;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ImUserFriendService imUserFriendService;
|
|
|
+ @Resource
|
|
|
+ private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
|
|
|
|
private static String holidayUrl = "http://tool.bitefu.net/jiari/?d=";
|
|
|
|
|
@@ -197,8 +201,29 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<StudentRegistration> findClassStudentList(Integer classGroupId, ClassGroupStudentStatusEnum status) {
|
|
|
- return classGroupStudentMapperDao.findClassStudentList(classGroupId, status);
|
|
|
+ public List<StudentWrapper.ClassStudentDto> findAllStudent(StudentWrapper.ClassStudentQuery query) {
|
|
|
+ List<StudentWrapper.ClassStudentDto> studentDtos = classGroupStudentMapperDao.findAllStudent(query);
|
|
|
+ if(CollectionUtils.isEmpty(studentDtos)){
|
|
|
+ return studentDtos;
|
|
|
+ }
|
|
|
+ //获取乐团学员剩余排课时长
|
|
|
+ String musicGroupId = studentDtos.get(0).getMusicGroupId();
|
|
|
+ List<Integer> studentIds = studentDtos.stream().map(StudentWrapper.ClassStudentDto::getUserId).collect(Collectors.toList());
|
|
|
+ List<StudentWrapper.ClassStudentDto> studentCourseDetails =
|
|
|
+ musicGroupPaymentStudentCourseDetailDao.findStudentCourseDetail(musicGroupId, studentIds,query);
|
|
|
+ if (CollectionUtils.isEmpty(studentCourseDetails)){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ Map<Integer,StudentWrapper.ClassStudentDto> studentDtoMap = studentDtos.stream()
|
|
|
+ .collect(Collectors.toMap(StudentWrapper.ClassStudentDto::getUserId, s -> s, (s1, s2) -> s1));
|
|
|
+ for (StudentWrapper.ClassStudentDto studentCourseDetail : studentCourseDetails) {
|
|
|
+ StudentWrapper.ClassStudentDto classStudentDto = studentDtoMap.get(studentCourseDetail.getUserId());
|
|
|
+ studentCourseDetail.setName(classStudentDto.getName());
|
|
|
+ studentCourseDetail.setGender(classStudentDto.getGender());
|
|
|
+ studentCourseDetail.setSubjectName(classStudentDto.getSubjectName());
|
|
|
+ studentCourseDetail.setParentsPhone(classStudentDto.getParentsPhone());
|
|
|
+ }
|
|
|
+ return classGroupStudentMapperDao.findAllStudent(query);
|
|
|
}
|
|
|
|
|
|
@Override
|