|
@@ -1919,14 +1919,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
//学生剩余课时
|
|
//学生剩余课时
|
|
List<StudentCourseInfoDto> userSurplusCourseInfoByGroup = courseScheduleDao.findUserSurplusCourseInfoByGroup(GroupType.VIP, vipGroupId.toString(), studentId);
|
|
List<StudentCourseInfoDto> userSurplusCourseInfoByGroup = courseScheduleDao.findUserSurplusCourseInfoByGroup(GroupType.VIP, vipGroupId.toString(), studentId);
|
|
|
|
|
|
- int days = 0;
|
|
|
|
- if(!CollectionUtils.isEmpty(userSurplusCourseInfoByGroup)){
|
|
|
|
- LocalDate nowDate = LocalDate.now(DateUtil.zoneId);
|
|
|
|
- StudentCourseInfoDto studentCourseInfoDto = userSurplusCourseInfoByGroup.stream().max(Comparator.comparing(StudentCourseInfoDto::getClassDate)).get();
|
|
|
|
- days = (int) nowDate
|
|
|
|
- .until((LocalDateTime.ofInstant(studentCourseInfoDto.getClassDate().toInstant(), DateUtil.zoneId).toLocalDate()), ChronoUnit.DAYS);
|
|
|
|
- }
|
|
|
|
- days += 1;
|
|
|
|
int[] teachModeSequence=new int[userSurplusCourseInfoByGroup.size()];
|
|
int[] teachModeSequence=new int[userSurplusCourseInfoByGroup.size()];
|
|
List<BigDecimal> coursePrices = new ArrayList<>();
|
|
List<BigDecimal> coursePrices = new ArrayList<>();
|
|
List<Long> courseScheduleIds=new ArrayList<>();
|
|
List<Long> courseScheduleIds=new ArrayList<>();
|
|
@@ -1937,7 +1929,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
}
|
|
}
|
|
pauseInfos.put("teaChModeSequence", teachModeSequence);
|
|
pauseInfos.put("teaChModeSequence", teachModeSequence);
|
|
pauseInfos.put("coursePriceInfo",coursePrices);
|
|
pauseInfos.put("coursePriceInfo",coursePrices);
|
|
- pauseInfos.put("days", days);
|
|
|
|
|
|
|
|
StudentPauseInfo studentPauseInfo=new StudentPauseInfo();
|
|
StudentPauseInfo studentPauseInfo=new StudentPauseInfo();
|
|
studentPauseInfo.setUserId(studentId);
|
|
studentPauseInfo.setUserId(studentId);
|
|
@@ -2074,12 +2065,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
newCourseSchedules.get(i).setOrganId(vipGroup.getOrganId());
|
|
newCourseSchedules.get(i).setOrganId(vipGroup.getOrganId());
|
|
}
|
|
}
|
|
|
|
|
|
- if(Objects.nonNull(studentRecoverInfo.getExpireDate())){
|
|
|
|
-// CourseSchedule courseSchedule = newCourseSchedules.stream().max(Comparator.comparing(CourseSchedule::getClassDate)).get();
|
|
|
|
- if(vipGroup.getCoursesExpireDate().compareTo(studentRecoverInfo.getExpireDate())<=0||DateUtil.isSameDay(vipGroup.getCoursesExpireDate(), studentRecoverInfo.getExpireDate())){
|
|
|
|
- throw new BizException("排课时间不可超过{}", DateUtil.dateToString(vipGroup.getCoursesExpireDate(), "yyyy年MM月dd日"));
|
|
|
|
- }
|
|
|
|
-// vipGroup.setCoursesExpireDate(courseSchedule.getEndClassTime());
|
|
|
|
|
|
+ CourseSchedule courseSchedule = newCourseSchedules.stream().max(Comparator.comparing(CourseSchedule::getClassDate)).get();
|
|
|
|
+ if(vipGroup.getCoursesExpireDate().compareTo(courseSchedule.getEndClassTime())<=0||DateUtil.isSameDay(vipGroup.getCoursesExpireDate(), courseSchedule.getEndClassTime())){
|
|
|
|
+ throw new BizException("排课时间不可超过{}", DateUtil.dateToString(vipGroup.getCoursesExpireDate(), "yyyy年MM月dd日"));
|
|
}
|
|
}
|
|
|
|
|
|
courseScheduleService.batchAddCourseSchedule(newCourseSchedules);
|
|
courseScheduleService.batchAddCourseSchedule(newCourseSchedules);
|
|
@@ -2183,11 +2171,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
Map<BigDecimal, Long> collect = coursePrices.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
Map<BigDecimal, Long> collect = coursePrices.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal("0.00")))?0:collect.get(new BigDecimal("0.00")).intValue());
|
|
studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal("0.00")))?0:collect.get(new BigDecimal("0.00")).intValue());
|
|
studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size()-studentRecoverInfoDto.getGiveCourseTimes());
|
|
studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size()-studentRecoverInfoDto.getGiveCourseTimes());
|
|
|
|
+ studentRecoverInfoDto.setExpireDate(vipGroup.getCoursesExpireDate());
|
|
|
|
|
|
- if(courseInfo.containsKey("days")){
|
|
|
|
- int surplusDays = Integer.valueOf(courseInfo.get("days").toString());
|
|
|
|
- studentRecoverInfoDto.setDays(surplusDays);
|
|
|
|
- }
|
|
|
|
return studentRecoverInfoDto;
|
|
return studentRecoverInfoDto;
|
|
}
|
|
}
|
|
|
|
|