|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using SlnMesnac.Model.dto;
|
|
|
|
|
|
|
|
namespace SlnMesnac.Controllers;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// ingredientsChenck 投料校验
|
|
|
|
/// </summary>
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
[ApiController]
|
|
|
|
public class IngCheckController
|
|
|
|
{
|
|
|
|
private ILogger<IngCheckController> _logger;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="logger"></param>
|
|
|
|
public IngCheckController(ILogger<IngCheckController> logger)
|
|
|
|
{
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 大料投料校验
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ingredientInfo"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("BigMaterial")]
|
|
|
|
public ApiResponse BigMaterialCheck(IngredientInfo ingredientInfo)
|
|
|
|
{
|
|
|
|
var result = new ApiResponse();
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (ingredientInfo != null)
|
|
|
|
{
|
|
|
|
result.SetSuccess($"校验成功,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result.SetSuccess($"校验失败,缺少必要参数,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
Console.WriteLine(e);
|
|
|
|
result.SetException(e,"小料投料校验异常");
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 小料投料校验
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ingredientInfo"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("SmallMaterial")]
|
|
|
|
public ApiResponse SmallMaterialCheck(IngredientInfo ingredientInfo)
|
|
|
|
{
|
|
|
|
|
|
|
|
var result = new ApiResponse();
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (ingredientInfo != null)
|
|
|
|
{
|
|
|
|
result.SetSuccess($"校验成功,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result.SetSuccess($"校验失败,缺少必要参数,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
Console.WriteLine(e);
|
|
|
|
result.SetException(e,"小料投料校验异常");
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|