shgx_tz_mom/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs

196 lines
7.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
{
/// <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);
}
/// <summary>
/// 查询成品库当前货物表列表(下拉菜单展示)
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("dict")]
public IActionResult QueryWmGoodsNowProductionDict([FromQuery] WmGoodsNowProductionDictDto parm)
{
var response = _WmGoodsNowProductionService.GetDictData(parm);
return SUCCESS(response);
}
/// <summary>
/// 批量查询 父子节点
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("patchsearch")]
public IActionResult Querypatchsearch(WmGoodsNowProductionQueryDto parm)
{
var response = _WmGoodsNowProductionService.QuerypatchsearchList(parm);
return SUCCESS(response);
}
/// <summary>
/// 移动端 短批次号查询
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("shortPatchsearch")]
public IActionResult QueryshortPatch(CommonQueryDto parm)
{
(List<WmGoodShortPackageCodeDto>, int) response = _WmGoodsNowProductionService.QueryshortPatch(parm);
var json = new
{
list = response.Item1,
total = response.Item2
};
return ToResponse(new ApiResult(200, "ok", json));
}
/// <summary>
/// 移动端 短批次号详细信息查询
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("patchsearchdetail")]
public IActionResult Patchsearchdetail(WmGoodsNowProductionQueryDto parm)
{
var response = _WmGoodsNowProductionService.Patchsearchdetail(parm);
var json = new
{
list = response.Item1,
total = response.Item2
};
return ToResponse(new ApiResult(200, "ok", json));
}
/// <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);
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)
{
long[] idsArr = Tools.SpitLongArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _WmGoodsNowProductionService.Delete(idsArr);
return ToResponse(response);
}
/// <summary>
/// 修改库存数量
/// </summary>
/// <param name="id"></param>
/// <param name="stack_num"></param>
/// <returns></returns>
[HttpGet("modifyInventoryQuantity")]
[Log(Title = "修改库存数量", BusinessType = BusinessType.UPDATE)]
public IActionResult ModifyInventoryQuantity(string id, int stack_num)
{
if (string.IsNullOrEmpty(id))
{
return SUCCESS(null);
}
var response = _WmGoodsNowProductionService.ModifyInventoryQuantity(id, stack_num);
return SUCCESS(response);
}
/// <summary>
/// 批量修改成品库仓库编码
/// </summary>
/// <returns></returns>
[HttpPost("batchUpdateGoodsNowProductionLocationCode")]
[ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:edit")]
[Log(Title = "批量修改成品库仓库编码(移入呆滞品)", BusinessType = BusinessType.UPDATE)]
public IActionResult BatchUpdateGoodsNowProductionLocationCode([FromBody] BatchUpdateLocationCodeDto parm)
{
parm.UpdatedBy = HttpContext.GetName();
parm.UpdatedTime = DateTime.Now;
var response = _WmGoodsNowProductionService.BatchUpdateLocationCode(parm);
return SUCCESS(response);
}
}
}