Sms Report Init

This commit is contained in:
SamSys
2026-01-07 14:49:44 +03:30
parent 8ad296fe61
commit 63edb33bf5
8 changed files with 145 additions and 6 deletions

View File

@@ -1,9 +1,14 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.SmsResultAgg;
using CompanyManagment.App.Contracts.SmsResult;
using CompanyManagment.App.Contracts.SmsResult.Dto;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository;
@@ -15,6 +20,27 @@ public class SmsResultRepository : RepositoryBase<long, SmsResult> , ISmsResultR
_context = context;
}
#region ForApi
public async Task<List<SmsReportDto>> GetSmsReportList(SmsReportSearchModel command)
{
var watch = new Stopwatch();
watch.Start();
var res = _context.SmsResults.GroupBy(x => x.CreationDate);
Console.WriteLine("query : " + watch.Elapsed);
watch.Stop();
watch.Reset();
watch.Start();
var b = await res.Take(9000).Select(x => new SmsReportDto()
{
SentDate = x.Key.ToFarsi()
}).ToListAsync();
Console.WriteLine("ToList : " + watch.Elapsed);
return b;
}
#endregion
public List<App.Contracts.SmsResult.SmsResultViewModel> Search(SmsResultSearchModel searchModel)
{