服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2025-03-08 a259e40ee315f068bd9b96f857f1f80ea137e89d
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.Extensions.Logging;
using Rhea.Common;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Tiger.IBusiness;
using Tiger.Model;
using Tiger.Model.Entitys.WMS.DTOS;
using Tiger.Model.Minsun;
 
namespace Tiger.Api.Controllers.WMS.T00ToWMS
{
    /// <summary>
    ///
    /// </summary>
    [ApiController]
    public class MaterialInfoController : ControllerBase
    {
        #region DI
 
        /// <summary>
        ///
        /// </summary>
        private readonly IMaterialInfoBusiness _materialBus;
 
        /// <summary>
        ///
        /// </summary>
        private readonly ILogger<WMS_MesMaterial> _logger;
 
        #endregion DI
 
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="materBus"></param>
        /// <param name="logger"></param>
        public MaterialInfoController(IMaterialInfoBusiness materBus, ILogger<WMS_MesMaterial> logger)
        {
            _materialBus = materBus;
            _logger = logger;
        }
 
        /// <summary>
        /// 从T100获取物料信息
        /// </summary>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetMaterialFromT100(InputDTO input)
        {
            return _materialBus.GetMaterialFromT100(input);
        }
 
        /// <summary>
        /// 从T100获取送检单信息
        /// </summary>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetInspectionNoFromT100()
        {
            return _materialBus.GetInspectionNoFromT100();
        }
 
        // <summary>
        /// 从T100获取调拨单信息
        /// </summary>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetTrasferInfoFromT100(InputDTO input)
        {
            return _materialBus.GetTrasferInfoFromT100(input);
        }
 
        // <summary>
        /// 从T100获取其他出库单信息
        /// </summary>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetOtherOutInfoFromT100(InputDTO input)
        {
            return _materialBus.GetOtherOutInfoFromT100(input);
        }
 
        // <summary>
        /// 其它出库单信息定时推送给T100——过账
        /// </summary>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetOtherOutInfoToT100(InputDTO input)
        {
            return _materialBus.GetOtherOutInfoToT100(input);
        }
 
        // <summary>
        /// 销售出库单信息定时推送给T100——过账
        /// </summary>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int PutSaleOutInfoToT100(InputDTO input)
        {
            return _materialBus.PutSaleOutInfoToT100(input);
        }
 
        // <summary>
        /// 调拨单信息定时推送给T100——创单并过账
        /// </summary>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetTrasferInfoToT100(InputDTO input)
        {
            return _materialBus.GetTrasferInfoToT100(input);
        }
 
        // <summary>
        /// 调拨单信息定时推送给T100——直接过账
        /// </summary>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetTrasferInfoToT100Plan2(InputDTO input)
        {
            return _materialBus.GetTrasferInfoToT100Plan2(input);
        }
 
        /// <summary>
        /// 从T100获取采购信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetPurchaseInfo(InputDTO input)
        {
            return _materialBus.GetPurchaseInfoFromT100(input);
        }
 
        /// <summary>
        /// 从T100获取客户信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetCustomerInfo(InputDTO input)
        {
            return _materialBus.GetCustomerInfoFromT100(input);
        }
 
        /// <summary>
        /// 从T100获取仓库代码信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int GetWarehouseCodeInfo(InputDTO input)
        {
            return _materialBus.GetWarehouseCodeInfoFromT100(input);
        }
 
        /// <summary>
        /// 从MES获取成品入库信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public int ProductInputInfoFromT100()
        {
            return _materialBus.ProductInputInfoFromT100();
        }
 
        /// <summary>
        /// 获取物料信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Route("[Controller]/[Action]")]
        public Task<List<MaterialDTO>> GetMaterialInfo(MaterialDTO input)
        {
            return _materialBus.GetMaterialInfo(input);
        }
 
        /// <summary>
        /// 更新有效期、预存期
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[Controller]/[Action]")]
        public IActionResult UpdateTime(MaterialDTO input)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(_materialBus.UpdateTime(input));
            }
            catch (Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
        /// <summary>
        /// 获取所有的超期数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[Controller]/[Action]")]
        public IActionResult OverdueData(OverdueDTO input)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(_materialBus.OverdueData(input));
            }
            catch (Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
        /// <summary>
        /// 获取T100单号状态
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[Controller]/[Action]")]
        public IActionResult GetOrderStatus(OrderStatusDTO input)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(_materialBus.GetOrderStatus(input));
            }
            catch (Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
 
    }
}