|
@@ -121,6 +121,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
private SysConfigService sysConfigService;
|
|
|
@Autowired
|
|
|
private StudentDao studentDao;
|
|
|
+ @Autowired
|
|
|
+ private MusicGroupPaymentCalenderCourseSettingsService musicGroupPaymentCalenderCourseSettingsService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, ClassGroup> getDAO() {
|
|
@@ -1531,11 +1533,24 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
//5、插入班级排课信息
|
|
|
LocalDateTime now = LocalDate.parse(classGroup4MixDtos.get(0).getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
|
|
|
|
|
|
+ Map<String, Integer> courseTypeMinutesMap = musicGroupPaymentCalenderCourseSettingsService.getMusicCourseSettingsWithStudents(musicGroupId, studentIdList);
|
|
|
+
|
|
|
//计算每节课的课酬
|
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
|
|
|
List<CourseSchedule> courseScheduleList = new ArrayList<>();
|
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
|
|
|
+ if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
|
|
|
+ throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
|
|
|
+ }
|
|
|
+ Integer totalMinutes = courseTypeMinutesMap.get(classGroup4MixDto.getCourseType().getCode());
|
|
|
+ long courseDuration = Duration.between(LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getStartClassTime() + ":00", formatter),
|
|
|
+ LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getEndClassTime() + ":00", formatter))
|
|
|
+ .toMinutes();
|
|
|
+ classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
|
|
|
+
|
|
|
int times = 0;
|
|
|
|
|
|
Set<String> holidayDays = new HashSet<>();
|
|
@@ -1546,7 +1561,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
holidayDays = new HashSet<>(JSON.parseArray(holidaySetting.getParanValue(), String.class));
|
|
|
}
|
|
|
}
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
WhileNode:
|
|
|
while (true) {
|
|
@@ -1822,18 +1836,32 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
classGroupTeacherMapperService.classGroupTeachersInsert(newClassGroupTeacherMapperList);
|
|
|
}
|
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
//2、获取班级学生
|
|
|
List<StudentRegistration> studentList = classGroupStudentMapperDao.findClassStudentList(classGroup.getId(), ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
|
|
+ List<Integer> studentIds = studentList.stream().map(StudentRegistration::getUserId).collect(Collectors.toList());
|
|
|
+
|
|
|
//3、插入班级排课信息
|
|
|
LocalDateTime now = LocalDate.parse(classGroup4MixDtos.get(0).getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
|
|
|
|
|
|
+ Map<String, Integer> courseTypeMinutesMap = musicGroupPaymentCalenderCourseSettingsService.getMusicCourseSettingsWithStudents(musicGroupId, studentIds);
|
|
|
+
|
|
|
//计算每节课的课酬
|
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
|
|
|
List<CourseSchedule> courseScheduleList = new ArrayList<>();
|
|
|
|
|
|
for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
|
|
|
+ if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
|
|
|
+ throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
|
|
|
+ }
|
|
|
+ Integer totalMinutes = courseTypeMinutesMap.get(classGroup4MixDto.getCourseType().getCode());
|
|
|
+ long courseDuration = Duration.between(LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getStartClassTime() + ":00", formatter),
|
|
|
+ LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getEndClassTime() + ":00", formatter))
|
|
|
+ .toMinutes();
|
|
|
+ classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
|
|
|
+
|
|
|
int times = 0;
|
|
|
Set<String> holidayDays = new HashSet<>();
|
|
|
if (classGroup4MixDto.getHoliday()) {
|
|
@@ -1842,7 +1870,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
holidayDays = new HashSet<>(JSON.parseArray(holidaySetting.getParanValue(), String.class));
|
|
|
}
|
|
|
}
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
WhileNode:
|
|
|
while (true) {
|
|
@@ -2005,7 +2032,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
}
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(studentList)) {
|
|
|
- List<Integer> studentIds = studentList.stream().map(StudentRegistration::getUserId).collect(Collectors.toList());
|
|
|
studentDao.updateStudentServiceTag(null, studentIds, YesOrNoEnum.YES.getCode());
|
|
|
|
|
|
//学生结算表
|
|
@@ -2105,11 +2131,23 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
//5、插入班级排课信息
|
|
|
LocalDateTime now = LocalDate.parse(classGroup4MixDtos.get(0).getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
|
|
|
|
|
|
+ Map<String, Integer> courseTypeMinutesMap = musicGroupPaymentCalenderCourseSettingsService.getMusicCourseSettingsWithStudents(musicGroupId, studentIdList);
|
|
|
+
|
|
|
//计算每节课的课酬
|
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
|
|
|
List<CourseSchedule> courseScheduleList = new ArrayList<>();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
|
|
|
+ if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
|
|
|
+ throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
|
|
|
+ }
|
|
|
+ Integer totalMinutes = courseTypeMinutesMap.get(classGroup4MixDto.getCourseType().getCode());
|
|
|
+ long courseDuration = Duration.between(LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getStartClassTime() + ":00", formatter),
|
|
|
+ LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getEndClassTime() + ":00", formatter))
|
|
|
+ .toMinutes();
|
|
|
+ classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
|
|
|
+
|
|
|
int times = 0;
|
|
|
Set<String> holidayDays = new HashSet<>();
|
|
|
if (classGroup4MixDto.getHoliday()) {
|
|
@@ -2118,7 +2156,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
holidayDays = new HashSet<>(JSON.parseArray(holidaySetting.getParanValue(), String.class));
|
|
|
}
|
|
|
}
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
WhileNode:
|
|
|
while (true) {
|