59 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			59 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using langguanApi.Service;
							 | 
						|||
| 
								 | 
							
								using Microsoft.AspNetCore.Http;
							 | 
						|||
| 
								 | 
							
								using Microsoft.AspNetCore.Mvc;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace langguanApi.Controllers
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    /// <summary>
							 | 
						|||
| 
								 | 
							
								    /// 统计数据控制器
							 | 
						|||
| 
								 | 
							
								    /// </summary>
							 | 
						|||
| 
								 | 
							
								    [Route("api/[controller]")]
							 | 
						|||
| 
								 | 
							
								    [ApiController]
							 | 
						|||
| 
								 | 
							
								    public class StatisticsController : ControllerBase
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        private readonly StatisticsService _statisticsService;
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 构造函数
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="statisticsService"></param>
							 | 
						|||
| 
								 | 
							
								        public StatisticsController(StatisticsService statisticsService)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            _statisticsService = statisticsService;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 获取统计数据
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="type">1,VOC,2CEM</param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="Organized">工序列表</param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="deviceId">deviceId</param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="startTime">startTime</param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="endTime">endTime</param>
							 | 
						|||
| 
								 | 
							
								        /// <param name=""></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        [HttpGet("huanbao")]
							 | 
						|||
| 
								 | 
							
								        public async Task<IActionResult> huanbao(int type, int Organized, string deviceId, DateTime startTime, DateTime endTime, int pageIndex = 1, int pageSize = 10)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var result = await _statisticsService.GetStatistics(type, Organized, deviceId, startTime, endTime, pageIndex, pageSize);
							 | 
						|||
| 
								 | 
							
								            return Ok(result);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 导出统计数据
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="type"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="Organized"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="deviceId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="startTime"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="endTime"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="pageIndex"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="pageSize"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        [HttpGet("exporthuanbao")]
							 | 
						|||
| 
								 | 
							
								        public async Task<IActionResult> export(int type, int Organized, string deviceId, DateTime startTime, DateTime endTime, int pageIndex = 1, int pageSize = 10)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var result = await _statisticsService.GetStatistics(type, Organized, deviceId, startTime, endTime, pageIndex, pageSize);
							 | 
						|||
| 
								 | 
							
								            return Ok(result);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |