2024-07-01 16:04:10 +08:00
|
|
|
|
using DOAN.Admin.WebApi.Filters;
|
2024-06-20 13:37:46 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2024-07-01 16:04:10 +08:00
|
|
|
|
using DOAN.Service.MES.andon.IService;
|
|
|
|
|
|
using DOAN.Model.MES.andon.Dto;
|
|
|
|
|
|
using DOAN.Model.Dto;
|
|
|
|
|
|
using DOAN.Service.MES.andon;
|
2024-06-20 13:37:46 +08:00
|
|
|
|
|
|
|
|
|
|
namespace DOAN.WebApi.Controllers.MES.andon
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安灯数据分析
|
|
|
|
|
|
/// </summary>
|
2024-06-21 17:12:56 +08:00
|
|
|
|
// [Verify]
|
2024-06-20 13:37:46 +08:00
|
|
|
|
[Route("mes/andonManagement/dataAnalysis")]
|
|
|
|
|
|
public class AndonDataAnalysisController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
private IAndonDataAnalysisServcie _andonDataAnalysisServcie;
|
|
|
|
|
|
public AndonDataAnalysisController(IAndonDataAnalysisServcie andonDataAnalysisServcie) {
|
|
|
|
|
|
_andonDataAnalysisServcie= andonDataAnalysisServcie;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-21 17:12:20 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询故障记录表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "andonManagement:andonfaultrecord:list")]
|
|
|
|
|
|
public IActionResult QueryAndonFaultRecord([FromBody] AndonFaultRecordQueryDto parm)
|
|
|
|
|
|
{
|
2024-06-20 13:37:46 +08:00
|
|
|
|
|
2024-06-21 17:12:20 +08:00
|
|
|
|
var response = _andonDataAnalysisServcie.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2024-06-20 13:37:46 +08:00
|
|
|
|
/// <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
|
|
|
|
}
|
|
|
|
|
|
}
|