From 475fc7c0176aafe0e0833ba4dd5cab9fd5c18160 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期三, 03 十二月 2025 15:26:37 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs |  258 ++++++++++++++++++++++++++++++---------------------
 1 files changed, 151 insertions(+), 107 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
index 08aaba5..341570f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
@@ -27,11 +27,13 @@
 using WIDESEA_DTO.Outbound;
 using WIDESEA_IAllocateService;
 using WIDESEA_IBasicService;
+using WIDESEA_ICheckService;
 using WIDESEA_IInboundService;
 using WIDESEA_IOutboundService;
 using WIDESEA_IStockService;
 using WIDESEA_Model.Models;
 using WIDESEA_Model.Models.Basic;
+using WIDESEA_Model.Models.Check;
 
 namespace WIDESEA_OutboundService
 {
@@ -59,7 +61,7 @@
         private readonly IRepository<Dt_InboundOrder> _inboundOrderRepository;
         private readonly IInboundOrderDetailService _inboundOrderDetailService;
         private readonly IRepository<Dt_WarehouseArea> _warehouseAreaRepository;
-
+        private readonly IReCheckOrderService _reCheckOrderService;
         private readonly ILogger<OutboundPickingService> _logger;
 
         private Dictionary<string, string> stations = new Dictionary<string, string>
@@ -79,7 +81,7 @@
         public OutboundPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService,
             IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService,
             IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService,
-            IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository) : base(BaseDal)
+            IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IReCheckOrderService reCheckOrderService) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManage;
             _stockInfoService = stockInfoService;
@@ -99,6 +101,7 @@
             _inboundOrderRepository = inboundOrderRepository;
             _inboundOrderDetailService = inboundOrderDetailService;
             _warehouseAreaRepository = warehouseAreaRepository;
+            _reCheckOrderService = reCheckOrderService;
         }
 
 
@@ -474,10 +477,21 @@
                     var completedLockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
                         .Where(it => it.CurrentBarcode == barcode &&
                                    (it.Status == (int)OutLockStockStatusEnum.鎷i�夊畬鎴� ||
+                                    it.Status == (int)OutLockStockStatusEnum.宸查噴鏀� ||
+                                    it.Status == (int)OutLockStockStatusEnum.宸插彇璧� ||
                                     it.PickedQty >= it.AssignQuantity)).FirstAsync();
 
                     if (completedLockInfo != null)
-                        throw new Exception($"鏉$爜{barcode}宸茬粡瀹屾垚鍒嗘嫞锛屼笉鑳介噸澶嶅垎鎷�");
+                    {
+                        string statusMsg = completedLockInfo.Status switch
+                        {
+                            (int)OutLockStockStatusEnum.鎷i�夊畬鎴� => "宸茬粡瀹屾垚鍒嗘嫞",
+                            (int)OutLockStockStatusEnum.宸查噴鏀� => "宸茬粡閲婃斁",
+                            (int)OutLockStockStatusEnum.宸插彇璧� => "宸茬粡鍙栬蛋",
+                            _ => "宸茬粡瀹屾垚鍒嗘嫞"
+                        };
+                        throw new Exception($"鏉$爜{barcode}{statusMsg}锛屼笉鑳介噸澶嶅垎鎷�");
+                    }
                     else
                         return null;
                 }
@@ -813,13 +827,13 @@
 
         private async Task<bool> CanCancelPicking(Dt_OutStockLockInfo lockInfo, Dt_StockInfoDetail stockDetail)
         {
+            if (lockInfo.Status == (int)OutLockStockStatusEnum.宸查噴鏀� || lockInfo.Status == (int)OutLockStockStatusEnum.宸插彇璧�)
+                return false;
             // 閿佸畾淇℃伅鐘舵�佹鏌�
             if (lockInfo.Status != (int)OutLockStockStatusEnum.鎷i�夊畬鎴�)
                 return false;
 
-            ////// 搴撳瓨鐘舵�佹鏌�
-            ////if (stockDetail.Status == StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt())
-            ////    return false;
+
 
             // 濡傛灉鏄媶鍖呰褰曪紝杩橀渶瑕佹鏌ョ埗閿佸畾淇℃伅鐘舵��
             if (lockInfo.IsSplitted == 1 && lockInfo.ParentLockId.HasValue)
@@ -827,7 +841,9 @@
                 var parentLock = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
                     .FirstAsync(x => x.Id == lockInfo.ParentLockId.Value);
 
-                if (parentLock == null || parentLock.Status == (int)OutLockStockStatusEnum.鍥炲簱涓�)
+                if (parentLock == null || parentLock.Status == (int)OutLockStockStatusEnum.鍥炲簱涓� ||
+                        parentLock.Status == (int)OutLockStockStatusEnum.宸查噴鏀� ||
+                        parentLock.Status == (int)OutLockStockStatusEnum.宸插彇璧�)
                     return false;
             }
 
@@ -1385,8 +1401,8 @@
             await _outStockLockInfoService.Db.Updateable<Dt_OutStockLockInfo>()
                 .SetColumns(it => new Dt_OutStockLockInfo
                 {
-                    Status = (int)OutLockStockStatusEnum.宸查噴鏀�, // 闇�瑕佹柊澧炶繖涓姸鎬�
-                                                              // ReleaseTime = DateTime.Now,
+                    Status = (int)OutLockStockStatusEnum.宸查噴鏀�,
+
                     Operator = App.User.UserName
                 })
                 .Where(it => lockIds.Contains(it.Id))
@@ -1673,7 +1689,7 @@
 
             // 鍒犻櫎鍘熷鍑哄簱浠诲姟
             _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.鑷姩瀹屾垚);
-            // await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync();
+            await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync();
 
 
 
@@ -1802,11 +1818,7 @@
 
                     _logger.LogInformation($"璁㈠崟鐘舵�佹洿鏂� - OrderNo: {orderNo}, 鏃х姸鎬�: {outboundOrder.OrderStatus}, 鏂扮姸鎬�: {newStatus}");
 
-                    // 鍙湁姝e父鍒嗘嫞瀹屾垚鏃舵墠鍚慚ES鍙嶉
-                    if (allCompleted && newStatus == (int)OutOrderStatusEnum.鍑哄簱瀹屾垚)
-                    {
-                        await HandleOrderCompletion(outboundOrder, orderNo);
-                    }
+
                 }
             }
             catch (Exception ex)
@@ -1936,7 +1948,7 @@
                 {
                     ReqCode = Guid.NewGuid().ToString(),
                     ReqTime = DateTime.Now.ToString(),
-                    BusinessType = "3",
+                    BusinessType = "2",
 
                     FactoryArea = outboundOrder.FactoryArea,
                     OperationType = 1,
@@ -1954,7 +1966,7 @@
                     .Where(x => x.OrderNo == orderNo && x.Status == (int)OutLockStockStatusEnum.鎷i�夊畬鎴�)
                     .ToListAsync();
 
-                var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.lineNo, item.Unit, item.WarehouseCode })
+                var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
                    .Select(group => new AllocateDtoDetail
                    {
                        MaterialCode = group.Key.MaterielCode,
@@ -1962,13 +1974,13 @@
                        WarehouseCode = group.Key.WarehouseCode,
                        Qty = group.Sum(x => x.PickedQty),
 
-                       Unit = group.Key.Unit,
+                       Unit = group.Key.BarcodeUnit,
                        Barcodes = group.Select(row => new BarcodeInfo
                        {
                            Barcode = row.CurrentBarcode,
                            SupplyCode = row.SupplyCode,
                            BatchNo = row.BatchNo,
-                           Unit = row.Unit,
+                           Unit = row.BarcodeUnit,
                            Qty = row.PickedQty
                        }).ToList()
 
@@ -2015,25 +2027,25 @@
 
                     // 鍙幏鍙栧凡鎷i�夊畬鎴愮殑閿佸畾璁板綍
                     var lists = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
-                        .Where(x => x.OrderNo == orderNo && x.Status == (int)OutLockStockStatusEnum.鎷i�夊畬鎴�)
+                        .Where(x => x.OrderNo == orderNo && (x.Status == (int)OutLockStockStatusEnum.鎷i�夊畬鎴� || x.Status == (int)OutLockStockStatusEnum.宸插洖搴�))
                         .ToListAsync();
 
-                    var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.lineNo, item.Unit, item.WarehouseCode })
+                    var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
                        .Select(group => new FeedbackOutboundDetailsModel
                        {
                            materialCode = group.Key.MaterielCode,
                            lineNo = group.Key.lineNo,
                            warehouseCode = group.Key.WarehouseCode,
-                           qty = group.Sum(x => x.BarcodeQty),
-                           currentDeliveryQty = group.Sum(x => x.BarcodeQty),
-                           unit = group.Key.Unit,
+                           qty = group.Sum(x => x.PickedQty),
+                           currentDeliveryQty = group.Sum(x => x.PickedQty),
+                           unit = group.Key.BarcodeUnit,
                            barcodes = group.Select(row => new WIDESEA_DTO.Outbound.BarcodesModel
                            {
                                barcode = row.CurrentBarcode,
                                supplyCode = row.SupplyCode,
                                batchNo = row.BatchNo,
                                unit = row.BarcodeUnit,
-                               qty = row.BarcodeQty
+                               qty = row.PickedQty
                            }).ToList()
                        }).ToList();
 
@@ -2202,7 +2214,7 @@
                 _logger.LogInformation($"璁㈠崟 {orderNo} 宸叉爣璁颁负鍑哄簱瀹屾垚");
 
                 // 鍚慚ES鍙嶉璁㈠崟瀹屾垚锛堝鏋滈渶瑕侊級
-                await HandleOrderCompletion(outboundOrder, orderNo);
+                //await HandleOrderCompletion(outboundOrder, orderNo);
             }
         }
 
@@ -2724,6 +2736,34 @@
                     }
                     outboundOrderDetails.Add(outboundOrderDetail);
 
+                    var newLockInfo = new Dt_OutStockLockInfo
+                    {
+                        OrderNo = outboundOrder.UpperOrderNo,
+                        OrderDetailId = outboundOrderDetail.Id,
+                        OutboundBatchNo = outboundOrderDetail.BatchNo,
+                        MaterielCode = outboundOrderDetail.MaterielCode,
+                        MaterielName = outboundOrderDetail.MaterielName,
+                        StockId = 0,
+                        OrderQuantity = outboundOrderDetail.OrderQuantity,
+                        AssignQuantity = outboundOrderDetail.OverOutQuantity,
+                        PickedQty = 0,
+                        LocationCode = "绌�",
+                        PalletCode = "绌�",
+                        TaskNum = 0,
+                        Status = (int)OutLockStockStatusEnum.鎷i�夊畬鎴�,
+                        Unit = outboundOrderDetail.Unit,
+                        SupplyCode = outboundOrderDetail.SupplyCode?? "鏃�",
+                        OrderType = outboundOrder.OrderType,
+                        CurrentBarcode = inboundOrderDetail.Barcode,
+                        IsSplitted = 1,
+                        Operator = App.User.UserName,
+                        lineNo= outboundOrderDetail.lineNo,
+                        WarehouseCode = outboundOrderDetail.WarehouseCode ?? "鏃�",
+                        BarcodeQty=outboundOrderDetail.NoStockOutQty,
+                        BarcodeUnit =outboundOrderDetail.BarcodeUnit,
+                        BatchNo = outboundOrderDetail.BatchNo
+                    };
+                    _outStockLockInfoService.AddData(newLockInfo);
                 }
                 //鍒ゆ柇鍏ュ簱鍗曟嵁鏄庣粏鏄惁鍏ㄩ儴鏄畬鎴愮姸鎬�
                 int e = inboundOrder.Details.Count();
@@ -2755,95 +2795,91 @@
                 _outboundOrderService.UpdateData(outboundOrder);
                 _unitOfWorkManage.CommitTran();
 
-                if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+                //鍏ュ簱鍥炰紶MES
+                var infeedmodel = new FeedbackInboundRequestModel
                 {
-                    var feedmodel = new FeedbackInboundRequestModel
+                    reqCode = Guid.NewGuid().ToString(),
+                    reqTime = DateTime.Now.ToString(),
+                    business_type = inboundOrder.BusinessType,
+                    factoryArea = inboundOrder.FactoryArea,
+                    operationType = 1,
+                    Operator = App.User.UserName,
+                    orderNo = inboundOrder.UpperOrderNo,
+                    status = inboundOrder.OrderStatus,
+                    details = new List<FeedbackInboundDetailsModel>()
+
+                };
+
+                var groupedData = inboundOrderDetails.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
+                    .Select(group => new FeedbackInboundDetailsModel
                     {
-                        reqCode = Guid.NewGuid().ToString(),
-                        reqTime = DateTime.Now.ToString(),
-                        business_type = inboundOrder.BusinessType,
-                        factoryArea = inboundOrder.FactoryArea,
-                        operationType = 1,
-                        Operator = inboundOrder.Operator,
-                        orderNo = inboundOrder.UpperOrderNo,
-                        status = inboundOrder.OrderStatus,
-                        details = new List<FeedbackInboundDetailsModel>()
+                        materialCode = group.Key.MaterielCode,
+                        supplyCode = group.Key.SupplyCode,
+                        batchNo = group.Key.BatchNo,
+                        lineNo = group.Key.lineNo,
+                        warehouseCode = group.Key.WarehouseCode,
+                        qty = group.Sum(x => x.BarcodeQty),
+                        // warehouseCode= "1072",
+                        unit = group.Key.BarcodeUnit,
+                        barcodes = group.Select(row => new FeedbackBarcodesModel
+                        {
+                            barcode = row.Barcode,
+                            qty = row.BarcodeQty
+                        }).ToList()
+                    }).ToList();
+                infeedmodel.details = groupedData;
 
-                    };
-
-                    var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
-                       .Select(group => new FeedbackInboundDetailsModel
-                       {
-                           materialCode = group.Key.MaterielCode,
-                           supplyCode = group.Key.SupplyCode,
-                           batchNo = group.Key.BatchNo,
-                           lineNo = group.Key.lineNo,
-                           warehouseCode = group.Key.WarehouseCode,
-                           qty = group.Sum(x => x.BarcodeQty),
-                           // warehouseCode= "1072",
-                           unit = group.Key.BarcodeUnit,
-                           barcodes = group.Select(row => new FeedbackBarcodesModel
-                           {
-                               barcode = row.Barcode,
-                               qty = row.BarcodeQty
-                           }).ToList()
-                       }).ToList();
-                    feedmodel.details = groupedData;
-
-                    var result = await _invokeMESService.FeedbackInbound(feedmodel);
-                    if (result != null && result.code == 200)
-                    {
-                        _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
-                        .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
-                        _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
-                        .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
-                    }
+                var result1 = await _invokeMESService.FeedbackInbound(infeedmodel);
+                if (result1 != null && result1.code == 200)
+                {
+                    _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
+                    .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+                    _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
+                    .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
                 }
-                if (outboundOrder.OrderStatus == OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt())
-                {
-                    var feedmodel = new FeedbackOutboundRequestModel
+                //鍑哄簱鍥炰紶MES
+                var outfeedmodel = new FeedbackOutboundRequestModel
                     {
                         reqCode = Guid.NewGuid().ToString(),
                         reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                         business_type = outboundOrder.BusinessType,
                         factoryArea = outboundOrder.FactoryArea,
                         operationType = 1,
-                        Operator = outboundOrder.Operator,
+                        Operator = App.User.UserName,
                         orderNo = outboundOrder.UpperOrderNo,
                         documentsNO = outboundOrder.OrderNo,
                         status = outboundOrder.OrderStatus,
                         details = new List<FeedbackOutboundDetailsModel>()
                     };
+                foreach (var detail in outboundOrder.Details)
+                {
+                    // 鑾峰彇璇ユ槑缁嗗搴旂殑鏉$爜淇℃伅锛堜粠閿佸畾璁板綍锛�
+                    var detailLocks = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
+                        .Where(x => x.OrderNo == outboundOrder.UpperOrderNo &&
+                                    x.OrderDetailId == detail.Id &&
+                                        (x.Status == (int)OutLockStockStatusEnum.鎷i�夊畬鎴� || x.Status == (int)OutLockStockStatusEnum.宸插洖搴�))
+                        .ToListAsync();
 
+                        var groupdata = detailLocks.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
+                              .Select(group => new FeedbackOutboundDetailsModel
+                              {
 
-                    foreach (var detail in outboundOrder.Details)
-                    {
-                        // 鑾峰彇璇ユ槑缁嗗搴旂殑鏉$爜淇℃伅锛堜粠閿佸畾璁板綍锛�
-                        var detailLocks = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
-                            .Where(x => x.OrderNo == outboundOrder.OrderNo &&
-                                       x.OrderDetailId == detail.Id &&
-                                       x.Status == (int)OutLockStockStatusEnum.鎷i�夊畬鎴�)
-                            .ToListAsync();
-
-                        var detailModel = new FeedbackOutboundDetailsModel
-                        {
-                            materialCode = detail.MaterielCode,
-                            lineNo = detail.lineNo,  
-                            warehouseCode = detail.WarehouseCode,
-                            qty = detail.OverOutQuantity, // 浣跨敤璁㈠崟鏄庣粏鐨勫凡鍑哄簱鏁伴噺
-                            currentDeliveryQty = detail.OverOutQuantity,
-                            unit = detail.Unit,
-                            barcodes = detailLocks.Select(lockInfo => new WIDESEA_DTO.Outbound.BarcodesModel
-                            {
-                                barcode = lockInfo.CurrentBarcode,
-                                supplyCode = lockInfo.SupplyCode,
-                                batchNo = lockInfo.BatchNo,
-                                unit = lockInfo.BarcodeUnit,
-                                qty = lockInfo.BarcodeQty //  
-                            }).ToList()
-                        };
-
-                        feedmodel.details.Add(detailModel);
+                                  materialCode = group.Key.MaterielCode,
+                                  lineNo = group.Key.lineNo,
+                                  warehouseCode = group.Key.WarehouseCode,
+                                  qty = group.Sum(x => x.PickedQty),
+                                  currentDeliveryQty = group.Sum(x => x.PickedQty),
+                                  unit = group.Key.BarcodeUnit,
+                                  barcodes = group.Select(lockInfo => new WIDESEA_DTO.Outbound.BarcodesModel
+                                  {
+                                      barcode = lockInfo.CurrentBarcode,
+                                      supplyCode = lockInfo.SupplyCode,
+                                      batchNo = lockInfo.BatchNo,
+                                      unit = lockInfo.BarcodeUnit,
+                                      qty = lockInfo.PickedQty
+                                  }).ToList()
+                              }).ToList();
+                        feedmodel.details.AddRange(groupdata);
                     }
                     var result = await _invokeMESService.FeedbackOutbound(feedmodel);
                     if (result != null && result.code == 200)
@@ -2853,14 +2889,11 @@
                             .Where(x => x.OrderId == outboundOrder.Id)
                             .ExecuteCommandAsync();
 
-                        await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>()
-                            .SetColumns(x => x.ReturnToMESStatus == 1)
-                            .Where(x => x.Id == outboundOrder.Id)
-                            .ExecuteCommandAsync();
-                    }
+                    await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>()
+                        .SetColumns(x => x.ReturnToMESStatus == 1)
+                        .Where(x => x.Id == outboundOrder.Id)
+                        .ExecuteCommandAsync();
                 }
-
-
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
@@ -2934,7 +2967,18 @@
                     return content = WebResponseContent.Instance.Error($"浠撳簱涓病鏈夎{materielGroupDTO.WarehouseType}缂栧彿銆�");
                 }
 
-
+                if (materielGroupDTO.orderTypes == InOrderTypeEnum.ReCheck.ObjToInt())
+                {
+                    var dborder = _reCheckOrderService.Db.Queryable<Dt_ReCheckOrder>().First(x => x.OrderNo == materielGroupDTO.OrderNo);
+                    if (dborder != null && dborder.SignSeq == 0)
+                    {
+                        return content.Error("鍙湁鎷垮埌閲嶆缁撴灉鎵嶈兘鍏ュ簱锛�");
+                    }
+                    else
+                    {
+                        return content.Error("娌℃湁鎵惧埌閲嶆鍗曟嵁鏁版嵁銆�");
+                    }
+                }
                 //  Dt_InboundOrder inboundOrder = GetInboundOrder(materielGroupDTO.OrderNo);
 
                 var dbinboundOrderDetails = Db.Queryable<Dt_PickingRecord>().Where(x => x.OrderNo == materielGroupDTO.OrderNo && !x.IsCancelled && x.Barcode == materielGroupDTO.Barcodes).ToList();
@@ -2980,7 +3024,7 @@
                 }
                 else
                 {
-                    dt_InboundOrder = new Dt_InboundOrder { Details = new List<Dt_InboundOrderDetail>() };        
+                    dt_InboundOrder = new Dt_InboundOrder { Details = new List<Dt_InboundOrderDetail>() };
                     inboindId = dbinbound.Id;
                 }
 

--
Gitblit v1.9.3