2024-03-22 09:29:40 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2024-04-11 19:37:03 +08:00
|
|
|
|
using System.Reflection.Metadata;
|
2024-03-22 09:29:40 +08:00
|
|
|
|
using ZR.Admin.WebApi.Extensions;
|
|
|
|
|
|
using ZR.Admin.WebApi.Filters;
|
|
|
|
|
|
using ZR.Model.MES.wms;
|
|
|
|
|
|
using ZR.Model.MES.wms.Dto;
|
2024-03-22 09:53:34 +08:00
|
|
|
|
using ZR.Service.mes.wms.IService;
|
2024-03-22 09:29:40 +08:00
|
|
|
|
|
|
|
|
|
|
//创建时间:2024-03-22
|
|
|
|
|
|
namespace ZR.Admin.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 成品库当前货物表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
|
|
|
|
|
[Route("/mes/wm/WmGoodsNowProduction")]
|
|
|
|
|
|
public class WmGoodsNowProductionController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 成品库当前货物表接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IWmGoodsNowProductionService _WmGoodsNowProductionService;
|
|
|
|
|
|
|
|
|
|
|
|
public WmGoodsNowProductionController(IWmGoodsNowProductionService WmGoodsNowProductionService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_WmGoodsNowProductionService = WmGoodsNowProductionService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询成品库当前货物表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:list")]
|
|
|
|
|
|
public IActionResult QueryWmGoodsNowProduction([FromQuery] WmGoodsNowProductionQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmGoodsNowProductionService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-29 17:00:38 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询成品库当前货物表列表(下拉菜单展示)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("dict")]
|
|
|
|
|
|
public IActionResult QueryWmGoodsNowProductionDict([FromQuery] WmGoodsNowProductionDictDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmGoodsNowProductionService.GetDictData(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-22 09:29:40 +08:00
|
|
|
|
|
2024-04-02 17:11:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 批量查询 父子节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("patchsearch")]
|
|
|
|
|
|
public IActionResult Querypatchsearch(WmGoodsNowProductionQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmGoodsNowProductionService.QuerypatchsearchList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2024-04-07 19:03:58 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 移动端 短批次号查询
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("shortPatchsearch")]
|
2024-04-25 12:49:18 +08:00
|
|
|
|
public IActionResult QueryshortPatch(CommonQueryDto parm)
|
2024-04-07 19:03:58 +08:00
|
|
|
|
{
|
2024-04-25 12:49:18 +08:00
|
|
|
|
List<WmGoodShortPackageCodeDto> response = _WmGoodsNowProductionService.QueryshortPatch(parm);
|
|
|
|
|
|
var json = new
|
|
|
|
|
|
{
|
|
|
|
|
|
list = response,
|
|
|
|
|
|
total = response.Count
|
|
|
|
|
|
};
|
|
|
|
|
|
return ToResponse(new ApiResult(200, "ok", json));
|
2024-04-07 19:03:58 +08:00
|
|
|
|
}
|
2024-04-08 11:01:42 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 移动端 短批次号查询
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2024-04-07 19:03:58 +08:00
|
|
|
|
[HttpGet("patchsearchdetail")]
|
|
|
|
|
|
public IActionResult Patchsearchdetail(WmGoodsNowProductionQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmGoodsNowProductionService.Patchsearchdetail(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2024-04-02 17:11:30 +08:00
|
|
|
|
|
2024-03-22 09:29:40 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询成品库当前货物表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:query")]
|
|
|
|
|
|
public IActionResult GetWmGoodsNowProduction(string Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _WmGoodsNowProductionService.GetInfo(Id);
|
2024-04-25 12:49:18 +08:00
|
|
|
|
|
2024-03-22 09:29:40 +08:00
|
|
|
|
var info = response.Adapt<WmGoodsNowProduction>();
|
|
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加成品库当前货物表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:add")]
|
|
|
|
|
|
[Log(Title = "成品库当前货物表", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddWmGoodsNowProduction([FromBody] WmGoodsNowProductionDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<WmGoodsNowProduction>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _WmGoodsNowProductionService.AddWmGoodsNowProduction(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新成品库当前货物表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:edit")]
|
|
|
|
|
|
[Log(Title = "成品库当前货物表", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateWmGoodsNowProduction([FromBody] WmGoodsNowProductionDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<WmGoodsNowProduction>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _WmGoodsNowProductionService.UpdateWmGoodsNowProduction(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除成品库当前货物表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpDelete("{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:delete")]
|
|
|
|
|
|
[Log(Title = "成品库当前货物表", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteWmGoodsNowProduction(string ids)
|
|
|
|
|
|
{
|
2024-03-23 14:31:50 +08:00
|
|
|
|
long[] idsArr = Tools.SpitLongArrary(ids);
|
2024-03-22 09:29:40 +08:00
|
|
|
|
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
|
|
|
|
|
|
|
|
|
|
|
var response = _WmGoodsNowProductionService.Delete(idsArr);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-11 19:37:03 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 修改库存数量
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
/// <param name="stack_num"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("modifyInventoryQuantity")]
|
2024-04-25 12:49:18 +08:00
|
|
|
|
public IActionResult ModifyInventoryQuantity(string id, int stack_num)
|
2024-04-11 19:37:03 +08:00
|
|
|
|
{
|
2024-04-25 12:49:18 +08:00
|
|
|
|
if (string.IsNullOrEmpty(id))
|
2024-04-11 19:37:03 +08:00
|
|
|
|
{
|
|
|
|
|
|
return SUCCESS(null);
|
|
|
|
|
|
}
|
2024-04-25 12:49:18 +08:00
|
|
|
|
var response = _WmGoodsNowProductionService.ModifyInventoryQuantity(id, stack_num);
|
|
|
|
|
|
return SUCCESS(response);
|
2024-04-11 19:37:03 +08:00
|
|
|
|
}
|
2024-03-22 09:29:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|