新框架PDA后端(祈禧6月初版本)
南骏 池
3 天以前 fca0719af6948fe8fa1e4f094f8e7dba339c7428
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System.Dynamic;
using Microsoft.AspNetCore.Mvc;
using NewPdaSqlServer.Dto.service;
using NewPdaSqlServer.entity;
using NewPdaSqlServer.service.Warehouse;
using NewPdaSqlServer.util;
 
namespace NewPdaSqlServer.Controllers.Warehouse;
 
[ApiController]
[Route("api/[controller]")]
public class MesXkyShdController : ControllerBase
{
    private readonly MesXkyShdManager m = new();
 
    /// <summary>
    ///     获取条码信息和物料信息
    /// </summary>
    /// <returns></returns>
    [HttpPost("GetShdhItems")]
    public ResponseResult GetShdhItems(dynamic unity)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.GetShdhItems(unity);
            resultInfos.tbMesItems = m.GetShdhBar(unity);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
 
    /// <summary>
    ///     获取条码信息和物料信息
    /// </summary>
    /// <returns></returns>
    [HttpPost("GetBarInfo")]
    public ResponseResult GetBarInfo(WarehouseQuery unity)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.GetBarInfo(unity);
            if(resultInfos.tbBillList == null)
            {
                return new ResponseResult
                {
                    status = -1,
                    message = "此条码不存在!!!",
                    data = resultInfos
                };
            }
            resultInfos.tbMesItems = m.GetItemNo(resultInfos.tbBillList.ItemId);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
 
    /// <summary>
    ///     到货单收货
    /// </summary>
    /// <returns></returns>
    [HttpPost("ScanBar")]
    public ResponseResult ScanBar(dynamic unity)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.ScanBar(unity);
            return new ResponseResult
            {
                status = 0,
                message = resultInfos.tbBillList,
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
}