Exemplo n.º 1
0
 private void Alert(EOfflineTimeoutAlertSetting setting)
 {
     if (setting.EnableSMS || setting.Enable)
     {
         if (setting.EnableSMS && this.IsInReceiveTime(_alertReport.MobileReceiveBeginTime, _alertReport.MobileReceiveEndTime))
         {
             SendSMS(_alertReport);
         }
         if (setting.Enable && this.IsInReceiveTime(_alertReport.UserReceiveBeginTime, _alertReport.UserReceiveEndTime))
         {
             AlarmHandleContext context = new AlarmHandleContext();
             this.SendWebSiteSMS(context, _alertReport);
         }
     }
 }
Exemplo n.º 2
0
        private EBaseAlertReport CreateAlertReport(EnumAlertState state, EOfflineTimeoutAlertSetting alertSetting)
        {
            EGPSCurrentInfo _gpsCurrentInfo = new GPSTrackManager().GetCurrentInfo(alertSetting.VehicleCode);
            EOfflineTimeoutAlertReport newReport = new EOfflineTimeoutAlertReport();
            newReport.EnumAlarmGrade = EnumAlarmGrade.Prompt;
            newReport.ACCState = _gpsCurrentInfo.ACCState;
            newReport.Speed = _gpsCurrentInfo.Speed;
            newReport.VStarkMileage = _gpsCurrentInfo.StarkMileage;
            newReport.EnumSMSInfoType = EnumSMSInfoType.OfflineTimeout;
            newReport.GPSCode = _gpsCurrentInfo.GPSCode;
            newReport.GPSReportTime = _gpsCurrentInfo.ReportTime;
            newReport.Latitude = _gpsCurrentInfo.Latitude;
            newReport.Longitude = _gpsCurrentInfo.Longitude;
            newReport.MobileReceiveBeginTime = alertSetting.MobileReceiveBeginTime;
            newReport.MobileReceiveEndTime = alertSetting.MobileReceiveEndTime;
            newReport.ReceiveMobileList = alertSetting.ReceiveMobileList;
            newReport.ReceiveUserList = alertSetting.ReceiveUserList;
            newReport.TenantCode = alertSetting.TenantCode;
            newReport.UserReceiveBeginTime = alertSetting.UserReceiveBeginTime;
            newReport.UserReceiveEndTime = alertSetting.UserReceiveEndTime;
            newReport.VehicleCode = alertSetting.VehicleCode;
            newReport.VehiclePosition = this.GetPlaceName(_gpsCurrentInfo.Latitude, _gpsCurrentInfo.Longitude);
            if (_MOVOVehicleDict.ContainsKey(alertSetting.VehicleCode))
            {
                newReport.LicensePlate = _MOVOVehicleDict[alertSetting.VehicleCode];
            }

            newReport.EnumAlertState = state;

            newReport.DownSendOrderCode = DownSendCodeHelper.GPS.LogisticVehicle.FatigueDrive;
            newReport.DurationDrivingTime = alertSetting.DrivingDuration;
            newReport.RestTime = alertSetting.RestTime;
            newReport.AlertState = (int)state;
            return newReport;
        }