|
|
@ -12,7 +12,10 @@ import com.huoran.common.entity.School; |
|
|
|
import com.huoran.common.exception.CustomException; |
|
|
|
import com.huoran.common.exception.CustomException; |
|
|
|
import com.huoran.common.exception.ExceptionEnum; |
|
|
|
import com.huoran.common.exception.ExceptionEnum; |
|
|
|
import com.huoran.common.response.R; |
|
|
|
import com.huoran.common.response.R; |
|
|
|
import com.huoran.competition.entity.*; |
|
|
|
import com.huoran.competition.entity.Competition; |
|
|
|
|
|
|
|
import com.huoran.competition.entity.CompetitionRegistration; |
|
|
|
|
|
|
|
import com.huoran.competition.entity.CompetitionTeam; |
|
|
|
|
|
|
|
import com.huoran.competition.entity.CompleteCompetitionSetup; |
|
|
|
import com.huoran.competition.entity.req.PageRegistrationStaffReq; |
|
|
|
import com.huoran.competition.entity.req.PageRegistrationStaffReq; |
|
|
|
import com.huoran.competition.entity.vo.ExcelData; |
|
|
|
import com.huoran.competition.entity.vo.ExcelData; |
|
|
|
import com.huoran.competition.entity.vo.PersonalExcelData; |
|
|
|
import com.huoran.competition.entity.vo.PersonalExcelData; |
|
|
@ -23,12 +26,14 @@ import com.huoran.competition.service.CompetitionRegistrationService; |
|
|
|
import com.huoran.competition.service.CompetitionTeamService; |
|
|
|
import com.huoran.competition.service.CompetitionTeamService; |
|
|
|
import com.huoran.competition.service.TeamParticipantService; |
|
|
|
import com.huoran.competition.service.TeamParticipantService; |
|
|
|
import com.huoran.competition.utils.ExcelStyleUtil; |
|
|
|
import com.huoran.competition.utils.ExcelStyleUtil; |
|
|
|
|
|
|
|
import com.huoran.competition.utils.HandleNameAsteriskReplacementUtil; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
@ -77,8 +82,23 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R registrationPageConditionQuery(PageRegistrationStaffReq req) { |
|
|
|
public R registrationPageConditionQuery(PageRegistrationStaffReq req) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Page<RegistrationVO> page = new Page<RegistrationVO>(req.getPageNum(), req.getPageSize()); |
|
|
|
Page<RegistrationVO> page = new Page<RegistrationVO>(req.getPageNum(), req.getPageSize()); |
|
|
|
IPage<RegistrationVO> pageList = baseMapper.selectRegistrationByCondition(page, req); |
|
|
|
IPage<RegistrationVO> pageList = baseMapper.selectRegistrationByCondition(page, req); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//默认设置后台
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(req.getQuerySource())){ |
|
|
|
|
|
|
|
req.setQuerySource(2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (req.getQuerySource() == 1) { |
|
|
|
|
|
|
|
pageList |
|
|
|
|
|
|
|
.getRecords().forEach(registrationVO -> { |
|
|
|
|
|
|
|
registrationVO.setUsername(HandleNameAsteriskReplacementUtil.desensitizedName(registrationVO.getUsername())); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return R.ok().put("data", pageList); |
|
|
|
return R.ok().put("data", pageList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -196,15 +216,15 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR |
|
|
|
Competition competition = competitionMapper.selectById(competitionRegistration.getCompetitionId()); |
|
|
|
Competition competition = competitionMapper.selectById(competitionRegistration.getCompetitionId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//个人赛人数限制
|
|
|
|
//个人赛人数限制
|
|
|
|
if (competition.getQuantityLimit() != null) { |
|
|
|
if (competition.getQuantityLimit() != null) { |
|
|
|
QueryWrapper<CompetitionRegistration> wrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<CompetitionRegistration> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq("competition_id", competitionRegistration.getCompetitionId()); |
|
|
|
wrapper.eq("competition_id", competitionRegistration.getCompetitionId()); |
|
|
|
List<CompetitionRegistration> competitionRegistrations = baseMapper.selectList(wrapper); |
|
|
|
List<CompetitionRegistration> competitionRegistrations = baseMapper.selectList(wrapper); |
|
|
|
if (competitionRegistrations != null && competitionRegistrations.size() >= competition.getQuantityLimit()) { |
|
|
|
if (competitionRegistrations != null && competitionRegistrations.size() >= competition.getQuantityLimit()) { |
|
|
|
throw new CustomException(ExceptionEnum.TEAM_LIMIT3); |
|
|
|
throw new CustomException(ExceptionEnum.TEAM_LIMIT3); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//内部添加,一路绿灯
|
|
|
|
//内部添加,一路绿灯
|
|
|
|
QueryWrapper<CompetitionRegistration> wrapper = getCompetitionRegistrationQueryWrapper(competitionRegistration, competition); |
|
|
|
QueryWrapper<CompetitionRegistration> wrapper = getCompetitionRegistrationQueryWrapper(competitionRegistration, competition); |
|
|
|