|
@@ -1,6 +1,7 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
@@ -2833,18 +2834,19 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
@Override
|
|
|
@Async
|
|
|
- public boolean updateHistoryTeacherSalaryOfOnline() {
|
|
|
+ public void updateHistoryTeacherSalaryOfOnline() {
|
|
|
// 查询所有含有线上课的课程组,线上课节数,实付金额
|
|
|
List<VipCourseStudentInfoDto> list = vipGroupDao.queryVipCourseStudentInfo();
|
|
|
- Map<Long, VipCourseStudentInfoDto> map = list.stream().collect(Collectors.toMap(VipCourseStudentInfoDto::getMusicGroupId, e -> e));
|
|
|
+ Map<String, VipCourseStudentInfoDto> map = list.stream().collect(Collectors.toMap(VipCourseStudentInfoDto::getMusicGroupId, e -> e));
|
|
|
|
|
|
VipCourseStudentInfoDto dto = null;
|
|
|
// 查询需要修改的课酬记录
|
|
|
List<CourseScheduleTeacherSalary> teacherSalaryList = courseScheduleTeacherSalaryDao.queryOnlineCourseByGroupType(GroupType.VIP);
|
|
|
for (CourseScheduleTeacherSalary ts : teacherSalaryList) {
|
|
|
- dto = map.get(ts.getCourseScheduleId());
|
|
|
+ dto = map.get(ts.getMusicGroupId());
|
|
|
if (dto != null) {
|
|
|
- ts.setExpectSalary(dto.getTotalAmount().divide(new BigDecimal((dto.getTotalCourseTimes() / dto.getStudentNum()))));
|
|
|
+ ts.setExpectSalary(dto.getTotalAmount().divide(new BigDecimal(dto.getTotalCourseTimes()), RoundingMode.HALF_UP)
|
|
|
+ .divide(new BigDecimal(dto.getStudentNum()), RoundingMode.HALF_UP).multiply(new BigDecimal(0.6)));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2852,6 +2854,5 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalarys(teacherSalaryList);
|
|
|
}
|
|
|
|
|
|
- return true;
|
|
|
}
|
|
|
}
|