/// <summary> /// 初使化 /// </summary> public void Init() { using (var context = new MyContext()) { //船舶端组件注册 var component = context.Component.FirstOrDefault(c => c.Type == ComponentType.WEB); if (component != null) { ManagerHelp.ComponentId = component.Id; component.Cid = ""; context.Update(component); context.SaveChanges(); } else { ManagerHelp.ComponentId = Guid.NewGuid().ToString(); } //获取数据库默认值 LoadDBValue(); //组件注册 InitData(); //船舶端需要发送缺岗通知 if (ManagerHelp.IsShipPort) { LoadNotice(); //向IPad推送消息 PublisherService service = new PublisherService(); PlayerService player = new PlayerService(); SyncAlarmJob sync = new SyncAlarmJob(); sync.SyncAlarmData(); } //定时获取组件信息 QueryComponent(); AlarmService alarmService = new AlarmService(); alarmService.ReviceAlarm(); } }