|
@@ -133,6 +133,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
//沈阳分部编号
|
|
//沈阳分部编号
|
|
private static final Integer SHENYANG_ORGAN_ID = 6;
|
|
private static final Integer SHENYANG_ORGAN_ID = 6;
|
|
|
|
|
|
|
|
+ private static final Set<Integer> ENABLE_APPLY_ORGANIDS = new HashSet<>(Arrays.asList(new Integer[]{1, 43, 47}));
|
|
|
|
+
|
|
private static Date activityStartDate, activityEndDate, applyStartDay, courseExpireDate;
|
|
private static Date activityStartDate, activityEndDate, applyStartDay, courseExpireDate;
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory
|
|
private static final Logger LOGGER = LoggerFactory
|
|
@@ -141,10 +143,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
private static List<String> applyDayTimes = new ArrayList<>();
|
|
private static List<String> applyDayTimes = new ArrayList<>();
|
|
|
|
|
|
static {
|
|
static {
|
|
- applyStartDay = DateUtil.stringToDate("2020-02-08 00:00:00");
|
|
|
|
- activityStartDate = DateUtil.stringToDate("2020-02-09 00:00:00");
|
|
|
|
- activityEndDate = DateUtil.stringToDate("2020-03-25 00:00:00");
|
|
|
|
- courseExpireDate = DateUtil.stringToDate("2020-04-01 00:00:00");
|
|
|
|
|
|
+ applyStartDay = DateUtil.stringToDate("2020-03-25 00:00:00");
|
|
|
|
+ activityStartDate = DateUtil.stringToDate("2020-03-25 00:00:00");
|
|
|
|
+ activityEndDate = DateUtil.stringToDate("2020-05-25 00:00:00");
|
|
|
|
+ courseExpireDate = DateUtil.stringToDate("2020-06-01 00:00:00");
|
|
|
|
|
|
schoolSubjectTeachersMap = new HashMap<>();
|
|
schoolSubjectTeachersMap = new HashMap<>();
|
|
Map<Integer, List<Integer>> subjectTeachersMap1 = new HashMap<>();
|
|
Map<Integer, List<Integer>> subjectTeachersMap1 = new HashMap<>();
|
|
@@ -945,7 +947,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
calendar.add(Calendar.DATE, 1);
|
|
calendar.add(Calendar.DATE, 1);
|
|
Date applyStartDate = calendar.getTime();
|
|
Date applyStartDate = calendar.getTime();
|
|
- Date applyEndDate = DateUtil.stringToDate("2020-03-24", "yyyy-MM-dd");
|
|
|
|
|
|
+ Date applyEndDate = DateUtil.stringToDate("2020-05-24", "yyyy-MM-dd");
|
|
Date firstMonday = DateUtil.getWeekDayWithDate(applyStartDate, Calendar.MONDAY);
|
|
Date firstMonday = DateUtil.getWeekDayWithDate(applyStartDate, Calendar.MONDAY);
|
|
Date secondSunday = DateUtil.getWeekDayWithDate(applyEndDate, Calendar.SUNDAY);
|
|
Date secondSunday = DateUtil.getWeekDayWithDate(applyEndDate, Calendar.SUNDAY);
|
|
|
|
|
|
@@ -1624,6 +1626,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
if (Objects.isNull(practiceGroup.getUserId())) {
|
|
if (Objects.isNull(practiceGroup.getUserId())) {
|
|
throw new BizException("请选择老师");
|
|
throw new BizException("请选择老师");
|
|
}
|
|
}
|
|
|
|
+ if(!ENABLE_APPLY_ORGANIDS.contains(practiceGroup.getOrganId())){
|
|
|
|
+ throw new BizException("所在城市暂不参与此活动");
|
|
|
|
+ }
|
|
Map result = new HashMap();
|
|
Map result = new HashMap();
|
|
SysConfig practiceSubjectIdListConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_SUBJECT_ID_LIST);
|
|
SysConfig practiceSubjectIdListConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_SUBJECT_ID_LIST);
|
|
if (Objects.isNull(practiceGroup.getSubjectId())
|
|
if (Objects.isNull(practiceGroup.getSubjectId())
|
|
@@ -1642,13 +1647,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
if (practiceGroup.getFirstCourseTime().before(activityStartDate)
|
|
if (practiceGroup.getFirstCourseTime().before(activityStartDate)
|
|
|| practiceGroup.getFirstCourseTime().after(activityEndDate)) {
|
|
|| practiceGroup.getFirstCourseTime().after(activityEndDate)) {
|
|
result.put("status", "APPLY_DATE_OVERFLOW");
|
|
result.put("status", "APPLY_DATE_OVERFLOW");
|
|
- result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-3-31之前),请重试。");
|
|
|
|
|
|
+ result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
if (practiceGroup.getSecondCourseTime().before(activityStartDate)
|
|
if (practiceGroup.getSecondCourseTime().before(activityStartDate)
|
|
|| practiceGroup.getSecondCourseTime().after(activityEndDate)) {
|
|
|| practiceGroup.getSecondCourseTime().after(activityEndDate)) {
|
|
result.put("status", "APPLY_DATE_OVERFLOW");
|
|
result.put("status", "APPLY_DATE_OVERFLOW");
|
|
- result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-3-31之前),请重试。");
|
|
|
|
|
|
+ result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
if (DateUtil.isSameDay(practiceGroup.getFirstCourseTime(), practiceGroup.getSecondCourseTime())) {
|
|
if (DateUtil.isSameDay(practiceGroup.getFirstCourseTime(), practiceGroup.getSecondCourseTime())) {
|
|
@@ -1702,13 +1707,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
if (allCourseDates.get(2).before(activityStartDate)
|
|
if (allCourseDates.get(2).before(activityStartDate)
|
|
|| allCourseDates.get(2).after(courseExpireDate)) {
|
|
|| allCourseDates.get(2).after(courseExpireDate)) {
|
|
result.put("status", "APPLY_DATE_OVERFLOW");
|
|
result.put("status", "APPLY_DATE_OVERFLOW");
|
|
- result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-3-31之前),请重试。");
|
|
|
|
|
|
+ result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
if (allCourseDates.get(3).before(activityStartDate)
|
|
if (allCourseDates.get(3).before(activityStartDate)
|
|
|| allCourseDates.get(3).after(courseExpireDate)) {
|
|
|| allCourseDates.get(3).after(courseExpireDate)) {
|
|
result.put("status", "APPLY_DATE_OVERFLOW");
|
|
result.put("status", "APPLY_DATE_OVERFLOW");
|
|
- result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-3-31之前),请重试。");
|
|
|
|
|
|
+ result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
allCourseDates.sort(Comparator.comparing(Date::getTime));
|
|
allCourseDates.sort(Comparator.comparing(Date::getTime));
|