2024-03-17 14:53:16 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using ZR.Model.Dto;
|
|
|
|
|
|
|
|
|
|
|
|
using ZR.Admin.WebApi.Extensions;
|
|
|
|
|
|
using ZR.Admin.WebApi.Filters;
|
|
|
|
|
|
using ZR.Service.mes.wms.IService;
|
|
|
|
|
|
using ZR.Model.MES.wms.Dto;
|
|
|
|
|
|
using ZR.Model.MES.wms;
|
|
|
|
|
|
using Org.BouncyCastle.Crypto;
|
|
|
|
|
|
|
|
|
|
|
|
//创建时间:2024-03-16
|
|
|
|
|
|
namespace ZR.Admin.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 物料记录表增删改查
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
|
|
|
|
|
[Route("/mes/wm/WmMaterial")]
|
|
|
|
|
|
public class WmMaterialController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 物料记录表接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IWmMaterialService _WmMaterialService;
|
|
|
|
|
|
|
|
|
|
|
|
public WmMaterialController(IWmMaterialService WmMaterialService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_WmMaterialService = WmMaterialService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询物料记录表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wms:wmmaterial:list")]
|
|
|
|
|
|
public IActionResult QueryWmMaterial([FromQuery] WmMaterialQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmMaterialService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询物料记录表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wms:wmmaterial:query")]
|
|
|
|
|
|
public IActionResult GetWmMaterial(string Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmMaterialService.GetInfo(Id);
|
|
|
|
|
|
|
2024-03-19 11:08:28 +08:00
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
2024-03-17 14:53:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加物料记录表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wms:wmmaterial:add")]
|
|
|
|
|
|
[Log(Title = "物料记录表", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddWmMaterial([FromBody] WmMaterialDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<WmMaterial>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _WmMaterialService.AddWmMaterial(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新物料记录表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wms:wmmaterial:edit")]
|
|
|
|
|
|
[Log(Title = "物料记录表", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateWmMaterial([FromBody] WmMaterialDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<WmMaterial>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _WmMaterialService.UpdateWmMaterial(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除物料记录表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpDelete("{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wms:wmmaterial:delete")]
|
|
|
|
|
|
[Log(Title = "物料记录表", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteWmMaterial(string ids)
|
|
|
|
|
|
{
|
|
|
|
|
|
long[] idsArr = Tools.SpitLongArrary(ids);
|
|
|
|
|
|
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-19 11:08:28 +08:00
|
|
|
|
var response = _WmMaterialService.Delete(idsArr);
|
2024-03-17 14:53:16 +08:00
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|