|
@@ -1346,6 +1346,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
checkTeacherLeaveDate = false;
|
|
|
}
|
|
|
|
|
|
+ SysConfig practiceFreeApplyExpireDateConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_FREE_APPLY_EXPIRE_DATE);
|
|
|
+ Date practiceFreeApplyExpireDate = DateUtil.stringToDate(practiceFreeApplyExpireDateConfig.getParanValue());
|
|
|
+
|
|
|
Date now = new Date();
|
|
|
if (now.before(applyStartDay)) {
|
|
|
now = applyStartDay;
|
|
@@ -1356,13 +1359,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
calendar.set(Calendar.MINUTE, 0);
|
|
|
calendar.set(Calendar.SECOND, 0);
|
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
|
- while (calendar.getTime().before(activityEndDate)) {
|
|
|
+ while (calendar.getTime().before(practiceFreeApplyExpireDate)) {
|
|
|
calendar.add(Calendar.DATE, 1);
|
|
|
Date applyStartDay = calendar.getTime();
|
|
|
calendar.add(Calendar.DATE, 6);
|
|
|
Date applyEndDay = calendar.getTime();
|
|
|
- if (applyEndDay.after(activityEndDate)) {
|
|
|
- applyEndDay = activityEndDate;
|
|
|
+ if (applyEndDay.after(practiceFreeApplyExpireDate)) {
|
|
|
+ applyEndDay = practiceFreeApplyExpireDate;
|
|
|
}
|
|
|
Date firstMonday = DateUtil.getWeekDayWithDate(applyStartDay, Calendar.MONDAY);
|
|
|
Date secondMonday = DateUtil.getWeekDayWithDate(applyEndDay, Calendar.MONDAY);
|
|
@@ -1698,18 +1701,18 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
practiceGroup.setSecondCourseTime(practiceGroup.getFirstCourseTime());
|
|
|
practiceGroup.setFirstCourseTime(tmp);
|
|
|
}
|
|
|
- if (practiceGroup.getFirstCourseTime().before(now)
|
|
|
- || practiceGroup.getFirstCourseTime().after(activityEndDate)) {
|
|
|
- result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
- result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
|
- return result;
|
|
|
- }
|
|
|
- if (practiceGroup.getSecondCourseTime().before(now)
|
|
|
- || practiceGroup.getSecondCourseTime().after(activityEndDate)) {
|
|
|
- result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
- result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
|
- return result;
|
|
|
- }
|
|
|
+// if (practiceGroup.getFirstCourseTime().before(now)
|
|
|
+// || practiceGroup.getFirstCourseTime().after(activityEndDate)) {
|
|
|
+// result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
+// result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
|
+// return result;
|
|
|
+// }
|
|
|
+// if (practiceGroup.getSecondCourseTime().before(now)
|
|
|
+// || practiceGroup.getSecondCourseTime().after(activityEndDate)) {
|
|
|
+// result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
+// result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
|
+// return result;
|
|
|
+// }
|
|
|
if (DateUtil.isSameDay(practiceGroup.getFirstCourseTime(), practiceGroup.getSecondCourseTime())) {
|
|
|
result.put("status", "TWO_DATE_ON_ONE_DAY");
|
|
|
result.put("info", "预约失败,网管课选择时间重复,请重试。");
|
|
@@ -1758,18 +1761,18 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
allCourseDates.remove(3);
|
|
|
allCourseDates.add(DateUtil.addDays(tempDate, 7));
|
|
|
}
|
|
|
- if (allCourseDates.get(2).before(now)
|
|
|
- || allCourseDates.get(2).after(courseExpireDate)) {
|
|
|
- result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
- result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
|
- return result;
|
|
|
- }
|
|
|
- if (allCourseDates.get(3).before(now)
|
|
|
- || allCourseDates.get(3).after(courseExpireDate)) {
|
|
|
- result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
- result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
|
- return result;
|
|
|
- }
|
|
|
+// if (allCourseDates.get(2).before(now)
|
|
|
+// || allCourseDates.get(2).after(courseExpireDate)) {
|
|
|
+// result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
+// result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
|
+// return result;
|
|
|
+// }
|
|
|
+// if (allCourseDates.get(3).before(now)
|
|
|
+// || allCourseDates.get(3).after(courseExpireDate)) {
|
|
|
+// result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
+// result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
|
+// return result;
|
|
|
+// }
|
|
|
allCourseDates.sort(Comparator.comparing(Date::getTime));
|
|
|
|
|
|
studentDao.lockUser(practiceGroup.getStudentId());
|