仓库管理:checklog
This commit is contained in:
110
ZR.Admin.WebApi/Controllers/mes/wms/WmCheckLogController.cs
Normal file
110
ZR.Admin.WebApi/Controllers/mes/wms/WmCheckLogController.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
|
||||
//创建时间:2024-03-26
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 盘点记录
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("/mes/wm//WmCheckLog")]
|
||||
public class WmCheckLogController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 盘点记录接口
|
||||
/// </summary>
|
||||
private readonly IWmCheckLogService _WmCheckLogService;
|
||||
|
||||
public WmCheckLogController(IWmCheckLogService WmCheckLogService)
|
||||
{
|
||||
_WmCheckLogService = WmCheckLogService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询盘点记录列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "business:wmchecklog:list")]
|
||||
public IActionResult QueryWmCheckLog([FromQuery] WmCheckLogQueryDto parm)
|
||||
{
|
||||
var response = _WmCheckLogService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询盘点记录详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "business:wmchecklog:query")]
|
||||
public IActionResult GetWmCheckLog(int Id)
|
||||
{
|
||||
var response = _WmCheckLogService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<WmCheckLog>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加盘点记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "business:wmchecklog:add")]
|
||||
[Log(Title = "盘点记录", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddWmCheckLog([FromBody] WmCheckLogDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<WmCheckLog>().ToCreate(HttpContext);
|
||||
|
||||
var response = _WmCheckLogService.AddWmCheckLog(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新盘点记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "business:wmchecklog:edit")]
|
||||
[Log(Title = "盘点记录", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateWmCheckLog([FromBody] WmCheckLogDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<WmCheckLog>().ToUpdate(HttpContext);
|
||||
var response = _WmCheckLogService.UpdateWmCheckLog(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除盘点记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "business:wmchecklog:delete")]
|
||||
[Log(Title = "盘点记录", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteWmCheckLog(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _WmCheckLogService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user