| | |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.util; |
| | | using MES.Service.service.Warehouse; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | private readonly SalesPalletManager _manager = new(); |
| | | |
| | | /// <summary> |
| | | /// 获取销售托盘信息 |
| | | /// 获取销售托盘分页数据 |
| | | /// </summary> |
| | | /// <returns>销售托盘信息列表</returns> |
| | | [HttpPost("GetSalesPalletInfo")] |
| | | public ResponseResult GetSalesPalletInfo() |
| | | /// <param name="request">查询请求参数</param> |
| | | /// <returns>分页结果</returns> |
| | | [HttpPost("GetSalesPalletPage")] |
| | | public ResponseResult GetSalesPalletPage( |
| | | [FromBody] SalesPalletSearchDto request) |
| | | { |
| | | try |
| | | { |
| | | var result = _manager.GetSalesPalletInfo(); |
| | | var (items, totalCount) = _manager.GetSalesPalletPage(request); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = items, |
| | | TotalCount = totalCount |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取销售托盘明细数据 |
| | | /// </summary> |
| | | /// <param name="request">查询请求参数</param> |
| | | /// <returns>明细列表</returns> |
| | | [HttpPost("GetSalesPalletDetail")] |
| | | public ResponseResult GetSalesPalletDetail( |
| | | [FromBody] SalesPalletDetailQueryDto request) |
| | | { |
| | | try |
| | | { |
| | | var result = _manager.GetSalesPalletDetail(request); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据条件获取销售托盘信息 |
| | | /// </summary> |
| | | /// <param name="request">查询条件</param> |
| | | /// <returns>销售托盘信息列表</returns> |
| | | [HttpPost("GetSalesPalletInfoByCondition")] |
| | | public ResponseResult GetSalesPalletInfoByCondition([FromBody] SalesPalletQueryRequest request) |
| | | { |
| | | try |
| | | { |
| | | var result = _manager.GetSalesPalletInfo(request.BillNo, request.ItemId, request.Status); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "查询成功", |
| | | data = result |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取销售托盘明细信息 |
| | | /// </summary> |
| | | /// <returns>销售托盘明细信息列表</returns> |
| | | [HttpPost("GetSalesPalletDetailInfo")] |
| | | public ResponseResult GetSalesPalletDetailInfo() |
| | | { |
| | | try |
| | | { |
| | | var result = _manager.GetSalesPalletDetailInfo(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "查询成功", |
| | | data = result |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据栈板码获取销售托盘明细信息 |
| | | /// </summary> |
| | | /// <param name="request">查询条件</param> |
| | | /// <returns>销售托盘明细信息列表</returns> |
| | | [HttpPost("GetSalesPalletDetailInfoByStackcode")] |
| | | public ResponseResult GetSalesPalletDetailInfoByStackcode([FromBody] SalesPalletDetailQueryRequest request) |
| | | { |
| | | try |
| | | { |
| | | var result = _manager.GetSalesPalletDetailInfo(request.Stackcode); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "查询成功", |
| | | data = result |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 销售托盘查询请求 |
| | | /// </summary> |
| | | public class SalesPalletQueryRequest |
| | | { |
| | | /// <summary> |
| | | /// 单据编号 |
| | | /// </summary> |
| | | public string? BillNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 物料ID |
| | | /// </summary> |
| | | public decimal? ItemId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 审核状态 |
| | | /// </summary> |
| | | public decimal? Status { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 销售托盘明细查询请求 |
| | | /// </summary> |
| | | public class SalesPalletDetailQueryRequest |
| | | { |
| | | /// <summary> |
| | | /// 栈板码 |
| | | /// </summary> |
| | | public string? Stackcode { get; set; } |
| | | } |