| 
														
															@@ -168,6 +168,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         int days = Integer.parseInt(sysConfigDao.findByParamName(SysConfigService.VIP_APPEAL_DAYS_RANGE).getParanValue()); 
														 | 
														
														 | 
														
															         int days = Integer.parseInt(sysConfigDao.findByParamName(SysConfigService.VIP_APPEAL_DAYS_RANGE).getParanValue()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal percent = new BigDecimal(10); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //获取教师未结算课程记录 
														 | 
														
														 | 
														
															         //获取教师未结算课程记录 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<CourseScheduleTeacherSalary> someDayAgoTeacherCourseSalaryNoSettlement = courseScheduleTeacherSalaryDao.findSomeDayAgoTeacherCourseSalaryNoSettlement(days); 
														 | 
														
														 | 
														
															         List<CourseScheduleTeacherSalary> someDayAgoTeacherCourseSalaryNoSettlement = courseScheduleTeacherSalaryDao.findSomeDayAgoTeacherCourseSalaryNoSettlement(days); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (CollectionUtils.isEmpty(someDayAgoTeacherCourseSalaryNoSettlement)) { 
														 | 
														
														 | 
														
															         if (CollectionUtils.isEmpty(someDayAgoTeacherCourseSalaryNoSettlement)) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -227,7 +229,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 //计算教师责任总占比 
														 | 
														
														 | 
														
															                 //计算教师责任总占比 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 double teacherLiabilityRatioSum = courseStudentComplaints.stream().mapToDouble(courseScheduleComplaint -> Objects.isNull(courseScheduleComplaint.getTeacherLiabilityRatio()) ? 0 : courseScheduleComplaint.getTeacherLiabilityRatio()).sum(); 
														 | 
														
														 | 
														
															                 double teacherLiabilityRatioSum = courseStudentComplaints.stream().mapToDouble(courseScheduleComplaint -> Objects.isNull(courseScheduleComplaint.getTeacherLiabilityRatio()) ? 0 : courseScheduleComplaint.getTeacherLiabilityRatio()).sum(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                teacherLiabilityAllratio = new BigDecimal(teacherLiabilityRatioSum); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                teacherLiabilityAllratio = new BigDecimal(teacherLiabilityRatioSum).divide(percent,CommonConstants.DECIMAL_PLACE,BigDecimal.ROUND_DOWN); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } else { 
														 | 
														
														 | 
														
															             } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 //如果没有投诉,则教师和学生的责任占比为0 
														 | 
														
														 | 
														
															                 //如果没有投诉,则教师和学生的责任占比为0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 teacherLiabilityAllratio = new BigDecimal(0); 
														 | 
														
														 | 
														
															                 teacherLiabilityAllratio = new BigDecimal(0); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -256,7 +258,11 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             teacherCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.WAGE); 
														 | 
														
														 | 
														
															             teacherCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.WAGE); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             teacherCashAccountDetail.setStatus(DealStatusEnum.SUCCESS); 
														 | 
														
														 | 
														
															             teacherCashAccountDetail.setStatus(DealStatusEnum.SUCCESS); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             teacherCashAccountDetail.setAmount(actualSalary); 
														 | 
														
														 | 
														
															             teacherCashAccountDetail.setAmount(actualSalary); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            teacherCashAccountDetail.setBalance(teacherCashAccount.getBalance()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(Objects.isNull(teacherCashAccount)){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                teacherCashAccountDetail.setBalance(new BigDecimal(0)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            }else{ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                teacherCashAccountDetail.setBalance(teacherCashAccount.getBalance()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             teacherCashAccountDetail.setAttribute(courseScheduleTeacherSalary.getCourseScheduleId().toString()); 
														 | 
														
														 | 
														
															             teacherCashAccountDetail.setAttribute(courseScheduleTeacherSalary.getCourseScheduleId().toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             userCashAccountDetails.add(teacherCashAccountDetail); 
														 | 
														
														 | 
														
															             userCashAccountDetails.add(teacherCashAccountDetail); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -285,7 +291,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     if (Objects.isNull(temp)) { 
														 | 
														
														 | 
														
															                     if (Objects.isNull(temp)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         temp = 0.0; 
														 | 
														
														 | 
														
															                         temp = 0.0; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    studentLiabilityRatio = new BigDecimal(temp); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    studentLiabilityRatio = new BigDecimal(temp).divide(percent,CommonConstants.DECIMAL_PLACE,BigDecimal.ROUND_DOWN); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } else { 
														 | 
														
														 | 
														
															                 } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     studentLiabilityRatio = new BigDecimal(0); 
														 | 
														
														 | 
														
															                     studentLiabilityRatio = new BigDecimal(0); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -293,7 +299,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 //当前课程学生应退费用 
														 | 
														
														 | 
														
															                 //当前课程学生应退费用 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 BigDecimal returnPrice = studentExpectPrice.multiply(studentLiabilityRatio); 
														 | 
														
														 | 
														
															                 BigDecimal returnPrice = studentExpectPrice.multiply(studentLiabilityRatio); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 //当前课程学生实际缴费 
														 | 
														
														 | 
														
															                 //当前课程学生实际缴费 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                BigDecimal actualPrice = expectSalary.subtract(returnPrice); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                BigDecimal actualPrice = studentExpectPrice.subtract(returnPrice); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 //更新学生结算信息 
														 | 
														
														 | 
														
															                 //更新学生结算信息 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 studentPayment.setActualPrice(actualPrice); 
														 | 
														
														 | 
														
															                 studentPayment.setActualPrice(actualPrice); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 studentPayment.setSettlementTime(now); 
														 | 
														
														 | 
														
															                 studentPayment.setSettlementTime(now); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -444,7 +450,10 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } else { 
														 | 
														
														 | 
														
															                     } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         classTimeDuty = classTimeDuty.divide(new BigDecimal(30), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN); 
														 | 
														
														 | 
														
															                         classTimeDuty = classTimeDuty.divide(new BigDecimal(30), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    BigDecimal teacherDefaultSalary = courseScheduleTeacherSalary.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher30MinSalary(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    BigDecimal teacherDefaultSalary = new BigDecimal(0); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if(Objects.nonNull(teacherDefaultMusicGroupSalaryWithTeacherId)){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        teacherDefaultSalary = courseScheduleTeacherSalary.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher30MinSalary(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     teacherSalary = teacherDefaultSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP); 
														 | 
														
														 | 
														
															                     teacherSalary = teacherDefaultSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } else if (settlementType.equals(SalarySettlementTypeEnum.GRADIENT_SALARY.getCode())) { 
														 | 
														
														 | 
														
															                 } else if (settlementType.equals(SalarySettlementTypeEnum.GRADIENT_SALARY.getCode())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     //课程时长与结算单位时长占比 
														 | 
														
														 | 
														
															                     //课程时长与结算单位时长占比 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -456,7 +465,10 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } else { 
														 | 
														
														 | 
														
															                     } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         classTimeDuty = classTimeDuty.divide(new BigDecimal(90), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN); 
														 | 
														
														 | 
														
															                         classTimeDuty = classTimeDuty.divide(new BigDecimal(90), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    BigDecimal teacherDefaultSalary = courseScheduleTeacherSalary.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher90MinSalary(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    BigDecimal teacherDefaultSalary = new BigDecimal(0); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if(Objects.nonNull(teacherDefaultMusicGroupSalaryWithTeacherId)){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        teacherDefaultSalary = courseScheduleTeacherSalary.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher90MinSalary(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     teacherSalary = teacherDefaultSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP); 
														 | 
														
														 | 
														
															                     teacherSalary = teacherDefaultSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             }else{ 
														 | 
														
														 | 
														
															             }else{ 
														 |