|
@@ -1,6 +1,7 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -101,6 +102,7 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
|
|
|
Map<String, MusicGroup> musicGroupMap = musicGroupDao.queryListByIds(StringUtils.join(musicGroupIdList, ",")).stream()
|
|
|
.collect(Collectors.toMap(MusicGroup::getId, mg -> mg));
|
|
|
|
|
|
+ List<CourseScheduleTeacherSalary> list = new ArrayList<CourseScheduleTeacherSalary>();
|
|
|
// 批量修改课程课酬
|
|
|
for (CourseScheduleTeacherSalary ts : updateTeacherSalaryList) {
|
|
|
MusicGroup musicGroup = musicGroupMap.get(ts.getMusicGroupId());
|
|
@@ -111,27 +113,42 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
|
|
|
|
|
|
BigDecimal duration = new BigDecimal(DateUtil.minutesBetween(ts.getCourseSchedule().getStartClassTime(), ts.getCourseSchedule()
|
|
|
.getEndClassTime()));
|
|
|
-
|
|
|
+ int mins = 0;
|
|
|
if (musicGroup.getSettlementType() == SalarySettlementTypeEnum.GRADIENT_SALARY) {// 3.0课酬
|
|
|
-
|
|
|
+ mins = 90;
|
|
|
+ if (tdms.getCourseScheduleType() == CourseScheduleType.CLASSROOM) {
|
|
|
+ mins = 40;
|
|
|
+ } else if (tdms.getCourseScheduleType() == CourseScheduleType.HIGH) {
|
|
|
+ mins = 45;
|
|
|
+ }
|
|
|
// 判断是助教、主教
|
|
|
if (ts.getTeacherRole() == TeachTypeEnum.BISHOP) {
|
|
|
- ts.setExpectSalary(duration.divide(new BigDecimal(90)).multiply(tdms.getMainTeacher90MinSalary()));
|
|
|
+ ts.setExpectSalary(duration.divide(new BigDecimal(mins)).multiply(tdms.getMainTeacher90MinSalary()));
|
|
|
} else {
|
|
|
- ts.setExpectSalary(duration.divide(new BigDecimal(90)).multiply(tdms.getAssistantTeacher90MinSalary()));
|
|
|
+ ts.setExpectSalary(duration.divide(new BigDecimal(mins)).multiply(tdms.getAssistantTeacher90MinSalary()));
|
|
|
}
|
|
|
+ list.add(ts);
|
|
|
} else if (musicGroup.getSettlementType() == SalarySettlementTypeEnum.TEACHER_DEFAULT) {// 默认课酬
|
|
|
+ mins = 30;
|
|
|
+ if (tdms.getCourseScheduleType() == CourseScheduleType.CLASSROOM) {
|
|
|
+ mins = 40;
|
|
|
+ } else if (tdms.getCourseScheduleType() == CourseScheduleType.HIGH) {
|
|
|
+ mins = 45;
|
|
|
+ }
|
|
|
// 判断是助教、主教
|
|
|
if (ts.getTeacherRole() == TeachTypeEnum.BISHOP) {
|
|
|
- ts.setExpectSalary(duration.divide(new BigDecimal(30)).multiply(tdms.getMainTeacher30MinSalary()));
|
|
|
+ ts.setExpectSalary(duration.divide(new BigDecimal(mins)).multiply(tdms.getMainTeacher30MinSalary()));
|
|
|
} else {
|
|
|
- ts.setExpectSalary(duration.divide(new BigDecimal(30)).multiply(tdms.getAssistantTeacher30MinSalary()));
|
|
|
+ ts.setExpectSalary(duration.divide(new BigDecimal(mins)).multiply(tdms.getAssistantTeacher30MinSalary()));
|
|
|
}
|
|
|
+ list.add(ts);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalarys(updateTeacherSalaryList);
|
|
|
+ if (list.size() > 0) {
|
|
|
+ courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalarys(list);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|