From a647de5665411f706beddc5e0ff7b3a3daaca4fc Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期六, 24 一月 2026 11:11:57 +0800
Subject: [PATCH] 前端页面优化和大屏

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/Partial/SCExecutionBlock.cs |   86 ++++++++++++++++++++++++++++++++++--------
 1 files changed, 69 insertions(+), 17 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/Partial/SCExecutionBlock.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/Partial/SCExecutionBlock.cs"
index 914a397..2332a12 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/Partial/SCExecutionBlock.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/Partial/SCExecutionBlock.cs"
@@ -47,7 +47,7 @@
                 if (dt_Location.Depth == 1 && dt_Task.TaskType == (int)TaskTypeEnum.Inbound)
                 {
                     if (shallowLocation.LocationStatus == (int)LocationStatusEnum.InStock) return content.OK();
-                    return content.Error();
+                    return content.Error($"鍏ュ簱鑷虫繁搴撲綅锛屼絾鏄祬璐т綅鏈夎揣锛屼换鍔″彿锛歿dt_Task.TaskId},鎵樼洏鏉$爜");
                 }
                 if (shallowLocation.LocationStatus == (int)LocationStatusEnum.Free) return content.OK();
 
@@ -69,14 +69,13 @@
                         UpdateTaskStatus(dt_Task, result,
                         successStatus: dt_Task.TaskStatus == (int)InTaskStatusEnum.PLC_InFinish ? (int)InTaskStatusEnum.SC_IntExecuting : (int)OutTaskStatusEnum.SC_OutExecuting, 1);
 
-                        WriteLog.Write_Log("WMS_鍒ゆ柇宸烽亾鍐呯Щ搴�", $"鍒ゆ柇绉诲簱", "澶辫触", $"鍘熷洜锛歿result.Message}");
-                        return content.Error();
+                        return content.Error($"涓嬪彂wcs澶辫触锛屽師鍥狅細{result.Message}");
                     }
                 }
 
                 var CuttTransferTask = _taskService.RelocationTaskProgress(dt_Task.Roadway);
                 //鍒ゆ柇褰撳墠鏄惁鏈夌Щ搴撲换鍔�
-                if (CuttTransferTask != null) return content.Error();
+                if (CuttTransferTask) return content.Error("褰撳墠鏈夌Щ搴撲换鍔★紝涓嶅彲涓嬪彂");
 
 
                 if (shallowLocation.LocationStatus != (int)LocationStatusEnum.InStock) return content.Error();
@@ -86,8 +85,7 @@
             }
             catch (Exception ex)
             {
-                WriteLog.Write_Log("WMS_鍒ゆ柇宸烽亾鍐呯Щ搴�", $"鍒ゆ柇绉诲簱", "澶辫触,鏂规硶鍐呮晠闅�", $"鍘熷洜锛歿ex.Message}");
-                return content.Error();
+                return content.Error($"鍒ゆ柇宸烽亾鍐呯Щ搴�,澶辫触,鏂规硶鍐呮晠闅�,鍘熷洜锛歿ex.Message}");
 
             }
         }
@@ -103,7 +101,66 @@
                 Dt_LocationInfo newLocation = _locationInfoService.GetLocation(OriginalLocation.RoadwayNo, OriginalLocation.LocationType);
                 List<Dt_LocationInfo> dt_Locations = new List<Dt_LocationInfo>();
 
-                MES_parameter mES_Parame = _taskService.ApplicationChangeStorageLocation(dt_StockInfo.PalletCode, OriginalLocation.LocationCode, newLocation.LocationCode);
+                var TransferTask = _taskService.GeRelocationTaskQueue(shallowLocation);
+
+
+
+
+                //杩涜鐢熸垚浠诲姟锛屼笅鍙戜换鍔¤嚦MES
+                Dt_Task task = new Dt_Task();
+                task.TaskNum = "0";
+                task.PalletCode = dt_StockInfo.PalletCode;
+                task.PalletType = dt_StockInfo.PalletType;
+                task.Roadway = OriginalLocation.RoadwayNo;
+                task.TaskType = (int)TaskTypeEnum.Relocation;
+                task.TaskStatus = (int)RelocationTaskStatusEnum.RelocationNew;
+                task.SourceAddress = OriginalLocation.LocationCode;
+                task.TargetAddress = newLocation.LocationCode;
+                task.CurrentAddress = OriginalLocation.LocationCode;
+                task.NextAddress = newLocation.LocationCode;
+                task.WarehouseId = OriginalLocation.WarehouseId;
+                task.OrderNo = "";
+                task.Grade = 1;
+                task.Creater = "MES";
+                task.CreateDate = DateTime.Now;
+
+                OriginalLocation.LocationStatus = (int)LocationStatusEnum.Lock;
+                newLocation.LocationStatus = (int)LocationStatusEnum.Lock;
+                dt_StockInfo.StockStatus = (int)StockStatusEmun.绉诲簱閿佸畾;
+
+                dt_Locations.Add(OriginalLocation);
+                dt_Locations.Add(newLocation);
+
+                _unitOfWorkManage.BeginTran();
+
+                int TaskId = _taskService.Repository.AddData(task);
+                _locationInfoService.UpdateData(dt_Locations);
+                _stockInfoService.UpdateData(dt_StockInfo);
+                _unitOfWorkManage.CommitTran();
+                return webResponse.Error("宸茬敓鎴愮Щ搴撲换鍔�");
+                //杩涜涓嬪彂缁欏爢鍨涙満浠诲姟
+                /*WCSginseng result = _taskService.SC_IssueTasks(
+                    TaskId,
+                    int.Parse(task.Roadway),
+                    task.TaskNum,
+                    task.PalletCode,
+                    int.Parse(task.PalletType),
+                    task.CurrentAddress,
+                    task.NextAddress,
+                    task.TargetAddress);
+                if (result.IsSuccess)
+                {
+                    Dt_Task dt_Task=_taskService.Repository.QueryFirst(x=>x.TaskId== task.TaskId);
+                    dt_Task.TaskStatus = (int)RelocationTaskStatusEnum.RelocationExecuting;
+                    _taskService.UpdateData(dt_Task);
+                    return webResponse.OK();
+                }
+                else
+                {
+                    return webResponse.Error($"涓嬪彂绉诲簱澶辫触,鍘熷洜锛歿result.Message}");
+                }*/
+
+                /*MES_parameter mES_Parame = _taskService.ApplicationChangeStorageLocation(dt_StockInfo.PalletCode, OriginalLocation.LocationCode, newLocation.LocationCode);
                 if (mES_Parame != null)
                 {
                     if (mES_Parame.Result == "Y")
@@ -160,28 +217,23 @@
                         }
                         else
                         {
-                            WriteLog.Write_Log("WMS_鍒ゆ柇宸烽亾鍐呯Щ搴�", $"绉诲簱浠诲姟鐢熸垚鏂规硶", "涓嬪彂绉诲簱澶辫触", $"鍘熷洜锛歿result.Message}");
-
-                            return webResponse.Error();
+                            return webResponse.Error($"涓嬪彂绉诲簱澶辫触,鍘熷洜锛歿result.Message}");
                         }
                     }
                     else
                     {
-                        WriteLog.Write_Log("WMS_鍒ゆ柇宸烽亾鍐呯Щ搴�", $"绉诲簱浠诲姟鐢熸垚鏂规硶", "鐢宠MES绉诲簱", $"鐢宠鍌ㄤ綅寮傚姩锛孧ES涓嶅厑璁哥Щ鍔�");
-                        return webResponse.Error();
+                        return webResponse.Error($"鐢宠鍌ㄤ綅寮傚姩锛孧ES涓嶅厑璁哥Щ鍔�====>>>>杩斿洖鍐呭锛歿mES_Parame.ToJson()}");
                     }
                 }
                 else
                 {
-                    WriteLog.Write_Log("WMS_鍒ゆ柇宸烽亾鍐呯Щ搴�", $"绉诲簱浠诲姟鐢熸垚鏂规硶", "鐢宠MES绉诲簱,杩斿洖绌�", $"鐢宠鍌ㄤ綅寮傚姩锛孧ES杩斿洖涓虹┖");
-                    return webResponse.Error();
-                }
+                    return webResponse.Error("鐢宠鍌ㄤ綅寮傚姩锛孧ES杩斿洖涓虹┖");
+                }*/
             }
             catch (Exception ex)
             {
                 _unitOfWorkManage.RollbackTran();
-                WriteLog.Write_Log("WMS_鍒ゆ柇宸烽亾鍐呯Щ搴�", $"绉诲簱浠诲姟鐢熸垚鏂规硶", "绯荤粺鏁呴殰", $"鍘熷洜锛歿ex.Message}");
-                return webResponse.Error();
+                return webResponse.Error($"绉诲簱浠诲姟鐢熸垚鏂规硶锛岀郴缁熸晠闅�,鍘熷洜锛歿ex.Message}");
             }
         }
 

--
Gitblit v1.9.3