|
@@ -2330,21 +2330,14 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
WeekFields weekFields = WeekFields.of(DayOfWeek.MONDAY, 1);
|
|
|
ZoneId zoneId = ZoneId.systemDefault();
|
|
|
|
|
|
- Date today=new Date();
|
|
|
-
|
|
|
LocalDate now = LocalDate.now();
|
|
|
if(renew){
|
|
|
PracticeGroup userLatestPracticeGroup = practiceGroupDao.findUserPracticeGroup(userId,groupId);
|
|
|
if(Objects.nonNull(userLatestPracticeGroup)){
|
|
|
- if(userLatestPracticeGroup.getCoursesExpireDate().after(today)){
|
|
|
- throw new BizException("此课程组已超过可续费期限");
|
|
|
- }
|
|
|
LocalDate lastExpiredDay=LocalDateTime.ofInstant(userLatestPracticeGroup.getCoursesExpireDate().toInstant(),DateUtil.zoneId).toLocalDate();
|
|
|
if(Objects.nonNull(lastExpiredDay)&&lastExpiredDay.compareTo(now)>=0){
|
|
|
now=lastExpiredDay;
|
|
|
}
|
|
|
- }else{
|
|
|
- throw new BizException("需要续费的课程组不存在");
|
|
|
}
|
|
|
}
|
|
|
now.plusDays(1);
|
|
@@ -2560,10 +2553,15 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
}
|
|
|
PracticeGroup userLatestPracticeGroup = practiceGroupDao.findUserPracticeGroup(practiceGroupBuyParams.getStudentId(),practiceGroupBuyParams.getGroupId());
|
|
|
if(Objects.nonNull(userLatestPracticeGroup)){
|
|
|
+ if(userLatestPracticeGroup.getCoursesExpireDate().before(now)){
|
|
|
+ throw new BizException("此课程组已超过可续费期限");
|
|
|
+ }
|
|
|
LocalDate lastExpiredDay=LocalDateTime.ofInstant(userLatestPracticeGroup.getCoursesExpireDate().toInstant(),DateUtil.zoneId).toLocalDate();
|
|
|
if(Objects.nonNull(lastExpiredDay)&&lastExpiredDay.compareTo(courseStartDay)>=0){
|
|
|
courseStartDay=lastExpiredDay;
|
|
|
}
|
|
|
+ }else{
|
|
|
+ return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "需要续费的课程组不存在");
|
|
|
}
|
|
|
}
|
|
|
|