服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-09-25 ab6b24d4a57611605781457faede959ea3163125
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Rhea.Common;
using Tiger.IBusiness;
using Microsoft.AspNetCore.Mvc;
using Tiger.Model.Minsun;
 
namespace Tiger.Api.Controllers.WMS
{
    public partial class WMSController : ControllerBase
    {
        /// <summary>
        /// 物料包装管理    物料包装层级:小包归属于哪个中包、中包归属于哪个外包  wms_barcode 有
        /// </summary>
        /// <param name="sn"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetPackageInfoAsync(string sn)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IiWMS>().GetPackageInfo(sn));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
        /// <summary>
        /// 物料入库信息    物料名称、物料代码、物料供应商、数量、库位、储位、批次、入库时间
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetInStoreInfoAsync(iParams param)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(_IInventroyInfo.GetInStoreInfo(param)); //response.GetResponse(DI.Resolve<IiWMS>().GetInStoreInfo(param));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
        /// <summary>
        /// 物料出库信息    领料单号、领料料号、数量、库位、储位、出库时间   
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetOutStoreInfoAsync(iParams param)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(_IInventroyInfo.GetOutStoreInfo(param)); // response.GetResponse(DI.Resolve<IiWMS>().GetOutStoreInfo(param));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
        /// <summary>
        /// 物料退料信息    退料料号、退料时间、退料条码、退料库位、称重清点结果  
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetReturnInfoAsync(iParams param)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IiWMS>().GetReturnInfo(param));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
        /// <summary>
        /// 备料分包装信息    拆包备料,重新组包的包装号关系:拆包编号、组包后编号、组包后数量、备领料单号、料号
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetSplitInfoAsync(iParams param)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IiWMS>().GetSplitInfo(param));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
        /// <summary>
        /// 物料库存信息
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetStorageInfo(iParamsBase param)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(_IInventroyInfo.GetStorageInfo(param)); // response.GetResponse(DI.Resolve<IiWMS>().GetStorageInfo(param));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
        /// <summary>
        /// 到货单生成接口    清点系统 --> wms,  接口需wms定义
        /// </summary>
        /// <param name="dtls"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GenerateReceiptAsync(iReceiptInput dtls)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IiWMS>().GenerateReceipt(dtls));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
        /// <summary>
        /// 获取T100领料单数据
        /// </summary>
        /// <param name="dtls"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetMaterialReq(List<WMS_PRDPICK_H> dtls)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IiWMS>().GetMaterialReq(dtls));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
        /// <summary>
        /// 领料单取消审核
        /// </summary>
        /// <param name="dtls"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> MaterialRem(MaterialRem dtls)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(DI.Resolve<IiWMS>().MaterialRem(dtls));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
    }
   
}