|
|
|
@ -244,6 +244,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result activitySignUp(ActUserRelationDTO actUserRelationDTO) { |
|
|
|
ActInfoDTO actInfoDTO = actInfoDao.queryActSignupNum(actUserRelationDTO.getActId()); |
|
|
|
//判断报名是否已满
|
|
|
|
@ -263,15 +264,14 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
} else { |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
// 活动报名人数+1
|
|
|
|
actInfoService.addSignUpNum(actUserRelationDTO.getActId()); |
|
|
|
//存储活动日志表
|
|
|
|
ActUserLogEntity actUserLog = new ActUserLogEntity(); |
|
|
|
actUserLog.setActUserRelationId(entity.getId()); |
|
|
|
actUserLog.setOperationType(ActUserRelationStatusConstant.SIGN_UP); |
|
|
|
actUserLog.setOperationTime(new Date()); |
|
|
|
actUserLogDao.insert(actUserLog); |
|
|
|
//更新epdc_act_info的已报名名额
|
|
|
|
actInfoDTO.setSignupNum(actInfoDTO.getSignupNum() + 1); |
|
|
|
actInfoService.update(actInfoDTO); |
|
|
|
} else { |
|
|
|
return new Result().error("您已报名"); |
|
|
|
} |
|
|
|
@ -279,6 +279,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result activityCancelSignUp(AppActUserCancelsignupDTO appActUserCancelsignupDTO) { |
|
|
|
//查询是否已报名
|
|
|
|
List<String> statusList = new ArrayList<>(); |
|
|
|
@ -293,6 +294,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
//1、更新活动人员关系表
|
|
|
|
ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); |
|
|
|
updateById(entity); |
|
|
|
// 活动报名人数-1
|
|
|
|
actInfoService.minusSignUpNum(actUserRelationDTO.getActId()); |
|
|
|
//2、存储活动日志表
|
|
|
|
Date currentTime = new Date(); |
|
|
|
ActUserLogEntity actUserLog = new ActUserLogEntity(); |
|
|
|
@ -301,12 +304,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
actUserLog.setOperationTime(currentTime); |
|
|
|
actUserLog.setFailureReason(appActUserCancelsignupDTO.getFailureReason()); |
|
|
|
actUserLogDao.insert(actUserLog); |
|
|
|
//3、更新epdc_act_info的已报名名额
|
|
|
|
//ActInfoDTO actInfoDTO = actInfoDao.queryActSignupNum(actUserRelationDTO.getActId());
|
|
|
|
ActInfoDTO actInfoDTO = actInfoService.get(actUserRelationDTO.getActId()); |
|
|
|
actInfoDTO.setSignupNum(actInfoDTO.getSignupNum() - 1); |
|
|
|
actInfoService.update(actInfoDTO); |
|
|
|
//4、判断是否扣除用户积分
|
|
|
|
ActInfoDTO actInfoDTO = actInfoService.get(actUserRelationDTO.getActId()); |
|
|
|
if (currentTime.after(actInfoDTO.getSignupEndTime()) && currentTime.before(actInfoDTO.getActStartTime())) { |
|
|
|
this.cancelActSubtractPoint(actUserRelationDTO, actInfoDTO); |
|
|
|
} |
|
|
|
@ -491,6 +490,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result updateAuditDefaultStatus(String actId) { |
|
|
|
// 根据actID查询活动开始未审核报名人默认状态
|
|
|
|
ActInfoDTO actInfoDTO = actInfoService.get(actId); |
|
|
|
@ -515,16 +515,13 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
actUserLog.setOperationType(actUserDefaultState);// 默认状态
|
|
|
|
actUserLog.setOperationTime(new Date()); |
|
|
|
actUserLogDao.insert(actUserLog); |
|
|
|
// 审核不通过,活动的报名人数-1
|
|
|
|
if (!NumConstant.ONE_STR.equals(actUserDefaultState)) { |
|
|
|
actInfoService.minusSignUpNum(actInfoDTO.getId()); |
|
|
|
} |
|
|
|
//给用户发送消息通知
|
|
|
|
this.sendNotice(actUserRelationDTO, actUserDefaultState, actInfoDTO); |
|
|
|
} |
|
|
|
// 审核不通过,活动的报名人数减少
|
|
|
|
if (!NumConstant.ONE_STR.equals(actUserDefaultState)) { |
|
|
|
ActInfoEntity actInfoEntity = new ActInfoEntity(); |
|
|
|
actInfoEntity.setId(actInfoDTO.getId()); |
|
|
|
actInfoEntity.setSignupNum(actInfoDTO.getSignupNum() - data.size()); |
|
|
|
actInfoService.updateById(actInfoEntity); |
|
|
|
} |
|
|
|
} else { |
|
|
|
return new Result().ok("该活动暂时没有未审核的志愿者"); |
|
|
|
} |
|
|
|
|