230 lines
7.5 KiB
C#
230 lines
7.5 KiB
C#
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;
|
||
using Aliyun.OSS;
|
||
|
||
//创建时间:2024-04-17
|
||
namespace ZR.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 成品入库检验
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("/mes/wm/WmFgentryInspect")]
|
||
public class WmFgentryInspectController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 成品入库检验接口
|
||
/// </summary>
|
||
private readonly IWmFgentryInspectService _WmFgentryInspectService;
|
||
|
||
public WmFgentryInspectController(IWmFgentryInspectService WmFgentryInspectService)
|
||
{
|
||
_WmFgentryInspectService = WmFgentryInspectService;
|
||
}
|
||
/// <summary>
|
||
/// 把包装数据转换为检验数据
|
||
/// </summary>
|
||
/// <param name="workorder"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("transform")]
|
||
[AllowAnonymous]
|
||
[Log(Title = "把包装数据转换为检验数据", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult Transform(string workorder)
|
||
{
|
||
if(string.IsNullOrEmpty(workorder) == null)
|
||
{
|
||
return SUCCESS(workorder);
|
||
}
|
||
var response = _WmFgentryInspectService.TransformData(workorder);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询成品入库检验列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:list")]
|
||
public IActionResult QueryWmFgentryInspect([FromQuery] WmFgentryInspectQueryDto parm)
|
||
{
|
||
var response = _WmFgentryInspectService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询成品入库检验列表 一级
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("first_level_list")]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:list")]
|
||
public IActionResult QueryWmFgentryInspect_first([FromQuery] WmFgentryInspectQueryDto parm)
|
||
{
|
||
|
||
var response = _WmFgentryInspectService.GetList_first(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询成品入库检验列表 二级
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("second_level_list")]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:list")]
|
||
public IActionResult QueryWmFgentryInspect_second([FromQuery] WmFgentryInspectQueryDto parm)
|
||
{
|
||
var response = _WmFgentryInspectService.GetList_second(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询成品入库检验详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:query")]
|
||
public IActionResult GetWmFgentryInspect(int Id)
|
||
{
|
||
var response = _WmFgentryInspectService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<WmFgentryInspect>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加成品入库检验
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:add")]
|
||
[Log(Title = "成品入库检验", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddWmFgentryInspect([FromBody] WmFgentryInspectDto parm)
|
||
{
|
||
var modal = parm.Adapt<WmFgentryInspect>().ToCreate(HttpContext);
|
||
|
||
var response = _WmFgentryInspectService.AddWmFgentryInspect(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新成品入库检验
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:edit")]
|
||
[Log(Title = "成品入库检验", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateWmFgentryInspect([FromBody] WmFgentryInspectDto parm)
|
||
{
|
||
var modal = parm.Adapt<WmFgentryInspect>().ToUpdate(HttpContext);
|
||
var response = _WmFgentryInspectService.UpdateWmFgentryInspect(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除成品入库检验
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:delete")]
|
||
[Log(Title = "成品入库检验", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteWmFgentryInspect(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _WmFgentryInspectService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 批量修改合适数据
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("batchQualified")]
|
||
public IActionResult BatchQualified([FromBody]string[] packcode_select)
|
||
{
|
||
if (packcode_select == null || packcode_select.Length <= 0)
|
||
{
|
||
return SUCCESS(null);
|
||
}
|
||
|
||
var response = _WmFgentryInspectService.BatchQualified(packcode_select, HttpContext.GetName());
|
||
|
||
return ToResponse(response);
|
||
|
||
}
|
||
/// <summary>
|
||
/// 批量修改合适数据
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("batchUnQualified")]
|
||
public IActionResult BatchUnQualified([FromBody] string[] packcode_select)
|
||
{
|
||
if (packcode_select == null || packcode_select.Length <= 0)
|
||
{
|
||
return SUCCESS(null);
|
||
}
|
||
|
||
var response = _WmFgentryInspectService.BatchUnQualified(packcode_select, HttpContext.GetName());
|
||
|
||
return ToResponse(response);
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 设置全部合格
|
||
/// </summary>
|
||
/// <param name="packcode_select"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("setAllQualified")]
|
||
public IActionResult SetAllQualified(string workorder_selected)
|
||
{
|
||
if (string.IsNullOrEmpty(workorder_selected))
|
||
{
|
||
return SUCCESS(null);
|
||
}
|
||
|
||
var response = _WmFgentryInspectService.SetAllQualified(workorder_selected, HttpContext.GetName());
|
||
|
||
return ToResponse(response);
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 设置全部不合格
|
||
/// </summary>
|
||
/// <param name="packcode_select"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("setAllUnQualified")]
|
||
public IActionResult SetAllUnQualified(string workorder_selected)
|
||
{
|
||
if (string.IsNullOrEmpty(workorder_selected))
|
||
{
|
||
return SUCCESS(null);
|
||
}
|
||
|
||
var response = _WmFgentryInspectService.SetAllUnQualified(workorder_selected, HttpContext.GetName());
|
||
|
||
return ToResponse(response);
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
} |