2025-12-25 12:02:03 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using DOAN.Model.BZFM.Dto;
|
|
|
|
|
|
using DOAN.Model.BZFM;
|
|
|
|
|
|
using DOAN.Service.BZFM.IBZFMService;
|
|
|
|
|
|
using DOAN.Admin.WebApi.Filters;
|
|
|
|
|
|
|
|
|
|
|
|
//创建时间:2025-12-25
|
|
|
|
|
|
namespace DOAN.Admin.WebApi.Controllers.BZFM
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 库位表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
2025-12-25 14:27:40 +08:00
|
|
|
|
[Route("mes/productionMaterial/MmLocation")]
|
2025-12-25 12:02:03 +08:00
|
|
|
|
public class MmLocationController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 库位表接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IMmLocationService _MmLocationService;
|
|
|
|
|
|
|
|
|
|
|
|
public MmLocationController(IMmLocationService MmLocationService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_MmLocationService = MmLocationService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询库位表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmlocation:list")]
|
|
|
|
|
|
public IActionResult QueryMmLocation([FromQuery] MmLocationQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _MmLocationService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询库位表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmlocation:query")]
|
|
|
|
|
|
public IActionResult GetMmLocation(int Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _MmLocationService.GetInfo(Id);
|
|
|
|
|
|
|
|
|
|
|
|
var info = response.Adapt<MmLocationDto>();
|
|
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加库位表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmlocation:add")]
|
|
|
|
|
|
[Log(Title = "库位表", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddMmLocation([FromBody] MmLocationDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<MmLocation>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _MmLocationService.AddMmLocation(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新库位表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmlocation:edit")]
|
|
|
|
|
|
[Log(Title = "库位表", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateMmLocation([FromBody] MmLocationDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<MmLocation>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _MmLocationService.UpdateMmLocation(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除库位表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("delete/{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "mmlocation:delete")]
|
|
|
|
|
|
[Log(Title = "库位表", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteMmLocation([FromRoute]string ids)
|
|
|
|
|
|
{
|
|
|
|
|
|
var idArr = Tools.SplitAndConvert<int>(ids);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(_MmLocationService.Delete(idArr));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|