|
@@ -24,6 +24,7 @@ import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -116,16 +117,6 @@ import com.ym.mec.biz.dal.page.StudentPayLogQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.TeacherMusicClassQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.VipClassQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.queryMusicGroupCourseScheduleQueryInfo;
|
|
|
-import com.ym.mec.biz.service.ClassGroupRelationService;
|
|
|
-import com.ym.mec.biz.service.ClassGroupService;
|
|
|
-import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
|
|
|
-import com.ym.mec.biz.service.CourseScheduleService;
|
|
|
-import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
|
|
|
-import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
|
|
|
-import com.ym.mec.biz.service.StudentRegistrationService;
|
|
|
-import com.ym.mec.biz.service.SubjectService;
|
|
|
-import com.ym.mec.biz.service.SysConfigService;
|
|
|
-import com.ym.mec.biz.service.TeacherDefaultMusicGroupSalaryService;
|
|
|
import com.ym.mec.common.constant.CommonConstants;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.entity.ImGroupMember;
|
|
@@ -222,6 +213,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() {
|
|
@@ -1729,11 +1722,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<>();
|
|
@@ -1744,7 +1750,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) {
|
|
@@ -2020,18 +2025,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()) {
|
|
@@ -2040,7 +2059,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) {
|
|
@@ -2203,7 +2221,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());
|
|
|
|
|
|
//学生结算表
|
|
@@ -2303,11 +2320,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()) {
|
|
@@ -2316,7 +2345,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) {
|