lrj
2 天以前 9f8395fab13ca4b230a0f7d62636e209745c91d4
backend/src/main/java/com/rongyichuang/player/service/ActivityPlayerDetailService.java
@@ -1,6 +1,7 @@
package com.rongyichuang.player.service;
import com.rongyichuang.player.dto.response.*;
import com.rongyichuang.player.dto.response.RegionInfoResponse;
import com.rongyichuang.rating.dto.response.RatingItemResponse;
import com.rongyichuang.rating.entity.RatingScheme;
import com.rongyichuang.rating.repository.RatingSchemeRepository;
@@ -45,14 +46,16 @@
    public ActivityPlayerDetailResponse getDetailForRating(Long activityPlayerId) {
        log.info("获取报名详情用于评分,activityPlayerId: {}", activityPlayerId);
        // 查询基本信息
        // 查询基本信息,包含区域信息
        String sql = """
            SELECT ap.id, ap.description, ap.activity_id,
            SELECT ap.id, ap.description, ap.activity_id, ap.region_id,
                   p.id as player_id, p.name as player_name, p.phone, p.description as player_desc,
                   a.name as activity_name, a.rating_scheme_id
                   a.name as activity_name, a.rating_scheme_id,
                   r.id as r_id, r.name as region_name, r.full_path as region_path
            FROM t_activity_player ap
            JOIN t_player p ON p.id = ap.player_id
            JOIN t_activity a ON a.id = ap.activity_id
            LEFT JOIN t_region r ON r.id = ap.region_id
            WHERE ap.id = ?
            """;
@@ -70,14 +73,24 @@
        ActivityPlayerDetailResponse response = new ActivityPlayerDetailResponse();
        response.setId(activityPlayerId);
        response.setDescription(row[1] != null ? row[1].toString() : "");
        response.setActivityName(row[7] != null ? row[7].toString() : "");
        response.setActivityName(row[8] != null ? row[8].toString() : "");
        // 构建学员信息
        PlayerInfoResponse playerInfo = new PlayerInfoResponse();
        playerInfo.setId(row[3] != null ? ((Number) row[3]).longValue() : null);
        playerInfo.setName(row[4] != null ? row[4].toString() : "");
        playerInfo.setPhone(row[5] != null ? row[5].toString() : "");
        playerInfo.setDescription(row[6] != null ? row[6].toString() : "");
        playerInfo.setId(row[4] != null ? ((Number) row[4]).longValue() : null);
        playerInfo.setName(row[5] != null ? row[5].toString() : "");
        playerInfo.setPhone(row[6] != null ? row[6].toString() : "");
        playerInfo.setDescription(row[7] != null ? row[7].toString() : "");
        // 构建区域信息
        RegionInfoResponse regionInfo = new RegionInfoResponse();
        if (row[10] != null) {
            regionInfo.setId(((Number) row[10]).longValue());
            regionInfo.setName(row[11] != null ? row[11].toString() : "");
            regionInfo.setFullPath(row[12] != null ? row[12].toString() : "");
            response.setRegionInfo(regionInfo);
            log.info("找到区域信息: {}", regionInfo.getName());
        }
        // 查询学员头像(使用枚举常量表示学员头像类型)
        if (playerInfo.getId() != null) {
@@ -102,7 +115,7 @@
        log.info("找到提交资料 {} 个", submissionFiles.size());
        // 查询评分模板
        Long ratingSchemeId = row[8] != null ? ((Number) row[8]).longValue() : null;
        Long ratingSchemeId = row[9] != null ? ((Number) row[9]).longValue() : null;
        if (ratingSchemeId != null) {
            RatingFormResponse ratingForm = buildRatingForm(ratingSchemeId);
            response.setRatingForm(ratingForm);