63 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			63 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Timers;
							 | 
						|||
| 
								 | 
							
								using System.Configuration;
							 | 
						|||
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace BLL
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public class CNCECHSSEMonitorService
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        #region 启动监视器 系统启动5分钟
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 监视组件
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        private static Timer messageTimer;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public static void StartMonitor()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            int adTimeJ = 120; 
							 | 
						|||
| 
								 | 
							
								            if (messageTimer != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                messageTimer.Stop();
							 | 
						|||
| 
								 | 
							
								                messageTimer.Dispose();
							 | 
						|||
| 
								 | 
							
								                messageTimer = null;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            if (adTimeJ > 0)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                messageTimer = new Timer
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    AutoReset = true
							 | 
						|||
| 
								 | 
							
								                };
							 | 
						|||
| 
								 | 
							
								                messageTimer.Elapsed += new ElapsedEventHandler(AdUserInProcess);
							 | 
						|||
| 
								 | 
							
								                messageTimer.Interval = 1000 * 60 * adTimeJ;//  60000 * adTimeJ;
							 | 
						|||
| 
								 | 
							
								                messageTimer.Start();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 流程确认 定时执行 系统启动5分钟
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender">Timer组件</param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e">事件参数</param>
							 | 
						|||
| 
								 | 
							
								        private static void AdUserInProcess(object sender, ElapsedEventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            try
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                CNCECHSSEWebService.getSupervise_SubUnitReport();
							 | 
						|||
| 
								 | 
							
								                CNCECHSSEWebService.getCheck_CheckInfo_Table8Item();
							 | 
						|||
| 
								 | 
							
								                CNCECHSSEWebService.getCheck_CheckRectify();
							 | 
						|||
| 
								 | 
							
								                CNCECHSSEWebService.getInformation_UrgeReport();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            catch (Exception ex)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                StartMonitor();
							 | 
						|||
| 
								 | 
							
								                ErrLogInfo.WriteLog(ex, "数据接口定时器", "RealNameMonitorService.AdUserInProcess");
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |