|
|
@@ -134,51 +134,8 @@ public class QRCodeUtils {
|
|
|
// 创建简化的数据结构,只包含必要信息
|
|
|
Map<String, Object> simpleData = new HashMap<>();
|
|
|
simpleData.put("eventId", referee.getEventId());
|
|
|
- try {
|
|
|
- if (referee.getEventId() != null) {
|
|
|
- GameEventVo eventVo = gameEventService.queryById(referee.getEventId());
|
|
|
- if (eventVo != null) {
|
|
|
- simpleData.put("eventName", eventVo.getEventName());
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Exception ignore) {}
|
|
|
- simpleData.put("refereeId", referee.getRefereeId());
|
|
|
- simpleData.put("refereeName", referee.getName());
|
|
|
simpleData.put("account", referee.getAccount());
|
|
|
simpleData.put("password", referee.getPassword());
|
|
|
-
|
|
|
- // 将项目ID列表转换为项目VO列表
|
|
|
- List<Long> projectIds = referee.getProjectList2();
|
|
|
- if (projectIds != null && !projectIds.isEmpty()) {
|
|
|
- Map<String, Object> projectList = new HashMap<>();
|
|
|
- for (Long pid : projectIds) {
|
|
|
- if (pid == null) continue;
|
|
|
- try {
|
|
|
- GameEventProjectVo pvo = gameEventProjectService.queryById(pid);
|
|
|
- if (pvo != null) {
|
|
|
- Map<String, Object> project = new HashMap<>();
|
|
|
- project.put("projectType", pvo.getProjectType());
|
|
|
- project.put("projectName", pvo.getProjectName());
|
|
|
- project.put("classification", pvo.getClassification());
|
|
|
- project.put("orderType", pvo.getOrderType());
|
|
|
- project.put("gradeRule", pvo.getScoreRule());
|
|
|
- project.put("admissionRank",pvo.getRoundType());
|
|
|
- project.put("admissionPoint",pvo.getScoreValue());
|
|
|
- projectList.put(pvo.getProjectId().toString(), project);
|
|
|
- }else{
|
|
|
- // 记录日志,项目不存在
|
|
|
- log.warn("项目ID {} 不存在,跳过处理", pid);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- // 记录异常但不中断处理
|
|
|
- log.error("查询项目ID {} 失败: {}", pid, e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
- simpleData.put("projectList", projectList);
|
|
|
- } else {
|
|
|
- simpleData.put("projectList", Collections.emptyMap());
|
|
|
- }
|
|
|
-
|
|
|
String content = objectMapper.writeValueAsString(simpleData);
|
|
|
System.out.println("二维码内容长度: " + content.length());
|
|
|
System.out.println("二维码内容: " + content);
|