|
|
|
@ -166,12 +166,18 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD |
|
|
|
return new Result().error("活动已报满"); |
|
|
|
} |
|
|
|
//查询是否已报名
|
|
|
|
int data = baseDao.isSignUp(actUserRelationDTO.getUserId(), actUserRelationDTO.getActId()); |
|
|
|
if (data == 0) { |
|
|
|
ActUserRelationEntity actUserRelationEntity = baseDao.selectOneByUserIdAndActId(actUserRelationDTO.getUserId(), actUserRelationDTO.getActId()); |
|
|
|
if (null == actUserRelationEntity || (ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserRelationEntity.getStatus()) |
|
|
|
&& ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserRelationEntity.getStatus()))) { |
|
|
|
//未报名该活动,进行报名
|
|
|
|
//存储活动人员关系表
|
|
|
|
ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); |
|
|
|
insert(entity); |
|
|
|
if (null != actUserRelationEntity) { |
|
|
|
entity.setId(actUserRelationEntity.getId()); |
|
|
|
baseDao.updateById(entity); |
|
|
|
} else { |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
//存储活动日志表
|
|
|
|
ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); |
|
|
|
actUserLogDTO.setActUserRelationId(entity.getId()); |
|
|
|
|