Files
shanghaigangxiangtuzhuangMES/ZR.Admin.WebApi/Controllers/mes/wms/WmBlankRecordController.cs

111 lines
3.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
using ZR.Model.Dto;
using ZR.Service.Business.IBusinessService;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Service.mes.wms.IService;
using ZR.Model.MES.wms.Dto;
using ZR.Model.MES.wms;
//创建时间2024-05-13
namespace ZR.Admin.WebApi.Controllers
{
/// <summary>
/// 毛坯库存库存变动记录表
/// </summary>
[Verify]
[Route("/mes/wm/WmBlankRecord")]
public class WmBlankRecordController : BaseController
{
/// <summary>
/// 毛坯库存库存变动记录表接口
/// </summary>
private readonly IWmBlankRecordService _WmBlankRecordService;
public WmBlankRecordController(IWmBlankRecordService WmBlankRecordService)
{
_WmBlankRecordService = WmBlankRecordService;
}
/// <summary>
/// 查询毛坯库存库存变动记录表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:wmblankrecord:list")]
public IActionResult QueryWmBlankRecord([FromQuery] WmBlankRecordQueryDto parm)
{
var response = _WmBlankRecordService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询毛坯库存库存变动记录表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:wmblankrecord:query")]
public IActionResult GetWmBlankRecord(string Id)
{
var response = _WmBlankRecordService.GetInfo(Id);
var info = response.Adapt<WmBlankRecord>();
return SUCCESS(info);
}
/// <summary>
/// 添加毛坯库存库存变动记录表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:wmblankrecord:add")]
[Log(Title = "毛坯库存库存变动记录表", BusinessType = BusinessType.INSERT)]
public IActionResult AddWmBlankRecord([FromBody] WmBlankRecordDto parm)
{
var modal = parm.Adapt<WmBlankRecord>().ToCreate(HttpContext);
var response = _WmBlankRecordService.AddWmBlankRecord(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新毛坯库存库存变动记录表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:wmblankrecord:edit")]
[Log(Title = "毛坯库存库存变动记录表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateWmBlankRecord([FromBody] WmBlankRecordDto parm)
{
var modal = parm.Adapt<WmBlankRecord>().ToUpdate(HttpContext);
var response = _WmBlankRecordService.UpdateWmBlankRecord(modal);
return ToResponse(response);
}
/// <summary>
/// 删除毛坯库存库存变动记录表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:wmblankrecord:delete")]
[Log(Title = "毛坯库存库存变动记录表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteWmBlankRecord(string ids)
{
string[] idsArr = ids.Split(',');
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _WmBlankRecordService.Delete(idsArr);
return ToResponse(response);
}
}
}