From f5df33d51a8555d709a4e8369fa98ce70759ddfc Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期一, 17 十一月 2025 13:39:17 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   57 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 47 insertions(+), 10 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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
index 596284c..7d96932 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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
@@ -108,7 +108,7 @@
             _outStockLockInfoService = outStockLockInfoService;
         }
 
- 
+
         /// <summary>
         /// 
         /// </summary>
@@ -260,15 +260,15 @@
 
                         };
 
-                        var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode})
+                        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 ,
-                              // warehouseCode= "1072",
+                               warehouseCode = group.Key.WarehouseCode,
+                               // warehouseCode= "1072",
                                unit = group.Key.BarcodeUnit,
                                barcodes = group.Select(row => new FeedbackBarcodesModel
                                {
@@ -277,20 +277,51 @@
                                }).ToList()
                            }).ToList();
                         feedmodel.details = groupedData;
-                        
+
                         _invokeMESService.FeedbackInbound(feedmodel);
                     }
 
                 }
             }
-            catch (Exception ex) {
+            catch (Exception ex)
+            {
                 _logger.LogInformation("InboundTaskCompleted 鍥炲啓MES澶辫触:  " + ex.Message);
             }
 
             return WebResponseContent.Instance.OK();
         }
 
+        public WebResponseContent OutboundTaskCompleted(Dt_Task task)
+        {
+            _logger.LogInformation($"TaskService  OutboundTaskCompleted: {task.TaskNum}");
+            //鏌ヨ揣浣�
+            Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+            if (locationInfo == null)
+            {
+                return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑缁堢偣璐т綅淇℃伅");
+            }
+            locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+            _locationInfoService.Repository.UpdateData(locationInfo);
 
+            var outloks = _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>().Where(x => x.TaskNum == task.TaskNum).ToList();
+            outloks.ForEach(o =>
+            {
+                o.Status = OutLockStockStatusEnum.宸插嚭搴�.ObjToInt();
+            });
+            _outStockLockInfoService.Db.Updateable(outloks).ExecuteCommand();
+
+            var locationCodes = outloks.Select(it => it.LocationCode).Distinct().ToList();
+
+            //_stockRepository.Db.Updateable<Dt_StockInfo>()
+            //  .SetColumns(it => new Dt_StockInfo { StockStatus = StockStatusEmun.})
+            //  .Where(it => locationCodes.Contains(it.LocationCode))
+            //  .ExecuteCommand();
+
+
+            return WebResponseContent.Instance.OK();
+
+
+        }
         public async Task<WebResponseContent> InEmptyTaskCompleted(Dt_Task task)
         {
 
@@ -344,14 +375,20 @@
             }
         }
 
+        public  WebResponseContent InPickTaskCompleted(Dt_Task task)
+        {
+            _logger.LogInformation($"TaskService  InPickTaskCompleted: {task.TaskNum}");
 
+
+            return WebResponseContent.Instance.OK();
+        }
 
         public async Task<WebResponseContent> OutEmptyTaskCompleted(Dt_Task task)
         {
             WebResponseContent content = new WebResponseContent();
             try
             {
-                Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode  ).First();
+                Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode).First();
                 if (stockInfo == null)
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒版墭鐩樺搴旂殑搴撳瓨淇℃伅");
@@ -363,7 +400,7 @@
                     return content.Error($"鏈壘鍒板搴旂殑缁堢偣璐т綅淇℃伅");
                 }
 
-               
+
                 int beforeStatus = locationInfo.LocationStatus;
 
                 locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
@@ -389,7 +426,7 @@
 
 
 
-      
+
         /// <summary>
         /// 鍥炲簱瀹屾垚鍥炶皟 
         public async Task<WebResponseContent> BackToStockComplete(Dt_Task task)
@@ -471,7 +508,7 @@
 
                 //  鏇存柊浠诲姟鐘舵�佷负宸插畬鎴�
                 task.TaskStatus = (int)TaskStatusEnum.Finish;
-             
+
                 await Db.Updateable(task).ExecuteCommandAsync();
 
                 _unitOfWorkManage.CommitTran();

--
Gitblit v1.9.3