89 lines
2.4 KiB
C#
Raw Normal View History

2025-02-25 13:52:50 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Admin.WebApi.Filters;
2025-02-27 14:36:35 +08:00
using DOAN.Service.MES.BI;
using DOAN.Service.MES.BI.IService;
using DOAN.Model.Dto;
using DOAN.Model.MES.andon.Dto;
2025-02-25 13:52:50 +08:00
namespace DOAN.WebApi.Controllers.MES.BI
{
2025-02-27 14:36:35 +08:00
/// <summary>
/// 新的andon数据分析
/// </summary>
2025-02-25 13:52:50 +08:00
[AllowAnonymous]
[Route("mes/BI/andon")]
public class AndonDataAnalysisController : BaseController
2025-03-17 11:06:36 +08:00
{
2025-02-27 14:36:35 +08:00
private readonly IAndonDataAnalysisService _andonDataAnalysisService;
2025-03-17 11:06:36 +08:00
public AndonDataAnalysisController(IAndonDataAnalysisService andonDataAnalysisService)
2025-02-27 14:36:35 +08:00
{
2025-03-17 11:06:36 +08:00
_andonDataAnalysisService = andonDataAnalysisService;
2025-02-27 14:36:35 +08:00
}
2025-02-25 13:52:50 +08:00
2025-02-27 14:36:35 +08:00
/// <summary>
/// 获取今天的故障记录和过去未处理的故障记录
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
2025-02-27 15:05:55 +08:00
[HttpGet("list")]
2025-02-27 14:36:35 +08:00
public IActionResult QueryTodayAndonFaultRecord()
{
var response = _andonDataAnalysisService.QueryTodayAndonFaultRecord();
return SUCCESS(response);
}
//TODO: 本月异常次数占比统计
/// <summary>
/// 本月异常次数占比统计
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
2025-02-27 15:05:55 +08:00
[HttpGet("getPieChart")]
2025-02-27 14:36:35 +08:00
public IActionResult AbnormalDurationRatio()
{
2025-03-17 11:06:36 +08:00
2025-02-27 14:36:35 +08:00
var response = _andonDataAnalysisService.AbnormalDurationRatio();
return SUCCESS(response);
}
//TODO本月停机时间统计柱状图
2025-02-27 15:05:55 +08:00
[HttpGet("getShutDowmBar")]
2025-02-27 14:36:35 +08:00
public IActionResult ShutdownBar()
{
var response = _andonDataAnalysisService.ShutdownBar();
return SUCCESS(response);
}
2025-02-25 13:52:50 +08:00
2025-03-17 11:06:36 +08:00
//TODO: 当前各产线实时状态
2025-03-17 11:17:28 +08:00
/// <summary>
/// string,bool 产线名称,(true正常,false异常)
/// </summary>
/// <returns></returns>
2025-03-17 11:06:36 +08:00
[HttpGet("line_realtime_status")]
public IActionResult LineRealTimeStatus()
{
var response = _andonDataAnalysisService.LineRealTimeStatus();
return SUCCESS(response);
}
//TODO 本月各个产线停机时间统计
[HttpGet("line_shut_down")]
public IActionResult MonthLineShutDown()
{
var response = _andonDataAnalysisService.MonthLineShutDown();
return SUCCESS(response);
}
2025-02-25 13:52:50 +08:00
}
}