using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc.ApplicationModels;
|
using Microsoft.Extensions.Logging;
|
using Rhea.Common;
|
using System;
|
using System.Collections.Generic;
|
using System.Threading.Tasks;
|
using Tiger.IBusiness;
|
using Tiger.Model;
|
using Tiger.Model.Entitys.WMS.DTOS;
|
using Tiger.Model.Minsun;
|
|
namespace Tiger.Api.Controllers.WMS.T00ToWMS
|
{
|
/// <summary>
|
///
|
/// </summary>
|
[ApiController]
|
public class MaterialInfoController : ControllerBase
|
{
|
#region DI
|
|
/// <summary>
|
///
|
/// </summary>
|
private readonly IMaterialInfoBusiness _materialBus;
|
|
/// <summary>
|
///
|
/// </summary>
|
private readonly ILogger<WMS_MesMaterial> _logger;
|
|
#endregion DI
|
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
/// <param name="materBus"></param>
|
/// <param name="logger"></param>
|
public MaterialInfoController(IMaterialInfoBusiness materBus, ILogger<WMS_MesMaterial> logger)
|
{
|
_materialBus = materBus;
|
_logger = logger;
|
}
|
|
/// <summary>
|
/// 从T100获取物料信息
|
/// </summary>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetMaterialFromT100(InputDTO input)
|
{
|
return _materialBus.GetMaterialFromT100(input);
|
}
|
|
/// <summary>
|
/// 从T100获取送检单信息
|
/// </summary>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetInspectionNoFromT100()
|
{
|
return _materialBus.GetInspectionNoFromT100();
|
}
|
|
// <summary>
|
/// 从T100获取调拨单信息
|
/// </summary>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetTrasferInfoFromT100(InputDTO input)
|
{
|
return _materialBus.GetTrasferInfoFromT100(input);
|
}
|
|
// <summary>
|
/// 从T100获取其他出库单信息
|
/// </summary>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetOtherOutInfoFromT100(InputDTO input)
|
{
|
return _materialBus.GetOtherOutInfoFromT100(input);
|
}
|
|
// <summary>
|
/// 其它出库单信息定时推送给T100——过账
|
/// </summary>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetOtherOutInfoToT100(InputDTO input)
|
{
|
return _materialBus.GetOtherOutInfoToT100(input);
|
}
|
|
// <summary>
|
/// 销售出库单信息定时推送给T100——过账
|
/// </summary>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int PutSaleOutInfoToT100(InputDTO input)
|
{
|
return _materialBus.PutSaleOutInfoToT100(input);
|
}
|
|
// <summary>
|
/// 调拨单信息定时推送给T100——创单并过账
|
/// </summary>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetTrasferInfoToT100(InputDTO input)
|
{
|
return _materialBus.GetTrasferInfoToT100(input);
|
}
|
|
// <summary>
|
/// 调拨单信息定时推送给T100——直接过账
|
/// </summary>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetTrasferInfoToT100Plan2(InputDTO input)
|
{
|
return _materialBus.GetTrasferInfoToT100Plan2(input);
|
}
|
|
/// <summary>
|
/// 从T100获取采购信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetPurchaseInfo(InputDTO input)
|
{
|
return _materialBus.GetPurchaseInfoFromT100(input);
|
}
|
|
/// <summary>
|
/// 从T100获取客户信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetCustomerInfo(InputDTO input)
|
{
|
return _materialBus.GetCustomerInfoFromT100(input);
|
}
|
|
/// <summary>
|
/// 从T100获取仓库代码信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int GetWarehouseCodeInfo(InputDTO input)
|
{
|
return _materialBus.GetWarehouseCodeInfoFromT100(input);
|
}
|
|
/// <summary>
|
/// 从MES获取成品入库信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public int ProductInputInfoFromT100()
|
{
|
return _materialBus.ProductInputInfoFromT100();
|
}
|
|
/// <summary>
|
/// 获取物料信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("[Controller]/[Action]")]
|
public Task<List<MaterialDTO>> GetMaterialInfo(MaterialDTO input)
|
{
|
return _materialBus.GetMaterialInfo(input);
|
}
|
|
/// <summary>
|
/// 更新有效期、预存期
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[Controller]/[Action]")]
|
public IActionResult UpdateTime(MaterialDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_materialBus.UpdateTime(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 获取所有的超期数据
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[Controller]/[Action]")]
|
public IActionResult OverdueData(OverdueDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_materialBus.OverdueData(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 获取T100单号状态
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[Controller]/[Action]")]
|
public IActionResult GetOrderStatus(OrderStatusDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_materialBus.GetOrderStatus(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
}
|
}
|