2024-08-08 17:14:03 +08:00
|
|
|
|
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")]
|
2024-08-08 17:14:03 +08:00
|
|
|
|
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")]
|
2024-08-08 17:14:03 +08:00
|
|
|
|
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")]
|
2024-08-08 17:14:03 +08:00
|
|
|
|
[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")]
|
2024-08-08 17:14:03 +08:00
|
|
|
|
[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")]
|
2024-08-08 17:14:03 +08:00
|
|
|
|
[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)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2025-06-02 09:07:55 +08:00
|
|
|
|
var response = _WmOneTimeRecordService.GenerateWmOneTimeRecord02(parm);
|
2025-03-24 15:23:17 +08:00
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-08-08 17:14:03 +08:00
|
|
|
|
}
|