duyongjia
2024-12-29 9a0acba23c5b5095be2a89b8ca190fe5202c2ea6
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
using AutoMapper;
using LogLibrary.Log;
using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Utilities;
using WIDESEA_DTO;
using WIDESEA_DTO.Inbound;
using WIDESEA_IBasicService;
using WIDESEA_IInboundRepository;
using WIDESEA_IInboundService;
using WIDESEA_InboundRepository;
using WIDESEA_IStockService;
using WIDESEA_ITaskInfoRepository;
using WIDESEA_Model;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Inbound;
using WIDESEA_Model.Models.System.Request;
 
namespace WIDESEA_InboundService
{
    public partial class InboundOrderService : ServiceBase<Dt_InboundOrder, IInboundOrderRepository>, IInboundOrderService
    {
 
        /// <summary>
        /// 根据入库单号获取入库单(含明细)
        /// </summary>
        /// <param name="inboundOrderNo"></param>
        /// <returns></returns>
        public Dt_InboundOrder GetInboundOrder(string inboundOrderNo)
        {
            return BaseDal.Db.Queryable<Dt_InboundOrder>().Includes(x => x.Details).First(x => x.OrderNo == inboundOrderNo); ;
        }
 
        /// <summary>
        /// 组盘
        /// </summary>
        /// <param name="materielGroupDTO"></param>
        /// <returns></returns>
        public WebResponseContent MaterielGroup(MaterielGroupDTO materielGroupDTO)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                materielGroupDTO.OrderNo = GetOrderNo();
                Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(materielGroupDTO.PalletCode);
                (bool, string, object?) result = CheckMaterielGroupParam(materielGroupDTO, stockInfo);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                if (stockInfo == null)
                {
                    stockInfo = new Dt_StockInfo();
                    stockInfo.PalletCode = materielGroupDTO.PalletCode;
                    stockInfo.StockStatus = StockStatusEmun.组盘暂存.ObjToInt();
                    stockInfo.Creater = "立库WMS";
                    stockInfo.Details = new List<Dt_StockInfoDetail>();
                   
                }
                List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>();
                List<Dt_LabelMaster> notExistLabels = new List<Dt_LabelMaster>();
                foreach (var lablel in materielGroupDTO.SerialNumbers)
                {
                    Dt_LabelMaster labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == lablel);
                    if(labmaster == null)
                    {
                        //通过条码接口同步条码主数据
                        var res= _sys_JobService.GetLabMaster(lablel);
                        if (res != null && res.Status)
                        {
                            labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == lablel);
                            if (labmaster == null)
                            {
                                notExistLabels.Add(labmaster);
                            }
                        }
                        else
                        {
                          return  content = WebResponseContent.Instance.Error("组盘条码在上游WMS系统中不存在!");
                        }    
                    } 
                    if(labmaster!=null)
                    {
                        //主数据条码状态允许组盘:01已收料待质检,02已收料无需质检,03待进仓已质检,09已下架;
                        //主数据条码状态不允许组盘:00创建,04已质检待退货,05收料房退货,06库房退货,07已进仓,08已上架,10已出库,11已冻结,12已锁定,20关闭的;
                        if (labmaster.LABEL_STATUS=="00"|| labmaster.LABEL_STATUS == "04" || labmaster.LABEL_STATUS == "05"|| labmaster.LABEL_STATUS == "06" || labmaster.LABEL_STATUS == "07" || labmaster.LABEL_STATUS == "08" || labmaster.LABEL_STATUS == "10" || labmaster.LABEL_STATUS == "11" || labmaster.LABEL_STATUS == "12" || labmaster.LABEL_STATUS == "20")
                        {
                            return content = WebResponseContent.Instance.Error("主数据条码状态不允许组盘!条码状态:"+ labmaster.LABEL_STATUS);
                        }
                    }
                }
                if (notExistLabels.Count == 0)
                {
                    foreach (var item in materielGroupDTO.SerialNumbers)
                    {
                        Dt_LabelMaster labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == item);
                        Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail();
                        dt_StockInfoDetail.Status = 0;
                        dt_StockInfoDetail.OrderNo = materielGroupDTO.OrderNo;
                        dt_StockInfoDetail.StockId = stockInfo.Id != 0 ? stockInfo.Id : 0;
                        dt_StockInfoDetail.MaterielCode = labmaster.MATNR;
                        dt_StockInfoDetail.MaterielName = labmaster.MAKTX;
                        dt_StockInfoDetail.BatchNo = labmaster.BATCH;
                        dt_StockInfoDetail.SerialNumber = labmaster.LABEL_NO;
                        dt_StockInfoDetail.StockQuantity = int.Parse(labmaster.BOX_QTY);
                        dt_StockInfoDetail.OutboundQuantity = 0;
                        dt_StockInfoDetail.Creater = "System";
                        stockInfoDetails.Add(dt_StockInfoDetail);
                        stockInfo.Details.AddRange(stockInfoDetails);     
                    }
                    content = MaterielGroupUpdateData(stockInfo);
 
                }
                else
                {
                    content = WebResponseContent.Instance.Error("组盘条码在上游WMS系统中不存在!");
                }      
 
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            finally
            {
 
            }
            return content;
        }
 
 
        /// <summary>
        /// 余料退回组盘
        /// </summary>
        /// <param name="materielGroupDTO"></param>
        /// <returns></returns>
        public WebResponseContent ReturnMaterielGroup(MaterielGroupDTO materielGroupDTO, ReturnInventoryRequest inventoryRequest)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(materielGroupDTO.PalletCode);
                (bool, string, object?) result = CheckMaterielGroupParam(materielGroupDTO, stockInfo);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                if (stockInfo == null)
                {
                    stockInfo = new Dt_StockInfo();
                    stockInfo.PalletCode = materielGroupDTO.PalletCode;
                    stockInfo.StockStatus = StockStatusEmun.组盘暂存.ObjToInt();
                    stockInfo.Creater = "WMS";
                    stockInfo.Details = new List<Dt_StockInfoDetail>();
 
                }
                List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>();
 
                foreach (var item in inventoryRequest.DATA)
                {
                  
                    Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail();
                    dt_StockInfoDetail.Status = 0;
                    dt_StockInfoDetail.OrderNo = materielGroupDTO.OrderNo;
                    dt_StockInfoDetail.StockId = stockInfo.Id != 0 ? stockInfo.Id : 0;
                    dt_StockInfoDetail.MaterielCode = item.MATNR;
                    dt_StockInfoDetail.MaterielName = "";
                    dt_StockInfoDetail.BatchNo = "";
                    dt_StockInfoDetail.SerialNumber = item.LABEL_NO;
                    dt_StockInfoDetail.StockQuantity = int.Parse(item.QTY);
                    dt_StockInfoDetail.OutboundQuantity = 0;
                    dt_StockInfoDetail.Creater = "WMS";
                    stockInfoDetails.Add(dt_StockInfoDetail);
                    stockInfo.Details.AddRange(stockInfoDetails);
                }
                content = MaterielGroupUpdateData(stockInfo);
 
 
 
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            finally
            {
 
            }
            return content;
        }
 
        /// <summary>
        /// 根据BYDWMS组盘信息,再生成立库组盘信息
        /// </summary>
        /// <param name="inventoryRequest"></param>
        /// <returns></returns>
        public ReturnInventoryResponse returnInventory(string inventoryRequeststr)
        {
 
            new LogFactory().GetLog("WMS接口").InfoFormat(true, "returnInventory", "余料退回信息", $"{inventoryRequeststr}");
            ReturnInventoryRequest inventoryRequest = JsonConvert.DeserializeObject<ReturnInventoryRequest>(inventoryRequeststr);
            ReturnInventoryResponse response= new ReturnInventoryResponse();
            MaterielGroupDTO materielGroupDTO = new MaterielGroupDTO();
            materielGroupDTO.PalletCode = inventoryRequest.TPNUM;
            materielGroupDTO.OrderNo = inventoryRequest.IZLID; //退货入库指令
            List<string> SerialNumbers = new List<string>();
            Dt_MainReturnInventory dt_MainReturnInventoryOld =  _mainReturnInventoryRepository.QueryFirst(x => x.RETURN_NO == inventoryRequest.RETURN_NO && x.RETURN_ITEM_NO == inventoryRequest.RETURN_ITEM_NO);
            if (dt_MainReturnInventoryOld == null)
            {
                //保存回退数据到本地
                Dt_MainReturnInventory dt_MainReturnInventory = new Dt_MainReturnInventory();
                dt_MainReturnInventory.WH_NUMBER = inventoryRequest.WH_NUMBER;
                dt_MainReturnInventory.BUSINESS_CODE = inventoryRequest.BUSINESS_CODE;
                dt_MainReturnInventory.BUSINESS_NAME = inventoryRequest.BUSINESS_NAME;
                dt_MainReturnInventory.WERKS = inventoryRequest.WERKS;
                dt_MainReturnInventory.LGORT = inventoryRequest.LGORT;
                dt_MainReturnInventory.TOTAL_RETURN_QTY = inventoryRequest.TOTAL_RETURN_QTY;
                dt_MainReturnInventory.RETURN_NO = inventoryRequest.RETURN_NO;
                dt_MainReturnInventory.RETURN_ITEM_NO = inventoryRequest.RETURN_ITEM_NO;
                dt_MainReturnInventory.TPNUM = inventoryRequest.TPNUM;
                dt_MainReturnInventory.YLZD1 = inventoryRequest.YLZD1;
                dt_MainReturnInventory.YLZD2 = inventoryRequest.YLZD2;
                dt_MainReturnInventory.YLZD3 = inventoryRequest.YLZD3;
                dt_MainReturnInventory.YLZD4 = inventoryRequest.YLZD4;
                dt_MainReturnInventory.YLZD5 = inventoryRequest.YLZD5;
                dt_MainReturnInventory.IZLID = inventoryRequest.IZLID;
                dt_MainReturnInventory.SYSNOD = inventoryRequest.SYSNOD;
                dt_MainReturnInventory.MO_NO = inventoryRequest.MO_NO;
                foreach (ReturnInventory item in inventoryRequest.DATA)
                {
                    Dt_ReturnInventoryDetail dt_ReturnInventoryDetail = new Dt_ReturnInventoryDetail();
                    dt_ReturnInventoryDetail.LABEL_NO = item.LABEL_NO;
                    dt_ReturnInventoryDetail.SOBKZ = item.SOBKZ;
                    dt_ReturnInventoryDetail.UNIT = item.UNIT;
                    dt_ReturnInventoryDetail.LGORT = item.LGORT;
                    dt_ReturnInventoryDetail.QTY = item.QTY;
                    dt_ReturnInventoryDetail.LIFNR = item.LIFNR;
                    dt_ReturnInventoryDetail.F_LGORT = item.F_LGORT;
                    dt_ReturnInventoryDetail.MATNR = item.MATNR;
                    _ReturnInventoryDetailRepository.AddData(dt_ReturnInventoryDetail);
                    SerialNumbers.Add(item.LABEL_NO);
                }
                materielGroupDTO.SerialNumbers = SerialNumbers;
                _mainReturnInventoryRepository.AddData(dt_MainReturnInventory);
                WebResponseContent content = ReturnMaterielGroup(materielGroupDTO, inventoryRequest);
                if (content.Status)
                {
                    response.MSGTY = "S";
                    response.MSGTX = "";
                }
                else
                {
                    response.MSGTY = "E";
                    response.MSGTX = content.Message;
                }
            }
            else
            {
                response.MSGTY = "E";
                response.MSGTX = "不能重复申请!";
 
            }
            return response;
        }
        /// <summary>
        /// 生成订单号
        /// </summary>
        /// <returns></returns>
        public string GetOrderNo()
        {
            DataTable dt = BaseDal.QueryTable("SELECT FORMAT(NEXT VALUE FOR dbo.seqOrderNum, '000000000');");
            return DateTime.Now.ToString("yyyyMMdd") + dt.Rows[0][0].ToString();
        }
 
        /// <summary>
        /// 撤销组盘
        /// </summary>
        /// <param name="materielGroupDTO"></param>
        /// <returns></returns>
        public WebResponseContent MaterielGroupRevoke(string PalletCode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(PalletCode);
                if(stockInfo != null)
                {
                    if(stockInfo.StockStatus!= (int)StockStatusEmun.组盘暂存)
                    {
                        return content = WebResponseContent.Instance.Error("组盘暂存状态才可以撤销组盘!");
                    }
                    else
                    {
                        stockInfo.StockStatus = (int)StockStatusEmun.组盘撤销;
                        foreach (var item in stockInfo.Details)
                        {
                            item.Status = (int)OutStockStatus.撤销;
                        }
                    }
                    content = MaterielGroupUpdateData(stockInfo);
 
                } 
                else
                {
                    return content = WebResponseContent.Instance.Error("组盘信息不存在!");
                }
              
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            finally
            {
 
            }
            return content;
        }
 
        /// <summary>
        /// 组盘数据更新
        /// </summary>
        /// <param name="inboundOrder">入库单</param>
        /// <param name="inboundOrderDetails">入库单明细</param>
        /// <param name="stockInfo">组盘数据</param>
        /// <returns></returns>
        public WebResponseContent MaterielGroupUpdateData(Dt_InboundOrder inboundOrder, List<Dt_InboundOrderDetail> inboundOrderDetails, Dt_StockInfo stockInfo)
        {
            try
            {
                _unitOfWorkManage.BeginTran();
                UpdateData(inboundOrder);
                _inboundOrderDetailService.UpdateData(inboundOrderDetails);
                _stockService.StockInfoService.AddMaterielGroup(stockInfo);
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
 
        /// <summary>
        /// 组盘数据更新
        /// </summary>
        /// <param name="inboundOrder">入库单</param>
        /// <param name="inboundOrderDetails">入库单明细</param>
        /// <param name="stockInfo">组盘数据</param>
        /// <returns></returns>
        public WebResponseContent MaterielGroupUpdateData(Dt_StockInfo stockInfo)
        {
            try
            {
                _unitOfWorkManage.BeginTran();
                _stockService.StockInfoService.AddMaterielGroup(stockInfo);
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
 
 
        /// <summary>
        /// 验证组盘数据
        /// </summary>
        /// <param name="materielGroupDTO">物料组盘DTO</param>
        /// <param name="matSerialNumberDTOs">扫码序列号</param>
        /// <param name="materielInfos">物料信息</param>
        /// <param name="materielCodes">物料编号</param>
        /// <param name="inboundOrder">入库单据</param>
        /// <param name="stockInfo">组盘信息</param>
        /// <returns></returns>
        public (bool, string, object?) CheckMaterielGroupParam(MaterielGroupDTO materielGroupDTO, List<MatSerialNumberDTO> matSerialNumberDTOs, List<Dt_MaterielInfo> materielInfos, List<string> materielCodes, Dt_InboundOrder inboundOrder, Dt_StockInfo stockInfo)
        {
            (bool, string, object?) result = ModelValidate.ValidateModelData(materielGroupDTO);
            if (!result.Item1) return result;
 
            if (_taskRepository.QueryFirst(x => x.PalletCode == materielGroupDTO.PalletCode) != null)
            {
                return (false, "该托盘号已有任务", materielGroupDTO);
            }
 
            if (stockInfo != null && !string.IsNullOrEmpty(stockInfo.LocationCode) && stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt())
            {
                return (false, "已上架的托盘不能再次组盘", materielGroupDTO);
            }
 
            if (_stockService.StockInfoDetailService.ExistSerialNumbers(materielGroupDTO.SerialNumbers))
            {
                return (false, "有序列号在库存中已存在", materielGroupDTO);
            }
 
            if (materielInfos.Count != materielCodes.Count)
            {
                return (false, "有物料信息未录入,请录入物料信息", materielGroupDTO);
            }
 
            if (materielCodes.Count > 1 && materielInfos.FirstOrDefault(x => !x.IsMixMateriel) != null)
            {
                return (false, "有物料不可混料组盘", materielGroupDTO);
            }
 
            List<string> batchs = matSerialNumberDTOs.GroupBy(x => x.BatchNo).Select(x => x.Key).ToList();
            if (batchs.Count > 1 && materielInfos.FirstOrDefault(x => !x.IsMixMateriel) != null)
            {
                return (false, "有物料不可混批组盘", materielGroupDTO);
            }
 
            if (inboundOrder == null)
            {
                return (false, "单据不存在", materielGroupDTO);
            }
 
            if (inboundOrder.Details == null || inboundOrder.Details.Count == 0)
            {
                return (false, "无单据明细信息", materielGroupDTO);
            }
 
            if (inboundOrder.OrderStatus != InboundStatusEnum.未开始.ObjToInt() && inboundOrder.OrderStatus != InboundStatusEnum.入库中.ObjToInt())
            {
                return (false, "该单据不可再组盘", materielGroupDTO);
            }
 
            List<Dt_InboundOrderDetail> inboundOrderDetails = inboundOrder.Details.Where(x => materielCodes.Contains(x.MaterielCode)).ToList();
 
            if (inboundOrderDetails.GroupBy(x => x.MaterielCode).Count() != materielCodes.Count)
            {
                return (false, "有物料不在单据内", materielGroupDTO);
            }
 
            IGrouping<string, Dt_InboundOrderDetail>? temp = inboundOrder.Details.Where(x => materielCodes.Contains(x.MaterielCode)).GroupBy(x => x.MaterielCode).FirstOrDefault(x => x.Sum(v => v.OverInQuantity) >= x.Sum(v => v.OrderQuantity) || x.Sum(v => v.ReceiptQuantity) >= x.Sum(v => v.OrderQuantity));
            if (temp != null)
            {
                return (false, "有物料超出单据数量", materielGroupDTO);
            }
 
            return (true, "成功", materielGroupDTO);
        }
 
 
        /// <summary>
        /// 验证组盘数据
        /// </summary>
        /// <param name="materielGroupDTO">物料组盘DTO</param>
        /// <param name="stockInfo">组盘信息</param>
        /// <returns></returns>
        public (bool, string, object?) CheckMaterielGroupParam(MaterielGroupDTO materielGroupDTO, Dt_StockInfo stockInfo)
        {
            (bool, string, object?) result = ModelValidate.ValidateModelData(materielGroupDTO);
            if (!result.Item1) return result;
 
            if (_taskRepository.QueryFirst(x => x.PalletCode == materielGroupDTO.PalletCode) != null)
            {
                return (false, "该托盘号已有任务", materielGroupDTO);
            }
 
            if (stockInfo != null && !string.IsNullOrEmpty(stockInfo.LocationCode) && stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt())
            {
                return (false, "已上架的托盘不能再次组盘", materielGroupDTO);
            }
 
            if (_stockService.StockInfoDetailService.ExistSerialNumbers(materielGroupDTO.SerialNumbers))
            {
                return (false, "有序列号在库存中已存在", materielGroupDTO);
            }
 
            return (true, "成功", materielGroupDTO);
        }
 
 
 
        /// <summary>
        /// PDA分页查询数据
        /// </summary>
        /// <param name="pageNo">页码</param>
        /// <param name="orderNo">订单号</param>
        /// <returns></returns>
        public WebResponseContent QueryOrderInfo(int pageNo, string orderNo)
        {
            if (string.IsNullOrEmpty(orderNo))
            {
                object obj = Repository.QueryPage(x => true, pageNo, 10, new Dictionary<string, OrderByType> { { nameof(Dt_InboundOrder.CreateDate), OrderByType.Desc } }).Rows.Select(x => new
                {
                    x.OrderNo,
                    x.UpperOrderNo,
                    x.CreateDate,
                    x.Creater
                });
                return WebResponseContent.Instance.OK(data: obj);
            }
            else
            {
                object obj = Repository.QueryPage(x => x.OrderNo == orderNo, pageNo, 10, new Dictionary<string, OrderByType> { { nameof(Dt_InboundOrder.CreateDate), OrderByType.Desc } }).Rows.Select(x => new
                {
                    x.OrderNo,
                    x.UpperOrderNo,
                    x.CreateDate,
                    x.Creater
                });
                return WebResponseContent.Instance.OK(data: obj);
            }
        }
    }
}