This commit is contained in:
@@ -2,6 +2,7 @@ import type {
|
||||
AudioPlayTargetType,
|
||||
ExplainBusinessUnit,
|
||||
ExplainGuideStop,
|
||||
ExplainGuideStopPage,
|
||||
ExplainTrack,
|
||||
MediaAsset,
|
||||
MuseumExhibit,
|
||||
@@ -67,7 +68,6 @@ export interface ExhibitDetailAudioOptions {
|
||||
|
||||
export interface ExplainHallSummary {
|
||||
hallId: string
|
||||
businessUnitCount: number
|
||||
guideStopCount: number
|
||||
}
|
||||
|
||||
@@ -487,24 +487,20 @@ export class ExplainUseCase {
|
||||
if (hall && (typeof hall.outlineCount === 'number' || typeof hall.stopCount === 'number')) {
|
||||
return [hallId, {
|
||||
hallId,
|
||||
businessUnitCount: hall.outlineCount || 0,
|
||||
guideStopCount: hall.stopCount || 0
|
||||
}] as const
|
||||
}
|
||||
|
||||
try {
|
||||
const units = await this.loadTemporaryBusinessUnitsByHall(hallId)
|
||||
const guideStopCount = units.reduce((total, unit) => total + unit.guideStopCount, 0)
|
||||
const page = await this.listGuideStopsPageByHall(hallId, 1, 1)
|
||||
return [hallId, {
|
||||
hallId,
|
||||
businessUnitCount: units.length,
|
||||
guideStopCount
|
||||
guideStopCount: page.total
|
||||
}] as const
|
||||
} catch (error) {
|
||||
console.warn('讲解展厅统计加载失败:', hallId, error)
|
||||
return [hallId, {
|
||||
hallId,
|
||||
businessUnitCount: 0,
|
||||
guideStopCount: 0
|
||||
}] as const
|
||||
}
|
||||
@@ -513,6 +509,10 @@ export class ExplainUseCase {
|
||||
return Object.fromEntries(entries)
|
||||
}
|
||||
|
||||
listGuideStopsPageByHall(hallId: string, pageNo: number, pageSize: number): Promise<ExplainGuideStopPage> {
|
||||
return this.explain.listGuideStopsPageByHall(hallId, pageNo, pageSize)
|
||||
}
|
||||
|
||||
getHallById(id: string) {
|
||||
return this.explain.getHallById(id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user