|
|
@ -9,7 +9,9 @@ import com.huoran.competition.entity.CompetitionRegistration; |
|
|
|
import com.huoran.competition.entity.req.PageRegistrationStaffReq; |
|
|
|
import com.huoran.competition.entity.req.PageRegistrationStaffReq; |
|
|
|
import com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO; |
|
|
|
import com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO; |
|
|
|
import com.huoran.competition.entity.vo.RegistrationVO; |
|
|
|
import com.huoran.competition.entity.vo.RegistrationVO; |
|
|
|
|
|
|
|
import com.huoran.competition.mapper.CompetitionRegistrationMapper; |
|
|
|
import com.huoran.competition.service.CompetitionRegistrationService; |
|
|
|
import com.huoran.competition.service.CompetitionRegistrationService; |
|
|
|
|
|
|
|
import com.huoran.competition.service.impl.CompetitionRegistrationServiceImpl; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
@ -21,6 +23,7 @@ import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
@ -38,6 +41,9 @@ public class CompetitionRegistrationController { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private CompetitionRegistrationService competitionRegistrationService; |
|
|
|
private CompetitionRegistrationService competitionRegistrationService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private CompetitionRegistrationMapper competitionRegistrationMapper; |
|
|
|
|
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
|
@NoRepeatSubmit |
|
|
|
@ApiOperation(value = "是否禁用报名人员") |
|
|
|
@ApiOperation(value = "是否禁用报名人员") |
|
|
|
@PutMapping("/disableRegistration") |
|
|
|
@PutMapping("/disableRegistration") |
|
|
@ -158,21 +164,39 @@ public class CompetitionRegistrationController { |
|
|
|
if (ObjectUtils.isEmpty(info.getAccountId())) { |
|
|
|
if (ObjectUtils.isEmpty(info.getAccountId())) { |
|
|
|
return R.error("账号id不能为空"); |
|
|
|
return R.error("账号id不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//获取原报名信息
|
|
|
|
|
|
|
|
CompetitionRegistration registration = competitionRegistrationService.getById(info.getId()); |
|
|
|
//判断活动id不能为空
|
|
|
|
//判断活动id不能为空
|
|
|
|
if (ObjectUtils.isEmpty(info.getCompetitionId())) { |
|
|
|
if (ObjectUtils.isEmpty(info.getCompetitionId())) { |
|
|
|
return R.error("活动id不能为空"); |
|
|
|
return R.error("活动id不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
//校验是否已经报名活动过
|
|
|
|
//校验是否已经报名活动过(用于防止该用户本来为个人账号报名了该活动,后认证企业账号后又报名活动,防止通过后台编辑更改当前所属组织架构为个人或组织时候就需判重)
|
|
|
|
if (isRegistered(info.getAccountId(), info.getCompetitionId())) { |
|
|
|
//当前处理方法为:如果当前活动下,用户多个角色下都已参加报名活动,通过后台不能做编辑更改组织的情况
|
|
|
|
return R.error("该账号已报名该活动"); |
|
|
|
//如果当前活动下,用户只有一个角色下都已参加报名活动,通过后台可以更改组织的情况
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<RegistrationNewInformationBroughtOutVO> role = competitionRegistrationMapper.getOrganizationalInformation(null, info.getAccountId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(role)) { |
|
|
|
|
|
|
|
QueryWrapper<CompetitionRegistration> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
//查询role里面全部accountId
|
|
|
|
|
|
|
|
queryWrapper.in("account_id", role.stream().map(RegistrationNewInformationBroughtOutVO::getAccountId).collect(Collectors.toList())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<CompetitionRegistration> list = competitionRegistrationService.list(queryWrapper); |
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(list)){ |
|
|
|
|
|
|
|
return R.error("当前用户已在该角色下报名该活动,请勿重复操作报名!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean flag = true; |
|
|
|
boolean flag = true; |
|
|
|
//获取原报名信息
|
|
|
|
|
|
|
|
CompetitionRegistration registration = competitionRegistrationService.getById(info.getId()); |
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(registration)) { |
|
|
|
if (!ObjectUtils.isEmpty(registration)) { |
|
|
|
//需求:如果时间被清空情况下,签到状态变更为未签到
|
|
|
|
//需求:如果时间被清空情况下,签到状态变更为未签到
|
|
|
|
if (ObjectUtils.isEmpty(info.getSignInTime())) { |
|
|
|
if (ObjectUtils.isEmpty(info.getSignInTime())) { |
|
|
|
registration.setSignInStatus(String.valueOf(2)); |
|
|
|
registration.setSignInStatus(String.valueOf(2)); |
|
|
|
|
|
|
|
}else if (!ObjectUtils.isEmpty(registration.getSignInTime())){ |
|
|
|
|
|
|
|
registration.setSignInStatus(String.valueOf(1));//有签到时间设置签到状态
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//判断如果账号id不等于原登记的账户id,则账号id做更改
|
|
|
|
//判断如果账号id不等于原登记的账户id,则账号id做更改
|
|
|
|