|
@@ -3,7 +3,6 @@ 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;
|
|
@@ -12,12 +11,11 @@ import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.util.http.HttpUtil;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
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;
|
|
@@ -211,19 +209,41 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
|
|
|
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 studentCourseDetails;
|
|
|
+ if(StringUtils.isNotEmpty(query.getCourseType()) || StringUtils.isNotEmpty(query.getSortType()) || StringUtils.isNotEmpty(query.getSortField())){
|
|
|
+ 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 studentCourseDetails;
|
|
|
+ }else {
|
|
|
+ if (CollectionUtils.isEmpty(studentCourseDetails)){
|
|
|
+ return studentDtos;
|
|
|
+ }
|
|
|
+ Map<Integer,StudentWrapper.ClassStudentDto> studentDtoMap = studentCourseDetails.stream()
|
|
|
+ .collect(Collectors.toMap(StudentWrapper.ClassStudentDto::getUserId, s -> s, (s1, s2) -> s1));
|
|
|
+ for (StudentWrapper.ClassStudentDto studentDto : studentDtos) {
|
|
|
+ StudentWrapper.ClassStudentDto studentCourseDetail = studentDtoMap.get(studentDto.getUserId());
|
|
|
+ if (studentCourseDetail != null){
|
|
|
+ studentDto.setClassroom(studentCourseDetail.getClassroom());
|
|
|
+ studentDto.setComprehensive(studentCourseDetail.getComprehensive());
|
|
|
+ studentDto.setHigh(studentCourseDetail.getHigh());
|
|
|
+ studentDto.setHighOnline(studentCourseDetail.getHighOnline());
|
|
|
+ studentDto.setMix(studentCourseDetail.getMix());
|
|
|
+ studentDto.setSingle(studentCourseDetail.getSingle());
|
|
|
+ studentDto.setTrainingMix(studentCourseDetail.getTrainingMix());
|
|
|
+ studentDto.setTrainingSingle(studentCourseDetail.getTrainingSingle());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return studentDtos;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|