|
@@ -22,6 +22,7 @@ using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Requests;
|
|
|
using Hotline.Tools;
|
|
|
using MapsterMapper;
|
|
|
+using Microsoft.AspNetCore.Cors.Infrastructure;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using MiniExcelLibs;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
@@ -47,7 +48,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
private readonly IRepository<OrderVisit> _orderVisitRepository;
|
|
|
private readonly IRepository<TrCallRecord> _trCallRecordRepository;
|
|
|
private readonly IRepository<OrderPublish> _orderPublishRepository;
|
|
|
- private readonly IRepository<SystemOrganize> _systemOrganizeRepository;
|
|
|
+ private readonly ISystemOrganizeRepository _systemOrganizeRepository;
|
|
|
private readonly IRepository<AiOrderVisitDetail> _aiOrderVisitDetailRepository;
|
|
|
private readonly ISessionContext _sessionContext;
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
@@ -61,6 +62,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
private readonly IRepository<SystemArea> _systemAreaRepository;
|
|
|
private readonly IRepository<Hotspot> _hotspotRepository;
|
|
|
private readonly IRepository<SystemDicData> _systemDicDataRepository;
|
|
|
+ private readonly ISystemDicDataCacheManager _systemDicDataCacheManager;
|
|
|
|
|
|
public BiOrderController(
|
|
|
IOrderRepository orderRepository,
|
|
@@ -74,7 +76,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
IRepository<OrderVisit> orderVisitRepository,
|
|
|
IRepository<TrCallRecord> trCallRecordRepository,
|
|
|
IRepository<OrderPublish> orderPublishRepository,
|
|
|
- IRepository<SystemOrganize> systemOrganizeRepository,
|
|
|
+ ISystemOrganizeRepository systemOrganizeRepository,
|
|
|
IRepository<AiOrderVisitDetail> aiOrderVisitDetailRepository,
|
|
|
ISessionContext sessionContext,
|
|
|
ISystemSettingCacheManager systemSettingCacheManager,
|
|
@@ -87,7 +89,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
IOrderReportApplication orderReportApplication,
|
|
|
IRepository<SystemArea> systemAreaRepository,
|
|
|
IRepository<Hotspot> hotspotRepository,
|
|
|
- IRepository<SystemDicData> systemDicDataRepository
|
|
|
+ IRepository<SystemDicData> systemDicDataRepository,
|
|
|
+ ISystemDicDataCacheManager systemDicDataCacheManager
|
|
|
)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
@@ -115,6 +118,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
_systemAreaRepository = systemAreaRepository;
|
|
|
_hotspotRepository = hotspotRepository;
|
|
|
_systemDicDataRepository = systemDicDataRepository;
|
|
|
+ _systemDicDataCacheManager = systemDicDataCacheManager;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -2968,12 +2972,31 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpGet("org-visitdetail-list")]
|
|
|
public async Task<PagedDto<OrgVisitDetailListResp>> OrgVisitDetailList([FromQuery] OrgVisitDetailListReq dto)
|
|
|
{
|
|
|
- var query = _orderRepository.OrgVisitDetailList(dto);
|
|
|
+ var query = _orderReportApplication.OrgVisitDetailList(dto);
|
|
|
var (total, items) = await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<OrgVisitDetailListResp>(total, _mapper.Map<IReadOnlyList<OrgVisitDetailListResp>>(items));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 部门满意度明细页面基础数据
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("org-visitdetail-list-basedata")]
|
|
|
+ public async Task<object> OrgVisitDetailListBaseData()
|
|
|
+ {
|
|
|
+ var VisitSatisfaction = _systemDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction);
|
|
|
+
|
|
|
+ if (_sessionContext.OrgIsCenter)
|
|
|
+ {
|
|
|
+ return new { OrgsOptions = await _systemOrganizeRepository.GetOrgJson() , VisitSatisfaction= VisitSatisfaction };
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return new { OrgsOptions = await _systemOrganizeRepository.GetOrgJsonForUser(_sessionContext.RequiredOrgId), VisitSatisfaction = VisitSatisfaction };
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 部门满意度明细导出
|
|
|
/// </summary>
|
|
@@ -2982,7 +3005,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
[HttpPost("org-visitdetail-list-export")]
|
|
|
public async Task<FileStreamResult> OrgVisitDetailListExport([FromBody] ExportExcelDto<OrgVisitDetailListReq> dto)
|
|
|
{
|
|
|
- var query = _orderRepository.OrgVisitDetailList(dto.QueryDto);
|
|
|
+ var query = _orderReportApplication.OrgVisitDetailList(dto.QueryDto);
|
|
|
|
|
|
List<OrderVisitDetail> orders;
|
|
|
if (dto.IsExportAll)
|