2025-12-26 14:39:45 +08:00
|
|
|
|
using DOAN.Admin.WebApi.Filters;
|
2025-12-25 12:02:03 +08:00
|
|
|
|
using DOAN.Model.BZFM;
|
2025-12-26 14:39:45 +08:00
|
|
|
|
using DOAN.Model.BZFM.Dto;
|
|
|
|
|
|
using DOAN.Service.BZFM;
|
2025-12-25 12:02:03 +08:00
|
|
|
|
using DOAN.Service.BZFM.IBZFMService;
|
2025-12-26 14:39:45 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2025-12-25 12:02:03 +08:00
|
|
|
|
|
|
|
|
|
|
//创建时间:2025-12-25
|
|
|
|
|
|
namespace DOAN.Admin.WebApi.Controllers.BZFM
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 物料表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
2025-12-25 14:27:40 +08:00
|
|
|
|
[Route("mes/productionMaterial/MmMaterial")]
|
2025-12-25 12:02:03 +08:00
|
|
|
|
public class MmMaterialController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 物料表接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IMmMaterialService _MmMaterialService;
|
|
|
|
|
|
|
|
|
|
|
|
public MmMaterialController(IMmMaterialService MmMaterialService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_MmMaterialService = MmMaterialService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询物料表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmmaterial:list")]
|
|
|
|
|
|
public IActionResult QueryMmMaterial([FromQuery] MmMaterialQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _MmMaterialService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询物料表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmmaterial:query")]
|
|
|
|
|
|
public IActionResult GetMmMaterial(int Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _MmMaterialService.GetInfo(Id);
|
|
|
|
|
|
|
|
|
|
|
|
var info = response.Adapt<MmMaterialDto>();
|
|
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加物料表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmmaterial:add")]
|
|
|
|
|
|
[Log(Title = "物料表", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddMmMaterial([FromBody] MmMaterialDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<MmMaterial>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _MmMaterialService.AddMmMaterial(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新物料表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmmaterial:edit")]
|
|
|
|
|
|
[Log(Title = "物料表", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateMmMaterial([FromBody] MmMaterialDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<MmMaterial>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _MmMaterialService.UpdateMmMaterial(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除物料表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("delete/{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmmaterial:delete")]
|
|
|
|
|
|
[Log(Title = "物料表", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteMmMaterial([FromRoute]string ids)
|
|
|
|
|
|
{
|
|
|
|
|
|
var idArr = Tools.SplitAndConvert<int>(ids);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(_MmMaterialService.Delete(idArr));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-26 14:53:50 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取物料表类别下拉框
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("GetMmMaterialCategoryOptions")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult GetMmMaterialCategoryOptions([FromBody] MmMaterialCategoryDto parm)
|
2025-12-26 14:39:45 +08:00
|
|
|
|
{
|
2025-12-26 14:53:50 +08:00
|
|
|
|
var response = _MmMaterialService.GetMmMaterialCategoryOptions(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
2025-12-26 14:39:45 +08:00
|
|
|
|
}
|
2025-12-26 14:53:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-12-25 12:02:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|