103 lines
3.5 KiB
C#
103 lines
3.5 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using ZR.Admin.WebApi.Extensions;
|
||
using ZR.Model.MES.wms;
|
||
using ZR.Model.MES.wms.Dto;
|
||
using ZR.Service.mes.wms.IService;
|
||
|
||
//创建时间:2024-04-18
|
||
namespace ZR.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 仓库操作
|
||
/// </summary>
|
||
// [Verify]
|
||
[Route("/mes/wm/WmGoodsAction")]
|
||
public class WmGoodsActionController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 仓库操作
|
||
/// </summary>
|
||
private readonly IWmGoodsChangeLogService _WmGoodsChangeLogService;
|
||
private readonly IWmGoodsActionService _WmGoodsActionService;
|
||
|
||
public WmGoodsActionController(IWmGoodsChangeLogService WmGoodsChangeLogService, IWmGoodsActionService wmGoodsActionService)
|
||
{
|
||
_WmGoodsChangeLogService = WmGoodsChangeLogService;
|
||
_WmGoodsActionService = wmGoodsActionService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 拼箱
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("doConsolidationGoods")]
|
||
[Log(Title = "拼箱", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult doConsolidationGoods([FromBody] WmGoodsConsolidationDto parm)
|
||
{
|
||
try
|
||
{
|
||
WmGoodsChangeLog response = _WmGoodsActionService.doConsolidationGoods(parm);
|
||
if (response == null)
|
||
{
|
||
return ToResponse(new ApiResult(500, "拼箱异常!", "拼箱异常!"));
|
||
}
|
||
return SUCCESS(response);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
return ToResponse(new ApiResult(500, ex.Message, "拼箱异常!"));
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 拆箱
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("doUnpackingGoods")]
|
||
[Log(Title = "拆箱", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult doUnpackingGoods([FromBody] WmGoodsUnpackingDto parm)
|
||
{
|
||
try
|
||
{
|
||
string createName = HttpContext.GetName();
|
||
parm.CreateBy = createName;
|
||
WmGoodsChangeLog response = _WmGoodsActionService.doUnpackingGoods(parm);
|
||
if (response == null)
|
||
{
|
||
return ToResponse(new ApiResult(500, "拆箱异常!", "拆箱异常!"));
|
||
}
|
||
return SUCCESS(response);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
return ToResponse(new ApiResult(500, ex.Message, "拆箱异常!"));
|
||
}
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 拼箱2 多箱拼一起
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("doConsolidationGoods2")]
|
||
[Log(Title = "拼箱2", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult DoConsolidationGoods2([FromBody] WmGoodsConsolidationDto2 parm)
|
||
{
|
||
try
|
||
{
|
||
string createName = HttpContext.GetName();
|
||
parm.CreateBy = createName;
|
||
WmGoodsChangeLog response = _WmGoodsActionService.DoConsolidationGoods2(parm);
|
||
if (response == null)
|
||
{
|
||
return ToResponse(new ApiResult(500, "拼箱异常!", "拼箱异常!"));
|
||
}
|
||
return SUCCESS(response);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
return ToResponse(new ApiResult(500, ex.Message, "拼箱异常!" + ex.Message));
|
||
}
|
||
}
|
||
}
|
||
} |