huangxiaoqiang
2025-12-18 ba61740dd99fffa9c20e99cb987eb690268c7c5c
Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
已添加1个文件
已修改6个文件
283 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/LoggerHelper.cs 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/QuartzJobMildd.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/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.db
Binary files differ
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db
Binary 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_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
                                // é‡å†™ç‰¹å®šå‘½åç©ºé—´çš„æ—¥å¿—级别,过滤系统噪音