feat(manual-entry): 支持筛选及全量导出 CSV

This commit is contained in:
yml
2026-11-29 13:53:30 +08:00
parent 2692488ff2
commit 2e0018b943
10 changed files with 588 additions and 71 deletions
@@ -96,6 +96,22 @@ func (s *Service) List(ctx context.Context, query ListQuery) (*PaginatedResult,
return s.repo.List(ctx, query)
}
// Export 按列表筛选条件生成 CSV;空筛选表示导出全部。
func (s *Service) Export(ctx context.Context, query ListQuery) ([]byte, int, error) {
if s.repo == nil {
return nil, 0, ErrDependencyUnavailable
}
items, err := s.repo.ListForExport(ctx, query)
if err != nil {
return nil, 0, err
}
data, err := buildManualEntryCSV(items)
if err != nil {
return nil, 0, err
}
return data, len(items), nil
}
// TodayAgentStats 返回今日(北京时间)各客服录单统计。
func (s *Service) TodayAgentStats(ctx context.Context) ([]AgentDayStatsDTO, error) {
if s.repo == nil {