仓库-毛坯仓库添加,毛坯仓库日志添加

This commit is contained in:
2024-05-13 17:32:20 +08:00
parent 47dd0c4930
commit b4039d0b49
14 changed files with 791 additions and 0 deletions

View File

@@ -0,0 +1,136 @@
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;
//创建时间2024-05-13
namespace ZR.Admin.WebApi.Controllers
{
/// <summary>
/// 毛坯库存表
/// </summary>
[Verify]
[Route("/mes/wm/WmBlankInventory")]
public class WmBlankInventoryController : BaseController
{
/// <summary>
/// 毛坯库存表接口
/// </summary>
private readonly IWmBlankInventoryService _WmBlankInventoryService;
public WmBlankInventoryController(IWmBlankInventoryService WmBlankInventoryService)
{
_WmBlankInventoryService = WmBlankInventoryService;
}
/// <summary>
/// 查询毛坯库存表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:wmblankinventory:list")]
public IActionResult QueryWmBlankInventory([FromQuery] WmBlankInventoryQueryDto parm)
{
var response = _WmBlankInventoryService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询毛坯库存表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:wmblankinventory:query")]
public IActionResult GetWmBlankInventory(string Id)
{
var response = _WmBlankInventoryService.GetInfo(Id);
var info = response.Adapt<WmBlankInventory>();
return SUCCESS(info);
}
/// <summary>
/// 添加毛坯库存表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:wmblankinventory:add")]
[Log(Title = "毛坯库存表", BusinessType = BusinessType.INSERT)]
public IActionResult AddWmBlankInventory([FromBody] WmBlankInventoryDto parm)
{
try
{
var modal = parm.Adapt<WmBlankInventory>().ToCreate(HttpContext);
var response = _WmBlankInventoryService.AddWmBlankInventory(modal);
return SUCCESS(response);
}
catch (Exception ex)
{
return ToResponse(new ApiResult(500, ex.Message, null));
}
}
/// <summary>
/// 更新毛坯库存表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:wmblankinventory:edit")]
[Log(Title = "毛坯库存表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateWmBlankInventory([FromBody] WmBlankInventoryDto parm)
{
var modal = parm.Adapt<WmBlankInventory>().ToUpdate(HttpContext);
var response = _WmBlankInventoryService.UpdateWmBlankInventory(modal);
return ToResponse(response);
}
/// <summary>
/// 删除毛坯库存表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:wmblankinventory:delete")]
[Log(Title = "毛坯库存表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteWmBlankInventory(string ids)
{
string[] idsArr = ids.Split(',');
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _WmBlankInventoryService.Delete(idsArr);
return ToResponse(response);
}
/// <summary>
/// 物料清单数据同步
/// </summary>
/// <returns></returns>
[HttpPost("synchronousMaterial")]
[ActionPermissionFilter(Permission = "business:wmblankinventory:add")]
[Log(Title = "物料清单数据同步", BusinessType = BusinessType.INSERT)]
public IActionResult SynchronousMaterial([FromBody] WmBlankInventoryDto parm)
{
var modal = parm.Adapt<WmBlankInventory>().ToCreate(HttpContext);
var response = _WmBlankInventoryService.AddWmBlankInventory(modal);
return SUCCESS(response);
}
}
}

View File

@@ -0,0 +1,111 @@
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;
//创建时间2024-05-13
namespace ZR.Admin.WebApi.Controllers
{
/// <summary>
/// 毛坯库存库存变动记录表
/// </summary>
[Verify]
[Route("/mes/wm/WmBlankRecord")]
public class WmBlankRecordController : BaseController
{
/// <summary>
/// 毛坯库存库存变动记录表接口
/// </summary>
private readonly IWmBlankRecordService _WmBlankRecordService;
public WmBlankRecordController(IWmBlankRecordService WmBlankRecordService)
{
_WmBlankRecordService = WmBlankRecordService;
}
/// <summary>
/// 查询毛坯库存库存变动记录表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:wmblankrecord:list")]
public IActionResult QueryWmBlankRecord([FromQuery] WmBlankRecordQueryDto parm)
{
var response = _WmBlankRecordService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询毛坯库存库存变动记录表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:wmblankrecord:query")]
public IActionResult GetWmBlankRecord(string Id)
{
var response = _WmBlankRecordService.GetInfo(Id);
var info = response.Adapt<WmBlankRecord>();
return SUCCESS(info);
}
/// <summary>
/// 添加毛坯库存库存变动记录表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:wmblankrecord:add")]
[Log(Title = "毛坯库存库存变动记录表", BusinessType = BusinessType.INSERT)]
public IActionResult AddWmBlankRecord([FromBody] WmBlankRecordDto parm)
{
var modal = parm.Adapt<WmBlankRecord>().ToCreate(HttpContext);
var response = _WmBlankRecordService.AddWmBlankRecord(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新毛坯库存库存变动记录表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:wmblankrecord:edit")]
[Log(Title = "毛坯库存库存变动记录表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateWmBlankRecord([FromBody] WmBlankRecordDto parm)
{
var modal = parm.Adapt<WmBlankRecord>().ToUpdate(HttpContext);
var response = _WmBlankRecordService.UpdateWmBlankRecord(modal);
return ToResponse(response);
}
/// <summary>
/// 删除毛坯库存库存变动记录表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:wmblankrecord:delete")]
[Log(Title = "毛坯库存库存变动记录表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteWmBlankRecord(string ids)
{
string[] idsArr = ids.Split(',');
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _WmBlankRecordService.Delete(idsArr);
return ToResponse(response);
}
}
}