Browse Source

fix:课酬

Joburgess 4 years ago
parent
commit
84357644b4

+ 4 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -464,15 +464,15 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                         || CourseSchedule.CourseScheduleType.HIGH.equals(c.getType()))
                 .map(CourseSchedule::getId).collect(Collectors.toList());
 
-        List<StudentAttendance> studentAttendances = null;
+        List<CourseScheduleStudentPayment> studentAttendances = null;
         if(!CollectionUtils.isEmpty(needStudentAttendanceCourseScheduleIds)){
-            studentAttendances = studentAttendanceDao.findByCourseIds(needStudentAttendanceCourseScheduleIds);
+            studentAttendances = courseScheduleStudentPaymentDao.findByCourseScheduleIds(needStudentAttendanceCourseScheduleIds);
         }
         Map<Long, Long> courseNormalStudentsMap = new HashMap<>();
         if(!CollectionUtils.isEmpty(studentAttendances)){
             courseNormalStudentsMap =studentAttendances.stream()
 //                    .filter(studentAttendance -> StudentAttendanceStatusEnum.NORMAL.equals(studentAttendance.getStatus()))
-                    .collect(Collectors.groupingBy(StudentAttendance::getCourseScheduleId, Collectors.counting()));
+                    .collect(Collectors.groupingBy(CourseScheduleStudentPayment::getCourseScheduleId, Collectors.counting()));
         }
 
         //课程对应乐团结算方式集合
@@ -526,6 +526,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 //扣除费用
                 BigDecimal deductCost = new BigDecimal(0);
                 List<String> deductReasons = new ArrayList<>();
+                deductReasons.add("课程应到人数:" + normalStudentNum);
                 List<TeacherAttendance> courseTeacherAttendances = teacherCourseAttendanceMap.get(org.apache.commons.lang3.StringUtils.joinWith(":", courseScheduleTeacherSalary.getCourseScheduleId(), courseScheduleTeacherSalary.getUserId()));
 
                 TeacherAttendance teacherAttendance = courseTeacherAttendances.get(0);