录音时长统计修改
This commit is contained in:
@@ -124,37 +124,6 @@ public class AudioStatisticsExample {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 示例5:查询指定项目的统计数据
|
||||
*/
|
||||
public void exampleQueryProjectStatistics() {
|
||||
System.out.println("=== 示例5:查询指定项目的统计数据 ===");
|
||||
|
||||
String projectId = "project001"; // 假设项目ID
|
||||
LocalDate startDate = LocalDate.now().minusDays(30); // 最近30天
|
||||
LocalDate endDate = LocalDate.now().minusDays(1);
|
||||
|
||||
List<AudioManagementStatistics> statistics = audioStatisticsService.getStatisticsByProject(projectId, startDate, endDate);
|
||||
|
||||
System.out.println("项目ID: " + projectId);
|
||||
System.out.println("查询到统计记录数: " + statistics.size());
|
||||
|
||||
// 计算该项目的总统计
|
||||
long totalDuration = 0;
|
||||
int totalCount = 0;
|
||||
|
||||
for (AudioManagementStatistics stat : statistics) {
|
||||
totalDuration += stat.getProjectTotalDuration();
|
||||
totalCount += stat.getProjectRecordingCount();
|
||||
}
|
||||
|
||||
System.out.println("项目总录音时长: " + totalDuration + "秒");
|
||||
System.out.println("项目总录音数量: " + totalCount);
|
||||
if (totalCount > 0) {
|
||||
System.out.println("项目平均录音时长: " + (totalDuration / totalCount) + "秒");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 示例6:批量生成历史统计数据
|
||||
*/
|
||||
@@ -179,37 +148,5 @@ public class AudioStatisticsExample {
|
||||
System.out.println("批量生成完成,总记录数: " + totalCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行所有示例
|
||||
*/
|
||||
public void runAllExamples() {
|
||||
System.out.println("开始运行门店录音统计功能示例...");
|
||||
System.out.println();
|
||||
|
||||
try {
|
||||
exampleGenerateStatistics();
|
||||
System.out.println();
|
||||
|
||||
exampleQueryRecentStatistics();
|
||||
System.out.println();
|
||||
|
||||
exampleQueryDealershipStatistics();
|
||||
System.out.println();
|
||||
|
||||
exampleQuerySalesStatistics();
|
||||
System.out.println();
|
||||
|
||||
exampleQueryProjectStatistics();
|
||||
System.out.println();
|
||||
|
||||
exampleBatchGenerateStatistics();
|
||||
System.out.println();
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("示例运行失败: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("示例运行完成!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user