Ver código fonte

增加减免金额

周箭河 5 anos atrás
pai
commit
9629018254

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

@@ -769,7 +769,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 }
 
                 List<Integer> repeatStudentIds = new ArrayList<>();
-                if (classGroupStudentsMap.containsKey(newCourseSchedule.getClassGroupId()) && exitStudentPaymentMap.containsKey(existCourseSchedule.getId())) {
+                if (!isTeacherRepeat && classGroupStudentsMap.containsKey(newCourseSchedule.getClassGroupId()) && exitStudentPaymentMap.containsKey(existCourseSchedule.getId())) {
                     //如果班级不同,则需要检测两个班级是否存在重复的学生
                     List<ClassGroupStudentMapper> preClassGroupStudents = classGroupStudentsMap.get(newCourseSchedule.getClassGroupId());
                     List<CourseScheduleStudentPayment> backClassGroupStudents = exitStudentPaymentMap.get(existCourseSchedule.getId());
@@ -788,7 +788,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                     if (!CollectionUtils.isEmpty(repeatStudentIds)) {
                         isStudentRepeat = true;
                     }
+
+                    if(isStudentRepeat && (backClassGroupStudentIds.size() == repeatStudentIds.size())){
+                        isStudentRepeat = false;
+                        isTeacherRepeat = true;
+                    }
                 }
+
                 if (!isTeacherRepeat && !isStudentRepeat) {
                     continue;
                 }