Files
shanghaigangxiangtuzhuangMES/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs
2024-03-23 14:31:59 +08:00

110 lines
3.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
[Verify]
[Route("/mes/wm/WmGoodsNowProduction")]
public class WmGoodsNowProductionController : BaseController
{
/// <summary>
/// 成品库当前货物表接口
/// </summary>
private readonly IWmGoodsNowProductionService _WmGoodsNowProductionService;
public WmGoodsNowProductionController(IWmGoodsNowProductionService WmGoodsNowProductionService)
{
_WmGoodsNowProductionService = WmGoodsNowProductionService;
}
/// <summary>
/// 查询成品库当前货物表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:list")]
public IActionResult QueryWmGoodsNowProduction([FromQuery] WmGoodsNowProductionQueryDto parm)
{
var response = _WmGoodsNowProductionService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询成品库当前货物表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:query")]
public IActionResult GetWmGoodsNowProduction(string Id)
{
var response = _WmGoodsNowProductionService.GetInfo(Id);
var info = response.Adapt<WmGoodsNowProduction>();
return SUCCESS(info);
}
/// <summary>
/// 添加成品库当前货物表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:add")]
[Log(Title = "成品库当前货物表", BusinessType = BusinessType.INSERT)]
public IActionResult AddWmGoodsNowProduction([FromBody] WmGoodsNowProductionDto parm)
{
var modal = parm.Adapt<WmGoodsNowProduction>().ToCreate(HttpContext);
var response = _WmGoodsNowProductionService.AddWmGoodsNowProduction(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新成品库当前货物表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:edit")]
[Log(Title = "成品库当前货物表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateWmGoodsNowProduction([FromBody] WmGoodsNowProductionDto parm)
{
var modal = parm.Adapt<WmGoodsNowProduction>().ToUpdate(HttpContext);
var response = _WmGoodsNowProductionService.UpdateWmGoodsNowProduction(modal);
return ToResponse(response);
}
/// <summary>
/// 删除成品库当前货物表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:delete")]
[Log(Title = "成品库当前货物表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteWmGoodsNowProduction(string ids)
{
long[] idsArr = Tools.SpitLongArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _WmGoodsNowProductionService.Delete(idsArr);
return ToResponse(response);
}
}
}