|
|
@@ -303,6 +303,60 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
|
return athleteList;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<GameAthleteVo> queryListNoPermission(GameAthleteBo bo) {
|
|
|
+ if (bo.getEventId() == null) {
|
|
|
+ Object cacheObject = RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID);
|
|
|
+ if (cacheObject instanceof Integer) {
|
|
|
+ bo.setEventId(((Integer) cacheObject).longValue()); // 显式转换为 Long 类型
|
|
|
+ } else if (cacheObject instanceof Long) {
|
|
|
+ bo.setEventId((Long) cacheObject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<GameAthlete> lqw = buildQueryWrapper(bo);
|
|
|
+ List<GameAthleteVo> athleteList = baseMapper.selectVoList(lqw);
|
|
|
+// List<GameAthleteVo> athleteList = baseMapper.selectAthleteList(lqw);
|
|
|
+ athleteList.forEach(vo -> {
|
|
|
+ Optional.ofNullable(vo.getProjectValue())
|
|
|
+ .filter(StringUtils::isNotBlank)
|
|
|
+ .ifPresent(projectValue -> {
|
|
|
+ log.debug("解析运动员 {} 的项目数据 - projectValue: {}", vo.getName(), projectValue);
|
|
|
+ try {
|
|
|
+ List<Long> projects = JSONUtil.toList(projectValue, Long.class);
|
|
|
+ vo.setProjectList(projects);
|
|
|
+ log.debug("解析成功 - 运动员: {}, 项目列表: {}", vo.getName(), projects);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("解析项目数据失败 - 运动员: {}, projectValue: {}, 错误: {}", vo.getName(), projectValue, e.getMessage());
|
|
|
+ vo.setProjectList(new ArrayList<>());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ Optional.ofNullable(vo.getEventId())
|
|
|
+ .filter(ObjectUtil::isNotEmpty)
|
|
|
+ .ifPresent(eventId -> {
|
|
|
+ GameEventVo gameEventVo = gameEventService.queryById(vo.getEventId());
|
|
|
+ if (gameEventVo != null) {
|
|
|
+ vo.setEventName(gameEventVo.getEventName());
|
|
|
+ } else {
|
|
|
+ log.warn("赛事ID {} 对应的赛事信息不存在", eventId);
|
|
|
+ vo.setEventName("未知赛事");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ Optional.ofNullable(vo.getTeamId())
|
|
|
+ .filter(ObjectUtil::isNotEmpty)
|
|
|
+ .ifPresent(teamId -> {
|
|
|
+ GameTeamVo gameTeamVo = gameTeamService.queryById(vo.getTeamId());
|
|
|
+ if (gameTeamVo != null) {
|
|
|
+ vo.setTeamName(gameTeamVo.getTeamName());
|
|
|
+ } else {
|
|
|
+ log.warn("队伍ID {} 对应的队伍信息不存在", teamId);
|
|
|
+ vo.setTeamName("未知队伍");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ return athleteList;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导出数据
|
|
|
*/
|