diff --git a/lesingle-creation-backend/src/main/java/com/lesingle/modules/pub/service/PublicActivityService.java b/lesingle-creation-backend/src/main/java/com/lesingle/modules/pub/service/PublicActivityService.java index f073149..094755d 100644 --- a/lesingle-creation-backend/src/main/java/com/lesingle/modules/pub/service/PublicActivityService.java +++ b/lesingle-creation-backend/src/main/java/com/lesingle/modules/pub/service/PublicActivityService.java @@ -10,10 +10,12 @@ import com.lesingle.common.result.PageResult; import com.lesingle.modules.biz.contest.entity.BizContest; import com.lesingle.modules.biz.contest.entity.BizContestAttachment; import com.lesingle.modules.biz.contest.entity.BizContestNotice; +import com.lesingle.modules.biz.contest.entity.BizContestNoticeAttachment; import com.lesingle.modules.biz.contest.entity.BizContestRegistration; import com.lesingle.modules.biz.contest.entity.BizContestWork; import com.lesingle.modules.biz.contest.mapper.ContestAttachmentMapper; import com.lesingle.modules.biz.contest.mapper.ContestMapper; +import com.lesingle.modules.biz.contest.mapper.ContestNoticeAttachmentMapper; import com.lesingle.modules.biz.contest.mapper.ContestNoticeMapper; import com.lesingle.modules.biz.contest.mapper.ContestRegistrationMapper; import com.lesingle.modules.biz.contest.mapper.ContestWorkMapper; @@ -50,6 +52,7 @@ public class PublicActivityService { private final UgcWorkMapper ugcWorkMapper; private final UgcWorkPageMapper ugcWorkPageMapper; private final ContestNoticeMapper contestNoticeMapper; + private final ContestNoticeAttachmentMapper contestNoticeAttachmentMapper; private final ContestAttachmentMapper contestAttachmentMapper; private final SysUserMapper sysUserMapper; @@ -163,6 +166,31 @@ public class PublicActivityService { m.put("createTime", n.getCreateTime()); list.add(m); } + if (!rows.isEmpty()) { + List noticeIds = rows.stream().map(BizContestNotice::getId).filter(Objects::nonNull).toList(); + LambdaQueryWrapper attw = new LambdaQueryWrapper<>(); + attw.in(BizContestNoticeAttachment::getNoticeId, noticeIds); + attw.orderByAsc(BizContestNoticeAttachment::getCreateTime); + List attRows = contestNoticeAttachmentMapper.selectList(attw); + Map> byNotice = attRows.stream() + .collect(Collectors.groupingBy(BizContestNoticeAttachment::getNoticeId)); + for (Map m : list) { + Long nid = (Long) m.get("id"); + List nas = byNotice.getOrDefault(nid, Collections.emptyList()); + List> attList = new ArrayList<>(); + for (BizContestNoticeAttachment a : nas) { + Map am = new LinkedHashMap<>(); + am.put("id", a.getId()); + am.put("fileName", a.getFileName()); + am.put("fileUrl", a.getFileUrl()); + am.put("fileType", a.getFileType()); + am.put("format", a.getFormat()); + am.put("size", a.getSize()); + attList.add(am); + } + m.put("attachments", attList); + } + } return list; } diff --git a/lesingle-creation-frontend/src/api/public.ts b/lesingle-creation-frontend/src/api/public.ts index 872a337..ca328bd 100644 --- a/lesingle-creation-frontend/src/api/public.ts +++ b/lesingle-creation-frontend/src/api/public.ts @@ -289,6 +289,15 @@ export interface PublicActivity { workRequirement: string; } +export interface PublicActivityAttachment { + id: number; + fileName: string; + fileUrl: string; + fileType?: string; + format?: string; + size?: string; +} + /** 公众端活动详情(含公告、附件等扩展字段) */ export interface PublicActivityNotice { id: number; @@ -297,15 +306,8 @@ export interface PublicActivityNotice { noticeType?: string; publishTime?: string; createTime?: string; -} - -export interface PublicActivityAttachment { - id: number; - fileName: string; - fileUrl: string; - fileType?: string; - format?: string; - size?: string; + /** 公告附件(公众活动详情接口填充,与活动附件字段一致) */ + attachments?: PublicActivityAttachment[]; } export interface PublicActivityDetail extends PublicActivity { diff --git a/lesingle-creation-frontend/src/views/contests/Detail.vue b/lesingle-creation-frontend/src/views/contests/Detail.vue index 9de6736..b452351 100644 --- a/lesingle-creation-frontend/src/views/contests/Detail.vue +++ b/lesingle-creation-frontend/src/views/contests/Detail.vue @@ -4,15 +4,12 @@
-
+
@@ -46,43 +43,29 @@
- 活动时间:{{ formatDate(contest?.startTime) }} ~ - {{ formatDate(contest?.endTime) }} + 活动时间:{{ formatDate(contest?.startTime) }} ~ + {{ formatDate(contest?.endTime) }}
- 报名时间:{{ formatDate(contest?.registerStartTime) }} ~ - {{ formatDate(contest?.registerEndTime) }} + 报名时间:{{ formatDate(contest?.registerStartTime) }} ~ + {{ formatDate(contest?.registerEndTime) }}
- - - @@ -98,30 +81,18 @@
-
+
活动信息
-
+
通知公告 {{ notices.length }}
-
+
活动结果
@@ -144,11 +115,7 @@

竞赛详情

-
+
@@ -165,18 +132,11 @@
-
+
-
+
{{ item.title }} @@ -184,6 +144,15 @@
{{ item.content }}
+
+
公告附件
+ +
{{ formatDateTime(item.publishTime) }} @@ -204,19 +173,11 @@
- +