|
@@ -5,6 +5,7 @@ using Hotline.FlowEngine.Workflows;
|
|
|
using Hotline.Orders;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Settings;
|
|
|
+using Hotline.Settings.Hotspots;
|
|
|
using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.Article;
|
|
|
using Hotline.Share.Dtos.DataSharingSearch;
|
|
@@ -32,13 +33,15 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IBulletinApplication _bulletinApplication;
|
|
|
private readonly ISystemDicDataCacheManager _sysDicDataCacheManager;
|
|
|
private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
|
|
|
+ private readonly IRepository<Hotspot> _hotspotTypeRepository;
|
|
|
|
|
|
public DataSharingController(IMapper mapper,
|
|
|
IOrderRepository orderRepository,
|
|
|
IRepository<Bulletin> bulletinRepository,
|
|
|
IBulletinApplication bulletinApplication,
|
|
|
ISystemDicDataCacheManager sysDicDataCacheManager,
|
|
|
- IRepository<WorkflowTrace> workflowTraceRepository)
|
|
|
+ IRepository<WorkflowTrace> workflowTraceRepository,
|
|
|
+ IRepository<Hotspot> hotspotTypeRepository)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -46,6 +49,7 @@ namespace Hotline.Api.Controllers
|
|
|
_bulletinApplication = bulletinApplication;
|
|
|
_sysDicDataCacheManager = sysDicDataCacheManager;
|
|
|
_workflowTraceRepository = workflowTraceRepository;
|
|
|
+ _hotspotTypeRepository = hotspotTypeRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -153,7 +157,7 @@ namespace Hotline.Api.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("get_order_list_publish")]
|
|
|
[AllowAnonymous]
|
|
|
- public async Task<PagedDto<OrderDto>> GetOrderByListOpen([FromBody] GetOrderList dto)
|
|
|
+ public async Task<PagedDto<PublishDto>> GetOrderByListOpen([FromBody] GetOrderList dto)
|
|
|
{
|
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
|
.Includes(d => d.OrderPublish)
|
|
@@ -168,7 +172,7 @@ namespace Hotline.Api.Controllers
|
|
|
.OrderByDescending(p => p.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
|
|
- return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
+ return new PagedDto<PublishDto>(total, _mapper.Map<IReadOnlyList<PublishDto>>(items));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -284,8 +288,46 @@ namespace Hotline.Api.Controllers
|
|
|
var dayCount = await _orderRepository.Queryable().Where(p => p.CreationTime >= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")) &&
|
|
|
p.CreationTime <= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"))).CountAsync();
|
|
|
|
|
|
- return new { DayTrandCount = dayTrandCount, DayCount = dayCount };
|
|
|
+ //总共已办结
|
|
|
+ var allTrandCount = await _orderRepository.Queryable().Where(p => p.Status >= EOrderStatus.Filed).CountAsync();
|
|
|
+
|
|
|
+ //总共总量
|
|
|
+ var allCount = await _orderRepository.Queryable().Where(p => p.Status >= EOrderStatus.WaitForAccept).CountAsync();
|
|
|
+
|
|
|
+ return new { DayTrandCount = dayTrandCount, DayCount = dayCount, AllTrandCount = allTrandCount, AllCount = allCount };
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询热点分类
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("get_accept_type_list")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task<object> GetHotspotStatistics()
|
|
|
+ {
|
|
|
+ var list = await _hotspotTypeRepository.Queryable()
|
|
|
+ .LeftJoin<Order>((it, o) => it.Id == o.HotspotId)
|
|
|
+ .Where((it, o) => o.CreationTime >= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")))
|
|
|
+ .Where((it, o) => o.CreationTime <= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59")))
|
|
|
+ .Where((it, o) => o.Id != null)
|
|
|
+ .GroupBy((it, o) => new { Id = it.Id.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("2")) })
|
|
|
+ .Select((it, o) => new
|
|
|
+ {
|
|
|
+ HotspotCode = it.Id.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("2")),
|
|
|
+ SumCount = SqlFunc.AggregateCount(it.HotSpotName)
|
|
|
+ })
|
|
|
+ .MergeTable()
|
|
|
+ .LeftJoin<Hotspot>((x, q) => x.HotspotCode == q.Id)
|
|
|
+ .Select((x, q) => new
|
|
|
+ {
|
|
|
+ Name = q.HotSpotName,
|
|
|
+ Value = x.SumCount
|
|
|
+ })
|
|
|
+ .ToListAsync();
|
|
|
|
|
|
+ return list;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|