110 lines
3.8 KiB
C#
110 lines
3.8 KiB
C#
|
|
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.Business.IBusinessService;
|
|||
|
|
|
|||
|
|
//创建时间: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)
|
|||
|
|
{
|
|||
|
|
int[] idsArr = Tools.SpitIntArrary(ids);
|
|||
|
|
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
|||
|
|
|
|||
|
|
var response = _WmGoodsNowProductionService.Delete(idsArr);
|
|||
|
|
|
|||
|
|
return ToResponse(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|