Browse Source

Merge branch 'teacher_vip_salary'

Joburgess 4 years ago
parent
commit
e0188de59e

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

@@ -1232,7 +1232,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroup.getId());
             for (CourseSchedule courseSchedule : courseScheduleList) {
                 if(existCourseIds.contains(courseSchedule.getId())){
-                    continue;
+                    throw new BizException("该学员已在此班级{}课程中", courseSchedule.getId());
                 }
 
                 CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();

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

@@ -432,15 +432,8 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 		for (Map.Entry<CourseSchedule.CourseScheduleType, List<CourseSchedule>> typeCoursesEntry : typeCourseMap.entrySet()) {
 			Map<Integer, Integer> sdMap = new HashMap<>();
 			for (Integer studentId : studentIds) {
-				Set<Long> existCourseIds = new HashSet<>();
-				if(studentCourseIdsMap.containsKey(studentId)){
-					existCourseIds = studentCourseIdsMap.get(studentId);
-				}
 				int totalCourseDuration = 0;
 				for (CourseSchedule courseSchedule : typeCoursesEntry.getValue()) {
-					if(existCourseIds.contains(courseSchedule.getId())){
-						continue;
-					}
 					//课程时长
 					int courseDuration = DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime());
 					totalCourseDuration += courseDuration;
@@ -504,7 +497,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 				BigDecimal typeCourseTotalOriginalPrice = new BigDecimal("0"), typeCourseTotalCurrentPrice = new BigDecimal("0");
 				for (CourseSchedule courseSchedule : courseScheduleTypeListEntry.getValue()) {
 					if(existCourseIds.contains(courseSchedule.getId())){
-						continue;
+						throw new BizException("该学员已在此班级{}课程中", courseSchedule.getId());
 					}
 					//课程时长
 					int courseDuration = DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime());