using System.Dynamic;
|
using Microsoft.AspNetCore.Mvc;
|
using NewPdaSqlServer.Dto.service;
|
using NewPdaSqlServer.entity;
|
using NewPdaSqlServer.service.Warehouse;
|
using NewPdaSqlServer.util;
|
|
namespace NewPdaSqlServer.Controllers.Warehouse;
|
|
/// <summary>
|
/// 生产补料相关接口
|
/// </summary>
|
[Route("api/[controller]")]
|
[ApiController]
|
public class MesStrkController : ControllerBase
|
{
|
private readonly MesStrkManager _manager = new();
|
|
#region 基础
|
/***进入模版管理可以修改模版***/
|
|
/// <summary>
|
/// 获取所有
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("GetList")]
|
public ResponseResult GetList()
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.GetList();
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 根据主键获取
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("GetById")]
|
public ResponseResult GetById(int id)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.GetById(id);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 根据主键删除
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("DeleteByIds")]
|
public ResponseResult DeleteByIds([FromBody] object[] ids)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.DeleteByIds(ids);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 添加
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("Insert")]
|
public ResponseResult Add([FromBody] MesItemBl data)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.Insert(data);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 添加返回自增
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("InsertReturnIdentity")]
|
public ResponseResult InsertReturnIdentity([FromBody] MesItemBl data)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.InsertReturnIdentity(data);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 修改
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("Update")]
|
public ResponseResult Update([FromBody] MesItemBl data)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.Update(data);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
#endregion
|
|
|
/// <summary>
|
/// 获取受托入库申请列表
|
/// </summary>
|
/// <returns>受托入库申请列表</returns>
|
[HttpPost("GetStrkBillNo")]
|
public ResponseResult GetStrkBillNo(WarehouseQuery query)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.GetStrkBillNo(query);
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 根据单号获取受托入库单明细
|
/// </summary>
|
/// <param name="query">查询参数</param>
|
/// <returns>受托入库单明细列表</returns>
|
[HttpPost("GetMesItemDetailByBillNo")]
|
public ResponseResult GetMesItemDetailByBillNo(
|
[FromBody] WarehouseQuery query)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.GetMesItemDetailByBillNo(query);
|
|
if (resultInfos.tbBillList.Count < 1)
|
{
|
return new ResponseResult
|
{
|
status = 1,
|
message = "该申请单号不存在或未审核!!!",
|
data = ""
|
};
|
}
|
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
/// <summary>
|
/// 获取条码信息和物料信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("XsthScanBarcode")]
|
public ResponseResult XsthScanBarcode(WarehouseQuery unity)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = _manager.XsthScanBarcode(unity);
|
return new ResponseResult
|
{
|
status = 0,
|
message = resultInfos.tbBillList,
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
|
}
|