|
@@ -226,15 +226,16 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
List<VipGroupGiveCourseSortDto> vipGroupSortCourseByGroup = courseScheduleStudentPaymentDao.findVipGroupSortCourseByGroup(vipGroupId.toString());
|
|
|
Map<Integer, List<VipGroupGiveCourseSortDto>> userCourseMap = vipGroupSortCourseByGroup.stream().collect(Collectors.groupingBy(VipGroupGiveCourseSortDto::getUserId));
|
|
|
|
|
|
+ BigDecimal zero = new BigDecimal("0.00");
|
|
|
+
|
|
|
List<CourseScheduleStudentPayment> needUpdatePayments=new ArrayList<>();
|
|
|
for (Map.Entry<Integer, List<VipGroupGiveCourseSortDto>> integerListEntry : userCourseMap.entrySet()) {
|
|
|
List<VipGroupGiveCourseSortDto> courses = integerListEntry.getValue();
|
|
|
Map<BigDecimal, Long> expectPriceCountMap = courses.stream()
|
|
|
.collect(Collectors.groupingBy(VipGroupGiveCourseSortDto::getExpectPrice, Collectors.counting()));
|
|
|
- BigDecimal zero = new BigDecimal("0.00");
|
|
|
Long zeroPriceNum = expectPriceCountMap.get(zero);
|
|
|
if(Objects.isNull(zeroPriceNum)||zeroPriceNum<=0){
|
|
|
- return;
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
List<VipGroupGiveCourseSortDto> zeroExpectPricePayments = courses.stream()
|
|
@@ -251,7 +252,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
|
|
|
if(!vipGroupGiveCourseSortDto.getId().equals(zeroExpectPricePayments.get(i).getId())
|
|
|
&&!vipGroupGiveCourseSortDto.getTeachMode().equals(zeroExpectPricePayments.get(i).getTeachMode())){
|
|
|
- throw new BizException("不支持将不同教学形式的课程调整的赠送课时后");
|
|
|
+ throw new BizException("不支持将不同教学形式的课程调整到赠送课时后");
|
|
|
}
|
|
|
|
|
|
if(!vipGroupGiveCourseSortDto.getId().equals(zeroExpectPricePayments.get(i).getId())){
|
|
@@ -262,7 +263,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
}
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(needUpdatePayments)){
|
|
|
-// courseScheduleStudentPaymentDao.batchUpdate(needUpdatePayments);
|
|
|
+ courseScheduleStudentPaymentDao.batchUpdate(needUpdatePayments);
|
|
|
}
|
|
|
}
|
|
|
}
|