|
@@ -13,12 +13,7 @@ import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.StandardEnum;
|
|
|
import com.ym.mec.biz.dal.enums.TeacherRemindTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.*;
|
|
|
-import com.ym.mec.biz.service.ClassGroupService;
|
|
|
-import com.ym.mec.biz.service.CourseScheduleService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupService;
|
|
|
-import com.ym.mec.biz.service.StudentCourseHomeworkService;
|
|
|
-import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
|
|
|
-import com.ym.mec.biz.service.SysMessageService;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.constant.CommonConstants;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
@@ -83,7 +78,7 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
private ClassGroupService classGroupService;
|
|
|
|
|
|
@Autowired
|
|
|
- private StudentCourseHomeworkService studentCourseHomeworkService;
|
|
|
+ private CooperationOrganService cooperationOrganService;
|
|
|
|
|
|
@Autowired
|
|
|
private ExtracurricularExercisesDao extracurricularExercisesDao;
|
|
@@ -118,6 +113,9 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
PageInfo<StudentExercisesSituationDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
+ if (StringUtils.isNotEmpty(queryInfo.getOrganId())){
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
List<StudentExercisesSituationDto> dataList = null;
|
|
|
int count = studentExtracurricularExercisesSituationDao.countExercisesSituations(params);
|
|
@@ -125,27 +123,37 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
|
|
|
- List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
|
|
|
+ List<Integer> organIds = dataList.stream().map(StudentExercisesSituationDto::getOrganId).distinct().collect(Collectors.toList());
|
|
|
+ List<String> musicGroupIds = dataList.stream().map(StudentExercisesSituationDto::getMusicGroupId).distinct().collect(Collectors.toList());
|
|
|
+ List<Integer> studentIds = dataList.stream().map(StudentExercisesSituationDto::getStudentId).collect(Collectors.toList());
|
|
|
+ List<Integer> teacherIds = dataList.stream().map(StudentExercisesSituationDto::getTeacherId).distinct().collect(Collectors.toList());
|
|
|
List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(), GroupType.VIP);
|
|
|
Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
|
|
|
|
|
|
List<Map<Integer, Long>> studentPracticeCoursesMaps = courseScheduleDao.countStudentPayPracticeCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
|
|
|
Map<Integer, Long> studentPracticeCourseMap = MapUtil.convertIntegerMap(studentPracticeCoursesMaps);
|
|
|
-
|
|
|
- /*List<StudentEduTeacherDto> studentEducationalTeachers = classGroupStudentMapperDao.getStudentEducationalTeachers(studentIds);
|
|
|
- Map<Integer, List<StudentEduTeacherDto>> studentEduTeachersMap = studentEducationalTeachers.stream().collect(Collectors.groupingBy(StudentEduTeacherDto::getStudentId));
|
|
|
-*/
|
|
|
- /*List<UserGroupDto> allUserGroups = studentRegistrationDao.getUserGroups(studentIds);
|
|
|
- Map<Integer, List<UserGroupDto>> userGroupsMap = new HashMap<>();
|
|
|
- if(!CollectionUtils.isEmpty(allUserGroups)){
|
|
|
- userGroupsMap = allUserGroups.stream().collect(Collectors.groupingBy(UserGroupDto::getUserId));
|
|
|
- }*/
|
|
|
-
|
|
|
+ Map<Integer, String> teacherNameMap = MapUtil.convertMybatisMap(teacherDao.queryNameByIdList(teacherIds));
|
|
|
+
|
|
|
+ Map<Integer, String> organNameMap = this.getMap("organization", "id_", "name_", organIds, queryInfo.getTenantId(), Integer.class, String.class);
|
|
|
+ Map<String, String> groupNameMap = this.getMap("music_group", "id_", "name_", musicGroupIds, queryInfo.getTenantId(), String.class, String.class);
|
|
|
+ List<CooperationOrganDto> cooperationOrgans = cooperationOrganService.getDao().queryByGroupIds(musicGroupIds);
|
|
|
+ Map<String, CooperationOrganDto> cooperationMap = new HashMap<>();
|
|
|
+ if(!CollectionUtils.isEmpty(cooperationOrgans)){
|
|
|
+ cooperationMap = cooperationOrgans.stream().collect(Collectors.groupingBy(e -> e.getMusicGroupId(),Collectors.collectingAndThen(Collectors.toList(),v->v.get(0))));
|
|
|
+ }
|
|
|
for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
|
|
|
Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
|
|
|
exercisesSituationDto.setExistVipCourse(Objects.isNull(vipCourses)?0:vipCourses.intValue());
|
|
|
Long practiceCourses=studentPracticeCourseMap.get(exercisesSituationDto.getStudentId());
|
|
|
exercisesSituationDto.setExistPracticeCourse(Objects.isNull(practiceCourses)?0:practiceCourses.intValue());
|
|
|
+ exercisesSituationDto.setOrganName(organNameMap.get(exercisesSituationDto.getOrganId()));
|
|
|
+ exercisesSituationDto.setTeacherName(teacherNameMap.get(exercisesSituationDto.getTeacherId()));
|
|
|
+ exercisesSituationDto.setGroupNames(groupNameMap.get(exercisesSituationDto.getMusicGroupId()));
|
|
|
+ CooperationOrganDto cooperationOrganDto = cooperationMap.get(exercisesSituationDto.getMusicGroupId());
|
|
|
+ if(Objects.nonNull(cooperationOrganDto)){
|
|
|
+ exercisesSituationDto.setEducationalTeacherId(cooperationOrganDto.getEducationUserId());
|
|
|
+ exercisesSituationDto.setEducationalTeacherName(cooperationOrganDto.getRealName());
|
|
|
+ }
|
|
|
// exercisesSituationDto.setExpectExercisesNum((int) until+1);
|
|
|
/*List<UserGroupDto> userGroupDtos = userGroupsMap.get(exercisesSituationDto.getStudentId());
|
|
|
if(!CollectionUtils.isEmpty(userGroupDtos)){
|
|
@@ -604,8 +612,10 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
studentExtracurricularExercisesSituationDao.batchInsert(situations);
|
|
|
String collect = situations.stream().map(e -> e.getCourseIds()).filter(e -> StringUtils.isNotEmpty(e)).distinct().collect(Collectors.joining(","));
|
|
|
if(StringUtils.isNotEmpty(collect)){
|
|
|
+ //转换成int数组
|
|
|
+ List<Integer> courseIds = Arrays.stream(collect.split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
|
|
|
//更新课程服务指标
|
|
|
- courseScheduleStatisticsDao.updateCourseService(collect,1);
|
|
|
+ courseScheduleStatisticsDao.updateCourseService(courseIds,1);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -898,8 +908,9 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
// studentExtracurricularExercisesSituationDao.batchDelete(collect1);
|
|
|
String collect = situations.stream().map(e -> e.getCourseIds()).filter(e -> StringUtils.isNotEmpty(e)).distinct().collect(Collectors.joining(","));
|
|
|
if(StringUtils.isNotEmpty(collect)){
|
|
|
+ List<Integer> courseIds = Arrays.stream(collect.split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
|
|
|
//更新课程服务指标
|
|
|
- courseScheduleStatisticsDao.updateCourseService(collect,0);
|
|
|
+ courseScheduleStatisticsDao.updateCourseService(courseIds,0);
|
|
|
}
|
|
|
}
|
|
|
}
|