|
@@ -381,16 +381,33 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
Map<CourseSchedule.CourseScheduleType, List<StudentServeCourseDto>> typeCourseMap = studentCourseMapEntry.getValue().stream().collect(Collectors.groupingBy(StudentServeCourseDto::getType));
|
|
|
|
|
|
Integer userId = studentCourseMapEntry.getKey();
|
|
|
-
|
|
|
+
|
|
|
+ Set<String> musicGroupIds = noCourseStudentMusicIdsMap.get(studentCourseMapEntry.getKey());
|
|
|
+ if(Objects.isNull(musicGroupIds)){
|
|
|
+ musicGroupIds = new HashSet<>();
|
|
|
+ }
|
|
|
+ //查询用户在指定乐团截止本周末的课程数
|
|
|
+ List<Mapper> mapperList = new ArrayList<Mapper>();
|
|
|
+ if(musicGroupIds.size() > 0){
|
|
|
+ mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, userId, new Date(0, 1, 1), LocalDateToUdate(sunDayDate));
|
|
|
+ }
|
|
|
+ Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
|
|
|
+
|
|
|
+ //是否在乐团生成服务指标
|
|
|
+ boolean isServiceWithMusicGroup = false;
|
|
|
+ //判断截止本周末是否有乐团课
|
|
|
+ for(Mapper m : mapperList){
|
|
|
+ if((long)m.getValue() > 0){
|
|
|
+ isServiceWithMusicGroup = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(userId == 2163133){
|
|
|
+ System.out.println("********************");
|
|
|
+ }
|
|
|
+
|
|
|
//有未上的单技课
|
|
|
- if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.SINGLE)){
|
|
|
- Set<String> musicGroupIds = noCourseStudentMusicIdsMap.get(studentCourseMapEntry.getKey());
|
|
|
- if(Objects.isNull(musicGroupIds)){
|
|
|
- musicGroupIds = new HashSet<>();
|
|
|
- }
|
|
|
-
|
|
|
- List<Mapper> mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, userId, new Date(0, 1, 1), LocalDateToUdate(monDayDate));
|
|
|
- Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
|
|
|
+ if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.SINGLE) && isServiceWithMusicGroup){
|
|
|
|
|
|
List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
|
|
|
if(!CollectionUtils.isEmpty(weekCourseInfo)){
|
|
@@ -398,6 +415,7 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
Map<Integer, Set<Long>> teacherNotOverCourseIds = new HashMap<>();
|
|
|
Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
|
|
|
for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
|
|
|
+
|
|
|
if(musicGroupIds.contains(groupCourseInfoEntry.getKey())) {
|
|
|
musicGroupIds.remove(groupCourseInfoEntry.getKey());
|
|
|
}
|
|
@@ -499,14 +517,6 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
}
|
|
|
}else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.MIX)){//有未上的合奏课
|
|
|
- Set<String> musicGroupIds = noCourseStudentMusicIdsMap.get(studentCourseMapEntry.getKey());
|
|
|
- if(CollectionUtils.isEmpty(musicGroupIds)){
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- List<Mapper> mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, userId, new Date(0, 1, 1), LocalDateToUdate(monDayDate));
|
|
|
- Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
|
|
|
-
|
|
|
|
|
|
Map<Integer, Integer> teacherNumMap = new HashMap<>();
|
|
|
for (String groupId : musicGroupIds) {
|
|
@@ -592,18 +602,14 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
if(CollectionUtils.isEmpty(musicGroupIds)){
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
- List<Mapper> mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, noCourseServeStudentId, new Date(0, 1, 1), LocalDateToUdate(monDayDate));
|
|
|
- Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
|
|
|
|
|
|
+ if(noCourseServeStudentId == 2163133){
|
|
|
+ System.out.println("********************");
|
|
|
+ }
|
|
|
+
|
|
|
Map<Integer, Integer> teacherNumMap = new HashMap<>();
|
|
|
for (String groupId : musicGroupIds) {
|
|
|
|
|
|
- //学生在当前乐团没有上过课,就不需要生成服务指标
|
|
|
- if(map.get(groupId) == null || (long)map.get(groupId) == 0){
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
Integer teacherId = null;
|
|
|
List<BaseMapDto<Integer, Integer>> studentTeacherIdList = classGroupStudentMapperDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(noCourseServeStudentId), groupId);
|
|
|
if(!CollectionUtils.isEmpty(studentTeacherIdList)){
|