2025-11-11 08:26:20 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2025-11-11 09:50:52 +08:00
|
|
|
|
using RIZO.Model.Mes.Material;
|
|
|
|
|
|
using RIZO.Model.Mes.Dto.Material;
|
|
|
|
|
|
using RIZO.Service.Mes.IMesService.Material;
|
2025-11-11 08:26:20 +08:00
|
|
|
|
|
|
|
|
|
|
//创建时间:2025-11-05
|
2025-11-11 09:50:52 +08:00
|
|
|
|
namespace RIZO.Admin.WebApi.Controllers.Mes.Material
|
2025-11-11 08:26:20 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 物料表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[AllowAnonymous] //先跳过验证
|
2025-11-11 09:50:52 +08:00
|
|
|
|
[Route("mes/MaterialInfo")]
|
2025-11-11 08:26:20 +08:00
|
|
|
|
public class MaterialInfoController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 物料表接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IMaterialInfoService _MaterialInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
public MaterialInfoController(IMaterialInfoService MaterialInfoService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_MaterialInfoService = MaterialInfoService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询物料表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialinfo:list")]
|
|
|
|
|
|
public IActionResult QueryMaterialInfo([FromQuery] MaterialInfoQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _MaterialInfoService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询物料表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialinfo:query")]
|
|
|
|
|
|
public IActionResult GetMaterialInfo(long Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _MaterialInfoService.GetInfo(Id);
|
|
|
|
|
|
|
|
|
|
|
|
var info = response.Adapt<MaterialInfoDto>();
|
|
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加物料表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialinfo:add")]
|
|
|
|
|
|
[Log(Title = "物料表", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddMaterialInfo([FromBody] MaterialInfoDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<MaterialInfo>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _MaterialInfoService.AddMaterialInfo(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新物料表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialinfo:edit")]
|
|
|
|
|
|
[Log(Title = "物料表", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateMaterialInfo([FromBody] MaterialInfoDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<MaterialInfo>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _MaterialInfoService.UpdateMaterialInfo(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除物料表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("delete/{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialinfo:delete")]
|
|
|
|
|
|
[Log(Title = "物料表", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteMaterialInfo([FromRoute]string ids)
|
|
|
|
|
|
{
|
|
|
|
|
|
var idArr = Tools.SplitAndConvert<long>(ids);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(_MaterialInfoService.Delete(idArr));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|