From 6a17bde61e85c7dbe0dc441ad3faf057ff44d66f Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 14 一月 2025 14:58:42 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   38 ++++++++++++++++++--------------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index cc787f0..b3a551d 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -112,12 +112,12 @@
                 {
                     x.AGVArea = agvDescription;
                 });
-                string address = AppSettings.Get("WCSApiAddress");
-                if (string.IsNullOrEmpty(address))
+                string url = AppSettings.Get("WCS");
+                if (string.IsNullOrEmpty(url))
                 {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒癢CSApi鍦板潃");
+                    return WebResponseContent.Instance.Error($"鏈壘鍒癢CSApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
                 }
-                string response = HttpHelper.Post($"{address}/api/Task/ReceiveTask", taskDTOs.Serialize());
+                string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize());
 
                 return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
             }
@@ -135,12 +135,12 @@
         {
             try
             {
-                string address = AppSettings.Get("WCSApiAddress");
-                if (string.IsNullOrEmpty(address))
+                string url = AppSettings.Get("WCS");
+                if (string.IsNullOrEmpty(url))
                 {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒癢CSApi鍦板潃");
+                    return WebResponseContent.Instance.Error($"鏈壘鍒癢CSAApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
                 }
-                string response = HttpHelper.Post($"{address}/api/CTU_AGV/PutFinish", code);
+                string response = HttpHelper.Post($"{url}/api/CTU_AGV/PutFinish?code=" + code);
 
                 return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
             }
@@ -198,8 +198,8 @@
 
                 stockInfo.LocationCode = locationInfo.LocationCode;
 
-                #region 绌虹鍏ュ簱
-                if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt())
+                #region 绌虹鍏ュ簱/鎷i�夊洖搴�
+                if (task.TaskType == TaskTypeEnum.InEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.InPick.ObjToInt())
                 {
                     stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
                     task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
@@ -215,16 +215,13 @@
 
                 Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First();
                 List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>();
+                List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>();
                 if (stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt())
                 {
-                    //鎺ㄩ�佸叆搴撳畬鎴愮粰Erp
                     if (inboundOrder == null)
                     {
                         return WebResponseContent.Instance.Error($"瀵瑰簲鍏ュ簱鍗曚笉瀛樺湪");
                     }
-
-                    List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>();
-
                     foreach (var item in stockInfo.Details)
                     {
                         Dt_InboundOrderDetail? inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == item.InboundOrderRowNo);
@@ -261,17 +258,14 @@
                     {
                         inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt();
                     }
-                    if (!_inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels).Status)//todo 淇敼澶勭悊
-                    {
-                        return WebResponseContent.Instance.Error($"鍏ュ簱鍚屾Erp澶辫触");
-                    }
+
                 }
 
                 if ((stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt() || stockInfo.StockStatus == StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt()) && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString())
                 {
                     foreach (var model in stockInfo.Details)
                     {
-                        TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, /*MaterialName = model.MaterielName,*/ Life = int.TryParse(model.Remark, out int val) ? val : 1000 });
+                        TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, MaterialName = model.MaterielName, Life = int.TryParse(model.Remark, out int val) ? val : 1000 });
                     }
                 }
 
@@ -304,6 +298,10 @@
                     _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder);
                 }
                 _unitOfWorkManage.CommitTran();
+                if (stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt())
+                {
+                    _inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels);
+                }
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
@@ -354,7 +352,7 @@
                     {
                         if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt())
                         {
-                            Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.Id == item.OrderDetailId);
+                            Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.TaskNo == item.OrderNo);
                             if (mesOutboundOrder != null)
                             {
                                 mesOutboundOrder.OverOutQuantity = item.AssignQuantity;

--
Gitblit v1.9.3