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-03-22 namespace ZR.Admin.WebApi.Controllers { /// /// 成品库当前货物表 /// [Verify] [Route("/mes/wm/WmGoodsNowProduction")] public class WmGoodsNowProductionController : BaseController { /// /// 成品库当前货物表接口 /// private readonly IWmGoodsNowProductionService _WmGoodsNowProductionService; public WmGoodsNowProductionController(IWmGoodsNowProductionService WmGoodsNowProductionService) { _WmGoodsNowProductionService = WmGoodsNowProductionService; } /// /// 查询成品库当前货物表列表 /// /// /// [HttpGet("list")] [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:list")] public IActionResult QueryWmGoodsNowProduction([FromQuery] WmGoodsNowProductionQueryDto parm) { var response = _WmGoodsNowProductionService.GetList(parm); return SUCCESS(response); } /// /// 批量查询 父子节点 /// /// /// [HttpGet("patchsearch")] public IActionResult Querypatchsearch(WmGoodsNowProductionQueryDto parm) { var response = _WmGoodsNowProductionService.QuerypatchsearchList(parm); return SUCCESS(response); } /// /// 移动端 短批次号查询 /// /// /// [HttpGet("shortPatchsearch")] public IActionResult QueryshortPatch(WmGoodsNowProductionQueryDto parm) { var response = _WmGoodsNowProductionService.QueryshortPatch(parm); return SUCCESS(response); } [HttpGet("patchsearchdetail")] public IActionResult Patchsearchdetail(WmGoodsNowProductionQueryDto parm) { var response = _WmGoodsNowProductionService.Patchsearchdetail(parm); return SUCCESS(response); } /// /// 查询成品库当前货物表详情 /// /// /// [HttpGet("{Id}")] [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:query")] public IActionResult GetWmGoodsNowProduction(string Id) { var response = _WmGoodsNowProductionService.GetInfo(Id); var info = response.Adapt(); return SUCCESS(info); } /// /// 添加成品库当前货物表 /// /// [HttpPost] [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:add")] [Log(Title = "成品库当前货物表", BusinessType = BusinessType.INSERT)] public IActionResult AddWmGoodsNowProduction([FromBody] WmGoodsNowProductionDto parm) { var modal = parm.Adapt().ToCreate(HttpContext); var response = _WmGoodsNowProductionService.AddWmGoodsNowProduction(modal); return SUCCESS(response); } /// /// 更新成品库当前货物表 /// /// [HttpPut] [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:edit")] [Log(Title = "成品库当前货物表", BusinessType = BusinessType.UPDATE)] public IActionResult UpdateWmGoodsNowProduction([FromBody] WmGoodsNowProductionDto parm) { var modal = parm.Adapt().ToUpdate(HttpContext); var response = _WmGoodsNowProductionService.UpdateWmGoodsNowProduction(modal); return ToResponse(response); } /// /// 删除成品库当前货物表 /// /// [HttpDelete("{ids}")] [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:delete")] [Log(Title = "成品库当前货物表", BusinessType = BusinessType.DELETE)] public IActionResult DeleteWmGoodsNowProduction(string ids) { long[] idsArr = Tools.SpitLongArrary(ids); if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); } var response = _WmGoodsNowProductionService.Delete(idsArr); return ToResponse(response); } } }