|
@@ -588,21 +588,21 @@ 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())){
|
|
|
- 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()){
|
|
|
- errStudentIds.add(Integer.valueOf(studentIdStr));
|
|
|
- }
|
|
|
- }
|
|
|
- if(errStudentIds.size()>0){
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- String studentNames = StringUtils.join(studentSimpleInfos.stream().map(SimpleUserDto::getNickName).collect(Collectors.toList()), "、");
|
|
|
- return BaseController.failed(HttpStatus.PARTIAL_CONTENT,"该活动"+studentNames+"学员创建及成课之和已达上限,是否继续创建该课程?");
|
|
|
- }
|
|
|
- }
|
|
|
+// 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()){
|
|
|
+// errStudentIds.add(Integer.valueOf(studentIdStr));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if(errStudentIds.size()>0){
|
|
|
+// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+// String studentNames = StringUtils.join(studentSimpleInfos.stream().map(SimpleUserDto::getNickName).collect(Collectors.toList()), "、");
|
|
|
+// return BaseController.failed(HttpStatus.PARTIAL_CONTENT,"该活动"+studentNames+"学员创建及成课之和已达上限,是否继续创建该课程?");
|
|
|
+// }
|
|
|
+// }
|
|
|
//判断课程安排是否超出范围
|
|
|
if(Objects.nonNull(vipGroupActivity)&&(Objects.nonNull(vipGroupActivity.getCoursesEndTime())||Objects.nonNull(vipGroupActivity.getCoursesStartTime()))){
|
|
|
if(latestCourseSchedule.getEndClassTime().after(vipGroupActivity.getCoursesEndTime())
|