2024-06-20 13:37:46 +08:00
|
|
|
|
using ZR.Admin.WebApi.Filters;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using ZR.Service.MES.andon.IService;
|
|
|
|
|
|
using ZR.Model.MES.andon.Dto;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DOAN.WebApi.Controllers.MES.andon
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安灯数据分析
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
|
|
|
|
|
[Route("mes/andonManagement/dataAnalysis")]
|
|
|
|
|
|
public class AndonDataAnalysisController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
private IAndonDataAnalysisServcie _andonDataAnalysisServcie;
|
|
|
|
|
|
public AndonDataAnalysisController(IAndonDataAnalysisServcie andonDataAnalysisServcie) {
|
|
|
|
|
|
_andonDataAnalysisServcie= andonDataAnalysisServcie;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取故障类型
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("getAndonAlarmTypeDict")]
|
|
|
|
|
|
public IActionResult GetListFault()
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _andonDataAnalysisServcie.GetListFault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取各异常时长占比饼图
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="query"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("getPieChart")]
|
|
|
|
|
|
public IActionResult AbnormalDurationRatio([FromBody] AndonAnalysisQueryDto query)
|
|
|
|
|
|
{
|
2024-06-20 13:56:36 +08:00
|
|
|
|
if(query == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SUCCESS(null);
|
|
|
|
|
|
}
|
2024-06-20 13:37:46 +08:00
|
|
|
|
var response = _andonDataAnalysisServcie.AbnormalDurationRatio(query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-20 13:41:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取异常数量汇总比例分析饼图
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="query"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("getPieChart2")]
|
|
|
|
|
|
public IActionResult AbnormalNumDurationRatio([FromBody] AndonAnalysisQueryDto query)
|
|
|
|
|
|
{
|
2024-06-20 13:56:36 +08:00
|
|
|
|
if (query == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SUCCESS(null);
|
|
|
|
|
|
}
|
2024-06-20 13:41:32 +08:00
|
|
|
|
var response = _andonDataAnalysisServcie.AbnormalNumDurationRatio(query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-20 14:38:04 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
///获取异常情况柱状图
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="query"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("exception_distribution")]
|
|
|
|
|
|
public IActionResult ExceptionDistribution([FromBody] AndonAnalysisQueryDto query)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (query == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SUCCESS(null);
|
|
|
|
|
|
}
|
|
|
|
|
|
var response = _andonDataAnalysisServcie.ExceptionDistribution(query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2024-06-20 13:41:32 +08:00
|
|
|
|
|
2024-06-20 13:37:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|