From 5bfad0fb36a39632459d58ba3e1f3d0f6ea66191 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 18 十二月 2025 18:32:01 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db |    0 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db      |    0 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/LoggerHelper.cs                                   |  187 +++++++++++++++++++++++++++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs                                             |   40 +++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs                               |    2 
 项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue                                                |   28 +++-
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                                   |   57 +++++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/QuartzJobMildd.cs                                 |   26 ++--
 8 files changed, 313 insertions(+), 27 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
index 7301271..1d56456 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
@@ -1379,17 +1379,33 @@
 
 /* Element Plus Loading 閬僵灞傛牱寮忎慨澶� */
 ::v-deep .el-loading-mask {
-    background-color: rgba(255, 255, 255, 0.8);
-    z-index: 2000;
+    background-color: rgba(255, 255, 255, 0.8) !important;
+    z-index: 9999 !important;
+    position: fixed !important;
+    top: 0 !important;
+    left: 0 !important;
+    right: 0 !important;
+    bottom: 0 !important;
+    display: flex !important;
+    justify-content: center !important;
+    align-items: center !important;
 }
 
 ::v-deep .el-loading-spinner {
-    z-index: 2001;
+    z-index: 10000 !important;
+    margin-top: -21px !important;
 }
 
 ::v-deep .el-loading-text {
-    color: #409EFF;
-    font-weight: bold;
-    font-size: 14px;
+    color: #409EFF !important;
+    font-weight: bold !important;
+    font-size: 16px !important;
+    margin-top: 15px !important;
+}
+
+/* 纭繚瀹瑰櫒鐩稿瀹氫綅 */
+.picking-container {
+    position: relative !important;
+    min-height: 100vh;
 }
 </style>
\ No newline at end of file
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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db" "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db"
index 0667523..38462b5 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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db"
+++ "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db"
Binary files differ
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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db" "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db"
index 3e55c8a..84a3942 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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db"
+++ "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db"
Binary files differ
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_Core/LogHelper/LoggerHelper.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_Core/LogHelper/LoggerHelper.cs"
new file mode 100644
index 0000000..49008cc
--- /dev/null
+++ "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_Core/LogHelper/LoggerHelper.cs"
@@ -0,0 +1,187 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEAWCS_Core.LogHelper
+{
+    public class LoggerHelper
+    {
+        // 璇诲啓閿侊紝纭繚澶氱嚎绋嬬幆澧冧笅鏃ュ織鍐欏叆鐨勭嚎绋嬪畨鍏�
+        static ReaderWriterLockSlim LogWriteLock = new ReaderWriterLockSlim();
+
+        // 鏃ュ織鏂囦欢澶硅矾寰�
+        static string folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Log");
+
+        // 璁板綍鏃ュ織鐨勯槦鍒�
+        static Queue<string> logQueue = new Queue<string>();
+
+        static LoggerHelper()
+        {
+            try
+            {
+                if (!Directory.Exists(folderPath))
+                {
+                    Directory.CreateDirectory(folderPath);
+                }
+            }
+            catch (Exception ex)
+            {
+                Debug.WriteLine(ex.Message);
+            }
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="ex"></param>
+        /// <param name="filePath"></param>
+        public static void WriteError(Exception ex, string filePath = "")
+        {
+            StringBuilder builder = new StringBuilder();
+            builder.Append("閿欒淇℃伅锛�");
+            builder.Append(ex.Message);
+            builder.Append(Environment.NewLine);
+            builder.Append("閿欒婧愶細");
+            builder.Append(ex.Source);
+            builder.Append(Environment.NewLine);
+            builder.Append("閿欒鍫嗘爤锛�");
+            builder.Append(ex.StackTrace);
+            builder.Append(Environment.NewLine);
+            builder.Append("閿欒绫诲瀷锛�");
+            builder.Append(ex.GetType().ToString());
+            builder.Append(Environment.NewLine);
+            builder.Append("閿欒鏂规硶锛�");
+            builder.Append(ex.TargetSite?.ToString());
+            builder.Append(Environment.NewLine);
+            builder.Append(Environment.NewLine);
+
+            WriteLogToFile($"Error_", builder.ToString(), filePath);
+        }
+
+        /// <summary>
+        /// 灏嗘棩蹇楀唴瀹瑰啓鍏ユ寚瀹氭枃浠�
+        /// </summary>
+        /// <param name="fileName">鏃ュ織鏂囦欢鍚�</param>
+        /// <param name="log">瑕佽褰曠殑鏃ュ織鍐呭</param>
+        /// <remarks>
+        /// 璇ユ柟娉曚細纭繚绾跨▼瀹夊叏鍦板啓鍏ユ棩蹇楋紝鑻ョ洰褰曚笉瀛樺湪浼氳嚜鍔ㄥ垱寤猴紝
+        /// 鏃ュ織鍐呭浼氳嚜鍔ㄦ坊鍔犳椂闂存埑骞惰拷鍔犲埌鏂囦欢鏈熬
+        /// </remarks>
+        public static void WriteLogToFile(string fileName, string log, string filePath = "")
+        {
+            try
+            {
+                // 杩涘叆鍐欓攣
+                LogWriteLock.EnterWriteLock();
+
+                string path = string.IsNullOrEmpty(filePath) ? folderPath : filePath;
+
+                // 濡傛灉鏂囦欢澶逛笉瀛樺湪锛屽垯鍒涘缓鏂囦欢澶�
+                if (!Directory.Exists(path))
+                {
+                    Directory.CreateDirectory(path);
+                }
+                // 鑾峰彇鏃ュ織鏂囦欢璺緞
+                string logFilePath = Path.Combine(path, GetLastAccessFileName(fileName, path));
+                // 鑾峰彇褰撳墠鏃堕棿
+                DateTime now = DateTime.Now;
+                // 鏋勯�犳棩蹇楀唴瀹�
+                string logContent = $"銆恵now}銆憑Environment.NewLine}{log}";
+
+                // 灏嗘棩蹇楀唴瀹硅拷鍔犲埌鏃ュ織鏂囦欢涓�
+                File.AppendAllText(logFilePath, logContent);
+
+                WriteCompleted();
+            }
+            catch { }
+            finally
+            {
+                // 閫�鍑哄啓閿�
+                LogWriteLock.ExitWriteLock();
+            }
+        }
+        static int size = 10 * 1024 * 1024;
+
+        /// <summary>
+        /// 鑾峰彇鏈�鍚庝竴涓彲鐢ㄧ殑鏃ュ織鏂囦欢鍚�
+        /// </summary>
+        /// <param name="fileName">鏃ュ織鏂囦欢鍩虹鍚嶇О</param>
+        /// <returns>濡傛灉瀛樺湪鏈揪鍒板ぇ灏忛檺鍒剁殑鏃ュ織鏂囦欢鍒欒繑鍥炶鏂囦欢鍚嶏紝鍚﹀垯杩斿洖鍩轰簬褰撳墠鏃堕棿鐨勬柊鏃ュ織鏂囦欢鍚�</returns>
+        /// <remarks>
+        /// 璇ユ柟娉曚細閬嶅巻鎵�鏈夊凡瀛樺湪鐨勬棩蹇楁枃浠讹紝杩斿洖绗竴涓枃浠跺ぇ灏忔湭瓒呰繃闄愬埗鐨勬枃浠跺悕銆�
+        /// 濡傛灉娌℃湁绗﹀悎鏉′欢鐨勬枃浠讹紝鍒欑敓鎴愪竴涓互褰撳墠鏃堕棿鍛藉悕鐨勬柊鏃ュ織鏂囦欢鍚嶃��
+        /// </remarks>
+        private static string GetLastAccessFileName(string fileName, string path)
+        {
+            foreach (var m in GetExistLogFileNames(fileName, path))
+            {
+                FileInfo fileInfo = new FileInfo(m);
+                if (fileInfo.Length < size)
+                {
+                    return m;
+                }
+            }
+
+            // 杩斿洖涓�涓柊鐨勯粯璁ゅ綋鍓嶆椂闂寸殑鏃ュ織鍚嶇О
+            return $@"{fileName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.log";
+        }
+
+        /// <summary>
+        /// 鑾峰彇鎸囧畾鏂囦欢鍚嶆ā寮忕殑鎵�鏈夋棩蹇楁枃浠�
+        /// </summary>
+        /// <param name="fileName">鏃ュ織鏂囦欢鍚嶅墠缂�</param>
+        /// <returns>鍖归厤鏂囦欢鍚嶆ā寮忕殑鎵�鏈夋棩蹇楁枃浠惰矾寰勬暟缁�</returns>
+        private static string[] GetExistLogFileNames(string fileName, string path)
+        {
+            string[] fileNames = Directory.GetFiles(path, fileName + "*.log");
+            return fileNames;
+        }
+
+        private static string[] GetExistLogFileNames()
+        {
+            if (!string.IsNullOrEmpty(folderPath))
+                return Directory.GetFiles(folderPath, "Error_*.log");
+            else
+                return new string[] { };
+        }
+
+        private static int controlFileQuantity = 100;
+
+        protected static void WriteCompleted()
+        {
+            if (controlFileQuantity > 1)
+            {
+                try
+                {
+                    string[] files = GetExistLogFileNames();
+                    if (files.Length > controlFileQuantity)
+                    {
+                        List<FileInfo> fileInfos = new List<FileInfo>();
+                        for (int i = 0; i < files.Length; i++)
+                        {
+                            fileInfos.Add(new FileInfo(files[i]));
+                        }
+
+                        fileInfos.Sort(new Comparison<FileInfo>((m, n) =>
+                        {
+                            return m.CreationTime.CompareTo(n.CreationTime);
+                        }));
+
+                        for (int i = 0; i < fileInfos.Count - controlFileQuantity; i++)
+                        {
+                            File.Delete(fileInfos[i].FullName);
+                        }
+                    }
+                }
+                catch
+                {
+
+                }
+            }
+        }
+    }
+}
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/OutboundService.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/OutboundService.cs"
index c779ed3..b49a2ad 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/OutboundService.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/OutboundService.cs"
@@ -1163,6 +1163,8 @@
                     FactoryArea = item.FactoryArea,
                     WarehouseCode = item.WarehouseCode,
                     Barcode = item.Barcode,
+                    CreateDate = item.CreateDate,
+                    Creater = item.Creater,
                     Remark = $"鏁寸鍑哄簱瀹屾垚鍒犻櫎锛屾潯鐮侊細{request.PalletCode}锛屽師鏁伴噺锛歿item.StockQuantity}锛屽嚭搴撴暟閲忥細{item.StockQuantity}锛屾搷浣滆�咃細{request.Operator}"
                 };
                 historyRecords.Add(historyRecord);
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 f9334b2..8405d4c 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"
@@ -41,10 +41,12 @@
 using WIDESEA_Core.BaseServices;
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
+using WIDESEA_Core.Util;
 using WIDESEA_DTO.Allocate;
 using WIDESEA_DTO.Basic;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Outbound;
+using WIDESEA_DTO.ReturnMES;
 using WIDESEA_DTO.Task;
 using WIDESEA_IAllocateService;
 using WIDESEA_IBasicService;
@@ -56,6 +58,7 @@
 using WIDESEA_Model.Models;
 using WIDESEA_Model.Models.Check;
 using WIDESEA_Model.Models.Outbound;
+using static HslCommunication.Profinet.Knx.KnxCode;
 
 namespace WIDESEA_TaskInfoService
 {
@@ -459,8 +462,11 @@
                                }).ToList();
                             feedmodel.details = groupedData;
 
-                            var feedbackresult = await _invokeMESService.FeedbackInbound(feedmodel);
-                            if (feedbackresult != null && feedbackresult.code == 200)
+                            //var feedbackresult = await _invokeMESService.FeedbackInbound(feedmodel);
+
+                            var response= responseModel(feedmodel, inboundOrder);
+
+                            if (response != null && response.IsSuccess)
                             {
                                 _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1, Remark = "" })
                                 .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
@@ -469,7 +475,7 @@
                             }
                             else
                             {
-                                _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2, Remark = feedbackresult.message })
+                                _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2, Remark = response.ErrorMessage })
                                 .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
                                 _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 })
                                .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
@@ -487,6 +493,51 @@
             return WebResponseContent.Instance.OK();
         }
 
+        public HttpResponseResult<MesResponseDTO> responseModel(FeedbackInboundRequestModel model,Dt_InboundOrder order)
+        {
+            HttpResponseResult<MesResponseDTO> httpResponseResult = new HttpResponseResult<MesResponseDTO>();
+            string reqCode = Guid.NewGuid().ToString();
+            string reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            string requestData = string.Empty;
+            //string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl");
+            string apiUrl = "http://127.0.0.1:450/api/AldMaterialWarehousing/MaterialWarehousing";
+            httpResponseResult = _httpClientHelper.Post<MesResponseDTO>(apiUrl, model.Serialize());
+            httpResponseResult.ApiUrl = apiUrl;
+            bool isSuccess = httpResponseResult.IsSuccess && httpResponseResult.Data.Code == "200";
+            string message = "鎴愬姛";
+            if (!isSuccess)
+            {
+                if (!httpResponseResult.IsSuccess)
+                {
+                    message = $"MES鎺ュ彛杩斿洖閿欒锛孒TTP浠g爜锛歿httpResponseResult.StatusCode}锛屼俊鎭細{httpResponseResult.ErrorMessage}";
+                }
+                else if (httpResponseResult?.Data?.Code != "200")
+                {
+                    message = $"璋冪敤MES鎺ュ彛澶辫触锛屼唬鐮侊細{httpResponseResult?.Data?.Code}锛屼俊鎭細{httpResponseResult?.Data?.Message}";
+                }
+            }
+            Dt_MesReturnRecord mesReturnRecord = new Dt_MesReturnRecord()
+            {
+                ApiUrl = httpResponseResult.ApiUrl,
+                InterfaceType = 2,
+                OrderId = order.Id,
+                OrderNo = order.InboundOrderNo,
+                RequestCode = reqCode,
+                RequestData = requestData,
+                FailureReason = message,
+                LastReturnTime = DateTime.Now,
+                HttpStatusCode = httpResponseResult.StatusCode.ObjToInt(),
+                ResponseData = httpResponseResult.Content,
+                ReturnType = 0,
+                ReturnCount = 1,
+                ReturnStatus = httpResponseResult.IsSuccess ? 1 : 2,
+                SuccessTime = httpResponseResult.IsSuccess ? DateTime.Now : null
+            };
+            _unitOfWorkManage.Db.Insertable(mesReturnRecord).ExecuteCommand();
+            
+            return httpResponseResult;
+        }
+
 
         public async Task<WebResponseContent> OutAllocateTaskCompleted(Dt_Task task)
         {
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_WMSServer/Jobs/QuartzJobMildd.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_WMSServer/Jobs/QuartzJobMildd.cs"
index cdd7ef8..e179ff3 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_WMSServer/Jobs/QuartzJobMildd.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_WMSServer/Jobs/QuartzJobMildd.cs"
@@ -21,19 +21,19 @@
             {
                 var allQzServices = new List<TasksQz>()
                 {
-                    new TasksQz()
-                    {
-                         Id = 1,
-                         AssemblyName = "WIDESEA_WMSServer",
-                         ClassName = "AgvTaskJob",
-                         CreateTime = DateTime.Now,
-                         IntervalSecond = 3,
-                         IsDeleted = false,
-                         IsStart = false,
-                         JobGroup = "WIDESEA_WMSServer",
-                         Name = "AgvTaskJob",
-                         TriggerType = 0
-                    },
+                    //new TasksQz()
+                    //{
+                    //     Id = 1,
+                    //     AssemblyName = "WIDESEA_WMSServer",
+                    //     ClassName = "AgvTaskJob",
+                    //     CreateTime = DateTime.Now,
+                    //     IntervalSecond = 3,
+                    //     IsDeleted = false,
+                    //     IsStart = false,
+                    //     JobGroup = "WIDESEA_WMSServer",
+                    //     Name = "AgvTaskJob",
+                    //     TriggerType = 0
+                    //},
                    
                 };
                 foreach (var item in allQzServices)
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_WMSServer/Program.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_WMSServer/Program.cs"
index 540eeae..8152876 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_WMSServer/Program.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_WMSServer/Program.cs"
@@ -1,3 +1,7 @@
+using System.Net.Security;
+using System.Reflection;
+using System.Runtime.ConstrainedExecution;
+using System.Text;
 using Autofac;
 using Autofac.Core;
 using Autofac.Extensions.DependencyInjection;
@@ -13,10 +17,6 @@
 using Quartz.Impl;
 using Quartz.Spi;
 using Serilog;
-using System.Net.Security;
-using System.Reflection;
-using System.Runtime.ConstrainedExecution;
-using System.Text;
 using WIDESEA.QuartzJob;
 using WIDESEA_Core;
 using WIDESEA_Core.Authorization;
@@ -31,7 +31,7 @@
 using WIDESEA_WMSServer;
 using WIDESEA_WMSServer.Filter;
 using WIDESEA_WMSServer.Jobs;
-using static Quartz.Logging.OperationName;
+using WIDESEAWCS_Core.LogHelper;
 
 var builder = WebApplication.CreateBuilder(args);
 
@@ -42,6 +42,36 @@
 //  .WriteTo.File("logs/log-.txt", rollingInterval: RollingInterval.Day)
 //  .CreateLogger();
 
+AppDomain.CurrentDomain.FirstChanceException += (sender, e) =>
+{
+    bool flag = e.Exception.TargetSite?.DeclaringType?.Namespace?.StartsWith("WIDESEA") == true;
+
+    if (e.Exception is not OperationCanceledException && flag)
+    {
+        string folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Log\\Exception");
+        Exception ex = e.Exception;
+        StringBuilder builder = new StringBuilder();
+        builder.Append("错误信息:");
+        builder.Append(ex.Message);
+        builder.Append(Environment.NewLine);
+        builder.Append("错误源:");
+        builder.Append(ex.Source);
+        builder.Append(Environment.NewLine);
+        builder.Append("错误堆栈:");
+        builder.Append(ex.StackTrace);
+        builder.Append(Environment.NewLine);
+        builder.Append("错误类型:");
+        builder.Append(ex.GetType().ToString());
+        builder.Append(Environment.NewLine);
+        builder.Append("错误方法:");
+        builder.Append(ex.TargetSite?.ToString());
+        builder.Append(Environment.NewLine);
+        builder.Append(Environment.NewLine);
+
+        LoggerHelper.WriteError(e.Exception, folderPath);
+    }
+};
+
 Log.Logger = new LoggerConfiguration()
     .MinimumLevel.Information() // 设置全局最低日志级别为 Information
                                 // 重写特定命名空间的日志级别,过滤系统噪音

--
Gitblit v1.9.3