|
@@ -10,6 +10,7 @@ using Hotline.Settings;
|
|
|
using Hotline.Settings.Hotspots;
|
|
|
using Hotline.Settings.TimeLimits;
|
|
|
using Hotline.Share.Dtos;
|
|
|
+using Hotline.Share.Dtos.Ai;
|
|
|
using Hotline.Share.Dtos.Bi;
|
|
|
using Hotline.Share.Dtos.Bigscreen;
|
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
@@ -23,6 +24,7 @@ using MapsterMapper;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using MiniExcelLibs;
|
|
|
using SqlSugar;
|
|
|
+using System.Data;
|
|
|
using XF.Domain.Authentications;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
@@ -1320,7 +1322,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
|
CountNum = SqlFunc.AggregateCount(it.OrgLevelOneCode),
|
|
|
|
|
|
- OrgName = it.OrgLevelOneCode == "001" ? "热线中心" : o.Name
|
|
|
+ OrgName = it.OrgLevelOneCode == "001" ? "市民热线服务中心" : o.Name
|
|
|
}).ToListAsync();
|
|
|
|
|
|
centerReportStatisticsDto.OrgStatisticsCityAll = new OrgStatisticsAll
|
|
@@ -1340,7 +1342,7 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
.Select((it, o) => new OrgStatistics
|
|
|
{
|
|
|
CountNum = SqlFunc.AggregateCount(it.OrgLevelOneCode),
|
|
|
- OrgName = it.OrgLevelOneCode == "001" ? "热线中心" : o.Name
|
|
|
+ OrgName = it.OrgLevelOneCode == "001" ? "市民热线服务中心" : o.Name
|
|
|
}).ToListAsync();
|
|
|
|
|
|
centerReportStatisticsDto.OrgStatisticsAreaAll = new OrgStatisticsAll
|
|
@@ -2621,28 +2623,31 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("order_source_report_list")]
|
|
|
- public async Task<List<OrderSourceHeaderVo>> QueryOrderSourceReportList([FromQuery] QueryOrderSourceRequest dto)
|
|
|
+ public async Task<Object> QueryOrderSourceReportList([FromQuery] QueryOrderSourceRequest dto)
|
|
|
{
|
|
|
- var data = await _orderApplication.QueryOrderSourceList(dto);
|
|
|
- return data;
|
|
|
- ;
|
|
|
+ var item = await _orderRepository.OrderSource(dto);
|
|
|
+
|
|
|
+ var titleData = await _systemDicDataRepository.Queryable()
|
|
|
+ .Where(p => p.DicTypeCode == "SourceChannel")
|
|
|
+ .Select(p => new
|
|
|
+ {
|
|
|
+ Key = p.DicDataValue,
|
|
|
+ Value = p.DicDataName
|
|
|
+ }).ToListAsync();
|
|
|
+
|
|
|
+ return new { Item = item, TitleData = titleData };
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 信件来源统计导出
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("order_source_list/_export")]
|
|
|
- public async Task<FileStreamResult> QueryOrderSourceReportList([FromBody] ExportExcelDto<QueryOrderSourceRequest> dto)
|
|
|
+ public async Task<FileStreamResult> QueryOrderSourceListExport([FromBody] QueryOrderSourceRequest dto)
|
|
|
{
|
|
|
- var data = await _orderApplication.QueryOrderSourceList(dto.QueryDto);
|
|
|
- dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
- var dtos = data
|
|
|
- .Select(stu => _mapper.Map(stu, typeof(OrderSourceHeaderVo), dynamicClass))
|
|
|
- .Cast<object>()
|
|
|
- .ToList();
|
|
|
- var stream = ExcelHelper.CreateStream(dtos);
|
|
|
- return ExcelStreamResult(stream, "信件来源统计列表数据");
|
|
|
- }
|
|
|
+ var dataTable = await _orderRepository.OrderSourceExport(dto);
|
|
|
+ var stream = ExcelHelper.CreateStream(dataTable);
|
|
|
+ return ExcelStreamResult(stream, "信件来源统计数据");
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 信件来源统计明细
|
|
@@ -2683,183 +2688,6 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
return ExcelStreamResult(stream, "信件来源统计明细数据");
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 信件来源分时统计列表
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("order_source_hours_report_list")]
|
|
|
- public async Task<List<OrderSourceHeaderVo>> QueryOrderSourceHoursReportList([FromQuery] QueryOrderSourceRequest dto)
|
|
|
- {
|
|
|
- var data = await _orderApplication.QueryOrderSourceHoursList(dto);
|
|
|
- var totalVo = new OrderSourceHeaderVo()
|
|
|
- {
|
|
|
- Time = "合计",
|
|
|
- Phone = data.Sum(x => x.Phone),
|
|
|
- Web = data.Sum(x => x.Web),
|
|
|
- Rests = data.Sum(x => x.Rests),
|
|
|
- Created = data.Sum(x => x.Created),
|
|
|
- WeChat = data.Sum(x => x.WeChat),
|
|
|
- App = data.Sum(x => x.App),
|
|
|
- WisdomYB = data.Sum(x => x.WisdomYB),
|
|
|
- Platform = data.Sum(x => x.Platform),
|
|
|
- Platform12328 = data.Sum(x => x.Platform12328),
|
|
|
- MayorAndNetizens = data.Sum(x => x.MayorAndNetizens),
|
|
|
- MediaYB = data.Sum(x => x.MediaYB),
|
|
|
- Platform12345 = data.Sum(x => x.Platform12345),
|
|
|
- Interaction = data.Sum(x => x.Interaction),
|
|
|
- ServiceYB = data.Sum(x => x.ServiceYB),
|
|
|
- CityTransfer = data.Sum(x => x.CityTransfer),
|
|
|
- Platform110 = data.Sum(x => x.Platform110),
|
|
|
- NoService = data.Sum(x => x.NoService),
|
|
|
- Iyb = data.Sum(x => x.Iyb)
|
|
|
- };
|
|
|
- data.Add(totalVo);
|
|
|
- return data;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 信件来源分时统计柱状列表
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("order_source_hours_report_columnar_list")]
|
|
|
- public async Task<Object> QueryOrderSourceHoursReportColumnarList([FromQuery] QueryOrderSourceRequest dto)
|
|
|
- {
|
|
|
- var data = await _orderApplication.QueryOrderSourceHoursList(dto);
|
|
|
- List<string> tiems = new List<string>();
|
|
|
- for (int i = 0; i < 24; i++)
|
|
|
- {
|
|
|
- var item = i.ToString("D2") + ":00 - " + i.ToString("D2") + ":59";
|
|
|
- tiems.Add(item);
|
|
|
- }
|
|
|
- var dataList = (from t1 in tiems
|
|
|
- join t2 in data on t1 equals t2.Time into t1_t2
|
|
|
- from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new
|
|
|
- {
|
|
|
- Time = t1,
|
|
|
- Phone = t1_t2.Select(x => x.Phone).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Phone).FirstOrDefault(),
|
|
|
- Web = t1_t2.Select(x => x.Web).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Web).FirstOrDefault(),
|
|
|
- Rests = t1_t2.Select(x => x.Rests).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Rests).FirstOrDefault(),
|
|
|
- Created = t1_t2.Select(x => x.Created).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Created).FirstOrDefault(),
|
|
|
- WeChat = t1_t2.Select(x => x.WeChat).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.WeChat).FirstOrDefault(),
|
|
|
- App = t1_t2.Select(x => x.App).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.App).FirstOrDefault(),
|
|
|
- WisdomYB = t1_t2.Select(x => x.WisdomYB).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.WisdomYB).FirstOrDefault(),
|
|
|
- Platform = t1_t2.Select(x => x.Platform).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Platform).FirstOrDefault(),
|
|
|
- Platform12328 = t1_t2.Select(x => x.Platform12328).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Platform12328).FirstOrDefault(),
|
|
|
- MayorAndNetizens = t1_t2.Select(x => x.MayorAndNetizens).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.MayorAndNetizens).FirstOrDefault(),
|
|
|
- MediaYB = t1_t2.Select(x => x.MediaYB).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.MediaYB).FirstOrDefault(),
|
|
|
- Platform12345 = t1_t2.Select(x => x.Platform12345).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Platform12345).FirstOrDefault(),
|
|
|
- Interaction = t1_t2.Select(x => x.Interaction).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Interaction).FirstOrDefault(),
|
|
|
- ServiceYB = t1_t2.Select(x => x.ServiceYB).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.ServiceYB).FirstOrDefault(),
|
|
|
- CityTransfer = t1_t2.Select(x => x.CityTransfer).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.CityTransfer).FirstOrDefault(),
|
|
|
- Platform110 = t1_t2.Select(x => x.Platform110).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Platform110).FirstOrDefault(),
|
|
|
- NoService = t1_t2.Select(x => x.NoService).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.NoService).FirstOrDefault(),
|
|
|
- Iyb = t1_t2.Select(x => x.Iyb).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Iyb).FirstOrDefault(),
|
|
|
- }).ToList();
|
|
|
- var res = new
|
|
|
- {
|
|
|
- Phone = new { Key = "电话", data = dataList.Select(x => x.Phone) },
|
|
|
- Web = new { Key = "因特网", data = dataList.Select(x => x.Web) },
|
|
|
- Rests = new { Key = "其他", data = dataList.Select(x => x.Rests) },
|
|
|
- Created = new { Key = "自建", data = dataList.Select(x => x.Created) },
|
|
|
- WeChat = new { Key = "微信", data = dataList.Select(x => x.WeChat) },
|
|
|
- App = new { Key = "APP", data = dataList.Select(x => x.App) },
|
|
|
- WisdomYB = new { Key = "智慧宜宾", data = dataList.Select(x => x.WisdomYB) },
|
|
|
- Platform = new { Key = "综治平台", data = dataList.Select(x => x.Platform) },
|
|
|
- Platform12328 = new { Key = "省12328平台", data = dataList.Select(x => x.Platform12328) },
|
|
|
- MayorAndNetizens = new { Key = "市州与网民", data = dataList.Select(x => x.MayorAndNetizens) },
|
|
|
- MediaYB = new { Key = "宜宾融媒体", data = dataList.Select(x => x.MediaYB) },
|
|
|
- Platform12345 = new { Key = "省12345平台", data = dataList.Select(x => x.Platform12345) },
|
|
|
- Interaction = new { Key = "省政民互动", data = dataList.Select(x => x.Interaction) },
|
|
|
- ServiceYB = new { Key = "宜办事", data = dataList.Select(x => x.ServiceYB) },
|
|
|
- CityTransfer = new { Key = "市州互转", data = dataList.Select(x => x.CityTransfer) },
|
|
|
- Platform110 = new { Key = "宜宾110平台", data = dataList.Select(x => x.Platform110) },
|
|
|
- NoService = new { Key = "办不成事反映窗口", data = dataList.Select(x => x.NoService) },
|
|
|
- Iyb = new { Key = "I宜宾", data = dataList.Select(x => x.Iyb) }
|
|
|
- };
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 信件来源分时统计表头
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("order_source_hours_report_header")]
|
|
|
- public async Task<Object> QueryOrderSourceHoursReportHeader()
|
|
|
- {
|
|
|
- List<Kv> header = new List<Kv>
|
|
|
- {
|
|
|
- new Kv { Key = "电话", Value = "Phone" },
|
|
|
- new Kv { Key = "因特网", Value = "Web" },
|
|
|
- new Kv { Key = "其他", Value = "Rests" },
|
|
|
- new Kv { Key = "自建", Value = "Created" },
|
|
|
- new Kv { Key = "微信", Value = "WeChat" },
|
|
|
- new Kv { Key = "APP", Value = "App" },
|
|
|
- new Kv { Key = "智慧宜宾", Value = "WisdomYB" },
|
|
|
- new Kv { Key = "综治平台", Value = "Platform" },
|
|
|
- new Kv { Key = "省12328平台", Value = "Platform12328" },
|
|
|
- new Kv { Key = "市州与网民", Value = "MayorAndNetizens" },
|
|
|
- new Kv { Key = "宜宾融媒体", Value = "MediaYB" },
|
|
|
- new Kv { Key = "省12345平台", Value = "Platform12345" },
|
|
|
- new Kv { Key = "省政民互动", Value = "Interaction" },
|
|
|
- new Kv { Key = "宜办事", Value = "ServiceYB" },
|
|
|
- new Kv { Key = "市州互转", Value = "CityTransfer" },
|
|
|
- new Kv { Key = "宜宾110平台", Value = "Platform110" },
|
|
|
- new Kv { Key = "办不成事反映窗口", Value = "NoService" },
|
|
|
- new Kv { Key = "I宜宾", Value = "Iyb" }
|
|
|
- };
|
|
|
- List<string> tiems = new List<string>();
|
|
|
- for (int i = 0; i < 24; i++)
|
|
|
- {
|
|
|
- var item = i.ToString("D2") + ":00 - " + i.ToString("D2") + ":59";
|
|
|
- tiems.Add(item);
|
|
|
- }
|
|
|
- return new { Header = header, Tiems = tiems };
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 信件来源分时统计导出
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost("order_source_hours_list/_export")]
|
|
|
- public async Task<FileStreamResult> QueryOrderSourceHoursReportList([FromBody] ExportExcelDto<QueryOrderSourceRequest> dto)
|
|
|
- {
|
|
|
- var data = await _orderApplication.QueryOrderSourceHoursList(dto.QueryDto);
|
|
|
- var totalVo = new OrderSourceHeaderVo()
|
|
|
- {
|
|
|
- Time = "合计",
|
|
|
- Phone = data.Sum(x => x.Phone),
|
|
|
- Web = data.Sum(x => x.Web),
|
|
|
- Rests = data.Sum(x => x.Rests),
|
|
|
- Created = data.Sum(x => x.Created),
|
|
|
- WeChat = data.Sum(x => x.WeChat),
|
|
|
- App = data.Sum(x => x.App),
|
|
|
- WisdomYB = data.Sum(x => x.WisdomYB),
|
|
|
- Platform = data.Sum(x => x.Platform),
|
|
|
- Platform12328 = data.Sum(x => x.Platform12328),
|
|
|
- MayorAndNetizens = data.Sum(x => x.MayorAndNetizens),
|
|
|
- MediaYB = data.Sum(x => x.MediaYB),
|
|
|
- Platform12345 = data.Sum(x => x.Platform12345),
|
|
|
- Interaction = data.Sum(x => x.Interaction),
|
|
|
- ServiceYB = data.Sum(x => x.ServiceYB),
|
|
|
- CityTransfer = data.Sum(x => x.CityTransfer),
|
|
|
- Platform110 = data.Sum(x => x.Platform110),
|
|
|
- NoService = data.Sum(x => x.NoService),
|
|
|
- Iyb = data.Sum(x => x.Iyb)
|
|
|
- };
|
|
|
- data.Add(totalVo);
|
|
|
- dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
- var dtos = data
|
|
|
- .Select(stu => _mapper.Map(stu, typeof(OrderSourceHeaderVo), dynamicClass))
|
|
|
- .Cast<object>()
|
|
|
- .ToList();
|
|
|
- var stream = ExcelHelper.CreateStream(dtos);
|
|
|
- return ExcelStreamResult(stream, "信件来源分时统计列表数据");
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 区域分时统计
|
|
|
/// </summary>
|
|
@@ -2995,6 +2823,51 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
var stream = ExcelHelper.CreateStream(dataTable);
|
|
|
return ExcelStreamResult(stream, "信件来源分时统计数据");
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 部门满意度明细
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("org-visitdetail-list")]
|
|
|
+ public async Task<PagedDto<OrgVisitDetailListResp>> OrgVisitDetailList([FromQuery]OrgVisitDetailListReq dto)
|
|
|
+ {
|
|
|
+ var query = _orderRepository.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>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("org-visitdetail-list-export")]
|
|
|
+ public async Task<FileStreamResult> OrgVisitDetailListExport([FromBody] ExportExcelDto<OrgVisitDetailListReq> dto)
|
|
|
+ {
|
|
|
+ var query = _orderRepository.OrgVisitDetailList(dto.QueryDto);
|
|
|
+
|
|
|
+ List<OrderVisitDetail> orders;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ orders = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ orders = items;
|
|
|
+ }
|
|
|
+ var ordersDtos = _mapper.Map<ICollection<OrgVisitDetailListResp>>(orders);
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+ var dtos = ordersDtos
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(OrgVisitDetailListResp), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+ return ExcelStreamResult(stream, "部门满意度明细");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|