|
|
@@ -400,18 +400,15 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
//学员总缴费金额
|
|
|
BigDecimal totalActualAmount = musicGroupPaymentCalenderDetails.stream().map(e -> Objects.isNull(e.getActualAmount())?BigDecimal.ZERO:e.getActualAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
- for(int i=0;i<studentStudentPaymentMapEntry.getValue().size();i++){
|
|
|
- if(totalActualAmount.compareTo(studentStudentPaymentMapEntry.getValue().get(i).getExpectPrice())>=0){
|
|
|
- studentStudentPaymentMapEntry.getValue().get(i).setActualPrice(studentStudentPaymentMapEntry.getValue().get(i).getExpectPrice());
|
|
|
- totalActualAmount=totalActualAmount.subtract(studentStudentPaymentMapEntry.getValue().get(i).getExpectPrice());
|
|
|
+ for (CourseScheduleStudentPayment courseScheduleStudentPayment : studentStudentPaymentMapEntry.getValue()) {
|
|
|
+ if(totalActualAmount.compareTo(courseScheduleStudentPayment.getExpectPrice())>=0){
|
|
|
+ courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
|
|
|
+ totalActualAmount=totalActualAmount.subtract(courseScheduleStudentPayment.getExpectPrice());
|
|
|
}else{
|
|
|
- studentStudentPaymentMapEntry.getValue().get(i).setActualPrice(totalActualAmount);
|
|
|
+ courseScheduleStudentPayment.setActualPrice(totalActualAmount);
|
|
|
totalActualAmount=BigDecimal.ZERO;
|
|
|
}
|
|
|
- updateStudentPayments.add(studentStudentPaymentMapEntry.getValue().get(i));
|
|
|
- if(i==studentStudentPaymentMapEntry.getValue().size()-1){
|
|
|
- studentStudentPaymentMapEntry.getValue().get(0).setActualPrice(studentStudentPaymentMapEntry.getValue().get(0).getExpectPrice().add(totalActualAmount));
|
|
|
- }
|
|
|
+ updateStudentPayments.add(courseScheduleStudentPayment);
|
|
|
}
|
|
|
}
|
|
|
|