|
@@ -199,7 +199,11 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
|
//教师应扣除费用
|
|
|
BigDecimal deductPrice = avgSalary.multiply(teacherLiabilityAllratio);
|
|
|
//教师实际课酬
|
|
|
- BigDecimal actualSalary = expectSalary.subtract(deductPrice).add(courseScheduleTeacherSalary.getSubsidy());
|
|
|
+ BigDecimal schoolSubsidy=new BigDecimal(0);
|
|
|
+ if(Objects.nonNull(courseScheduleTeacherSalary.getSubsidy())){
|
|
|
+ schoolSubsidy=courseScheduleTeacherSalary.getSubsidy();
|
|
|
+ }
|
|
|
+ BigDecimal actualSalary = expectSalary.subtract(deductPrice).add(schoolSubsidy);
|
|
|
|
|
|
//更新教师结算信息
|
|
|
courseScheduleTeacherSalary.setActualSalary(actualSalary);
|
|
@@ -221,16 +225,25 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
|
userCashAccountDetails.add(teacherCashAccountDetail);
|
|
|
|
|
|
//根据学生进行投诉分组
|
|
|
- Map<Integer, List<CourseScheduleComplaints>> complainsGroupByStudent = courseStudentComplaints.stream().collect(Collectors.groupingBy(CourseScheduleComplaints::getUserId));
|
|
|
+ Map<Integer, List<CourseScheduleComplaints>> complainsGroupByStudent = null;
|
|
|
+ if(Objects.nonNull(courseStudentComplaints)){
|
|
|
+ complainsGroupByStudent = courseStudentComplaints.stream().collect(Collectors.groupingBy(CourseScheduleComplaints::getUserId));
|
|
|
+ }
|
|
|
|
|
|
//计算学生当前课程应缴费用
|
|
|
- studentPaymentsWithCourse.forEach(studentPayment -> {
|
|
|
+ for (CourseScheduleStudentPayment studentPayment : studentPaymentsWithCourse) {
|
|
|
//当前课程学生应缴费用
|
|
|
BigDecimal studentExpectPrice = studentPayment.getExpectPrice();
|
|
|
+ if(Objects.isNull(studentExpectPrice)){
|
|
|
+ studentExpectPrice=new BigDecimal(0);
|
|
|
+ }
|
|
|
//当前课程学生责任占比
|
|
|
BigDecimal studentLiabilityRatio;
|
|
|
- List<CourseScheduleComplaints> currentCourseScheduleComplaints = complainsGroupByStudent.get(studentPayment.getUserId());
|
|
|
- if (CollectionUtils.isEmpty(currentCourseScheduleComplaints)) {
|
|
|
+ List<CourseScheduleComplaints> currentCourseScheduleComplaints = null;
|
|
|
+ if(!CollectionUtils.isEmpty(complainsGroupByStudent)){
|
|
|
+ currentCourseScheduleComplaints = complainsGroupByStudent.get(studentPayment.getUserId());
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(currentCourseScheduleComplaints)) {
|
|
|
Double temp = currentCourseScheduleComplaints.get(0).getStudentLiabilityRatio();
|
|
|
studentLiabilityRatio = new BigDecimal(temp);
|
|
|
} else {
|
|
@@ -259,8 +272,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
|
studentAccountDetail.setAttribute(courseScheduleTeacherSalary.getCourseScheduleId().toString());
|
|
|
|
|
|
userCashAccountDetails.add(studentAccountDetail);
|
|
|
-
|
|
|
- });
|
|
|
+ }
|
|
|
|
|
|
});
|
|
|
sysUserCashAccountDetailDao.batchInsert(userCashAccountDetails);
|