|
@@ -197,6 +197,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
String studentIds=vipGroup.getStudentIds();
|
|
|
List<String> studentIdList=new ArrayList<>();
|
|
|
+ if(StringUtils.isNotBlank(studentIds)){
|
|
|
+ studentIdList = Arrays.asList(studentIds.split(","));
|
|
|
+ }
|
|
|
|
|
|
Date now=new Date();
|
|
|
|
|
@@ -239,9 +242,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
//获取活动信息
|
|
|
VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId());
|
|
|
- if(Objects.nonNull(vipGroupActivity)&&Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes())&&StringUtils.isNotBlank(studentIds)){
|
|
|
- studentIdList = Arrays.asList(studentIds.split(","));
|
|
|
- for (String studentIdStr : studentIdList) {
|
|
|
+ if(Objects.nonNull(vipGroupActivity)&&Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes())&&StringUtils.isNotBlank(vipGroupApplyBaseInfoDto.getStudentIdList())){
|
|
|
+ List<String> tempStudentIds = Arrays.asList(vipGroupApplyBaseInfoDto.getStudentIdList().split(","));
|
|
|
+ for (String studentIdStr : tempStudentIds) {
|
|
|
int useNum = vipGroupDao.countStudentUserActivityNum(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId(), Integer.valueOf(studentIdStr));
|
|
|
if(useNum>=vipGroupActivity.getStudentMaxUsedTimes()){
|
|
|
throw new BizException("创建失败:当前活动可购买次数为{}次", vipGroupActivity.getStudentMaxUsedTimes());
|