|
@@ -114,6 +114,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
@Autowired
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
@Autowired
|
|
|
+ private SysTenantConfigService sysTenantConfigService;
|
|
|
+ @Autowired
|
|
|
private StudentPaymentOrderDao studentPaymentOrderDao;
|
|
|
@Autowired
|
|
|
private GroupClassService groupService;
|
|
@@ -776,17 +778,20 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map getPracticeApplyParams(Integer userId) {
|
|
|
- Map result = new HashMap();
|
|
|
- SysConfig practiceSubjectIdListConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_SUBJECT_ID_LIST);
|
|
|
- SysConfig practiceApplyStartTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_START_TIME);
|
|
|
- SysConfig practiceApplyEndTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_END_TIME);
|
|
|
+ public Map getPracticeApplyParams(Integer userId,Integer tenantId) {
|
|
|
+ Map result = new HashMap(7);
|
|
|
+ String practiceSubjectIdListConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_SUBJECT_ID_LIST,tenantId);
|
|
|
+ if(StringUtils.isEmpty(practiceSubjectIdListConfig)){
|
|
|
+ throw new BizException("请配置陪练课可预约声部");
|
|
|
+ }
|
|
|
+ String practiceApplyStartTimeConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_APPLY_START_TIME,tenantId);
|
|
|
+ String practiceApplyEndTimeConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_APPLY_END_TIME,tenantId);
|
|
|
SysConfig practiceApplyIntervalTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_INTERVAL_TIME);
|
|
|
SysConfig practiceCourseMinutesConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
|
|
|
SysConfig practiceFreeApplyExpireDateConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_FREE_APPLY_EXPIRE_DATE);
|
|
|
Student student = studentDao.get(userId);
|
|
|
- List<Subject> subjects = subjectDao.findBySubjectByIdList(practiceSubjectIdListConfig.getParanValue());
|
|
|
- List<Integer> subjectIds = Arrays.asList(practiceSubjectIdListConfig.getParanValue().split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
|
+ List<Subject> subjects = subjectDao.findBySubjectByIdList(practiceSubjectIdListConfig);
|
|
|
+ List<Integer> subjectIds = Arrays.asList(practiceSubjectIdListConfig.split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
|
List<Integer> userDefaultSubjectIds = Objects.isNull(student) || Objects.isNull(student.getSubjectIdList()) ? null : Arrays.asList(student.getSubjectIdList().split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(userDefaultSubjectIds) && userDefaultSubjectIds.size() <= 1) {
|
|
|
userDefaultSubjectIds = userDefaultSubjectIds.stream().filter(userDefaultSubjectId -> subjectIds.contains(userDefaultSubjectId)).collect(Collectors.toList());
|
|
@@ -794,11 +799,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
userDefaultSubjectIds = new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
- Integer applyTimes = practiceGroupDao.countUserPracticeApplyRecord(userId);
|
|
|
-
|
|
|
result.put("subjects", subjects);
|
|
|
- result.put("practiceApplyStartTime", practiceApplyStartTimeConfig.getParanValue());
|
|
|
- result.put("practiceApplyEndTime", practiceApplyEndTimeConfig.getParanValue());
|
|
|
+ result.put("practiceApplyStartTime", practiceApplyStartTimeConfig);
|
|
|
+ result.put("practiceApplyEndTime", practiceApplyEndTimeConfig);
|
|
|
result.put("userDefaultSubjectIds", StringUtils.join(userDefaultSubjectIds.toArray(), ","));
|
|
|
result.put("practiceApplyIntervalMinutes", practiceApplyIntervalTimeConfig.getParanValue(Integer.class));
|
|
|
result.put("practiceCourseMinutes", practiceCourseMinutesConfig.getParanValue(Integer.class));
|
|
@@ -807,10 +810,12 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Object getPracticeApplySubjects() {
|
|
|
- SysConfig practiceSubjectIdListConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_SUBJECT_ID_LIST);
|
|
|
- List<Subject> subjects = subjectDao.findBySubjectByIdList(practiceSubjectIdListConfig.getParanValue());
|
|
|
- return subjects;
|
|
|
+ public Object getPracticeApplySubjects(Integer tenantId) {
|
|
|
+ String practiceSubjectIdListConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_SUBJECT_ID_LIST,tenantId);
|
|
|
+ if(StringUtils.isEmpty(practiceSubjectIdListConfig)){
|
|
|
+ throw new BizException("请配置陪练课可预约声部");
|
|
|
+ }
|
|
|
+ return subjectDao.findBySubjectByIdList(practiceSubjectIdListConfig);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -913,6 +918,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
if (Objects.isNull(student.getOrganId())) {
|
|
|
throw new BizException("未找到用户分部属性");
|
|
|
}
|
|
|
+ if (Objects.isNull(student.getTenantId())) {
|
|
|
+ throw new BizException("未找到用户机构属性");
|
|
|
+ }
|
|
|
Teacher teacher = teacherDao.get(teacherId);
|
|
|
if (Objects.isNull(teacher)) {
|
|
|
throw new BizException("教师不存在");
|
|
@@ -1012,7 +1020,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
tomorrow = tempCalendar.getTime();
|
|
|
}
|
|
|
|
|
|
- List<Date> enableApplyDates = getEnableApplyDates(applyStartDate, applyEndDate);
|
|
|
+ List<Date> enableApplyDates = getEnableApplyDates(applyStartDate, applyEndDate,student.getTenantId());
|
|
|
List<CourseSchedule> allTeacherCourses = courseScheduleDao.findTeacherCoursesWithDateRange(teacherId, firstMonday, secondSunday);
|
|
|
allTeacherCourses.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
|
|
|
|
|
@@ -1347,6 +1355,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
if (Objects.isNull(sysUser.getOrganId())) {
|
|
|
throw new BizException("未找到用户分部属性");
|
|
|
}
|
|
|
+ if (Objects.isNull(sysUser.getTenantId())) {
|
|
|
+ throw new BizException("未找到用户机构属性");
|
|
|
+ }
|
|
|
Map result = new HashMap();
|
|
|
Set<Date> allTeacherFreeDates = new HashSet<>();
|
|
|
SysConfig practiceCourseMinutesConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
|
|
@@ -1413,7 +1424,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Date secondMonday = DateUtil.getWeekDayWithDate(applyEndDay, Calendar.MONDAY);
|
|
|
Date secondSunday = DateUtil.getWeekDayWithDate(applyEndDay, Calendar.SUNDAY);
|
|
|
|
|
|
- List<Date> enableApplyDates = getEnableApplyDates(applyStartDay, applyEndDay);
|
|
|
+ List<Date> enableApplyDates = getEnableApplyDates(applyStartDay, applyEndDay,sysUser.getTenantId());
|
|
|
List<CourseSchedule> allTeacherCourses = courseScheduleDao.findTeachersCoursesWithDateRange(teacherIds, firstMonday, secondSunday);
|
|
|
HashSet<Integer> excludeTeacherIds = new HashSet<>();
|
|
|
if (Objects.nonNull(firstClassTime)) {
|
|
@@ -1641,19 +1652,15 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Date> getEnableApplyDates(Date startDay, Date endDay) {
|
|
|
+ public List<Date> getEnableApplyDates(Date startDay, Date endDay,Integer tenantId) {
|
|
|
List<Date> result = new ArrayList<>();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(startDay);
|
|
|
calendar.add(Calendar.DATE, -1);
|
|
|
calendar.set(Calendar.SECOND, 0);
|
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
|
- SysConfig practiceApplyStartTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_START_TIME);
|
|
|
- SysConfig practiceApplyEndTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_END_TIME);
|
|
|
- SysConfig practiceApplyIntervalTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_INTERVAL_TIME);
|
|
|
- String enableStartTimeStr = practiceApplyStartTimeConfig.getParanValue();
|
|
|
- String enableEndTimeStr = practiceApplyEndTimeConfig.getParanValue();
|
|
|
- Integer practiceApplyIntervalMinutes = practiceApplyIntervalTimeConfig.getParanValue(Integer.class);
|
|
|
+ String enableStartTimeStr = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_APPLY_START_TIME,tenantId);
|
|
|
+ String enableEndTimeStr = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_APPLY_END_TIME,tenantId);
|
|
|
while (!calendar.getTime().after(endDay)) {
|
|
|
calendar.add(Calendar.DATE, 1);
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(enableStartTimeStr.split(":")[0]));
|
|
@@ -1661,7 +1668,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Date enableApplyDayStartTime = calendar.getTime();
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(enableEndTimeStr.split(":")[0]));
|
|
|
calendar.set(Calendar.MINUTE, Integer.valueOf(enableEndTimeStr.split(":")[1]));
|
|
|
- Date enableApplyDayEndTime = calendar.getTime();
|
|
|
Calendar applyStartCalendar = Calendar.getInstance();
|
|
|
applyStartCalendar.setTime(enableApplyDayStartTime);
|
|
|
for (String applyDayTime : applyDayTimes) {
|
|
@@ -1674,18 +1680,16 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Date> getEnableApplyDatesIncludeAllTimes(Date startDay, Date endDay) {
|
|
|
+ public List<Date> getEnableApplyDatesIncludeAllTimes(Date startDay, Date endDay,Integer tenantId) {
|
|
|
List<Date> result = new ArrayList<>();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(startDay);
|
|
|
calendar.add(Calendar.DATE, -1);
|
|
|
calendar.set(Calendar.SECOND, 0);
|
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
|
- SysConfig practiceApplyStartTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_START_TIME);
|
|
|
- SysConfig practiceApplyEndTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_END_TIME);
|
|
|
+ String enableStartTimeStr = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_APPLY_START_TIME,tenantId);
|
|
|
+ String enableEndTimeStr = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_APPLY_END_TIME,tenantId);
|
|
|
SysConfig practiceApplyIntervalTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_INTERVAL_TIME);
|
|
|
- String enableStartTimeStr = practiceApplyStartTimeConfig.getParanValue();
|
|
|
- String enableEndTimeStr = practiceApplyEndTimeConfig.getParanValue();
|
|
|
Integer practiceApplyIntervalMinutes = practiceApplyIntervalTimeConfig.getParanValue(Integer.class);
|
|
|
LocalTime dayStartTime = LocalTime.parse("00:00:00", DateUtil.timeFormatter);
|
|
|
LocalTime dayEndTime = LocalTime.parse("00:00:00", DateUtil.timeFormatter);
|
|
@@ -1705,7 +1709,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Date enableApplyDayStartTime = calendar.getTime();
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(enableEndTimeStr.split(":")[0]));
|
|
|
calendar.set(Calendar.MINUTE, Integer.valueOf(enableEndTimeStr.split(":")[1]));
|
|
|
- Date enableApplyDayEndTime = calendar.getTime();
|
|
|
Calendar applyStartCalendar = Calendar.getInstance();
|
|
|
applyStartCalendar.setTime(enableApplyDayStartTime);
|
|
|
for (String applyDayTime : dayApplyTimes) {
|
|
@@ -1724,9 +1727,12 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
throw new BizException("请选择老师");
|
|
|
}
|
|
|
Map result = new HashMap();
|
|
|
- SysConfig practiceSubjectIdListConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_SUBJECT_ID_LIST);
|
|
|
+ String practiceSubjectIdListConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_SUBJECT_ID_LIST,practiceGroup.getTenantId());
|
|
|
+ if(StringUtils.isEmpty(practiceSubjectIdListConfig)){
|
|
|
+ throw new BizException("请配置陪练课可预约声部");
|
|
|
+ }
|
|
|
if (Objects.isNull(practiceGroup.getSubjectId())
|
|
|
- || !Arrays.asList(practiceSubjectIdListConfig.getParanValue().split(",")).contains(practiceGroup.getSubjectId().toString())) {
|
|
|
+ || !Arrays.asList(practiceSubjectIdListConfig.split(",")).contains(practiceGroup.getSubjectId().toString())) {
|
|
|
result.put("status", "DISABLE_SUBJECT");
|
|
|
result.put("info", "预约失败,声部选择错误,请重试。");
|
|
|
return result;
|
|
@@ -1743,43 +1749,11 @@ 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 (DateUtil.isSameDay(practiceGroup.getFirstCourseTime(), practiceGroup.getSecondCourseTime())) {
|
|
|
result.put("status", "TWO_DATE_ON_ONE_DAY");
|
|
|
result.put("info", "预约失败,网管课选择时间重复,请重试。");
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
-// int recordNum = practiceLessonApplyDao.checkUserIsApply(practiceGroup.getStudentId());
|
|
|
-// if(recordNum>0){
|
|
|
-// LocalDateTime nowDateTime=LocalDateTime.now();
|
|
|
-// LocalDateTime applyExpireDateTime=LocalDateTime.parse("2020-02-29 00:00:00", DateUtil.dateTimeFormatter);
|
|
|
-// if(nowDateTime.compareTo(applyExpireDateTime)>0){
|
|
|
-// result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
-// result.put("info", "预约失败,超出可预约时间范围。");
|
|
|
-// return result;
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// LocalDateTime nowDateTime=LocalDateTime.now();
|
|
|
-// LocalDateTime applyExpireDateTime=LocalDateTime.parse("2020-02-22 20:00:00", DateUtil.dateTimeFormatter);
|
|
|
-// if(nowDateTime.compareTo(applyExpireDateTime)>0){
|
|
|
-// result.put("status", "APPLY_DATE_OVERFLOW");
|
|
|
-// result.put("info", "预约失败,超出可预约时间范围。");
|
|
|
-// return result;
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
List<String> musicGroupIds = studentRegistrationDao.queryStudentMusicGroup(practiceGroup.getStudentId());
|
|
|
if (!CollectionUtils.isEmpty(musicGroupIds) && musicGroupIds.size() <= 1) {
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupIds.get(0));
|
|
@@ -1803,18 +1777,6 @@ 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;
|
|
|
-// }
|
|
|
allCourseDates.sort(Comparator.comparing(Date::getTime));
|
|
|
|
|
|
studentDao.lockUser(practiceGroup.getStudentId());
|
|
@@ -2348,11 +2310,14 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map getPayPracticeApplyParams(Integer userId, Integer organId) {
|
|
|
+ public Map getPayPracticeApplyParams(Integer userId, Integer organId,Integer tenantId) {
|
|
|
Map result = new HashMap();
|
|
|
- SysConfig practiceSubjectIdListConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_SUBJECT_ID_LIST);
|
|
|
- SysConfig practiceApplyStartTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_START_TIME);
|
|
|
- SysConfig practiceApplyEndTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_END_TIME);
|
|
|
+ String practiceSubjectIdListConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_SUBJECT_ID_LIST,tenantId);
|
|
|
+ if(StringUtils.isEmpty(practiceSubjectIdListConfig)){
|
|
|
+ throw new BizException("请配置陪练课可预约声部");
|
|
|
+ }
|
|
|
+ String practiceApplyStartTimeConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_APPLY_START_TIME,tenantId);
|
|
|
+ String practiceApplyEndTimeConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_APPLY_END_TIME,tenantId);
|
|
|
SysConfig practiceApplyIntervalTimeConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_APPLY_INTERVAL_TIME);
|
|
|
SysConfig practiceCourseMinutesConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
|
|
|
SysConfig practicePayMaxMonthConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_PAY_MAX_MONTH);
|
|
@@ -2361,8 +2326,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
SysConfig practiceBuyActivityExpireDateConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_BUY_ACTIVITY_EXPIRE_DATE);
|
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(userId);
|
|
|
Student student = studentDao.get(userId);
|
|
|
- List<Subject> subjects = subjectDao.findBySubjectByIdList(practiceSubjectIdListConfig.getParanValue());
|
|
|
- List<Integer> subjectIds = Arrays.asList(practiceSubjectIdListConfig.getParanValue().split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
|
+ List<Subject> subjects = subjectDao.findBySubjectByIdList(practiceSubjectIdListConfig);
|
|
|
+ List<Integer> subjectIds = Arrays.asList(practiceSubjectIdListConfig.split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
|
List<Integer> userDefaultSubjectIds = Objects.isNull(student) || Objects.isNull(student.getSubjectIdList()) ? null : Arrays.asList(student.getSubjectIdList().split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
|
if (!CollectionUtils.isEmpty(userDefaultSubjectIds) && userDefaultSubjectIds.size() <= 1) {
|
|
|
userDefaultSubjectIds = userDefaultSubjectIds.stream().filter(userDefaultSubjectId -> subjectIds.contains(userDefaultSubjectId)).collect(Collectors.toList());
|
|
@@ -2372,8 +2337,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Collections.swap(subjects, 6, 7);
|
|
|
PracticeGroupSellPrice practiceGroupSellPrice = practiceGroupSellPriceDao.get(organId);
|
|
|
result.put("subjects", subjects);
|
|
|
- result.put("practiceApplyStartTime", practiceApplyStartTimeConfig.getParanValue());
|
|
|
- result.put("practiceApplyEndTime", practiceApplyEndTimeConfig.getParanValue());
|
|
|
+ result.put("practiceApplyStartTime", practiceApplyStartTimeConfig);
|
|
|
+ result.put("practiceApplyEndTime", practiceApplyEndTimeConfig);
|
|
|
result.put("userDefaultSubjectIds", StringUtils.join(userDefaultSubjectIds.toArray(), ","));
|
|
|
result.put("practiceApplyIntervalMinutes", practiceApplyIntervalTimeConfig.getParanValue(Integer.class));
|
|
|
result.put("practiceCourseMinutes", practiceCourseMinutesConfig.getParanValue(Integer.class));
|
|
@@ -2398,25 +2363,23 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
if (Objects.isNull(sysUser.getOrganId())) {
|
|
|
throw new BizException("未找到用户分部属性");
|
|
|
}
|
|
|
-
|
|
|
-// if (sysUser.getOrganId().equals(DALIAN_ORGAN_ID)) {
|
|
|
-// sysUser.setOrganId(SHENYANG_ORGAN_ID);
|
|
|
-// }
|
|
|
+ if (Objects.isNull(sysUser.getTenantId())) {
|
|
|
+ throw new BizException("用户机构信息异常");
|
|
|
+ }
|
|
|
|
|
|
Integer practiceCourseMinutes = 25;
|
|
|
SysConfig practiceCourseMinutesConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
|
|
|
if (Objects.nonNull(practiceCourseMinutesConfig)) {
|
|
|
practiceCourseMinutes = practiceCourseMinutesConfig.getParanValue(Integer.class);
|
|
|
}
|
|
|
-
|
|
|
- SysConfig organIdConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_TEACHER_ORGAN_RANGE);
|
|
|
-
|
|
|
- if(organIdConfig == null || StringUtils.isBlank(organIdConfig.getParanValue())){
|
|
|
+ String organIdConfig = sysTenantConfigService.getTenantConfigValue(SysConfigService.PRACTICE_TEACHER_ORGAN_RANGE,sysUser.getTenantId());
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(organIdConfig)){
|
|
|
throw new BizException("系统参数[{}]未配置", SysConfigService.PRACTICE_TEACHER_ORGAN_RANGE);
|
|
|
}
|
|
|
|
|
|
List<Integer> includeTeacherIds = new ArrayList<>();
|
|
|
- List<ExtendTeacherBasicDto> organAndSubjectTeachers = teacherDao.findTeaTeachersByOrganAndSubject4(organIdConfig.getParanValue(), subjectId);
|
|
|
+ List<ExtendTeacherBasicDto> organAndSubjectTeachers = teacherDao.findTeaTeachersByOrganAndSubject4(organIdConfig, subjectId);
|
|
|
if (CollectionUtils.isEmpty(organAndSubjectTeachers)) {
|
|
|
return new ArrayList<>();
|
|
|
}
|