|
@@ -47,8 +47,7 @@ import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
-import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
|
|
|
-import static com.ym.mec.biz.dal.enums.GroupType.PRACTICE;
|
|
|
+import static com.ym.mec.biz.dal.enums.GroupType.*;
|
|
|
import static com.ym.mec.biz.dal.enums.PracticeGroupType.*;
|
|
|
|
|
|
@Service
|
|
@@ -2076,6 +2075,26 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(groupType == VIP){
|
|
|
+ VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
|
+ try {
|
|
|
+ Map<String, BigDecimal> costInfo = vipGroupService.countVipGroupPredictFee(vipGroup,
|
|
|
+ courseSchedules.get(0).getActualTeacherId(),
|
|
|
+ vipGroup.getOnlineClassesUnitPrice(),
|
|
|
+ vipGroup.getOfflineClassesUnitPrice(),
|
|
|
+ false,true);
|
|
|
+ courseScheduleTeacherSalaryDao.batchUpdateCourseSalarys(courseScheduleIds,
|
|
|
+ vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)?costInfo.get("offlineTeacherSalary"):costInfo.get("onlineTeacherSalary"));
|
|
|
+ } catch (Exception e) {
|
|
|
+ TeacherDefaultVipGroupSalary tdvs = teacherDefaultVipGroupSalaryDao.findByTeacherAndCategory(courseSchedules.get(0).getActualTeacherId(),vipGroup.getVipGroupCategoryId());
|
|
|
+ if (tdvs == null) {
|
|
|
+ throw new BizException("老师[]没有设置默认课酬,请先设置", courseSchedules.get(0).getActualTeacherId());
|
|
|
+ }
|
|
|
+ courseScheduleTeacherSalaryDao.batchUpdateCourseSalarys(courseScheduleIds,
|
|
|
+ vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)?tdvs.getOfflineClassesSalary():tdvs.getOnlineClassesSalary());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
courseScheduleDao.batchUpdate(courseSchedules);
|
|
|
classGroupService.updateClassGroupInfo(classGroup.getId());
|
|
|
if(vipGroupCourseAdjustInfo.getCourseCreateStartTime().after(now)){
|
|
@@ -2679,29 +2698,24 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if (vipGroup == null) {
|
|
|
throw new BizException("课程[{}]记录存在异常,请联系管理员", courseScheduleId);
|
|
|
}
|
|
|
- TeacherDefaultVipGroupSalary tdvs = map.get(vipGroup.getVipGroupCategoryId());
|
|
|
- if (tdvs == null) {
|
|
|
- throw new BizException("老师[]没有设置默认课酬,请先设置", teacherId);
|
|
|
- }
|
|
|
- Map<String, BigDecimal> costInfo = vipGroupService.countVipGroupPredictFee(vipGroup,
|
|
|
- teacherId,
|
|
|
- vipGroup.getOnlineClassesUnitPrice(),
|
|
|
- vipGroup.getOfflineClassesUnitPrice(),
|
|
|
- false,true);
|
|
|
- if (newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE) {
|
|
|
- ts.setExpectSalary(costInfo.get("offlineTeacherSalary"));
|
|
|
- } else {
|
|
|
- ts.setExpectSalary(costInfo.get("onlineTeacherSalary"));
|
|
|
+ try {
|
|
|
+ Map<String, BigDecimal> costInfo = vipGroupService.countVipGroupPredictFee(vipGroup,
|
|
|
+ teacherId,
|
|
|
+ vipGroup.getOnlineClassesUnitPrice(),
|
|
|
+ vipGroup.getOfflineClassesUnitPrice(),
|
|
|
+ false,true);
|
|
|
+ if (newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE) {
|
|
|
+ ts.setExpectSalary(costInfo.get("offlineTeacherSalary"));
|
|
|
+ } else {
|
|
|
+ ts.setExpectSalary(costInfo.get("onlineTeacherSalary"));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ TeacherDefaultVipGroupSalary tdvs = map.get(vipGroup.getVipGroupCategoryId());
|
|
|
+ if (tdvs == null) {
|
|
|
+ throw new BizException("老师[]没有设置默认课酬,请先设置", teacherId);
|
|
|
+ }
|
|
|
+ ts.setExpectSalary(newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE?tdvs.getOfflineClassesSalary():tdvs.getOnlineClassesSalary());
|
|
|
}
|
|
|
-
|
|
|
-// ts.setExpectSalary(new BigDecimal(0));
|
|
|
-// Map<Integer, CourseScheduleTeacherSalary> tsMap = courseScheduleTeacherSalaryMap.get(courseScheduleId);
|
|
|
-// if(tsMap != null){
|
|
|
-// CourseScheduleTeacherSalary oldTS = tsMap.get(teacherId);
|
|
|
-// if(oldTS != null){
|
|
|
-// ts.setExpectSalary(oldTS.getExpectSalary());
|
|
|
-// }
|
|
|
-// }
|
|
|
} else if (newCourseSchedule.getGroupType() == PRACTICE) {
|
|
|
List<TeacherDefaultPracticeGroupSalary> teacherDefaultPracticeGroupSalaryList = teacherDefaultPracticeGroupSalaryDao
|
|
|
.queryByUserId(teacherId);
|