|
@@ -2713,33 +2713,55 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
public async Task<Object> QueryOrderSourceHoursReportColumnarList([FromQuery] QueryOrderSourceRequest dto)
|
|
|
{
|
|
|
var data = await _orderApplication.QueryOrderSourceHoursList(dto);
|
|
|
- List<string> times = new List<string>();
|
|
|
+ List<string> tiems = new List<string>();
|
|
|
for (int i = 0; i < 24; i++)
|
|
|
{
|
|
|
var item = i.ToString("D2") + ":00 - " + i.ToString("D2") + ":59";
|
|
|
- times.Add(item);
|
|
|
+ tiems.Add(item);
|
|
|
}
|
|
|
- var phone = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.Phone).FirstOrDefault() == null ? 0 : t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var web = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.Web).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var Rests = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.Rests).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var Created = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.Created).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var WeChat = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.WeChat).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var App = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.App).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var WisdomYB = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.WisdomYB).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var Platform = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.Platform).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var Platform12328 = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.Platform12328).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- var MayorAndNetizens = (from t1 in times join t2 in data on t1 equals t2.Time into t1_t2 from item in t1_t2.DefaultIfEmpty()
|
|
|
- select new { Time = t1,Num = t1_t2.Select(x => x.MayorAndNetizens).FirstOrDefault() == null ? 0: t1_t2.Select(x => x.Web).FirstOrDefault(), }).ToList();
|
|
|
- return new { Phone = phone , Web = web, Rests = Rests , Created = Created , WeChat = WeChat, App= App, WisdomYB = WisdomYB, Platform= Platform, Platform12328 = Platform12328, MayorAndNetizens= MayorAndNetizens };
|
|
|
+ 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>
|
|
@@ -2752,7 +2774,6 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
{
|
|
|
List<Kv> header = new List<Kv>
|
|
|
{
|
|
|
- new Kv { Key = "宜宾110平台", Value = "Platform110" },
|
|
|
new Kv { Key = "电话", Value = "Phone" },
|
|
|
new Kv { Key = "因特网", Value = "Web" },
|
|
|
new Kv { Key = "其他", Value = "Rests" },
|
|
@@ -2768,7 +2789,8 @@ namespace Hotline.Api.Controllers.Bi
|
|
|
new Kv { Key = "省政民互动", Value = "Interaction" },
|
|
|
new Kv { Key = "宜办事", Value = "ServiceYB" },
|
|
|
new Kv { Key = "市州互转", Value = "CityTransfer" },
|
|
|
- new Kv { Key = "办不成事反映窗口", Value = "NoService" },
|
|
|
+ new Kv { Key = "宜宾110平台", Value = "Platform110" },
|
|
|
+ new Kv { Key = "办不成事反映窗口", Value = "NoService" },
|
|
|
new Kv { Key = "I宜宾", Value = "Iyb" }
|
|
|
};
|
|
|
List<string> times = new List<string>();
|