11
tjx
8 天以前 93770f3ba3276cd222480d83dbbcae9ae7a5fa31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using MES.Service.Dto.webApi;
using MES.Service.util;
using MES.Service.service.Warehouse;
using Microsoft.AspNetCore.Mvc;
 
namespace MESApplication.Controllers.Warehouse;
 
/// <summary>
///     销售托盘管理控制器
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class SalesPalletController : ControllerBase
{
    private readonly SalesPalletManager _manager = new();
 
    /// <summary>
    /// 获取销售托盘分页数据
    /// </summary>
    /// <param name="request">查询请求参数</param>
    /// <returns>分页结果</returns>
    [HttpPost("GetSalesPalletPage")]
    public ResponseResult GetSalesPalletPage(
        [FromBody] SalesPalletSearchDto request)
    {
        try
        {
            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,
                message = "查询成功",
                data = result
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
}