|
@ -259,9 +259,13 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
// 活动报名的按钮,报名后。在取消 报名活动的所有时间段之前,不支持再次报名!
|
|
|
// 活动报名的按钮,报名后。在取消 报名活动的所有时间段之前,不支持再次报名!
|
|
|
|
|
|
|
|
|
List<ActPeriodDTO> periods = actUserRelationDTO.getPeriods(); |
|
|
List<ActPeriodDTO> periods = actUserRelationDTO.getPeriods(); |
|
|
|
|
|
// 存储活动时间段ID,用作 活动时间段报名人数修改
|
|
|
|
|
|
List<String> periodIds = new ArrayList<>(); |
|
|
|
|
|
|
|
|
// 校验当前报名的 活动时间段,是否已报满
|
|
|
// 校验当前报名的 活动时间段,是否已报满
|
|
|
List<ActPeriodDTO> periodsByActId = actPeriodService.listOfActPeriodsByActId(actUserRelationDTO.getActId()); |
|
|
List<ActPeriodDTO> periodsByActId = actPeriodService.listOfActPeriodsByActId(actUserRelationDTO.getActId()); |
|
|
for (ActPeriodDTO period : periods) { |
|
|
for (ActPeriodDTO period : periods) { |
|
|
|
|
|
periodIds.add(period.getId()); |
|
|
for (ActPeriodDTO dto : periodsByActId) { |
|
|
for (ActPeriodDTO dto : periodsByActId) { |
|
|
if (period.getId().equals(dto.getId())) { |
|
|
if (period.getId().equals(dto.getId())) { |
|
|
if (NumConstant.ZERO != dto.getActPeriodQuotaCategory() && |
|
|
if (NumConstant.ZERO != dto.getActPeriodQuotaCategory() && |
|
@ -298,6 +302,9 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
|
|
|
|
|
// 活动报名人数+1
|
|
|
// 活动报名人数+1
|
|
|
actInfoService.addSignUpNum(actUserRelationDTO.getActId()); |
|
|
actInfoService.addSignUpNum(actUserRelationDTO.getActId()); |
|
|
|
|
|
// 报名的所有活动时间段,报名人数 +1
|
|
|
|
|
|
actPeriodService.addPeriodSignUpNum(periodIds); |
|
|
|
|
|
|
|
|
//存储活动日志表
|
|
|
//存储活动日志表
|
|
|
ActUserLogEntity actUserLog = new ActUserLogEntity(); |
|
|
ActUserLogEntity actUserLog = new ActUserLogEntity(); |
|
|
actUserLog.setActUserRelationId(entity.getId()); |
|
|
actUserLog.setActUserRelationId(entity.getId()); |
|
@ -314,6 +321,9 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Result activityCancelSignUp(AppActUserCancelsignupDTO appActUserCancelsignupDTO) { |
|
|
public Result activityCancelSignUp(AppActUserCancelsignupDTO appActUserCancelsignupDTO) { |
|
|
|
|
|
// 存储活动时间段ID,用作 活动时间段报名人数修改
|
|
|
|
|
|
List<String> periodIds = new ArrayList<>(); |
|
|
|
|
|
|
|
|
// 根据活动id,查询该活动是否属于老数据(即,epdc_act_period 表中,不存在的活动)
|
|
|
// 根据活动id,查询该活动是否属于老数据(即,epdc_act_period 表中,不存在的活动)
|
|
|
Integer number = actPeriodService.getPeriodNumberByActId(appActUserCancelsignupDTO.getActId()); |
|
|
Integer number = actPeriodService.getPeriodNumberByActId(appActUserCancelsignupDTO.getActId()); |
|
|
|
|
|
|
|
@ -326,6 +336,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
|
|
|
|
|
List<ActPeriodUserDTO> periodUserDtoList = new ArrayList<>(); |
|
|
List<ActPeriodUserDTO> periodUserDtoList = new ArrayList<>(); |
|
|
for (String actPeriodId : appActUserCancelsignupDTO.getActPeriodId()) { |
|
|
for (String actPeriodId : appActUserCancelsignupDTO.getActPeriodId()) { |
|
|
|
|
|
periodIds.add(actPeriodId); |
|
|
|
|
|
|
|
|
ActPeriodUserDTO periodUserDTO = new ActPeriodUserDTO(); |
|
|
ActPeriodUserDTO periodUserDTO = new ActPeriodUserDTO(); |
|
|
periodUserDTO.setActPeriodId(actPeriodId); |
|
|
periodUserDTO.setActPeriodId(actPeriodId); |
|
|
periodUserDTO.setActUserRelationId(actUserRelationEntity.getId()); |
|
|
periodUserDTO.setActUserRelationId(actUserRelationEntity.getId()); |
|
@ -369,6 +381,10 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
updateById(entity); |
|
|
updateById(entity); |
|
|
// 活动报名人数-1
|
|
|
// 活动报名人数-1
|
|
|
actInfoService.minusSignUpNum(actUserRelationDTO.getActId()); |
|
|
actInfoService.minusSignUpNum(actUserRelationDTO.getActId()); |
|
|
|
|
|
|
|
|
|
|
|
// 取消报名的所有活动时间段,活动报名人数 -1
|
|
|
|
|
|
actPeriodService.minusPeriodSignUpNum(periodIds); |
|
|
|
|
|
|
|
|
//2、存储活动日志表
|
|
|
//2、存储活动日志表
|
|
|
Date currentTime = new Date(); |
|
|
Date currentTime = new Date(); |
|
|
ActUserLogEntity actUserLog = new ActUserLogEntity(); |
|
|
ActUserLogEntity actUserLog = new ActUserLogEntity(); |
|
|