录音管理功能联调

This commit is contained in:
spllzh
2025-10-25 23:07:07 +08:00
parent 6801f06db5
commit c14476dc92
34 changed files with 1254 additions and 58 deletions

View File

@@ -36,12 +36,12 @@ public class AudioStatisticsController {
*/
@Operation(summary = "手动生成指定日期的统计数据", description = "手动触发指定日期的门店录音统计")
@PostMapping("/generate")
public Result generateStatistics(
public Result<?> generateStatistics(
@Parameter(description = "统计日期格式yyyy-MM-dd")
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate date) {
try {
int count = audioStatisticsScheduler.manualGenerateStatistics(date);
Result result = Result.ok(count);
Result<?> result = Result.ok(count);
result.setMsg("统计生成成功");
return result;
} catch (Exception e) {
@@ -54,14 +54,14 @@ public class AudioStatisticsController {
*/
@Operation(summary = "查询指定日期范围的统计数据", description = "查询指定日期范围内的门店录音统计数据")
@GetMapping("/range")
public Result getStatisticsByDateRange(
public Result<?> getStatisticsByDateRange(
@Parameter(description = "开始日期格式yyyy-MM-dd")
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate,
@Parameter(description = "结束日期格式yyyy-MM-dd")
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) {
try {
List<AudioManagementStatistics> statistics = audioStatisticsService.getStatisticsByDateRange(startDate, endDate);
Result result = Result.ok(statistics);
Result<?> result = Result.ok(statistics);
result.setMsg("查询成功");
return result;
} catch (Exception e) {
@@ -74,7 +74,7 @@ public class AudioStatisticsController {
*/
@Operation(summary = "查询指定门店的统计数据", description = "查询指定门店在指定日期范围内的录音统计数据")
@GetMapping("/dealership/{dealershipId}")
public Result getStatisticsByDealership(
public Result<?> getStatisticsByDealership(
@Parameter(description = "门店ID")
@PathVariable Long dealershipId,
@Parameter(description = "开始日期格式yyyy-MM-dd")
@@ -83,7 +83,7 @@ public class AudioStatisticsController {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) {
try {
List<AudioManagementStatistics> statistics = audioStatisticsService.getStatisticsByDealership(dealershipId, startDate, endDate);
Result result = Result.ok(statistics);
Result<?> result = Result.ok(statistics);
result.setMsg("查询成功");
return result;
} catch (Exception e) {
@@ -96,7 +96,7 @@ public class AudioStatisticsController {
*/
@Operation(summary = "查询指定销售人员的统计数据", description = "查询指定销售人员在指定日期范围内的录音统计数据")
@GetMapping("/sales/{salesId}")
public Result getStatisticsBySales(
public Result<?> getStatisticsBySales(
@Parameter(description = "销售人员ID")
@PathVariable String salesId,
@Parameter(description = "开始日期格式yyyy-MM-dd")
@@ -105,7 +105,7 @@ public class AudioStatisticsController {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) {
try {
List<AudioManagementStatistics> statistics = audioStatisticsService.getStatisticsBySales(salesId, startDate, endDate);
Result result = Result.ok(statistics);
Result<?> result = Result.ok(statistics);
result.setMsg("查询成功");
return result;
} catch (Exception e) {
@@ -118,7 +118,7 @@ public class AudioStatisticsController {
*/
@Operation(summary = "查询指定项目的统计数据", description = "查询指定项目在指定日期范围内的录音统计数据")
@GetMapping("/project/{projectId}")
public Result getStatisticsByProject(
public Result<?> getStatisticsByProject(
@Parameter(description = "项目ID")
@PathVariable String projectId,
@Parameter(description = "开始日期格式yyyy-MM-dd")
@@ -127,7 +127,7 @@ public class AudioStatisticsController {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) {
try {
List<AudioManagementStatistics> statistics = audioStatisticsService.getStatisticsByProject(projectId, startDate, endDate);
Result result = Result.ok(statistics);
Result<?> result = Result.ok(statistics);
result.setMsg("查询成功");
return result;
} catch (Exception e) {
@@ -140,12 +140,12 @@ public class AudioStatisticsController {
*/
@Operation(summary = "查询指定日期的统计数据", description = "查询指定日期的所有门店录音统计数据")
@GetMapping("/date/{date}")
public Result getStatisticsByDate(
public Result<?> getStatisticsByDate(
@Parameter(description = "统计日期格式yyyy-MM-dd")
@PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate date) {
try {
List<AudioManagementStatistics> statistics = audioStatisticsService.getStatisticsByDateRange(date, date);
Result result = Result.ok(statistics);
Result<?> result = Result.ok(statistics);
result.setMsg("查询成功");
return result;
} catch (Exception e) {
@@ -158,16 +158,16 @@ public class AudioStatisticsController {
*/
@Operation(summary = "获取统计概览", description = "获取最近7天的门店录音统计概览")
@GetMapping("/overview")
public Result getStatisticsOverview() {
public Result<?> getStatisticsOverview() {
try {
LocalDate endDate = LocalDate.now().minusDays(1); // 昨天
LocalDate startDate = endDate.minusDays(6); // 7天前
List<AudioManagementStatistics> statistics = audioStatisticsService.getStatisticsByDateRange(startDate, endDate);
Result result = Result.ok(statistics);
Result<?> result = Result.ok(statistics);
result.setMsg("查询成功");
return result;
} catch (Exception e) {
return Result.error("查询失败:" + e.getMessage());
}
}
}
}