Преглед на файлове

fix:排课时计算课酬的学生人数优先从课程取

Joburgess преди 4 години
родител
ревизия
8e355325f8

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

@@ -721,19 +721,22 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 								if (StringUtils.equals(settlementType, "GRADIENT_SALARY")) {
 									salary = courseScheduleTeacherSalary.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? tdms.getMainTeacher90MinSalary() : tdms.getAssistantTeacher90MinSalary();
 								}
-								Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroup.getId());
-								if(Objects.isNull(studentNum)){
-									studentNum = 0;
+								int studentNum = courseScheduleStudentPaymentDao.countCourseOnlyStudentNum(courseSchedule.getId());
+								if(studentNum<=0){
+									studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(courseSchedule.getClassGroupId());
 								}
 								courseScheduleTeacherSalary.setExpectSalary(salary.multiply(new BigDecimal(studentNum)));
 							}
 							//线上小班课
 							if(type == CourseScheduleType.HIGH_ONLINE){
-								Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroup.getId());
-								if(Objects.isNull(studentNum)){
-									studentNum = 0;
+								int studentNum = courseScheduleStudentPaymentDao.countCourseOnlyStudentNum(courseSchedule.getId());
+								if(studentNum<=0){
+									studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(courseSchedule.getClassGroupId());
 								}
 								BigDecimal salary = JSON.parseObject(tdms.getSalaryRuleJson()).getBigDecimal(studentNum+"");
+								if(studentNum<=0){
+									salary = new BigDecimal(0);
+								}
 								courseScheduleTeacherSalary.setExpectSalary(salary);
 							}
 

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

@@ -1199,22 +1199,25 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 if(Objects.isNull(salary)){
                     throw new BizException("课酬设置异常");
                 }
-                Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(courseSchedule.getClassGroupId());
-                if(Objects.isNull(studentNum)){
-                    studentNum = 0;
+                int studentNum = courseScheduleStudentPaymentDao.countCourseOnlyStudentNum(courseSchedule.getId());
+                if(studentNum<=0){
+                    studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(courseSchedule.getClassGroupId());
                 }
                 salary = salary.multiply(new BigDecimal(studentNum));
             }
             //线上小班课
             if (courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.HIGH_ONLINE)) {
-                Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(courseSchedule.getClassGroupId());
-                if(Objects.isNull(studentNum)){
-                    studentNum = 0;
+                int studentNum = courseScheduleStudentPaymentDao.countCourseOnlyStudentNum(courseSchedule.getId());
+                if(studentNum<=0){
+                    studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(courseSchedule.getClassGroupId());
                 }
                 if(studentNum>5){
                     studentNum=5;
                 }
                 salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum+"");
+                if(studentNum<=0){
+                    salary = new BigDecimal(0);
+                }
             }
 
             if (courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.MUSIC_NETWORK)) {