|
@@ -5502,8 +5502,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(VIP.equals(courseSchedule.getGroupType())||PRACTICE.equals(courseSchedule.getGroupType())){
|
|
|
throw new BizException("VIP课、网管课暂不支持课程合并");
|
|
|
}
|
|
|
- if(CourseScheduleType.MUSIC_NETWORK.equals(courseSchedule.getType())||CourseScheduleType.HIGH_ONLINE.equals(courseSchedule.getType())){
|
|
|
- throw new BizException("乐团网管课、线上基础技能课暂不支持课程合并");
|
|
|
+ if(CourseScheduleType.MUSIC_NETWORK.equals(courseSchedule.getType())){
|
|
|
+ throw new BizException("乐团网管课暂不支持课程合并");
|
|
|
}
|
|
|
if(Objects.isNull(courseMergeInfo.getClassGroupId())&&courseMergeInfo.getId().equals(courseSchedule.getId())){
|
|
|
courseMergeInfo.setClassGroupId(courseSchedule.getClassGroupId());
|
|
@@ -5513,28 +5513,16 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
courseSchedule.setNote("课程合并");
|
|
|
}
|
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findByCourseScheduleIds(allCourseIds);
|
|
|
-// Map<Long, Set<Integer>> courseStudentIdsMap = courseScheduleStudentPayments.stream().collect(Collectors.groupingBy(CourseScheduleStudentPayment::getCourseScheduleId, Collectors.mapping(CourseScheduleStudentPayment::getUserId, Collectors.toSet())));
|
|
|
-// Set<Integer> allStudentIds = courseScheduleStudentPayments.stream().map(CourseScheduleStudentPayment::getUserId).collect(Collectors.toSet());
|
|
|
|
|
|
Map<Integer, CourseScheduleStudentPayment> mainStudentCourseMap = courseScheduleStudentPayments.stream().filter(c -> courseMergeInfo.getId().equals(c.getCourseScheduleId())).collect(Collectors.toMap(CourseScheduleStudentPayment::getUserId, c -> c, (c1, c2) -> c1));
|
|
|
|
|
|
Map<Integer, List<CourseScheduleStudentPayment>> otherStudentCourseMap = courseScheduleStudentPayments.stream().filter(c -> !courseMergeInfo.getId().equals(c.getCourseScheduleId())).collect(Collectors.groupingBy(CourseScheduleStudentPayment::getUserId));
|
|
|
|
|
|
List<CourseScheduleStudentPayment> newPayments = new ArrayList<>();
|
|
|
-// List<CourseScheduleStudentPayment> updatePayments = new ArrayList<>();
|
|
|
|
|
|
for (Map.Entry<Integer, List<CourseScheduleStudentPayment>> otherStudentCourseMapEntry : otherStudentCourseMap.entrySet()) {
|
|
|
List<CourseScheduleStudentPayment> studentCoursePayments = otherStudentCourseMapEntry.getValue();
|
|
|
-// BigDecimal salary = studentCoursePayments.stream().map(CourseScheduleStudentPayment::getExpectPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
if(mainStudentCourseMap.containsKey(otherStudentCourseMapEntry.getKey())){
|
|
|
-// CourseScheduleStudentPayment updatePayment = mainStudentCourseMap.get(otherStudentCourseMapEntry.getKey());
|
|
|
-// updatePayment.setExpectPrice(updatePayment.getExpectPrice().add(salary));
|
|
|
-// updatePayments.add(updatePayment);
|
|
|
-
|
|
|
-// for (CourseScheduleStudentPayment studentCoursePayment : studentCoursePayments) {
|
|
|
-// studentCoursePayment.setExpectPrice(BigDecimal.ZERO);
|
|
|
-// updatePayments.add(studentCoursePayment);
|
|
|
-// }
|
|
|
continue;
|
|
|
}
|
|
|
CourseScheduleStudentPayment newPayment = new CourseScheduleStudentPayment();
|
|
@@ -5547,10 +5535,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
newPayment.setId(null);
|
|
|
newPayment.setBeMerged(true);
|
|
|
newPayments.add(newPayment);
|
|
|
-// for (CourseScheduleStudentPayment studentCoursePayment : studentCoursePayments) {
|
|
|
-// studentCoursePayment.setExpectPrice(BigDecimal.ZERO);
|
|
|
-// updatePayments.add(studentCoursePayment);
|
|
|
-// }
|
|
|
}
|
|
|
|
|
|
List<CourseSchedule> courseSchedules=new ArrayList<>();
|
|
@@ -5567,13 +5551,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
|
|
|
//课程信息变更
|
|
|
courseSchedule.setNewCourseId(courseMergeInfo.getId());
|
|
|
-// courseSchedule.setClassDate(courseMergeInfo.getClassDate());
|
|
|
-// courseSchedule.setStartClassTime(courseMergeInfo.getStartClassTime());
|
|
|
-// courseSchedule.setEndClassTime(courseMergeInfo.getEndClassTime());
|
|
|
-// courseSchedule.setActualTeacherId(courseMergeInfo.getActualTeacherId());
|
|
|
-// courseSchedule.setClassGroupId(courseMergeInfo.getClassGroupId());
|
|
|
-// courseSchedule.setSchoolId(courseMergeInfo.getSchoolId());
|
|
|
-
|
|
|
courseScheduleModifyLog.setCurrentCourseSchedule(JsonUtil.toJSONString(courseSchedule));
|
|
|
courseScheduleModifyLog.setOperatorId(courseMergeInfo.getOperatorId());
|
|
|
insertCourseScheduleModifyLogList.add(courseScheduleModifyLog);
|