73 lines
2.7 KiB
C#
73 lines
2.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using WCS.BLL.Services.IService;
|
|
using WCS.BLL.Services.Service;
|
|
using WCS.Model;
|
|
using WCS.Model.ApiModel.StoreInfo;
|
|
using WCS.BLL.DbModels;
|
|
using WCS.Model.ApiModel.MatBaseInfo;
|
|
using WCS.Model.ApiModel.MatDetailCurrentInfo;
|
|
using WCS.DAL.DbModels;
|
|
|
|
namespace WCS.WebApi.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 当前库存存量的数据 当前库存数据
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class MatDetailCurrenInfoController : ControllerBase
|
|
{
|
|
public IMatDetailCurrentInfoService _matDetailCurrentInfoService { get; set; }
|
|
public MatDetailCurrenInfoController(IMatDetailCurrentInfoService matDetailCurrentInfoService)
|
|
{
|
|
_matDetailCurrentInfoService = matDetailCurrentInfoService;
|
|
}
|
|
|
|
#region 库存数据管理
|
|
[Route("getMatDetailCurrentInfos")]
|
|
[HttpPost(Name = "getMatDetailCurrentInfos")]
|
|
public async Task<ResponseBase> GetMatDetailCurrentInfos(GetMatDetailCurrentInfosRequest request)
|
|
{
|
|
return await _matDetailCurrentInfoService.GetMatDetailCurrentInfos(request);
|
|
}
|
|
|
|
[HttpPost("updateMatDetailCurrentInfo")]
|
|
public async Task<ResponseCommon<object>> updateMatDetailCurrentInfo(AddLocaionInfoRequest<MatDetailCurrentInfo> request)
|
|
{
|
|
return await _matDetailCurrentInfoService.updateMatDetailCurrentInfo(request);
|
|
}
|
|
|
|
[HttpPost("updateMatDetailCurrentInfoById")]
|
|
public async Task<ResponseCommon<object>> updateMatDetailCurrentInfoById(UpdateMatDetailCurrentInfoByIdRequest request)
|
|
{
|
|
var transRequest = new AddLocaionInfoRequest<MatDetailCurrentInfo>()
|
|
{
|
|
UserName = request.UserName,
|
|
DeviceType = request.DeviceType,
|
|
LocationInfo = new MatDetailCurrentInfo()
|
|
{
|
|
Id = request.MatDetailCurrentInfoId,
|
|
MatQty = request.MatQty,
|
|
}
|
|
};
|
|
return await _matDetailCurrentInfoService.updateMatDetailCurrentInfo(transRequest);
|
|
}
|
|
|
|
[HttpPost("deleteMatDetailCurrentInfo")]
|
|
public async Task<ResponseCommon<object>> deleteMatDetailCurrentInfo(DeleteInfosRequest request)
|
|
{
|
|
//校验
|
|
if (request.needDeleteIds == null || request.needDeleteIds.Count == 0)
|
|
{
|
|
return new ResponseCommon<object>()
|
|
{
|
|
Code = 201,
|
|
Message = "操作失败:参数校验失败(ID)."
|
|
};
|
|
}
|
|
return await _matDetailCurrentInfoService.deleteMatDetailCurrentInfo(request);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|