|
@@ -244,12 +244,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
//获取活动信息
|
|
|
VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId());
|
|
|
- if(!vipGroup.getAllowOverstepActivityStudentNum()&&Objects.nonNull(vipGroupActivity)&&Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes())&&vipGroupActivity.getStudentMaxUsedTimes()!=-1&&StringUtils.isNotBlank(vipGroupApplyBaseInfoDto.getStudentIdList())){
|
|
|
+ if(!vipGroup.getAllowOverstepActivityStudentNum() && Objects.nonNull(vipGroupActivity)
|
|
|
+ && Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes()) && vipGroupActivity.getStudentMaxUsedTimes()!=-1 &&
|
|
|
+ StringUtils.isNotBlank(vipGroupApplyBaseInfoDto.getStudentIdList())){
|
|
|
List<String> tempStudentIds = Arrays.asList(vipGroupApplyBaseInfoDto.getStudentIdList().split(","));
|
|
|
List<Integer> errStudentIds = new ArrayList<>();
|
|
|
for (String studentIdStr : tempStudentIds) {
|
|
|
int useNum = vipGroupDao.countStudentUserActivityNum(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId(), Integer.valueOf(studentIdStr));
|
|
|
- if(useNum>=vipGroupActivity.getStudentMaxUsedTimes()){
|
|
|
+ if(useNum >= vipGroupActivity.getStudentMaxUsedTimes()){
|
|
|
errStudentIds.add(Integer.valueOf(studentIdStr));
|
|
|
}
|
|
|
}
|
|
@@ -257,7 +259,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
List<SimpleUserDto> students = teacherDao.getUsersSimpleInfo(errStudentIds);
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
String studentNames = StringUtils.join(students.stream().map(SimpleUserDto::getNickName).collect(Collectors.toList()), "、");
|
|
|
- return BaseController.failed(HttpStatus.PARTIAL_CONTENT,"该活动"+studentNames+"学员创建及成课之和已达上限,是否继续创建该课程?");
|
|
|
+ return BaseController.failed(HttpStatus.PARTIAL_CONTENT,"该活动"+studentNames+"学员已超过该活动购买次数限制");
|
|
|
}
|
|
|
}
|
|
|
//判断课程安排是否超出范围
|
|
@@ -2576,7 +2578,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("订单还在交易中,请稍后重试");
|
|
|
}
|
|
|
if(!vipGroupBuyParams.isRepeatPay()){
|
|
|
- return BaseController.failed(HttpStatus.CONTINUE, "您有待支付的订单");
|
|
|
+ return BaseController.failed(HttpStatus.CONTINUE, "您有待支付的订单,是否继续支付");
|
|
|
}
|
|
|
//处理关闭订单
|
|
|
applyOrder.setStatus(DealStatusEnum.CLOSE);
|
|
@@ -2823,7 +2825,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if (i == 0) {
|
|
|
courseScheduleStudentPayment.setExpectPrice(firstAmount);
|
|
|
}else{
|
|
|
- courseScheduleStudentPayment.setExpectPrice(actualPrice);
|
|
|
+ courseScheduleStudentPayment.setExpectPrice(divide);
|
|
|
}
|
|
|
courseScheduleStudentPayment.setOriginalPrice(TeachModeEnum.ONLINE.equals(courseSchedule.getTeachMode())?vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice():vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
|
|
|
courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
|