山东雷驰
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

84 lines
2.3 KiB

using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using OfficeOpenXml;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace Kean.Presentation.Rest.Controllers
{
/// <summary>
/// 统计服务
/// </summary>
[ApiController, Route("api/statistics")]
public class StatisticsController : ControllerBase
{
private readonly Application.Query.Interfaces.IStatisticsService _statisticsQueryService;
/// <summary>
/// 依赖注入
/// </summary>
public StatisticsController(
Application.Query.Interfaces.IStatisticsService statisticsQueryService)
{
_statisticsQueryService = statisticsQueryService;
}
/// <summary>
/// 获取TV显示数据
/// </summary>
/// <response code="200">成功</response>
[HttpGet]
[ProducesResponseType(200)]
[Anonymous]
public async Task<IActionResult> GetTvStatistics(
[FromQuery] int? area)
{
var items = await _statisticsQueryService.GetTvStatistics(area);
return StatusCode(200, items);
}
/// <summary>
/// 获取TV显示站台提示
/// </summary>
/// <response code="200">成功</response>
[HttpGet("led")]
[ProducesResponseType(200)]
[Anonymous]
public async Task<IActionResult> GetTVLedInfo(
[FromQuery] string area)
{
var items = await _statisticsQueryService.GetTVLedInfo(area);
return StatusCode(200, items);
}
/// <summary>
/// 统计库存
/// </summary>
/// <response code="200">成功</response>
[HttpGet("stockstatistics")]
[ProducesResponseType(200)]
public async Task<IActionResult> StockStatistics(string statisticsType, bool bQC)
{
object data = null;
if (statisticsType == "EA")
{
data = await _statisticsQueryService.StockStatistics(bQC);
}
else
{
data = await _statisticsQueryService.StockPalletStatistics(bQC);
}
return StatusCode(200, new
{
data
});
}
}
}