|
@@ -3466,7 +3466,69 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
+ @Override
|
|
|
+ public PageInfo queryTeacherVipClassCourseSchedule(CourseScheduleQueryInfo queryInfo) {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (null == user) {
|
|
|
+ throw new BizException("请登录");
|
|
|
+ }
|
|
|
+ if(!queryInfo.getFindTotal()){
|
|
|
+ queryInfo.setUserId(user.getId().longValue());
|
|
|
+ }
|
|
|
+ PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+
|
|
|
+ if (Objects.isNull(queryInfo.getDate())) {
|
|
|
+ queryInfo.setDate(new Date());
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<TeacherClassCourseSchudeleDto> dataList = null;
|
|
|
+ int count = 0;
|
|
|
+ if (Objects.isNull(queryInfo.getOnlyHistory()) || queryInfo.getOnlyHistory() == 0) {
|
|
|
+ count = courseScheduleDao.countTeacherClassCourseSchedule(params);
|
|
|
+ } else {
|
|
|
+ count = courseScheduleDao.countTeacherHistoryClassCourseSchedule(params);
|
|
|
+ }
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ if (Objects.isNull(queryInfo.getOnlyHistory()) || queryInfo.getOnlyHistory() == 0) {
|
|
|
+ dataList = courseScheduleDao.queryTeacherClassCourseSchedule(params);
|
|
|
+ } else {
|
|
|
+ dataList = courseScheduleDao.queryTeacherHistoryClassCourseSchedule(params);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Integer> classGroupIds = dataList.stream().map(e->e.getClassGroupId().intValue()).collect(Collectors.toList());
|
|
|
+ List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds, ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
|
|
|
+
|
|
|
+ List<Long> allCourseScheduleIds = dataList.stream().map(TeacherClassCourseSchudeleDto::getCourseScheduleId).collect(Collectors.toList());
|
|
|
+ SysConfig advanceLeaveHoursConfig = sysConfigService.findByParamName(SysConfigService.ADVANCE_LEAVE_HOURS);
|
|
|
+ Integer advanceLeaveHours=advanceLeaveHoursConfig.getParanValue(Integer.class);
|
|
|
+ List<Map<Long, Integer>> courseLeaveStudentNumMaps = studentAttendanceDao.countCourseLeaveStudentNumWithFourHoursAgo(allCourseScheduleIds, advanceLeaveHours);
|
|
|
+ Map<Long,Long> courseLeaveStudentNumMap = MapUtil.convertIntegerMap((courseLeaveStudentNumMaps));
|
|
|
+
|
|
|
+ dataList.forEach(e -> {
|
|
|
+ e.setCurrentClassTimes(courseScheduleDao.countCurrentTimes(e.getClassGroupId().intValue(),new Date()));
|
|
|
+ e.setTotalClassTimes(courseScheduleDao.countCurrentCourseTime(e.getCourseScheduleId()));
|
|
|
+
|
|
|
+ Long leaveStudentNum = courseLeaveStudentNumMap.get(e.getCourseScheduleId());
|
|
|
+ Long normalStudentNum = classGroupStudentNumMap.get(e.getClassGroupId());
|
|
|
+ if(Objects.nonNull(leaveStudentNum)&&Objects.nonNull(normalStudentNum)&&leaveStudentNum.intValue()==normalStudentNum.intValue()){
|
|
|
+ e.setEnableAdjustInToday(1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public CourseAttendanceDetailHeadInfoDto findCourseAttendanceDetailHeadInfo(Long courseScheduleId) {
|
|
|
if (Objects.isNull(courseScheduleId)) {
|
|
|
throw new BizException("请指定课程");
|