diff --git a/common/src/main/java/com/huoran/common/utils/TokenUtils.java b/common/src/main/java/com/huoran/common/utils/TokenUtils.java index 6ca1a49..d373c56 100644 --- a/common/src/main/java/com/huoran/common/utils/TokenUtils.java +++ b/common/src/main/java/com/huoran/common/utils/TokenUtils.java @@ -38,6 +38,7 @@ public class TokenUtils { */ public static String getIdByJwtToken(HttpServletRequest request) { String jwtToken = request.getHeader("token"); + System.out.println("------------------------------->>>TOKEN-------------"+jwtToken); if(StringUtils.isEmpty(jwtToken)) { return ""; } diff --git a/competition/src/main/java/com/huoran/competition/controller/CompetitionRegistrationController.java b/competition/src/main/java/com/huoran/competition/controller/CompetitionRegistrationController.java index aa5e47d..c81d64f 100644 --- a/competition/src/main/java/com/huoran/competition/controller/CompetitionRegistrationController.java +++ b/competition/src/main/java/com/huoran/competition/controller/CompetitionRegistrationController.java @@ -9,7 +9,9 @@ import com.huoran.competition.entity.CompetitionRegistration; import com.huoran.competition.entity.req.PageRegistrationStaffReq; import com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO; import com.huoran.competition.entity.vo.RegistrationVO; +import com.huoran.competition.mapper.CompetitionRegistrationMapper; import com.huoran.competition.service.CompetitionRegistrationService; +import com.huoran.competition.service.impl.CompetitionRegistrationServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -21,6 +23,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; +import java.util.stream.Collectors; /** *
@@ -38,6 +41,9 @@ public class CompetitionRegistrationController {
@Autowired
private CompetitionRegistrationService competitionRegistrationService;
+ @Autowired
+ private CompetitionRegistrationMapper competitionRegistrationMapper;
+
@NoRepeatSubmit
@ApiOperation(value = "是否禁用报名人员")
@PutMapping("/disableRegistration")
@@ -158,21 +164,39 @@ public class CompetitionRegistrationController {
if (ObjectUtils.isEmpty(info.getAccountId())) {
return R.error("账号id不能为空");
}
+ //获取原报名信息
+ CompetitionRegistration registration = competitionRegistrationService.getById(info.getId());
//判断活动id不能为空
if (ObjectUtils.isEmpty(info.getCompetitionId())) {
return R.error("活动id不能为空");
}
- //校验是否已经报名活动过
- if (isRegistered(info.getAccountId(), info.getCompetitionId())) {
- return R.error("该账号已报名该活动");
+ //校验是否已经报名活动过(用于防止该用户本来为个人账号报名了该活动,后认证企业账号后又报名活动,防止通过后台编辑更改当前所属组织架构为个人或组织时候就需判重)
+ //当前处理方法为:如果当前活动下,用户多个角色下都已参加报名活动,通过后台不能做编辑更改组织的情况
+ //如果当前活动下,用户只有一个角色下都已参加报名活动,通过后台可以更改组织的情况
+
+ List