From 3714621173c606c4c58439ed8941100ce9ddea14 Mon Sep 17 00:00:00 2001
From: Codex Assistant <codex@example.com>
Date: 星期三, 05 十一月 2025 15:10:49 +0800
Subject: [PATCH] bug
---
backend/src/main/java/com/rongyichuang/player/service/ActivityPlayerDetailService.java | 43 +++++++++++++++++++++++++++++++++++++------
1 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/backend/src/main/java/com/rongyichuang/player/service/ActivityPlayerDetailService.java b/backend/src/main/java/com/rongyichuang/player/service/ActivityPlayerDetailService.java
index 5f56ef0..df96807 100644
--- a/backend/src/main/java/com/rongyichuang/player/service/ActivityPlayerDetailService.java
+++ b/backend/src/main/java/com/rongyichuang/player/service/ActivityPlayerDetailService.java
@@ -57,10 +57,11 @@
// 鏌ヨ鍩烘湰淇℃伅锛屽寘鍚尯鍩熶俊鎭�
String sql = """
- SELECT ap.id as ap_id, ap.description as ap_description, ap.activity_id, ap.region_id,
+ SELECT ap.id as ap_id, ap.description as ap_description, ap.activity_id, ap.region_id, ap.stage_id,
ap.project_name, ap.feedback, ap.state as ap_state,
- p.id as player_id, p.name as player_name, p.phone, p.description as player_desc,
+ p.id as player_id, p.name as player_name, u.phone, p.description as player_desc,
p.gender, u.birthday, p.education, p.introduction, u.id as user_id,
+ u.name as user_name, u.phone as user_phone,
a.name as activity_name, a.rating_scheme_id,
r.id as region_id, r.name as region_name, r.full_path as region_path
FROM t_activity_player ap
@@ -113,6 +114,19 @@
response.setState(0);
}
response.setActivityName(row.get("activity_name") != null ? row.get("activity_name").toString() : "");
+
+ // 璁剧疆闃舵ID
+ Object stageIdObj = row.get("stage_id");
+ if (stageIdObj != null) {
+ if (stageIdObj instanceof Number) {
+ response.setStageId(((Number) stageIdObj).longValue());
+ } else {
+ log.warn("闃舵ID绫诲瀷涓嶅尮閰�: {}, 绫诲瀷: {}", stageIdObj, stageIdObj.getClass().getName());
+ response.setStageId(Long.valueOf(stageIdObj.toString()));
+ }
+ } else {
+ response.setStageId(null);
+ }
// 鏋勫缓瀛﹀憳淇℃伅
PlayerInfoResponse playerInfo = new PlayerInfoResponse();
@@ -144,9 +158,11 @@
}
Object birthdayObj = row.get("birthday");
- playerInfo.setBirthday(birthdayObj != null ?
+ playerInfo.setBirthday(birthdayObj != null ?
(birthdayObj instanceof java.sql.Date ? ((java.sql.Date) birthdayObj).toString() : birthdayObj.toString()) : null);
- playerInfo.setEducation(row.get("education") != null ? row.get("education").toString() : "");
+ Object educationObj = row.get("education");
+ log.info("璋冭瘯锛氫粠鏁版嵁搴撴煡璇㈠埌鐨別ducation鍊�: {}", educationObj);
+ playerInfo.setEducation(educationObj != null ? educationObj.toString() : "");
playerInfo.setIntroduction(row.get("introduction") != null ? row.get("introduction").toString() : "");
// 鏋勫缓鍖哄煙淇℃伅
@@ -165,7 +181,7 @@
log.info("鎵惧埌鍖哄煙淇℃伅: {}", regionInfo.getName());
}
- // 鏌ヨ鐢ㄦ埛澶村儚锛堜娇鐢║SER_AVATAR鍏宠仈鍒扮敤鎴凤級
+ // 鏋勫缓鐢ㄦ埛淇℃伅瀵硅薄锛屽寘鍚ご鍍�
Object userIdObj = row.get("user_id");
log.info("璋冭瘯锛氫粠鏌ヨ缁撴灉涓幏鍙栫殑user_id: {}", userIdObj);
if (userIdObj != null) {
@@ -177,22 +193,34 @@
}
log.info("璋冭瘯锛氳В鏋愬悗鐨剈serId: {}", userId);
+ // 鍒涘缓PlayerUserInfo瀵硅薄
+ PlayerUserInfoResponse userInfo = new PlayerUserInfoResponse();
+ userInfo.setUserId(userId);
+ userInfo.setName(row.get("user_name") != null ? row.get("user_name").toString() : "");
+ userInfo.setPhone(row.get("user_phone") != null ? row.get("user_phone").toString() : "");
+
+ // 鏌ヨ鐢ㄦ埛澶村儚
List<Media> avatarMedias = mediaRepository.findByTargetTypeAndTargetIdAndState(
MediaTargetType.USER_AVATAR.getValue(), userId, 1);
log.info("璋冭瘯锛氭煡璇㈠埌鐨勫ご鍍忓獟浣撴暟閲�: {}", avatarMedias.size());
if (!avatarMedias.isEmpty()) {
Media avatar = avatarMedias.get(0);
String avatarUrl = buildFullMediaUrl(avatar.getPath());
+ userInfo.setAvatarUrl(avatarUrl);
+ userInfo.setAvatar(convertToMediaResponse(avatar));
+ // 鍚屾璧嬪�煎埌 playerInfo锛屼究浜庡墠绔洿鎺ヤ娇鐢� playerInfo.avatarUrl
playerInfo.setAvatarUrl(avatarUrl);
- // 璁剧疆avatar瀵硅薄
playerInfo.setAvatar(convertToMediaResponse(avatar));
log.info("鎵惧埌鐢ㄦ埛澶村儚: {}", avatarUrl);
} else {
log.info("璋冭瘯锛氭湭鎵惧埌鐢ㄦ埛澶村儚锛寀serId: {}, targetType: {}", userId, MediaTargetType.USER_AVATAR.getValue());
}
+
+ playerInfo.setUserInfo(userInfo);
} else {
log.warn("璋冭瘯锛歶ser_id涓簄ull");
}
+
response.setPlayerInfo(playerInfo);
// 鏌ヨ鎻愪氦鐨勮祫鏂欙紙浣跨敤鏋氫妇甯搁噺琛ㄧず鍙傝禌鎶ュ悕璧勬枡绫诲瀷锛�
@@ -222,7 +250,10 @@
SubmissionMediaResponse response = new SubmissionMediaResponse();
response.setId(media.getId());
response.setName(media.getName());
+ response.setPath(media.getPath());
response.setUrl(buildFullMediaUrl(media.getPath()));
+ response.setFullUrl(buildFullMediaUrl(media.getPath()));
+ response.setFullThumbUrl(buildFullMediaUrl(media.getThumbPath()));
response.setFileExt(media.getFileExt());
response.setFileSize(media.getFileSize() != null ? media.getFileSize().longValue() : null);
response.setMediaType(media.getMediaType());
--
Gitblit v1.8.0