Ver código fonte

fix:设置教师默认乐团课课酬是,课堂课课酬计算方式变更

Joburgess 4 anos atrás
pai
commit
b9d9f5c8d0

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultMusicGroupSalaryServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -165,6 +166,10 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
 										int studentNum = courseScheduleStudentPaymentDao.countCourseOnlyStudentNum(ts.getCourseScheduleId());
 										ts.setExpectSalary(ts.getExpectSalary().multiply(new BigDecimal(studentNum)));
 									}
+									//课堂课课酬改为按分钟数计算,并且时长占比向下取整
+									if (CourseSchedule.CourseScheduleType.CLASSROOM.equals(tdms.getCourseScheduleType())){
+										ts.setExpectSalary(duration.divide(new BigDecimal(40), BigDecimal.ZERO.intValue(), BigDecimal.ROUND_DOWN).multiply(ts.getExpectSalary()).setScale(2, BigDecimal.ROUND_HALF_UP));
+									}
 									list.add(ts);
 								} else if (musicGroup.getSettlementType() == SalarySettlementTypeEnum.TEACHER_DEFAULT) {// 默认课酬
 									mins = 30;
@@ -187,6 +192,10 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
 										int studentNum = courseScheduleStudentPaymentDao.countCourseOnlyStudentNum(ts.getCourseScheduleId());
 										ts.setExpectSalary(ts.getExpectSalary().multiply(new BigDecimal(studentNum)));
 									}
+									//课堂课课酬改为按分钟数计算,并且时长占比向下取整
+									if (CourseSchedule.CourseScheduleType.CLASSROOM.equals(tdms.getCourseScheduleType())){
+										ts.setExpectSalary(duration.divide(new BigDecimal(40), BigDecimal.ZERO.intValue(), BigDecimal.ROUND_DOWN).multiply(ts.getExpectSalary()).setScale(2, BigDecimal.ROUND_HALF_UP));
+									}
 									list.add(ts);
 								}
 								if(ts.getExpectSalary() == null){