using Hotline.Orders;
using Hotline.Settings;
using Hotline.Settings.Hotspots;
using Hotline.Share.Dtos.Bi;
using Hotline.Share.Dtos.Order;
using Hotline.Share.Dtos.StatisticalReport;
using Hotline.Share.Requests;
using SqlSugar;
using System.Data;

namespace Hotline.Application.StatisticalReport
{
    public interface IOrderReportApplication
    {
        #region 宜宾、自贡
        /// <summary>
        /// 部门办件统计表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<List<DepartmentalProcessingStatisticsDataDto>> DepartmentalProcessingStatisticsNew(DepartmentalProcessingStatisticsRequest dto);

        /// <summary>
        /// 部门办件统计表--子级---新
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<List<DepartmentalProcessingStatisticsDataDto>> DepartmentalProcessingChildStatisticsNew(DepartmentalProcessingStatisticsRequest dto);

        /// <summary>
        /// 部门办件统计表--明细---新
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<SelectOrderId> GetDepartmentalProcessingStatisticsListNew(DepartmentalProcessingStatisticsRequest dto, CancellationToken cancellationToken);

        /// <summary>
        /// 部门办件统计明细表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<SelectOrderId> DepartmentalProcessingStatisticsDetailsList(DepartmentalProcessingStatisticsRequest dto);
        #endregion

        #region 泸州
        /// <summary>
        /// 部门办件统计表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<List<DepartmentalProcessingStatisticsDataDto>> LZDepartmentalProcessingStatisticsNew(DepartmentalProcessingStatisticsRequest dto);

        /// <summary>
        /// 部门办件统计表--子级---新
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<List<DepartmentalProcessingStatisticsDataDto>> LZDepartmentalProcessingChildStatisticsNew(DepartmentalProcessingStatisticsRequest dto);

        /// <summary>
        /// 部门办件统计表--明细---新
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<SelectOrderId> LZGetDepartmentalProcessingStatisticsListNew(DepartmentalProcessingStatisticsRequest dto, CancellationToken cancellationToken);

        /// <summary>
        /// 部门办件统计明细表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<SelectOrderId> LZDepartmentalProcessingStatisticsDetailsList(DepartmentalProcessingStatisticsRequest dto);
        #endregion

        #region 暂时弃用
        /// <summary>
        /// 部门办件统计表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<DepartmentalProcessingStatisticsDataDto> DepartmentalProcessingStatistics(DepartmentalProcessingStatisticsRequest dto);

        /// <summary>
        /// 部门办件统计表--子级
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<DepartmentalProcessingStatisticsDataDto> DepartmentalProcessingChildStatistics(DepartmentalProcessingStatisticsRequest dto);

        /// <summary>
        /// 部门办件统计表--明细
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<SelectOrderId> GetDepartmentalProcessingStatisticsList(DepartmentalProcessingStatisticsRequest dto, CancellationToken cancellationToken);

        #endregion

        /// <summary>
        /// 部门延期统计
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<BiOrderDelayDataDto> QueryOrderDelayDataList(QueryOrderDelayDataListRequest dto);

        /// <summary>
        /// 部门延期统计明细
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<OrderDelay> QueryOrderDelayDataDetail(QueryOrderDelayDataDetailRequest dto);

        /// <summary>
        /// 部门受理类型统计周期
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<DepartmentAcceptanceTypeStatisticsDto> DepartmentAcceptanceTypeStatistics(DepartmentKeyWordRequest dto);

        /// <summary>
        /// 部门受理类型统计
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<DepartmentAcceptanceTypeStatisticsV1Dto> DepartmentAcceptanceTypeStatisticsV1(DepartmentKeyWordRequest dto);

        /// <summary>
        /// 部门受理类型统计周期--明细列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<Order> DepartmentAcceptanceTypeOrderList(DepartmentKeyWordRequest dto);

        /// <summary>
        /// 部门受理类型统计--明细列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<Order> DepartmentAcceptanceTypeOrderListV1(DepartmentKeyWordRequest dto);


        /// <summary>
        /// 受理类型统计
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<AcceptTypeStatisticsDto> AcceptTypeStatistics(AcceptTypeStatisticsReq dto);


        /// <summary>
        /// 部门不满意统计
        /// 已加验证部门
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="isCenter"></param>
        /// <returns></returns>
        Task<(IReadOnlyList<SystemDicData> dissatisfiedReason, List<dynamic>? list)> QueryVisitNoSatisfiedAsync(QueryVisitNoSatisfiedDto dto, bool isCenter);

        /// <summary>
        /// 部门不满意统计-导出
        /// </summary>
        /// <param name="dissatisfiedReason"></param>
        /// <param name="list"></param>
        /// <returns></returns>
        Task<DataTable> ExportQueryVisitNoSatisfiedAsync(IReadOnlyList<SystemDicData> dissatisfiedReason, List<dynamic>? list, List<string> addColumnName);

        Task<DataTable> ExportHotPortJoinOrgStatisticsAsync(IReadOnlyList<Hotspot> dissatisfiedReason, List<dynamic>? list, List<string> addColumnName);

        /// <summary>
        /// 部门不满意统计明细
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<OrderVisitDetail> BiQueryVisitNoSatisfiedDetail(BiQueryVisitNoSatisfiedDetailDto dto);

        /// <summary>
        /// 未签收统计
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<List<OrderNoSigenDto>> GetOrderNoSigen(OrderNoSigenRequestDto dto);

        /// <summary>
        /// 未签收统计--明细
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<Order> GetOrderNoSigenDetail(OrderNoSigenRequestDto dto);

        /// <summary>
        /// 企业专席信件统计
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<List<EnterpriseSeatsReportDto>> GetEnterpriseSeatsReport(EnterpriseSeatsReportRequestDto dto);

        /// <summary>
        /// 企业专席信件统计--明细
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<Order> GetEnterpriseSeatsReportDetail(EnterpriseSeatsReportRequestDto dto);

        /// <summary>
        /// 坐席退件明细
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<SeatReturnOrderListDto> GetSeatReturnOrderList(SeatReturnOrderListRequestDto dto);

        /// <summary>
        /// 中心退件明细
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<SeatReturnOrderListDto> GetCenterReturnOrderList(SeatReturnOrderListRequestDto dto);

        /// <summary>
        /// 延期审批统计
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ISugarQueryable<OrderDelayStatisicalReturnDto> OrderDelayStatisicalList(OrderDelayStatisicalRequestDto dto);

        Task<DataTable> HotspotStatisticsExprot_LZ(ExportExcelDto<HotspotStatisticsRep> dto);

	}
}
