using System.Dynamic;
|
using Microsoft.AspNetCore.Mvc;
|
using NewPdaSqlServer.service.Warehouse;
|
using NewPdaSqlServer.util;
|
|
namespace NewPdaSqlServer.Controllers.Warehouse;
|
|
[ApiController]
|
[Route("api/[controller]")]
|
public class MesKwcxController : BaseController
|
{
|
private readonly MesKwcxManager m = new();
|
|
/// <summary>
|
/// 获取条码信息和物料信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("GetBarInfoList")]
|
public ResponseResult GetBarInfoList([FromBody] dynamic query)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBarInfoList = m.GetBarInfoList(query);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 获取条码信息和物料信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("GetBarInfo")]
|
public ResponseResult GetBarInfo([FromBody] dynamic query)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBarInfo = m.GetBarInfo(query);
|
if (resultInfos.tbBarInfo == null)
|
return new ResponseResult
|
{
|
status = -1,
|
message = "此条码不存在!!!",
|
data = resultInfos
|
};
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
[HttpPost("GetKWList")]
|
public ResponseResult GetKWList([FromBody] dynamic query)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbKWList = m.GetKWList(query);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
[HttpPost("GetKWInfo")]
|
public ResponseResult GetKWInfo([FromBody] dynamic query)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbKWInfo = m.GetKWInfo(query);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
[HttpPost("GetItemInfoList")]
|
public ResponseResult GetItemInfoList([FromBody] dynamic query)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbItemInfo = m.GetItemInfoList(query, RequestInfo);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
}
|