123456789101112131415161718192021222324 |
- using Hotline.CallCenter.Tels;
- using SqlSugar;
- using XF.Domain.Dependency;
- namespace Hotline.Repository.SqlSugar.CallCenter
- {
- public class TelRepository : BaseRepository<Tel>, ITelRepository, IScopeDependency
- {
- public TelRepository(ISugarUnitOfWork<HotlineDbContext> uow) : base(uow)
- {
- }
- /// <summary>
- /// 分机是否正在休息
- /// </summary>
- /// <param name="telNo"></param>
- /// <param name="cancellationToken"></param>
- /// <returns></returns>
- public Task<bool> IsRestingAsync(string telNo, CancellationToken cancellationToken)
- {
- return Db.Queryable<TelRest>().AnyAsync(d => d.TelNo == telNo && !d.EndTime.HasValue);
- }
- }
- }
|