using Rhea.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using Tiger.IBusiness; namespace Tiger.Api.DbCache { public partial class Cache { /// /// 获取条码规则缓存 /// public static ICodeRuleCache CodeRule => DI.Resolve(); /// /// 获取系统参数缓存 /// public static ISysParamCache SysParam => DI.Resolve(); /// /// 获取不良代码缓存 /// public static IMesDefectCache MesDefect => DI.Resolve(); /// /// 获取岗位缓存 /// public static IMesPositionCache MesPosition => DI.Resolve(); /// /// 获取工单池缓存 /// public static IWoContext WorkBatch => DI.Resolve(); }//endClass /// /// 监控总控 /// public class DbCacheBus { #region Functions public static void StartAutoUpdate() { if (BizConfig.Configuration["IsUseDbCache"]?.ToLower() == "true") { //开启系统参数缓存 Cache.SysParam.Start(); ConsoleExt.WriteLine("Start SysParam Cache Auto Update Thread..........", ConsoleColor.Yellow); //开启系统参数缓存 Cache.CodeRule.Start(); ConsoleExt.WriteLine("Start CodeRule Cache Auto Update Thread..........", ConsoleColor.Yellow); //开启不良代码缓存 Cache.MesDefect.Start(); ConsoleExt.WriteLine("Start MesDefect Cache Auto Update Thread..........", ConsoleColor.Yellow); //开启岗位缓存 Cache.MesPosition.Start(); ConsoleExt.WriteLine("Start MesPosition Cache Auto Update Thread..........", ConsoleColor.Yellow); } } public static void StopAutoUpdate() { if (BizConfig.Configuration["IsUseDbCache"]?.ToLower() == "true") { //关闭系统参数缓存 Cache.SysParam.Stop(); //关闭系统参数缓存 Cache.CodeRule.Stop(); //关闭不良代码缓存 Cache.MesDefect.Stop(); //关闭岗位缓存 Cache.MesPosition.Stop(); } } #endregion } }