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

120 lines
4.0 KiB
C#
Raw Normal View History

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.mes.wms.IService;
//创建时间2024-08-08
namespace ZR.Admin.WebApi.Controllers
{
/// <summary>
/// 一次合格品仓库记录表
/// </summary>
[Route("/mes/wm/WmOneTimeRecord")]
public class WmOneTimeRecordController : BaseController
{
/// <summary>
/// 一次合格品仓库记录表接口
/// </summary>
private readonly IWmOneTimeRecordService _WmOneTimeRecordService;
public WmOneTimeRecordController(IWmOneTimeRecordService WmOneTimeRecordService)
{
_WmOneTimeRecordService = WmOneTimeRecordService;
}
/// <summary>
/// 查询一次合格品仓库记录表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
2024-11-15 18:51:05 +08:00
//[ActionPermissionFilter(Permission = "business:wmonetimerecord:list")]
public IActionResult QueryWmOneTimeRecord([FromQuery] WmOneTimeRecordQueryDto parm)
{
var response = _WmOneTimeRecordService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询一次合格品仓库记录表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
2024-11-15 18:51:05 +08:00
//[ActionPermissionFilter(Permission = "business:wmonetimerecord:query")]
public IActionResult GetWmOneTimeRecord(string Id)
{
var response = _WmOneTimeRecordService.GetInfo(Id);
var info = response.Adapt<WmOneTimeRecord>();
return SUCCESS(info);
}
/// <summary>
/// 添加一次合格品仓库记录表
/// </summary>
/// <returns></returns>
[HttpPost]
2024-11-15 18:51:05 +08:00
//[ActionPermissionFilter(Permission = "business:wmonetimerecord:add")]
[Log(Title = "一次合格品仓库记录表", BusinessType = BusinessType.INSERT)]
public IActionResult AddWmOneTimeRecord([FromBody] WmOneTimeRecordDto parm)
{
var modal = parm.Adapt<WmOneTimeRecord>().ToCreate(HttpContext);
var response = _WmOneTimeRecordService.AddWmOneTimeRecord(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新一次合格品仓库记录表
/// </summary>
/// <returns></returns>
[HttpPut]
2024-11-15 18:51:05 +08:00
//[ActionPermissionFilter(Permission = "business:wmonetimerecord:edit")]
[Log(Title = "一次合格品仓库记录表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateWmOneTimeRecord([FromBody] WmOneTimeRecordDto parm)
{
var modal = parm.Adapt<WmOneTimeRecord>().ToUpdate(HttpContext);
var response = _WmOneTimeRecordService.UpdateWmOneTimeRecord(modal);
return ToResponse(response);
}
/// <summary>
/// 删除一次合格品仓库记录表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
2024-11-15 18:51:05 +08:00
//[ActionPermissionFilter(Permission = "business:wmonetimerecord:delete")]
[Log(Title = "一次合格品仓库记录表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteWmOneTimeRecord(string ids)
{
string[] idsArr = ids.Split(',');
if (idsArr.Length <= 0)
{
return ToResponse(ApiResult.Error($"删除失败Id 不能为空"));
}
var response = _WmOneTimeRecordService.Delete(idsArr);
return ToResponse(response);
}
2025-03-24 15:23:17 +08:00
/// <summary>
///自动生成一次合格仓库记录日志
/// </summary>
/// <returns></returns>
[HttpPost("GenerateWmOneTimeRecord")]
public IActionResult GenerateWmOneTimeRecord([FromBody] WmOneTimeRecordGenerateDto parm)
{
var response = _WmOneTimeRecordService.GenerateWmOneTimeRecord02(parm);
2025-03-24 15:23:17 +08:00
return SUCCESS(response);
}
}
}