浏览代码

feat:合并课程还原

Joburgess 4 年之前
父节点
当前提交
fa3dcf5074

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

@@ -5320,7 +5320,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			newPayment.setClassGroupId(courseMergeInfo.getClassGroupId());
 			newPayment.setMusicGroupId(courseMergeInfo.getMusicGroupId());
 			newPayment.setGroupType(courseMergeInfo.getGroupType());
-			newPayment.setExpectPrice(salary);
+			newPayment.setExpectPrice(BigDecimal.ZERO);
 			newPayment.setId(null);
 			newPayment.setBeMerged(true);
 			newPayments.add(newPayment);

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

@@ -698,7 +698,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 			return;
 		}
 		List<CourseScheduleStudentPayment> needUpdates = new ArrayList<>();
-		Map<CourseStatusEnum, List<CourseScheduleStudentPaymentDto>> statusCoursesMap = courseScheduleStudentPayments.stream().collect(Collectors.groupingBy(CourseScheduleStudentPaymentDto::getCourseStatus));
+		Map<CourseStatusEnum, List<CourseScheduleStudentPaymentDto>> statusCoursesMap = courseScheduleStudentPayments.stream().filter(c->Objects.nonNull(c.getCourseStatus())).collect(Collectors.groupingBy(CourseScheduleStudentPaymentDto::getCourseStatus));
 		if(statusCoursesMap.containsKey(CourseStatusEnum.NOT_START)){
 			List<CourseScheduleStudentPaymentDto> notStartCourses = statusCoursesMap.get(CourseStatusEnum.NOT_START);
 			for (CourseScheduleStudentPaymentDto notStartCourse : notStartCourses) {

+ 3 - 4
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -626,8 +626,8 @@
 	<select id="findNeedUpdateActualPriceStudentCourses" resultMap="CourseScheduleStudentPaymentDto">
 		SELECT
 			cssp.*,
-			CONCAT(cs.class_date_,' ',cs.start_class_time_) course_start_time_,
-			cs.status_ course_status_
+			CASE WHEN cs.new_course_id_ IS NULL THEN CONCAT( cs.class_date_, ' ', cs.start_class_time_ ) ELSE CONCAT( cs1.class_date_, ' ', cs1.start_class_time_ ) END course_start_time_,
+			CASE WHEN cs.new_course_id_ IS NULL THEN cs.status_ ELSE cs1.status_ END course_status_
 		FROM
 			course_schedule_student_payment cssp
 			LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
@@ -635,8 +635,7 @@
 		WHERE
 			cssp.batch_no_ IS NOT NULL
 			AND cs.id_ IS NOT NULL
-			AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
-			AND (((cs.status_ IN ('OVER', 'UNDERWAY') OR OR cs1.status_ IN ( 'OVER', 'UNDERWAY' ))
+			AND (((cs.status_ IN ('OVER', 'UNDERWAY') OR cs1.status_ IN ( 'OVER', 'UNDERWAY' ))
 			          AND (cssp.actual_price_ IS NULL OR cssp.actual_price_ &lt; cssp.expect_price_))
 			OR ( cs.status_ = 'NOT_START' AND cssp.actual_price_ IS NOT NULL AND cssp.actual_price_ &gt; 0))
 			<if test="groupIds!=null and groupIds.size()>0">