ÏîÄ¿´úÂë/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> ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.dbBinary files differ
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.dbBinary files differ
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/LoggerHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,187 @@ using 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 { } } } } } ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/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); ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/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æ¥å£è¿åé误ï¼HTTP代ç ï¼{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) { ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/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) ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/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 // éåç¹å®å½å空é´çæ¥å¿çº§å«ï¼è¿æ»¤ç³»ç»åªé³