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.Dto;
|
|
|
|
|
|
using DOAN.Model.MES.andon;
|
2024-06-20 13:37:46 +08:00
|
|
|
|
|
|
|
|
|
|
namespace DOAN.WebApi.Controllers.MES.andon
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安灯交互
|
|
|
|
|
|
/// </summary>
|
2024-06-20 15:47:00 +08:00
|
|
|
|
|
2024-06-20 13:37:46 +08:00
|
|
|
|
[Route("mes/andonManagement/interaction")]
|
|
|
|
|
|
public class AndonInteractionController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
private IAndonInteractionService _andonInteractionService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AndonInteractionController(IAndonInteractionService andonInteractionService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_andonInteractionService = andonInteractionService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 呼叫请求
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="query"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("Call")]
|
|
|
|
|
|
public IActionResult CallHandle([FromBody] AndonAskQueryDto query)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (query == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SUCCESS(null);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2024-06-20 15:47:00 +08:00
|
|
|
|
AndonFaultRecord record = query.Adapt<AndonFaultRecord>();
|
|
|
|
|
|
record.ToCreate();
|
|
|
|
|
|
var response = _andonInteractionService.CallHandle(record);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取待响应的 记录
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("waitingResponse")]
|
|
|
|
|
|
public IActionResult WaitingResponse()
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _andonInteractionService.WaitingResponse();
|
2024-06-20 13:37:46 +08:00
|
|
|
|
return SUCCESS(response);
|
2024-06-20 15:47:00 +08:00
|
|
|
|
}
|
2024-06-20 13:37:46 +08:00
|
|
|
|
|
2024-06-20 15:47:00 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 签到
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="response"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2024-06-21 17:12:56 +08:00
|
|
|
|
[HttpPost("signin")]
|
2024-06-20 15:47:00 +08:00
|
|
|
|
public IActionResult SignIn([FromBody] AndonResponseQueryDto response)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (response == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SUCCESS(null);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
AndonFaultRecord record = response.Adapt<AndonFaultRecord>();
|
2024-07-01 17:30:47 +08:00
|
|
|
|
record.ToUpdate();
|
2024-06-20 15:47:00 +08:00
|
|
|
|
var res = _andonInteractionService.SignIn(record);
|
|
|
|
|
|
return SUCCESS(res);
|
2024-06-20 13:37:46 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|