Esempio n. 1
0
        private string MergeSql(int RegionId, string RegionName, int AllowLargest, int CurrentCount, bool IsFirst)
        {
            if (!IsFirst)
            {
                PlatformGatheredAlarm platformGatheredAlarm = this;
                string   sqlAll   = platformGatheredAlarm.SqlAll;
                string   sql2     = this.Sql2;
                object[] regionId = new object[] { RegionId, RegionName, AllowLargest, CurrentCount };
                platformGatheredAlarm.SqlAll = string.Concat(sqlAll, string.Format(sql2, regionId));
            }
            else
            {
                string   sql1     = this.Sql1;
                object[] objArray = new object[] { RegionId, RegionName, AllowLargest, CurrentCount };
                this.SqlAll = string.Format(sql1, objArray);
            }
            LogMsg logMsg = new LogMsg("PlatformGatheredAlarm", "MergeSql", "");

            object[] regionId1 = new object[] { "发生聚集报警-区域ID:", RegionId, ",区域名称:", RegionName, ",允许最大车辆:", AllowLargest, ",当前车辆数:", CurrentCount };
            logMsg.Msg = string.Concat(regionId1);
            this.logHelper.WriteLog(logMsg);
            return(this.SqlAll);
        }
Esempio n. 2
0
 private static void GpsPicMain()
 {
     LogMsg logMsg = new LogMsg()
     {
         ClassName = "Service",
         FunctionName = "GpsPicMain",
         Msg = "启动定时服务器 成功"
     };
     LogHelper logHelper = new LogHelper();
     logHelper.WriteLog(logMsg);
     ReadDataFromXml.UpdateParameter();
     logMsg.Msg = "未开启定时拍照功能";
     if (ReadDataFromXml.IsPic)
     {
         logMsg.Msg = "开启定时拍照功能";
         picTimer = new PicTimer();
         picTimer.start();
         logHelper.WriteLog(logMsg, logMsg.Msg);
     }
     logMsg.Msg = "未开启掉线通知功能";
     if (ReadDataFromXml.IsCuff)
     {
         logMsg.Msg = "开启掉线通知功能";
         cuffTimer = new CuffTimer();
         cuffTimer.start();
         logHelper.WriteLog(logMsg, logMsg.Msg);
     }
     logMsg.Msg = "未开启播报信息功能";
     if (ReadDataFromXml.IsBroadCast)
     {
         logMsg.Msg = "开启播报信息功能";
         broadCastTimer = new BroadCastTimer();
         broadCastTimer.start();
         logHelper.WriteLog(logMsg, logMsg.Msg);
     }
     logMsg.Msg = "未开启LBS定位服务";
     if (ReadDataFromXml.IsLBSPos)
     {
         logMsg.Msg = "开启LBS定位服务";
         lBSTimer = new LBSTimer();
         lBSTimer.start();
         logHelper.WriteLog(logMsg, logMsg.Msg);
     }
     logMsg.Msg = "未开启LCS定位服务";
     if (ReadDataFromXml.IsLCSPos)
     {
         logMsg.Msg = "开启LCS定位服务";
         lCSTimer = new LCSTimer();
         lCSTimer.start();
         logHelper.WriteLog(logMsg, logMsg.Msg);
     }
     logMsg.Msg = "未开启订单状态解析";
     if (ReadDataFromXml.IsBillPos)
     {
         logMsg.Msg = "开启订单状态解析";
         addressResolution = new AddressResolution();
         addressResolution.start();
         logHelper.WriteLog(logMsg, logMsg.Msg);
     }
     logMsg.Msg = "未开启出入行政区报警";
     if (ReadDataFromXml.IsAdminRegionAlarm)
     {
         logMsg.Msg = "开启出入行政区报警服务";
         iORegionTimer = new IORegionTimer();
         iORegionTimer.start();
         logHelper.WriteLog(logMsg, logMsg.Msg);
     }
     logMsg.Msg = "未开故障检测功能";
     if (ReadDataFromXml.IsChkError)
     {
         logMsg.Msg = "开启故障检测功能";
         chkErrorTimer = new ChkErrorTimer();
         chkErrorTimer.start();
         logHelper.WriteLog(logMsg, logMsg.Msg);
     }
     logMsg.Msg = "未开启未按时归班报警";
     if (ReadDataFromXml.IsBeBackOnTime)
     {
         logMsg.Msg = "开启未按时归班报警";
         carBeBackOnTime = new CarBeBackOnTime();
         carBeBackOnTime.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启DWLBS手机定位";
     if (ReadDataFromXml.IsDWLBSPos)
     {
         logMsg.Msg = "开启DWLBS手机定位";
         dWLBSPos = new DWLBSPos();
         dWLBSPos.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启未按时进出站报警";
     if (ReadDataFromXml.IsInOutOfRangeOnTime)
     {
         logMsg.Msg = "开启未按时进出站报警";
         carInOutOfRangeOnTime = new CarInOutOfRangeOnTime();
         carInOutOfRangeOnTime.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启平台报警-偏移路线报警";
     if (ReadDataFromXml.IsPathAlarm)
     {
         logMsg.Msg = "开启平台报警-偏移路线报警";
         platformAlarmPathAlarm = new PlatformAlarmPathAlarm();
         platformAlarmPathAlarm.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启平台报警-分路段超速报警";
     if (ReadDataFromXml.IsPathSegmentAlarm)
     {
         logMsg.Msg = "开启平台报警-分路段超速报警";
         platformAlarmPathSegmentAlarm = new PlatformAlarmPathSegmentAlarm();
         platformAlarmPathSegmentAlarm.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启平台报警-区域报警报警";
     if (ReadDataFromXml.IsRegionAlarm)
     {
         logMsg.Msg = "开启平台报警-区域报警报警";
         platformAlarmRegionAlarm = new PlatformAlarmRegionAlarm();
         platformAlarmRegionAlarm.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启交通部上下线通知";
     if (ReadDataFromXml.IsJTBOnOffNotice)
     {
         logMsg.Msg = "开启交通部上下线通知";
         jTBOnOffLineNotice = new JTBOnOffLineNotice();
         jTBOnOffLineNotice.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启定时下发终端点播";
     if (ReadDataFromXml.IsTerminalDemand)
     {
         logMsg.Msg = "开启定时下发终端点播";
         jTBTerminalDemand = new JTBTerminalDemand();
         jTBTerminalDemand.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启聚集报警";
     if (ReadDataFromXml.IsGatheredAlarm)
     {
         logMsg.Msg = "开启聚集报警";
         platformGatheredAlarm = new PlatformGatheredAlarm();
         platformGatheredAlarm.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启发送详细位置信息";
     if (ReadDataFromXml.IsCurrentAddress)
     {
         logMsg.Msg = "开启发送详细位置信息";
         inquiresCarCurrentAddress = new InquiresCarCurrentAddress();
         inquiresCarCurrentAddress.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启脱车粘车报警";
     if (ReadDataFromXml.IsSeparateAndSticky)
     {
         logMsg.Msg = "开启脱车粘车报警";
         separateAndSticky = new SeparateAndSticky();
         separateAndSticky.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启终端未上线短信提醒";
     if (ReadDataFromXml.IsMsgRemind)
     {
         logMsg.Msg = "开启终端未上线短信提醒";
         terminalOffLineMessageRemind = new TerminalOffLineMessageRemind();
         terminalOffLineMessageRemind.start();
         logHelper.WriteLog(logMsg);
     }
     logMsg.Msg = "未开启发送配置短信功能";
     if (ReadDataFromXml.IsSendPZMsg)
     {
         logMsg.Msg = "开启发送配置短信功能";
         sendPZMessage = new SendPZMessage();
         sendPZMessage.start();
         logHelper.WriteLog(logMsg);
     }
     if (ReadDataFromXml.IsForbidDriveAlarm)
     {
         logMsg.Msg = "开启平台禁驾报警功能";
         platFormrForbidDriveAlarm = new PlatFormrForbidDriveAlarm();
         platFormrForbidDriveAlarm.start();
         logHelper.WriteLog(logMsg);
     }
     if (ReadDataFromXml.IsThreeLevelRoadAlarm)
     {
         logMsg.Msg = "开启平台三级路面报警";
         platFormAlarmThreeLevelRoadAlarm = new PlatFormAlarmThreeLevelRoadAlarm();
         platFormAlarmThreeLevelRoadAlarm.start();
         logHelper.WriteLog(logMsg);
     }
     if (ReadDataFromXml.IschkRoadSpeedAndRank)
     {
         logMsg.Msg = "开启分道路等级超速报警";
         platFormCheckRoadSpeedAndRank = new PlatFormCheckRoadSpeedAndRank();
         platFormCheckRoadSpeedAndRank.start();
         logHelper.WriteLog(logMsg);
     }
     try
     {
         tDeleteLogTimer = new System.Timers.Timer((double)1000);
         tDeleteLogTimer.Elapsed += new System.Timers.ElapsedEventHandler(onDeleteOldRecord);
         tDeleteLogTimer.Enabled = true;
     }
     catch (Exception exception)
     {
         logHelper.WriteError(new ErrorMsg("Service", "启动日志删除失败", exception.Message));
     }
 }