|
@@ -4616,6 +4616,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
TeacherDefaultPracticeGroupSalary teacherDefaultPracticeGroupSalary = teacherDefaultPracticeGroupSalaryDao.findByTeacherAndCourseMinutes(teacherId,practiceCourseMinutes);
|
|
|
|
|
|
BigDecimal teacherDefaultSalary = BigDecimal.ZERO;
|
|
|
+ BigDecimal giveTeacherDefaultSalary = BigDecimal.ZERO;
|
|
|
if(Objects.isNull(teacherDefaultPracticeGroupSalary)){
|
|
|
throw new BizException("请设置老师课酬");
|
|
|
}
|
|
@@ -4633,6 +4634,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
|
|
|
//课程购买费用计算
|
|
|
VipGroupSalarySettlementTypeDto salarySettlement = null;
|
|
|
+ VipGroupSalarySettlementTypeDto givePracticeSalarySettlement = null;
|
|
|
if(practice.getVipGroupActivityId() != null){
|
|
|
VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(practice.getVipGroupActivityId());
|
|
|
VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
|
|
@@ -4640,18 +4642,26 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
throw new BizException("课酬结算方案错误");
|
|
|
}
|
|
|
salarySettlement = vipGroupSalarySettlementDto.getPracticeSalarySettlement();
|
|
|
+ givePracticeSalarySettlement = vipGroupSalarySettlementDto.getGivePracticeSalarySettlement();
|
|
|
totalPrice = totalPrice.multiply(vipGroupActivity.getDiscount()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
|
|
|
}
|
|
|
//教师课酬线上单课酬计算
|
|
|
teacherDefaultSalary = teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
|
|
|
+ giveTeacherDefaultSalary = teacherDefaultSalary;
|
|
|
if(Objects.nonNull(salarySettlement)){
|
|
|
if(salarySettlement.getSalarySettlementType() == SalarySettlementTypeEnum.FIXED_SALARY){
|
|
|
teacherDefaultSalary = salarySettlement.getSettlementValue();
|
|
|
}
|
|
|
}
|
|
|
+ if(Objects.nonNull(givePracticeSalarySettlement)){
|
|
|
+ if(givePracticeSalarySettlement.getSalarySettlementType() == SalarySettlementTypeEnum.FIXED_SALARY){
|
|
|
+ giveTeacherDefaultSalary = givePracticeSalarySettlement.getSettlementValue();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
results.put("totalPrice",totalPrice.setScale(0,BigDecimal.ROUND_CEILING));
|
|
|
results.put("onlineTeacherSalary",teacherDefaultSalary.setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ results.put("giveTeacherDefaultSalary",giveTeacherDefaultSalary.setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
return results;
|
|
|
}
|
|
|
|
|
@@ -4990,7 +5000,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
//计算课程相关费用信息
|
|
|
Map<String, BigDecimal> costInfo = countPracticeGroupPredictFee(applyBaseInfo,applyBaseInfo.getUserId());
|
|
|
if(practice.getGiveFlag()){
|
|
|
- applyBaseInfo.setOnlineTeacherSalary(costInfo.get("giveOnlineTeacherSalary"));
|
|
|
+ applyBaseInfo.setOnlineTeacherSalary(costInfo.get("giveTeacherDefaultSalary"));
|
|
|
}else {
|
|
|
applyBaseInfo.setOnlineTeacherSalary(costInfo.get("onlineTeacherSalary"));
|
|
|
}
|