2025-03-18 15:22:30 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using DOAN.Model.Dto;
|
|
|
|
|
|
|
|
|
|
|
|
using DOAN.Admin.WebApi.Filters;
|
|
|
|
|
|
using DOAN.Model.MES.material;
|
|
|
|
|
|
using DOAN.Model.MES.material.Dto;
|
|
|
|
|
|
using DOAN.Service.MES.material.IService;
|
|
|
|
|
|
|
|
|
|
|
|
//创建时间:2024-12-30
|
|
|
|
|
|
namespace DOAN.Admin.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 北泽线边库库位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
|
|
|
|
|
[Route("mes/materialManagement/Parts/MaterialPartsStorageLocations")]
|
|
|
|
|
|
public class MaterialPartsStorageLocationsController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 北泽线边库库位接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IMaterialPartsStorageLocationsService _MaterialPartsStorageLocationsService;
|
|
|
|
|
|
|
|
|
|
|
|
public MaterialPartsStorageLocationsController(IMaterialPartsStorageLocationsService MaterialPartsStorageLocationsService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_MaterialPartsStorageLocationsService = MaterialPartsStorageLocationsService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询北泽线边库库位列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialManagement:MaterialPartsstoragelocations:list")]
|
|
|
|
|
|
public IActionResult QueryMaterialPartsStorageLocations([FromQuery] MaterialPartsStorageLocationsQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _MaterialPartsStorageLocationsService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 查询北泽线边库库位编号
|
|
|
|
|
|
[HttpGet("list_location_code")]
|
2025-03-18 16:27:05 +08:00
|
|
|
|
public IActionResult QueryMaterialPartsStorageLocationsLocationCode(string? query)
|
2025-03-18 15:22:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
var response = _MaterialPartsStorageLocationsService.QueryMaterialPartsStorageLocationsLocationCode(query);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询北泽线边库库位详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="LocationId"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{LocationId}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialManagement:MaterialPartsstoragelocations:query")]
|
|
|
|
|
|
public IActionResult GetMaterialPartsStorageLocations(int LocationId)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _MaterialPartsStorageLocationsService.GetInfo(LocationId);
|
|
|
|
|
|
|
|
|
|
|
|
var info = response.Adapt<MaterialPartsStorageLocations>();
|
|
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加北泽线边库库位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialManagement:MaterialPartsstoragelocations:add")]
|
|
|
|
|
|
[Log(Title = "北泽线边库库位", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddMaterialPartsStorageLocations([FromBody] MaterialPartsStorageLocationsDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<MaterialPartsStorageLocations>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _MaterialPartsStorageLocationsService.AddMaterialPartsStorageLocations(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新北泽线边库库位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialManagement:MaterialPartsstoragelocations:edit")]
|
|
|
|
|
|
[Log(Title = "北泽线边库库位", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateMaterialPartsStorageLocations([FromBody] MaterialPartsStorageLocationsDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<MaterialPartsStorageLocations>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _MaterialPartsStorageLocationsService.UpdateMaterialPartsStorageLocations(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除北泽线边库库位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpDelete("{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "materialManagement:MaterialPartsstoragelocations:delete")]
|
|
|
|
|
|
[Log(Title = "北泽线边库库位", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteMaterialPartsStorageLocations(string ids)
|
|
|
|
|
|
{
|
|
|
|
|
|
int[] idsArr = Tools.SpitIntArrary(ids);
|
|
|
|
|
|
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
|
|
|
|
|
|
|
|
|
|
|
var response = _MaterialPartsStorageLocationsService.Delete(idsArr);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|