Files
sy_hx_pbl_backend/DOAN.Admin.WebApi/Controllers/PBL/StoragelocationController.cs

104 lines
3.2 KiB
C#
Raw Normal View History

2024-09-23 11:54:56 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Model.PBL.Dto;
using DOAN.Model.PBL;
using DOAN.Service.PBL.IService;
using DOAN.Admin.WebApi.Filters;
//创建时间2024-09-23
2024-10-21 14:50:20 +08:00
namespace DOAN.Admin.WebApi.Controllers.PBL
2024-09-23 11:54:56 +08:00
{
/// <summary>
/// 料架表
/// </summary>
[Verify]
[Route("PBL/Storagelocation")]
public class StoragelocationController : BaseController
{
/// <summary>
/// 料架表接口
/// </summary>
private readonly IStoragelocationService _StoragelocationService;
public StoragelocationController(IStoragelocationService StoragelocationService)
{
_StoragelocationService = StoragelocationService;
}
/// <summary>
/// 查询料架表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "storagelocation:list")]
public IActionResult QueryStoragelocation([FromQuery] StoragelocationQueryDto parm)
{
var response = _StoragelocationService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询料架表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "storagelocation:query")]
public IActionResult GetStoragelocation(int Id)
{
var response = _StoragelocationService.GetInfo(Id);
var info = response.Adapt<StoragelocationDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加料架表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "storagelocation:add")]
[Log(Title = "料架表", BusinessType = BusinessType.INSERT)]
public IActionResult AddStoragelocation([FromBody] StoragelocationDto parm)
{
var modal = parm.Adapt<Storagelocation>().ToCreate(HttpContext);
var response = _StoragelocationService.AddStoragelocation(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新料架表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "storagelocation:edit")]
[Log(Title = "料架表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateStoragelocation([FromBody] StoragelocationDto parm)
{
var modal = parm.Adapt<Storagelocation>().ToUpdate(HttpContext);
2025-01-16 10:13:50 +08:00
2024-09-23 11:54:56 +08:00
var response = _StoragelocationService.UpdateStoragelocation(modal);
return ToResponse(response);
}
/// <summary>
/// 删除料架表
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "storagelocation:delete")]
[Log(Title = "料架表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteStoragelocation([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<int>(ids);
return ToResponse(_StoragelocationService.Delete(idArr));
}
}
}