Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

周箭河 5 lat temu
rodzic
commit
4b639eb5d5

+ 9 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1687,9 +1687,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         //创建IM群组
         addImGroup(classGroup, userIds);
 
-        //5、插入班级排课信息
-        LocalDateTime now = LocalDate.parse(classGroup4MixDtos.get(0).getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
-
         Map<String, Integer> courseTypeMinutesMap = musicGroupPaymentCalenderCourseSettingsService.getMusicCourseSettingsWithStudents(musicGroupId, studentIdList);
 
         //计算每节课的课酬
@@ -1699,6 +1696,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 
         for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
+            //5、插入班级排课信息
+            LocalDateTime now = LocalDate.parse(classGroup4MixDto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
+
             if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
             }
@@ -1993,9 +1993,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         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);
 
         //计算每节课的课酬
@@ -2003,6 +2000,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<CourseSchedule> courseScheduleList = new ArrayList<>();
 
         for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
+            //3、插入班级排课信息
+            LocalDateTime now = LocalDate.parse(classGroup4MixDto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
+
             if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
             }
@@ -2282,9 +2282,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         //创建IM群组
         addImGroup(classGroup, userIds);
 
-        //5、插入班级排课信息
-        LocalDateTime now = LocalDate.parse(classGroup4MixDtos.get(0).getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
-
         Map<String, Integer> courseTypeMinutesMap = musicGroupPaymentCalenderCourseSettingsService.getMusicCourseSettingsWithStudents(musicGroupId, studentIdList);
 
         //计算每节课的课酬
@@ -2293,6 +2290,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 
         for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
+            //5、插入班级排课信息
+            LocalDateTime now = LocalDate.parse(classGroup4MixDto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
+
             if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
             }

+ 1 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java

@@ -336,7 +336,6 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 				BigDecimal unitMinuteCurrentPrice = musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice().divide(new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
 
 				if(MusicGroupPaymentCalender.PayUserType.SCHOOL.equals(musicGroupPaymentCalender.getPayUserType())){
-					unitMinuteOriginalPrice = new BigDecimal("0");
 					unitMinuteCurrentPrice = new BigDecimal("0");
 				}
 
@@ -368,8 +367,8 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 					typeCourseStudentPayments.add(cssp);
 				}
 
+				typeCourseStudentPayments.get(0).setOriginalPrice(typeCourseStudentPayments.get(0).getOriginalPrice().add(musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice().subtract(typeCourseTotalOriginalPrice)));
 				if(MusicGroupPaymentCalender.PayUserType.STUDENT.equals(musicGroupPaymentCalender.getPayUserType())) {
-					typeCourseStudentPayments.get(0).setOriginalPrice(typeCourseStudentPayments.get(0).getOriginalPrice().add(musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice().subtract(typeCourseTotalOriginalPrice)));
 					typeCourseStudentPayments.get(0).setExpectPrice(typeCourseStudentPayments.get(0).getExpectPrice().add(musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice().subtract(typeCourseTotalCurrentPrice)));
 				}
 				courseScheduleStudentPayments.addAll(typeCourseStudentPayments);