Przeglądaj źródła

1、修复复制报价副规格没有自动带出弹簧排列问题

MY 1 miesiąc temu
rodzic
commit
b4ed561eb3

+ 2 - 2
JLHHJSvr/Excutor/GetMattressSubspecsExcutor.cs

@@ -44,10 +44,10 @@ namespace JLHHJSvr.Excutor
 
                     var subspecsList = new List<u_mattress>();
                     var result = new List<u_mattress_mx_subspecs>();
-                    var fields = "mattress_width,mattress_length,mattress_height,mattressname,mattressrelcode";
+                    var fields = "mattressid,mattress_width,mattress_length,mattress_height,mattressname,mattressrelcode";
                     if (request.type == 0)
                     {
-                        fields += ",mattressid,mattresscode,parentid,erp_mtrlid,erp_mtrlcode,erp_configcodetype, erp_mtrlengname, erp_mtrlmode, erp_mtrlname, erp_mtrltype, erp_mtrltypeid, erp_mtrlunit, erp_piccode";
+                        fields += ",mattresscode,parentid,erp_mtrlid,erp_mtrlcode,erp_configcodetype, erp_mtrlengname, erp_mtrlmode, erp_mtrlname, erp_mtrltype, erp_mtrltypeid, erp_mtrlunit, erp_piccode";
                     }
 
                     //获取副规格列表

+ 6 - 7
JLHHJSvr/TextLog/RequestLogger.cs

@@ -1,21 +1,24 @@
 using LJLib.Tools.File;
 using System;
 using System.IO;
+using System.Threading;
 
 namespace LJLib.TextLog
 {
     internal class RequestLogger : ILogger
     {
         private readonly string _logDir;
+        private Timer _timer;
         private readonly object _syncRoot = new object();
 
         public RequestLogger(string logDir = null)
         {
             // 默认目录为执行目录下的 log 文件夹
             _logDir = logDir ?? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log");
+            if (!Directory.Exists(_logDir)) Directory.CreateDirectory(_logDir);
 
-            if (!Directory.Exists(_logDir))
-                Directory.CreateDirectory(_logDir);
+            // 创建定时器:立即启动,每隔24小时执行一次
+            _timer = new Timer(CleanupOldLogs, null, 0, 24 * 60 * 60 * 1000);
         }
 
         /// <summary>
@@ -47,9 +50,6 @@ namespace LJLib.TextLog
                         sw.WriteLine("====================================================================");
                         sw.WriteLine();
                     }
-
-                    // 清理过期日志(7天前的删除)
-                    CleanupOldLogs();
                 }
             }
             catch
@@ -61,7 +61,7 @@ namespace LJLib.TextLog
         /// <summary>
         /// 清理7天前的日志文件
         /// </summary>
-        private void CleanupOldLogs()
+        private void CleanupOldLogs(object state)
         {
             try
             {
@@ -88,7 +88,6 @@ namespace LJLib.TextLog
             }
             catch
             {
-                // 忽略清理异常
             }
         }
     }