2024-03-22 08:54:11 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using ZR.Admin.WebApi.Extensions;
|
|
|
|
|
|
using ZR.Admin.WebApi.Filters;
|
|
|
|
|
|
using ZR.Model.MES.wms;
|
|
|
|
|
|
using ZR.Model.MES.wms.Dto;
|
|
|
|
|
|
using ZR.Service.mes.wms.IService;
|
|
|
|
|
|
|
|
|
|
|
|
//创建时间:2024-03-22
|
|
|
|
|
|
namespace ZR.Admin.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 出库货物记录表
|
|
|
|
|
|
/// </summary>
|
2024-03-28 15:36:38 +08:00
|
|
|
|
// [Verify]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
[Route("/mes/wm/WmGoodsOutProduction")]
|
|
|
|
|
|
public class WmGoodsOutProductionController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 出库货物记录表接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IWmGoodsOutProductionService _WmGoodsOutProductionService;
|
|
|
|
|
|
|
|
|
|
|
|
public WmGoodsOutProductionController(IWmGoodsOutProductionService WmGoodsOutProductionService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_WmGoodsOutProductionService = WmGoodsOutProductionService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询出库货物记录表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsoutproduction:list")]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
public IActionResult QueryWmGoodsOutProduction([FromQuery] WmGoodsOutProductionQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmGoodsOutProductionService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询出库货物记录表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsoutproduction:query")]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
public IActionResult GetWmGoodsOutProduction(string Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmGoodsOutProductionService.GetInfo(Id);
|
2024-06-07 11:04:26 +08:00
|
|
|
|
|
2024-03-22 08:54:11 +08:00
|
|
|
|
var info = response.Adapt<WmGoodsOutRecord>();
|
2024-03-22 08:54:11 +08:00
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加出库货物记录表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsoutproduction:add")]
|
2024-07-10 17:11:01 +08:00
|
|
|
|
[Log(Title = "添加出库货物记录表", BusinessType = BusinessType.INSERT)]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
public IActionResult AddWmGoodsOutProduction([FromBody] WmGoodsOutProductionDto parm)
|
|
|
|
|
|
{
|
2024-05-14 14:55:08 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<WmGoodsOutRecord>().ToCreate(HttpContext);
|
2024-03-22 08:54:11 +08:00
|
|
|
|
|
2024-05-14 14:55:08 +08:00
|
|
|
|
var response = _WmGoodsOutProductionService.AddWmGoodsOutProduction(modal);
|
2024-03-22 08:54:11 +08:00
|
|
|
|
|
2024-05-14 14:55:08 +08:00
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ToResponse(new ApiResult(500, ex.Message, "error"));
|
|
|
|
|
|
}
|
2024-06-07 11:04:26 +08:00
|
|
|
|
|
2024-03-22 08:54:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新出库货物记录表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsoutproduction:edit")]
|
2024-07-10 17:11:01 +08:00
|
|
|
|
[Log(Title = "更新出库货物记录表", BusinessType = BusinessType.UPDATE)]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
public IActionResult UpdateWmGoodsOutProduction([FromBody] WmGoodsOutProductionDto parm)
|
|
|
|
|
|
{
|
2024-03-22 08:54:11 +08:00
|
|
|
|
var modal = parm.Adapt<WmGoodsOutRecord>().ToUpdate(HttpContext);
|
2024-03-22 08:54:11 +08:00
|
|
|
|
var response = _WmGoodsOutProductionService.UpdateWmGoodsOutProduction(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除出库货物记录表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpDelete("{ids}")]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsoutproduction:delete")]
|
2024-07-10 17:11:01 +08:00
|
|
|
|
[Log(Title = "删除出库货物记录表", BusinessType = BusinessType.DELETE)]
|
2024-03-22 08:54:11 +08:00
|
|
|
|
public IActionResult DeleteWmGoodsOutProduction(string ids)
|
|
|
|
|
|
{
|
2024-03-23 14:31:50 +08:00
|
|
|
|
long[] idsArr = Tools.SpitLongArrary(ids);
|
2024-03-22 08:54:11 +08:00
|
|
|
|
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
|
|
|
|
|
|
|
|
|
|
|
var response = _WmGoodsOutProductionService.Delete(idsArr);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-23 18:42:44 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按批次出库
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("doPatchOutProduction")]
|
|
|
|
|
|
[Log(Title = "按批次出库", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult DoPatchOutProduction([FromBody] WmBatchGoodsOutProductionDto parm)
|
|
|
|
|
|
{
|
2024-06-28 08:37:21 +08:00
|
|
|
|
parm = parm.ToCreate(HttpContext);
|
2024-04-23 18:42:44 +08:00
|
|
|
|
string response = _WmGoodsOutProductionService.DoPatchOutProduction(parm);
|
2024-06-07 11:04:26 +08:00
|
|
|
|
if (response == "ok")
|
2024-04-23 18:42:44 +08:00
|
|
|
|
{
|
|
|
|
|
|
return ToResponse(new ApiResult(200, response, response));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return ToResponse(new ApiResult(500, response, response));
|
|
|
|
|
|
}
|
2024-06-07 11:04:26 +08:00
|
|
|
|
|
2024-04-23 18:42:44 +08:00
|
|
|
|
}
|
2024-03-22 08:54:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|