Ejemplo n.º 1
0
 public long icar_SendCmdXML(CmdParam.ParamType ParamType, string SimNum, string CarId, string CarPw, string ProtocolName, CmdParam.CommMode CommMode, TxtMsg MsgContext, string sMsgType)
 {
     long num = (long)0;
     this.logMsg.FunctionName = "icar_SendTxtMsg";
     this.logMsg.Msg = string.Concat("发送:类型-", ParamType.ToString(), ",车辆-", SimNum);
     string str = string.Concat("消息类型-", MsgContext.MsgType.ToString(), string.Format(",{0}-", sMsgType), MsgContext.strMsg);
     LogMsg logMsg = this.logMsg;
     logMsg.Msg = string.Concat(logMsg.Msg, ",", str);
     this.log.WriteLog(this.logMsg);
     if (!this.isStartCommon())
     {
         num = (long)-1;
     }
     else
     {
         try
         {
             int newOrderId = DownData.CarCmdSend.GetNewOrderId();
             if (ProtocolName != "JTBGPS")
             {
                 num = DownData.CarCmdSend.icar_SendTxtMsg(this.WorkId, newOrderId, SimNum, MsgContext.MsgType, MsgContext.strMsg);
             }
             else
             {
                 MsgContext.TransformCode = CmdParam.TrafficProtocolCodeExchange((int)MsgContext.MsgType);
                 string str1 = "";
                 string xmlString = MsgContext.ToXmlString(this.CalOrderId(this.WorkId, newOrderId), SimNum, ProtocolName, (int)CommMode, "SimpleCmd", ref str1);
                 num = DownData.CarCmdSend.icar_SendCmdXML(this.WorkId, newOrderId, SimNum, ProtocolName, (int)MsgContext.MsgType, (int)CommMode, xmlString);
             }
             if (num == (long)0)
             {
                 ReadDataFromDB.execSaveGpsLogTable(this.WorkId, newOrderId, CarId, (int)MsgContext.MsgType, MsgContext.strMsg);
             }
             if (num != (long)0)
             {
                 AlarmMsg alarmMsg = new AlarmMsg()
                 {
                     ClassName = "GpsPicDownData",
                     FunctionName = "icar_SendTxtMsg"
                 };
                 object[] workId = new object[] { "workid-", this.WorkId, ",simNum-", SimNum, ",strMsg-", MsgContext.strMsg };
                 alarmMsg.AlarmText = string.Concat(workId);
                 alarmMsg.Code = num.ToString();
                 this.log.WriteAlarm(alarmMsg);
             }
         }
         catch (Exception exception1)
         {
             Exception exception = exception1;
             ErrorMsg errorMsg = new ErrorMsg()
             {
                 ClassName = "GpsPicDownData",
                 ErrorText = "下发消息指令时发生错误!"
             };
             this.log.WriteError(errorMsg, exception);
             num = (long)-1;
         }
     }
     return num;
 }
Ejemplo n.º 2
0
 public Response icar_RemoteDial(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, RemoteDial remoteDial_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_RemoteDial";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + remoteDial_0.OrderCode.ToString();
     string str = "电话号码-" + remoteDial_0.strPhone + ",消息-" + remoteDial_0.strMsg;
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (remoteDial_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", remoteDial_0.OrderCode.ToString(), "等待", "", str);
                 response.ResultCode = SendBase.CarCmdSend.icar_RemoteDial(base.WorkId, newOrderId, info.SimNum, remoteDial_0.Phone.ToString(), remoteDial_0.strMsg);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_RemoteDial";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", remoteDial_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 3
0
 public JTBPlatformPostResponse(CmdParam.OrderCode OrderCode, string[] responseId)
 {
     this.InitializeComponent();
     this.Text = OrderCode.ToString();
     this.OrderCode = OrderCode;
     this.repid = responseId[0];
     this.repContent = ((int)responseId.Length >= 1 ? responseId[1] : "");
     this.repType = ((int)responseId.Length >= 3 ? responseId[2] : "1");
     this.repObjectID = ((int)responseId.Length >= 4 ? responseId[3] : "");
     string[] strArrays = this.repContent.Split(new char[] { ';' }, 2, StringSplitOptions.RemoveEmptyEntries);
     this.OBJECT_ID = strArrays[0];
     string[] strArrays2 = strArrays[1].Split(new string[] { ":=" }, 2, StringSplitOptions.RemoveEmptyEntries);
     this.strAsk = strArrays2[1].Split(new char[] { '|' }, 2, StringSplitOptions.RemoveEmptyEntries)[0];
     this.txtPostContent.Text = strArrays2[1];
 }
        public JTBCallPoliceSuperviseReponsion(CmdParam.OrderCode OrderCode, string ReponseID, string CarNum)
        {
            this.InitializeComponent();

            string[] strArray6 = ReponseID.ToString().Replace("报警督办ID:", "").Split(new char[] { ',' });

            for (int i = 1; i < strArray6.Length; i++)
            {
                txtDetails.AppendText(strArray6[i] + "\r\n");
            }
            this.OrderCode = OrderCode;
            this.Text = OrderCode.ToString();
            //this._repid = ReponseID;
            this._repid = strArray6[0];
            this._carNum = CarNum;
            this.cmbResolve.SelectedIndex = 0;
            DataRow[] rowArray = MainForm.myCarList.AllCar.Select("CarNum='" + CarNum + "'");
            this.txtCarNum.Text = CarNum;
            if ((rowArray != null) && (rowArray.Length > 0))
            {
                this.txtSimNum.Text = rowArray[0]["SimNum"].ToString();
            }
        }
Ejemplo n.º 5
0
 public Response icar_SendTxtMsg(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, TxtMsg txtMsg_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SendTxtMsg";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + txtMsg_0.OrderCode.ToString();
     string str = "信息-" + txtMsg_0.strMsg + ",信息类型-" + txtMsg_0.MsgType.ToString();
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (txtMsg_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         string str3 = null;
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 switch (((int) txtMsg_0.MsgType))
                 {
                     case 240:
                     case 0xf1:
                     case 0xf2:
                     case 0xf3:
                         str3 = txtMsg_0.MsgType.ToString();
                         break;
                 }
                 base.SaveCommandParameterToGpsLogTable(newOrderId.ToString() + "|" + info.CarId.ToString() + ";", str3);
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "等待", "", str);
                 if (info.ProtocolName == SendBase.m_ProtocolName)
                 {
                     txtMsg_0.TransformCode = CmdParam.TrafficProtocolCodeExchange((int) txtMsg_0.MsgType);
                     string conntent = "";
                     string str5 = txtMsg_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SimpleCmd", ref conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, txtMsg_0.TransformCode, (int) commMode_0, str5);
                 }
                 else
                 {
                     response.ResultCode = SendBase.CarCmdSend.icar_SendTxtMsg(base.WorkId, newOrderId, info.SimNum, txtMsg_0.MsgType, txtMsg_0.strMsg);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SendTxtMsg";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", txtMsg_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 6
0
 public Response icar_StopCapture(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, StopCapture stopCapture_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetCaptureEx";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     string str = string.Empty;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (stopCapture_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", stopCapture_0.OrderCode.ToString(), "等待", "", str);
                 if (info.ProtocolName == SendBase.m_ProtocolName)
                 {
                     string conntent = "";
                     stopCapture_0.TransformCode = CmdParam.TrafficProtocolCodeExchange2((int) stopCapture_0.OrderCode);
                     string str4 = stopCapture_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SimpleCmd", ref conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, stopCapture_0.TransformCode, (int) commMode_0, str4);
                 }
                 else
                 {
                     response.ResultCode = SendBase.CarCmdSend.icar_StopCapture(base.WorkId, newOrderId, info.SimNum, stopCapture_0.CamerasID, stopCapture_0.Flag1, stopCapture_0.Flag2);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_StopCapture";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", stopCapture_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 else
                 {
                     new Car().UpdateGisCarCommandTime(info.CarId);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 7
0
 public Response icar_SelMultiPathAlarm(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, PathAlarmList pathAlarmList_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SelMultiPathAlarm";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 Car car = new Car();
                 int num = -1;
                 for (int i = 0; i < pathAlarmList_0.Count; i++)
                 {
                     PathAlarm alarm = (PathAlarm) pathAlarmList_0[i];
                     DataTable table = car.GetNewPathId(info.CarId, alarm.PathName, num);
                     if (table == null)
                     {
                         goto Label_035B;
                     }
                     int num3 = int.Parse(table.Rows[0][0].ToString());
                     if (-1 == num3)
                     {
                         goto Label_039A;
                     }
                     num = int.Parse(table.Rows[0][1].ToString());
                     alarm.ID = num3;
                 }
                 object pvRegions = pathAlarmList_0.pvRegions;
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", pathAlarmList_0.OrderCode.ToString(), "等待", "", "");
                 car.InsertPathIntoGisCar(info.CarId, base.WorkId, newOrderId, pathAlarmList_0.AlarmPathDot);
                 response.ResultCode = SendBase.CarCmdSend.icar_SelMultiPathAlarm(base.WorkId, newOrderId, info.SimNum, ref pvRegions);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SelMultiPathAlarm";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", pathAlarmList_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 for (int j = 0; j < pathAlarmList_0.Count; j++)
                 {
                     PathAlarm alarm2 = (PathAlarm) pathAlarmList_0[j];
                     car.UpdatePathAlarm(info.CarId, alarm2.PathName, 1, 0, 0, alarm2.ID, "", "", 0, 0, 0);
                 }
                 response.ResultCode = 0L;
                 continue;
             Label_035B:
                 response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"获取偏移路线ID失败!", info.CarNum);
                 base.log.WriteError(base.errMsg);
                 return response;
             Label_039A:
                 response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"偏移路线ID已满,请删除部分偏移路线!", info.CarNum);
                 base.log.WriteError(base.errMsg);
                 return response;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 8
0
 public Response icar_SelMultiPathAlarm(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, PathAlarmList pathAlarmList_0)
 {
     Response response = new Response();
     base.WriteLog(paramType_0.ToString(), string_1);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     Car car = new Car();
     int num = -1;
     int newOrderId = -1;
     DataTable table = null;
     object obj2 = null;
     PathAlarm alarm = null;
     object[] objArray = new object[4];
     foreach (Bussiness.CarInfo info in base.carInfoList)
     {
         try
         {
             int num3 = -1;
             newOrderId = SendBase.CarCmdSend.GetNewOrderId();
             base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
             string orderIDParam = response.OrderIDParam;
             response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
             for (int i = 0; i < pathAlarmList_0.Count; i++)
             {
                 alarm = (PathAlarm) pathAlarmList_0[i];
                 table = car.GetNewPathId(info.CarId, alarm.PathName, num3);
                 if ((table == null) || (table.Rows.Count <= 0))
                 {
                     goto Label_037E;
                 }
                 num = int.Parse(table.Rows[0][0].ToString());
                 alarm.ID = num;
                 if (-1 == num)
                 {
                     goto Label_033E;
                 }
                 num3 = int.Parse(table.Rows[0][1].ToString());
                 objArray[0] = num.ToString();
                 objArray[1] = alarm.PointCount.ToString();
                 objArray[2] = this.method_7(alarm.Points);
                 objArray[3] = alarm.PathDif;
                 obj2 = objArray;
                 base.AddUpDataLog(newOrderId, info.CarNum, RespCodeParam.GetRespName(((int) pathAlarmList_0.OrderCode) + 0x80), "");
                 car.InsertPathIdsIntoPathParam(info.CarId, base.WorkId.ToString(), newOrderId.ToString(), alarm.ID.ToString(), num.ToString());
                 if (i == (pathAlarmList_0.Count - 1))
                 {
                     object pvRegions = pathAlarmList_0.pvRegions;
                     car.InsertPathIntoGisCar(info.CarId, base.WorkId, newOrderId, pathAlarmList_0.AlarmPathDot);
                 }
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, (CmdParam.CmdCode) pathAlarmList_0.OrderCode, ref obj2, commMode_0);
                 if ((pathAlarmList_0.Count - i) > 1)
                 {
                     Thread.Sleep(300);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.WriteError(base.WorkId.ToString(), info.SimNum, pathAlarmList_0.OrderCode.ToString());
                 }
                 car.UpdatePathAlarm(info.CarId, alarm.PathName, 1, 0, 0, alarm.ID, "", "", alarm.PathFlag, alarm.DriEnough, alarm.DriNoEnough);
             }
             continue;
         Label_033E:
             response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"偏移路线ID已满,请删除部分偏移路线!", info.CarNum);
             base.log.WriteError(base.errMsg);
             return response;
         Label_037E:
             response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"获取偏移路线ID失败!", info.CarNum);
             base.log.WriteError(base.errMsg);
             return response;
         }
         catch (Exception exception)
         {
             response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText = "下发消息指令时发生错误!";
             base.log.WriteError(base.errMsg, exception);
         }
     }
     return response;
 }
Ejemplo n.º 9
0
 public Response icar_StopAlarmDeal(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, TrafficALarmHandle trafficALarmHandle_0, object object_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_StopAlarmDeal";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-报警解除(交通部)";
     base.log.WriteLog(base.logMsg);
     response.ResultCode = 0L;
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     foreach (Bussiness.CarInfo info in base.carInfoList)
     {
         try
         {
             int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
             trafficALarmHandle_0.OrderID = newOrderId;
             trafficALarmHandle_0.WorkID = base.WorkId;
             trafficALarmHandle_0.CarId = info.CarId;
             if (!string.IsNullOrEmpty(trafficALarmHandle_0.GpsTime))
             {
                 Alarm.InsertAlarmResult(trafficALarmHandle_0);
             }
             if ((trafficALarmHandle_0.iProcMode == 1) && (info.ProtocolName != SendBase.m_ProtocolName))
             {
                 SimpleCmd cmd = object_0 as SimpleCmd;
                 string paramDisc = cmd.GetParamDisc();
                 object pvArg = cmd.pvArg;
                 base.AddUpDataLog(newOrderId, info.CarNum, cmd.OrderCode.ToString(), paramDisc);
                 response.ResultCode = SendBase.CarCmdSend.icar_SimpleCmd(base.WorkId, newOrderId, info.SimNum, cmd.CmdCode, ref pvArg);
             }
             else
             {
                 string conntent = "";
                 CmdParamBase base2 = object_0 as CmdParamBase;
                 if (base2 == null)
                 {
                     return response;
                 }
                 if (trafficALarmHandle_0.iProcMode == 4)
                 {
                     base2.TransformCode = CmdParam.TrafficProtocolCodeExchange((int) ((TxtMsg) base2).MsgType);
                 }
                 else
                 {
                     base2.TransformCode = CmdParam.TrafficProtocolCodeExchange2((int) base2.OrderCode);
                 }
                 string str3 = base2.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SimpleCmd", ref conntent);
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", base2.OrderCode.ToString(), "等待", "", this.method_6(trafficALarmHandle_0.iProcMode, info.SimNum.ToString()));
                 response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, base2.TransformCode, (int) commMode_0, str3);
             }
         }
         catch (Exception exception)
         {
             response.ErrorMsg = exception.Message;
             response.ResultCode = -1L;
             return response;
         }
     }
     return response;
 }
Ejemplo n.º 10
0
 public Response icar_SetCustomAlarmer(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, AlarmEntity alarmEntity_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetCustomAlarmer";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + alarmEntity_0.OrderCode.ToString();
     string str = "配置自定义报警器";
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (alarmEntity_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", alarmEntity_0.OrderCode.ToString(), "等待", "", str);
                 new Car().InsertCustAlarmIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId, alarmEntity_0.CarAlarmSwitch, alarmEntity_0.CarAlarmFlag, alarmEntity_0.CarShowAlarm, alarmEntity_0.Level, alarmEntity_0.CustName);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCustomAlarmer(base.WorkId, newOrderId, info.SimNum, (uint) alarmEntity_0.CarAlarmSwitch, (uint) alarmEntity_0.CarAlarmFlag, (uint) alarmEntity_0.Level);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetCustomAlarmer";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", alarmEntity_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 11
0
 public Response icar_RemoteUpdate(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0)
 {
     byte[] buffer;
     Response response = new Response();
     base.logMsg.FunctionName = "icar_RemoteUpdate";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     string str = string.Empty;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string updateFileVersion = Const.UpdateFileVersion;
     string updateFilePath = Const.UpdateFilePath;
     FileStream input = null;
     BinaryReader reader = null;
     try
     {
         if (!string.IsNullOrEmpty(updateFilePath) && !string.IsNullOrEmpty(updateFilePath))
         {
             if (!File.Exists(updateFilePath))
             {
                 base.ErrorMsg = "不存在的升级文件!";
                 response.ErrorMsg = base.errMsg.ErrorText = "不存在的升级文件:FilePath-" + updateFilePath + ",FileVersion-" + updateFileVersion;
                 base.log.WriteError(base.errMsg);
                 return response;
             }
             input = new FileStream(updateFilePath, FileMode.Open);
             reader = new BinaryReader(input);
             buffer = new byte[input.Length];
             reader.Read(buffer, 0, buffer.Length);
             base.logMsg.Msg = string.Concat(new object[] { "升级文件大小:", buffer.Length, ",文件路径-", updateFilePath, ",文件版本-", updateFileVersion });
             base.log.WriteLog(base.logMsg);
         }
         else
         {
             base.ErrorMsg = "升级文件信息错误!";
             response.ErrorMsg = base.errMsg.ErrorText = "升级文件信息错误:FilePath-" + updateFilePath + ",FileVersion-" + updateFileVersion;
             base.log.WriteError(base.errMsg);
             return response;
         }
     }
     catch (Exception exception)
     {
         base.ErrorMsg = "读取升级文件信息错误!";
         response.ErrorMsg = base.errMsg.ErrorText = "读取升级文件信息错误:FilePath-" + updateFilePath + ",FileVersion-" + updateFileVersion;
         base.log.WriteError(base.errMsg, exception);
         return response;
     }
     finally
     {
         if (input != null)
         {
             input.Close();
         }
         if (reader != null)
         {
             reader.Close();
         }
     }
     object obj2 = buffer;
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", "远程升级车台软件", "等待", "", str);
                 response.ResultCode = SendBase.CarCmdSend.icar_RemoteUpdate(base.WorkId, newOrderId, info.SimNum, updateFileVersion, ref obj2);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_RemoteUpdate";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception2)
             {
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 base.log.WriteError(base.errMsg, exception2);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 12
0
 public Response icar_SetBlackBox(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, BlackBox blackBox_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetBlackBox";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + blackBox_0.OrderCode.ToString();
     string str = string.Concat(new object[] { "拐点补偿-", blackBox_0.IsAutoCalArc, ",自动上传数据-", blackBox_0.Flag, ",间隔-", blackBox_0.ReportCycle, ",汇报方式-", blackBox_0.ReportType });
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (blackBox_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", blackBox_0.OrderCode.ToString(), "等待", "", str);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetBlackBox(base.WorkId, newOrderId, info.SimNum, blackBox_0.ReportType, blackBox_0.ReportCycle, blackBox_0.IsAutoCalArc, blackBox_0.Flag);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetPosReport";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", blackBox_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 13
0
 public Response icar_SetCaptureEx(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, CaptureEx captureEx_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetCaptureEx";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     string str = string.Concat(new object[] {
         "是否多帧-", captureEx_0.IsMulitFramebool, ",拍摄类型:", captureEx_0.Type, ",监控次数-", captureEx_0.Times, ",间隔时间-", captureEx_0.Interval * 0.1, ",图像质量-", captureEx_0.Quality, ",图像亮度-", captureEx_0.Brightness, ",图像对比度-", captureEx_0.Contrast, ",图像饱和度-", captureEx_0.Saturation,
         ",图像色度", captureEx_0.Chroma, ",停车是否拍照-", captureEx_0.IsCapWhenStop, ",图像分辨率-", captureEx_0.PSize
      });
     if (!string.IsNullOrEmpty(captureEx_0.BeginTime) && !string.IsNullOrEmpty(captureEx_0.EndTime))
     {
         string str5 = str;
         str = str5 + ",时间段拍照启始时间-" + captureEx_0.BeginTime + ",时间段拍照结束时间-" + captureEx_0.EndTime;
     }
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (captureEx_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", captureEx_0.OrderCode.ToString(), "等待", "", str);
                 if ((info.ProtocolName == SendBase.m_ProtocolName) && (captureEx_0.protocolType == CarProtocolType.交通厅))
                 {
                     string conntent = "";
                     captureEx_0.TransformCode = CmdParam.TrafficProtocolCodeExchange2((int) captureEx_0.OrderCode);
                     if (captureEx_0.Quality == 0)
                     {
                         captureEx_0.Quality = 1;
                     }
                     if (captureEx_0.CaptureCache == 1)
                     {
                         captureEx_0.CaptureCache = -1;
                     }
                     string str4 = captureEx_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetCapture", ref conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, captureEx_0.TransformCode, (int) commMode_0, str4);
                 }
                 else
                 {
                     captureEx_0.Quality = byte.Parse(((10 - captureEx_0.Quality) / 2).ToString());
                     captureEx_0.CaptureCache = 0;
                     if (!string.IsNullOrEmpty(captureEx_0.BeginTime) && !string.IsNullOrEmpty(captureEx_0.EndTime))
                     {
                         response.ResultCode = SendBase.CarCmdSend.icar_SetCaptureExWithTime(base.WorkId, newOrderId, info.SimNum, captureEx_0.IsMultiFrame, captureEx_0.CamerasID, captureEx_0.CaptureFlag, captureEx_0.CaptureCache, captureEx_0.Times, captureEx_0.Interval, captureEx_0.Quality, captureEx_0.Brightness, captureEx_0.Contrast, captureEx_0.Saturation, captureEx_0.Chroma, captureEx_0.CapWhenStop, captureEx_0.BeginTime, captureEx_0.EndTime);
                     }
                     else
                     {
                         response.ResultCode = SendBase.CarCmdSend.icar_SetCaptureEx(base.WorkId, newOrderId, info.SimNum, captureEx_0.IsMultiFrame, captureEx_0.CamerasID, captureEx_0.CaptureFlag, captureEx_0.CaptureCache, captureEx_0.Times, captureEx_0.Interval, captureEx_0.Quality, captureEx_0.Brightness, captureEx_0.Contrast, captureEx_0.Saturation, captureEx_0.Chroma, captureEx_0.CapWhenStop);
                     }
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetCaptureEx";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", captureEx_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 else
                 {
                     new Car().InsertIntoCaptureParam(info.CarId, captureEx_0);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 14
0
 private void InsertAlarmInfo(DataRow dr, CmdParam.CarAlarmState carAlarmState, int AddMsgType)
 {
     try
     {
         int num = 0;
         string empty = string.Empty;
         int num1 = Convert.ToInt32(dr["carstatu"]);
         long num2 = (long)0;
         num2 = (dr["carstatuex"] == DBNull.Value || dr["carstatuex"].ToString().Equals("") ? 2251799813685248L : 2251799813685248L | Convert.ToInt64(dr["carstatuex"]));
         int num3 = 1154;
         int num4 = 65;
         string str = string.Empty;
         string str1 = dr["AddMsgTxt"].ToString();
         string str2 = null;
         bool flag = false;
         string str3 = null;
         int num5 = 0;
         try
         {
             SqlParameter[] sqlParameter = new SqlParameter[] { new SqlParameter("@wrkid", (object)num), new SqlParameter("@orderid", dr["OrderId"]), new SqlParameter("@userid", empty), new SqlParameter("@telephone", dr["telephone"]), new SqlParameter("@msgType", (object)num4), new SqlParameter("@recetime", dr["ReceTime"]), new SqlParameter("@gpstime", dr["GpsTime"]), new SqlParameter("@starCondition", dr["StarCondition"]), new SqlParameter("@starNum", dr["StarNum"]), new SqlParameter("@carStatu", (object)num1), new SqlParameter("@carStatuEx", (object)num2), new SqlParameter("@carCondition", dr["CarCondition"]), new SqlParameter("@Longitude", dr["Longitude"]), new SqlParameter("@Latitude", dr["Latitude"]), new SqlParameter("@direct", dr["Direct"]), new SqlParameter("@speed", dr["Speed"]), new SqlParameter("@Reserved", (object)num3), new SqlParameter("@TransportStatus", dr["TransportStatus"]), new SqlParameter("@Accelerration", dr["Accelerration"]), new SqlParameter("@Altitude", dr["Altitude"]), new SqlParameter("@DistanceDiff", dr["DistanceDiff"]), new SqlParameter("@commflag", dr["CommFlag"]), new SqlParameter("@addType", (object)AddMsgType), new SqlParameter("@addTxt", str1), new SqlParameter("@DutyStr", str2), new SqlParameter("@isPic", (object)flag), new SqlParameter("@pic", str3), new SqlParameter("@alarmInfo", str), new SqlParameter("@cameraID", (object)num5) };
             string str4 = "GpsPicServer_Alarm_Insert";
             string str5 = "GpsPicServer_RealTime_Insert";
             if (AddMsgType != -99997)
             {
                 int num6 = SqlDataAccess.insertBySp(str4, sqlParameter);
                 if (num6 > 0)
                 {
                     LogMsg logMsg = new LogMsg("PlatformAlarmPathAlarm", "InsertAlarmInfo", "");
                     string[] strArrays = new string[] { "车载电话为:", dr["telephone"].ToString(), "的平台检测", carAlarmState.ToString(), "报警报文已插入gpsrecebuffer" };
                     logMsg.Msg = string.Concat(strArrays);
                     this.logHelper.WriteLog(logMsg);
                 }
                 else
                 {
                     ErrorMsg errorMsg = new ErrorMsg("PlatformAlarmPathAlarm", "InsertAlarmInfo", string.Concat("将平台检测", carAlarmState.ToString(), "报警报文插入gpsrecbuffer表错误,返回值!", num6.ToString()));
                     this.logHelper.WriteError(errorMsg);
                 }
             }
             int num7 = SqlDataAccess.insertBySp(str5, sqlParameter);
             if (num7 > 0)
             {
                 string[] strArrays1 = new string[] { "车载电话为:", dr["telephone"].ToString(), "的平台检测", carAlarmState.ToString(), "报警报文已插入gpsrecerealtime" };
                 LogMsg logMsg1 = new LogMsg("PlatformAlarmPathAlarm", "InsertAlarmInfo", string.Concat(strArrays1));
                 string[] strArrays2 = new string[] { "车载电话为:", dr["telephone"].ToString(), "的平台检测", carAlarmState.ToString(), "报警报文已插入gpsrecerealtime" };
                 logMsg1.Msg = string.Concat(strArrays2);
                 this.logHelper.WriteLog(logMsg1);
             }
             else
             {
                 ErrorMsg errorMsg1 = new ErrorMsg("PlatformAlarmPathAlarm", "InsertAlarmInfo", string.Concat("将平台检测", carAlarmState.ToString(), "报警报文插入gpsrecerealtime_buffer表发生错误,返回值!", num7.ToString()));
                 this.logHelper.WriteError(errorMsg1);
             }
         }
         catch (Exception exception1)
         {
             Exception exception = exception1;
             string[] strArrays3 = new string[] { "车载电话为:", dr["telephone"].ToString(), "的平台检测", carAlarmState.ToString(), "报警报文插入数据库发生错误! 信息:", exception.Message };
             ErrorMsg errorMsg2 = new ErrorMsg("PlatformAlarmPathAlarm", "InsertAlarmInfo", string.Concat(strArrays3));
             this.logHelper.WriteError(errorMsg2);
         }
     }
     catch (Exception exception3)
     {
         Exception exception2 = exception3;
         LogHelper logHelper = new LogHelper();
         ErrorMsg errorMsg3 = new ErrorMsg("PlatformAlarmPathAlarm", "InsertAlarmInfo", string.Concat("将平台检测", carAlarmState.ToString(), "报警报文插入gpsrecbuffer表 、gpsrecerealtime_buffer表发生错误!", exception2.Message));
         logHelper.WriteError(errorMsg3);
     }
 }
Ejemplo n.º 15
0
 public Response icar_SetTextMsg(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, TxtMsg txtMsg_0, string string_3, string string_4)
 {
     Response response = new Response();
     if (string.IsNullOrEmpty(string_1))
     {
         DataTable table = base.GetCarInfoByArea(txtMsg_0.LLon, txtMsg_0.LLat, txtMsg_0.RLon, txtMsg_0.RLat, string_3, string_4);
         if ((table != null) && (table.Rows.Count > 0))
         {
             foreach (DataRow row in table.Rows)
             {
                 string_1 = string_1 + row["telephone"].ToString() + ",";
             }
             string_1 = string_1.Trim(new char[] { ',' });
         }
         if (string.IsNullOrEmpty(string_1))
         {
             response.ErrorMsg = "没有存在下发的车辆!";
             return response;
         }
     }
     base.logMsg.FunctionName = "icar_SetTextMsg";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + txtMsg_0.OrderCode.ToString();
     string msg = base.logMsg.Msg;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     new Car();
     foreach (Bussiness.CarInfo info in base.carInfoList)
     {
         try
         {
             int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
             if (info.ProtocolName == SendBase.m_ProtocolName)
             {
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "等待", "", msg);
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 string conntent = "";
                 string str3 = txtMsg_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetTextMsg", ref conntent);
                 response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) txtMsg_0.OrderCode, (int) commMode_0, str3);
             }
             else if ((txtMsg_0.OrderCode == CmdParam.OrderCode.电召指令) && (txtMsg_0.MsgType == CmdParam.MsgType.电召信息))
             {
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "等待", "", msg);
                 string str4 = base.WorkId.ToString() + SendBase.CarCmdSend.GetNewOrderId().ToString();
                 response.SvcContext = str4;
                 string str6 = response.OrderIDParam;
                 response.OrderIDParam = str6 + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 object obj2 = this.method_9(info.SimNum, txtMsg_0.TelNumber, txtMsg_0.strMsg, str4, txtMsg_0.Way, txtMsg_0.LLon + "," + txtMsg_0.LLat + "," + txtMsg_0.RLon + "," + txtMsg_0.RLat);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, CmdParam.CmdCode.电召指令, ref obj2, commMode_0);
             }
             else if (txtMsg_0.OrderCode == CmdParam.OrderCode.拨打电话号码)
             {
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "等待", "", msg);
                 string str7 = response.OrderIDParam;
                 response.OrderIDParam = str7 + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 SimpleCmd cmd = new SimpleCmd {
                     OrderCode = CmdParam.OrderCode.抢答确认指令
                 };
                 new ArrayList();
                 string[] strArray = new string[] { txtMsg_0.sPhone, txtMsg_0.TelNumber, txtMsg_0.strMsg, txtMsg_0.Orderid, txtMsg_0.sCarName };
                 object obj3 = this.method_6(strArray);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, cmd.CmdCode, ref obj3, commMode_0);
             }
             else
             {
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "失败", "", "错误描述:该车辆终端不支持此操作。");
                 response.ErrorMsg = "终端不支持该协议";
             }
         }
         catch (Exception exception)
         {
             response.ErrorMsg = exception.Message;
             return response;
         }
     }
     return response;
 }
Ejemplo n.º 16
0
 public long iCar_SetPosReport(CmdParam.ParamType ParamType, string SimNum, string CarPw, CmdParam.CommMode CommMode, PosReport posReport, int CarID)
 {
     long num = (long)0;
     this.logMsg.FunctionName = "iCar_SetPosReport";
     this.logMsg.Msg = string.Concat("发送:类型-", ParamType.ToString(), ",车辆-", SimNum);
     if (!this.isStartCommon())
     {
         num = (long)-1;
     }
     else
     {
         try
         {
             this.log.WriteLog(this.logMsg);
             int newOrderId = DownData.CarCmdSend.GetNewOrderId();
             num = DownData.CarCmdSend.icar_SetPosReport(this.WorkId, newOrderId, SimNum, posReport.ReportType, posReport.ReportTiming, posReport.ReportCycle, posReport.IsAutoCalArc, posReport.isCompressed, posReport.ReportWhenStop);
             if (num == (long)0)
             {
                 ReadDataFromDB.execSaveGpsLogTable(this.WorkId, newOrderId, CarID.ToString(), (int)posReport.OrderCode, "LBS单次定位");
             }
             else
             {
                 AlarmMsg alarmMsg = new AlarmMsg()
                 {
                     ClassName = "GpsPicDownData",
                     FunctionName = "iCar_SetPosReport"
                 };
                 object[] workId = new object[] { "workid-", this.WorkId, ",simNum-", SimNum, ",strMsg-调用位置查询" };
                 alarmMsg.AlarmText = string.Concat(workId);
                 alarmMsg.Code = num.ToString();
                 this.log.WriteAlarm(alarmMsg);
             }
         }
         catch (Exception exception1)
         {
             Exception exception = exception1;
             ErrorMsg errorMsg = new ErrorMsg()
             {
                 ClassName = "GpsPicDownData",
                 ErrorText = "下发消息指令时发生错误!"
             };
             this.log.WriteError(errorMsg, exception);
             num = (long)-1;
         }
     }
     return num;
 }
Ejemplo n.º 17
0
 public long icar_SetCaptureEx(CmdParam.ParamType ParamType, string SimNum, string CarPw, CmdParam.CommMode CommMode, CaptureEx captureEx, string PicTime, string CarID)
 {
     long num = (long)0;
     this.logMsg.FunctionName = "icar_SetCaptureEx";
     this.logMsg.Msg = string.Concat("发送:类型-", ParamType.ToString(), ",车辆-", SimNum);
     object[] picTime = new object[] { "抓拍时间-", PicTime, ",是否多帧-", captureEx.IsMulitFramebool, ",监控次数-", captureEx.Times, ",间隔时间-", (double)captureEx.Interval * 0.1, ",图像质量-", captureEx.Quality, ",图像亮度-", captureEx.Brightness, ",图像对比度-", captureEx.Contrast, ",图像饱和度-", captureEx.Saturation, ",图像色度", captureEx.Chroma, ",停车是否拍照-", captureEx.IsCapWhenStop };
     string str = string.Concat(picTime);
     LogMsg logMsg = this.logMsg;
     logMsg.Msg = string.Concat(logMsg.Msg, ",", str);
     this.log.WriteLog(this.logMsg);
     if (!this.isStartCommon())
     {
         num = (long)-1;
     }
     else
     {
         try
         {
             if (captureEx.ProtocolName == "JTBGPS")
             {
                 int newOrderId = DownData.CarCmdSend.GetNewOrderId();
                 string str1 = "";
                 captureEx.TransformCode = CmdParam.TrafficProtocolCodeExchange2((int)captureEx.OrderCode);
                 if (captureEx.Quality == 0)
                 {
                     captureEx.Quality = 1;
                 }
                 if (captureEx.CaptureCache == 1)
                 {
                     captureEx.CaptureCache = -1;
                 }
                 string xmlString = captureEx.ToXmlString(this.CalOrderId(this.WorkId, newOrderId), SimNum, captureEx.ProtocolName, (int)CommMode, "SetCapture", ref str1);
                 num = DownData.CarCmdSend.icar_SendCmdXML(this.WorkId, newOrderId, SimNum, captureEx.ProtocolName, captureEx.TransformCode, (int)CommMode, xmlString);
             }
             else
             {
                 int newOrderId = DownData.CarCmdSend.GetNewOrderId();
                 num = DownData.CarCmdSend.icar_SetCaptureEx(this.WorkId, newOrderId, SimNum, captureEx.IsMultiFrame, captureEx.CamerasID, captureEx.CaptureFlag, captureEx.CaptureCache, captureEx.Times, captureEx.Interval, captureEx.Quality, captureEx.Brightness, captureEx.Contrast, captureEx.Saturation, captureEx.Chroma, captureEx.CapWhenStop);
             }
             if (num == (long)0)
             {
                 ReadDataFromDB.execSaveGpsLogTable(this.WorkId, DownData.CarCmdSend.OrderId, CarID, 18, "定时拍照");
             }
             else
             {
                 AlarmMsg alarmMsg = new AlarmMsg()
                 {
                     ClassName = "GpsPicDownData",
                     FunctionName = "icar_SetCaptureEx"
                 };
                 object[] workId = new object[] { "workid-", this.WorkId, ",simNum-", SimNum, ",OrderCode-", captureEx.OrderCode };
                 alarmMsg.AlarmText = string.Concat(workId);
                 alarmMsg.Code = num.ToString();
                 this.log.WriteAlarm(alarmMsg);
             }
         }
         catch (Exception exception1)
         {
             Exception exception = exception1;
             ErrorMsg errorMsg = new ErrorMsg()
             {
                 ClassName = "GpsPicDownData",
                 ErrorText = "下发消息指令时发生错误!"
             };
             this.log.WriteError(errorMsg, exception);
             num = (long)-1;
         }
     }
     return num;
 }
Ejemplo n.º 18
0
 public long icar_SendTxtMsg(CmdParam.ParamType ParamType, string SimNum, string CarPw, CmdParam.CommMode CommMode, TxtMsg msgContent, int iMsgId, string sMsgType)
 {
     long num = (long)0;
     this.logMsg.FunctionName = "icar_SendTxtMsg";
     this.logMsg.Msg = string.Concat("发送:类型-", ParamType.ToString(), ",车辆-", SimNum);
     string str = string.Concat("消息类型-", msgContent.MsgType.ToString(), string.Format(",{0}-", sMsgType), msgContent.strMsg);
     LogMsg logMsg = this.logMsg;
     logMsg.Msg = string.Concat(logMsg.Msg, ",", str);
     this.log.WriteLog(this.logMsg);
     if (!this.isStartCommon())
     {
         num = (long)-1;
     }
     else
     {
         try
         {
             if (msgContent.MsgType != CmdParam.MsgType.掉线短信通知)
             {
                 int num1 = 1;
                 int num2 = iMsgId;
                 num = DownData.CarCmdSend.icar_SendTxtMsg(num1, num2, SimNum, msgContent.MsgType, msgContent.strMsg);
                 if (num == (long)0)
                 {
                     ReadDataFromDB.execSaveGpsLogTable(num1, num2, msgContent.CarId, (int)msgContent.MsgType, msgContent.strMsg);
                 }
             }
             else
             {
                 object[] objArray = new object[] { msgContent.MsgType.ToString(), msgContent.SimNum, msgContent.strMsg };
                 object obj = objArray;
                 int num3 = 4;
                 int newOrderId = DownData.CarCmdSend.GetNewOrderId();
                 num = DownData.CarCmdSend.icar_SetCommonCmd(num3, newOrderId, SimNum, (CmdParam.CmdCode)768, ref obj, CmdParam.CommMode.未知方式);
                 if (num == (long)0)
                 {
                     ReadDataFromDB.execSaveGpsLogTable(num3, newOrderId, msgContent.CarId, (int)msgContent.MsgType, msgContent.strMsg);
                 }
             }
             if (num != (long)0)
             {
                 AlarmMsg alarmMsg = new AlarmMsg()
                 {
                     ClassName = "GpsPicDownData",
                     FunctionName = "icar_SendTxtMsg"
                 };
                 object[] workId = new object[] { "workid-", this.WorkId, ",simNum-", SimNum, ",strMsg-", msgContent.strMsg };
                 alarmMsg.AlarmText = string.Concat(workId);
                 alarmMsg.Code = num.ToString();
                 this.log.WriteAlarm(alarmMsg);
             }
         }
         catch (Exception exception1)
         {
             Exception exception = exception1;
             ErrorMsg errorMsg = new ErrorMsg()
             {
                 ClassName = "GpsPicDownData",
                 ErrorText = "下发消息指令时发生错误!"
             };
             this.log.WriteError(errorMsg, exception);
             num = (long)-1;
         }
     }
     return num;
 }
Ejemplo n.º 19
0
 public long icar_SendRawPackage(CmdParam.ParamType ParamType, string SimNum, string CarPw, CmdParam.CommMode CommMode, TrafficRawPackage trafficRawPackage, string CarID)
 {
     long num = (long)-1;
     this.logMsg.FunctionName = "icar_SendRawPackage";
     LogMsg logMsg = this.logMsg;
     string[] str = new string[] { "发送:类型-", ParamType.ToString(), ",车辆-", SimNum, ",指令-", trafficRawPackage.OrderCode.ToString(), ",参数-", trafficRawPackage.strText };
     logMsg.Msg = string.Concat(str);
     string msg = this.logMsg.Msg;
     this.log.WriteLog(this.logMsg);
     if (!this.isStartCommon())
     {
         num = (long)-1;
     }
     else
     {
         try
         {
             int num1 = 1;
             int newOrderId = DownData.CarCmdSend.GetNewOrderId();
             string str1 = "";
             string xmlString = trafficRawPackage.ToXmlString(this.CalOrderId(num1, newOrderId), SimNum, "JTBGPS", (int)CommMode, "SendRawPackage", ref str1);
             num = DownData.CarCmdSend.icar_SendCmdXML(num1, newOrderId, SimNum, "JTBGPS", (int)trafficRawPackage.OrderCode, (int)CommMode, xmlString);
             if (num == (long)0)
             {
                 ReadDataFromDB.execSaveGpsLogTable(num1, newOrderId, CarID, (int)trafficRawPackage.OrderCode, trafficRawPackage.strText);
             }
             else
             {
                 AlarmMsg alarmMsg = new AlarmMsg()
                 {
                     ClassName = "GpsPicDownData",
                     FunctionName = "icar_SendRawPackage"
                 };
                 string[] simNum = new string[] { "异常发送:", SimNum, "类型-", ParamType.ToString(), ",车辆-", SimNum, ",指令-", trafficRawPackage.OrderCode.ToString(), ",参数-", trafficRawPackage.strText };
                 alarmMsg.AlarmText = string.Concat(simNum);
                 alarmMsg.Code = num.ToString();
                 this.log.WriteAlarm(alarmMsg);
             }
         }
         catch (Exception exception1)
         {
             Exception exception = exception1;
             ErrorMsg errorMsg = new ErrorMsg()
             {
                 ClassName = "GpsPicDownData",
                 ErrorText = "下发消息指令时发生错误!"
             };
             this.log.WriteError(errorMsg, exception);
             num = (long)-1;
         }
     }
     return num;
 }
Ejemplo n.º 20
0
 private void InsertAlarmInfo(DataRow dr, CmdParam.CarAlarmState carAlarmState, int regionID)
 {
     try
     {
         int num = 0;
         string empty = string.Empty;
         int num1 = 1;
         long num2 = 4503599627370496L;
         int num3 = 1154;
         int num4 = 65;
         string str = string.Empty;
         string str1 = dr["AddMsgTxt"].ToString();
         string str2 = null;
         bool flag = false;
         string str3 = null;
         int num5 = 0;
         try
         {
             SqlParameter[] sqlParameter = new SqlParameter[] { new SqlParameter("@wrkid", (object)num), new SqlParameter("@orderid", dr["OrderId"]), new SqlParameter("@userid", empty), new SqlParameter("@telephone", dr["telephone"]), new SqlParameter("@msgType", (object)num4), new SqlParameter("@recetime", dr["ReceTime"]), new SqlParameter("@gpstime", dr["GpsTime"]), new SqlParameter("@starCondition", dr["StarCondition"]), new SqlParameter("@starNum", dr["StarNum"]), new SqlParameter("@carStatu", (object)num1), new SqlParameter("@carStatuEx", (object)num2), new SqlParameter("@carCondition", dr["CarCondition"]), new SqlParameter("@Longitude", dr["Longitude"]), new SqlParameter("@Latitude", dr["Latitude"]), new SqlParameter("@direct", dr["Direct"]), new SqlParameter("@speed", dr["Speed"]), new SqlParameter("@Reserved", (object)num3), new SqlParameter("@TransportStatus", dr["TransportStatus"]), new SqlParameter("@Accelerration", dr["Accelerration"]), new SqlParameter("@Altitude", dr["Altitude"]), new SqlParameter("@DistanceDiff", dr["DistanceDiff"]), new SqlParameter("@commflag", dr["CommFlag"]), new SqlParameter("@addType", dr["AddMsgType"]), new SqlParameter("@addTxt", str1), new SqlParameter("@DutyStr", str2), new SqlParameter("@isPic", (object)flag), new SqlParameter("@pic", str3), new SqlParameter("@alarmInfo", str), new SqlParameter("@cameraID", (object)num5) };
             string str4 = "GpsPicServer_Alarm_Insert";
             string str5 = "GpsPicServer_RealTime_Insert";
             int num6 = SqlDataAccess.insertBySp(str4, sqlParameter);
             if (num6 > 0)
             {
                 LogMsg logMsg = new LogMsg("PlatformAlarmRegionAlarm", "InsertAlarmInfo", "");
                 object[] objArray = new object[] { "车载电话为:", dr["telephone"].ToString(), "的平台检测", carAlarmState.ToString(), "报警报文已插入gpsrecebuffer,区域ID:", regionID };
                 logMsg.Msg = string.Concat(objArray);
                 this.logHelper.WriteLog(logMsg);
             }
             else
             {
                 object[] objArray1 = new object[] { "将平台检测", carAlarmState.ToString(), "报警报文插入gpsrecbuffer表错误,返回值!", num6.ToString(), ",区域ID:", regionID };
                 ErrorMsg errorMsg = new ErrorMsg("PlatformAlarmRegionAlarm", "InsertAlarmInfo", string.Concat(objArray1));
                 this.logHelper.WriteError(errorMsg);
             }
             int num7 = SqlDataAccess.insertBySp(str5, sqlParameter);
             if (num7 > 0)
             {
                 string[] strArrays = new string[] { "车载电话为:", dr["telephone"].ToString(), "的平台检测", carAlarmState.ToString(), "报警报文已插入gpsrecerealtime" };
                 LogMsg logMsg1 = new LogMsg("PlatformAlarmRegionAlarm", "InsertAlarmInfo", string.Concat(strArrays));
                 object[] objArray2 = new object[] { "车载电话为:", dr["telephone"].ToString(), "的平台检测", carAlarmState.ToString(), "报警报文已插入gpsrecerealtime,区域ID:", regionID };
                 logMsg1.Msg = string.Concat(objArray2);
                 this.logHelper.WriteLog(logMsg1);
             }
             else
             {
                 object[] objArray3 = new object[] { "将平台检测", carAlarmState.ToString(), "报警报文插入gpsrecerealtime_buffer表发生错误,返回值!", num7.ToString(), ",区域ID:", regionID };
                 ErrorMsg errorMsg1 = new ErrorMsg("PlatformAlarmRegionAlarm", "InsertAlarmInfo", string.Concat(objArray3));
                 this.logHelper.WriteError(errorMsg1);
             }
         }
         catch (Exception exception1)
         {
             Exception exception = exception1;
             object[] objArray4 = new object[] { "车载电话为:", dr["telephone"].ToString(), "的平台检测", carAlarmState.ToString(), ",区域ID:", regionID, "报警报文插入数据库发生错误! 信息:", exception.Message };
             ErrorMsg errorMsg2 = new ErrorMsg("PlatformAlarmRegionAlarm", "InsertAlarmInfo", string.Concat(objArray4));
             this.logHelper.WriteError(errorMsg2);
         }
     }
     catch (Exception exception3)
     {
         Exception exception2 = exception3;
         LogHelper logHelper = new LogHelper();
         object[] objArray5 = new object[] { "将平台检测", carAlarmState.ToString(), ",区域ID:", regionID, "报警报文插入gpsrecbuffer表 、gpsrecerealtime_buffer表发生错误!", exception2.Message };
         ErrorMsg errorMsg3 = new ErrorMsg("PlatformAlarmRegionAlarm", "InsertAlarmInfo", string.Concat(objArray5));
         logHelper.WriteError(errorMsg3);
     }
 }
Ejemplo n.º 21
0
 public Response icar_SetAlarmFlag(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, AlarmEntity alarmEntity_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetAlarmFlag";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     string str = string.Concat(new object[] { "报警器开关标志位-", alarmEntity_0.CarAlarmSwitch.ToString(), ",报警器类型标志位-", alarmEntity_0.CarAlarmFlag.ToString(), ",扩展报警器开关标志位:", alarmEntity_0.CarAlarmSwitchEx, ",报警器类型标志位", alarmEntity_0.CarShowAlarmEx.ToString() });
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", alarmEntity_0.OrderCode.ToString(), "等待", "", str);
                 new Car().InsertAlamFlagIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId, (int) alarmEntity_0.CarAlarmSwitch, (int) alarmEntity_0.CarAlarmFlag, (int) alarmEntity_0.CarShowAlarm, (long) alarmEntity_0.AlarmFlagType, alarmEntity_0.AlarmFlagEx, alarmEntity_0.CarAlarmSwitchEx, alarmEntity_0.CarShowAlarmEx);
                 if (info.ProtocolName == SendBase.m_ProtocolName)
                 {
                     alarmEntity_0.TransformCode = (int) alarmEntity_0.AlarmFlagType;
                     string conntent = "";
                     string str3 = alarmEntity_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetCommArg", ref conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, alarmEntity_0.TransformCode, (int) commMode_0, str3);
                 }
                 else
                 {
                     response.ResultCode = SendBase.CarCmdSend.icar_SetAlarmFlag(base.WorkId, newOrderId, info.SimNum, (int) alarmEntity_0.CarAlarmSwitch, (int) alarmEntity_0.CarAlarmFlag);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetAlarmFlag";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", alarmEntity_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 22
0
 public Response icar_SetPhone(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, SetPhone phone)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetPhone";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     string str = "电话类型-" + phone.PhoneType.ToString() + ",电话号码-" + phone.strPhone;
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (phone.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 base.m_OrderCode = "255";
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCommandParameterToGpsLogTable(newOrderId.ToString() + "|" + info.CarId.ToString() + ";", Convert.ToInt32(phone.OrderCode).ToString());
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", phone.OrderCode.ToString(), "等待", "", str);
                 new Car().InsertPhonesIntoGisCar(phone.PhoneType, info.CarId, base.WorkId.ToString(), newOrderId.ToString(), phone.strPhone);
                 if (info.ProtocolName == SendBase.m_ProtocolName)
                 {
                     phone.TransformCode = CmdParam.TrafficProtocolCodeExchange((int) phone.PhoneType);
                     string conntent = "";
                     string str4 = phone.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetPhone", ref conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, phone.TransformCode, (int) commMode_0, str4);
                 }
                 else
                 {
                     response.ResultCode = SendBase.CarCmdSend.icar_SetPhone(base.WorkId, newOrderId, info.SimNum, phone.PhoneType, phone.strPhone);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetPhone";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", phone.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 23
0
 public Response icar_SetCallLimit(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, CallLimit callLimit_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetCallLimit";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + callLimit_0.OrderCode.ToString();
     string str = "发送车台呼叫限制";
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (callLimit_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 object callInPhone = callLimit_0.CallInPhone;
                 object callOutPhone = callLimit_0.CallOutPhone;
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", callLimit_0.OrderCode.ToString(), "等待", "", str);
                 SqlDataAccess access = new SqlDataAccess();
                 string str3 = string.Format(" insert into GisCarInfoTable_Tmp(carID, wrkID, orderID, carControlType, carControlMask, callInLst, callOutLst) values({0}, {1}, {2}, {3}, {4}, '{5}','{6}')", new object[] { info.CarId, base.WorkId, newOrderId, callLimit_0.FlagValue, callLimit_0.FlagMask, callLimit_0.CallInPhoneString, callLimit_0.CallOutPhoneString });
                 int num2 = access.insertBySql(str3);
                 if (num2 != 1)
                 {
                     base.alarmMsg.FunctionName = "icar_SetCallLimit";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", callLimit_0.OrderCode });
                     base.alarmMsg.Code = num2.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 long num3 = SendBase.CarCmdSend.icar_SetCallLimit(base.WorkId, newOrderId, info.SimNum, callLimit_0.FlagValue, callLimit_0.FlagMask, ref callInPhone, ref callOutPhone);
                 if (num3 != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetCallLimit";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", callLimit_0.OrderCode });
                     base.alarmMsg.Code = num3.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 24
0
 public Response icar_SetPosReport(CmdParam.ParamType paramType, string CarNum, string pwd, CmdParam.CommMode commMode, PosReport posReport)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetPosReport";
     base.logMsg.Msg = "发送:类型-" + paramType.ToString() + ",车辆-" + CarNum + ",指令-" + posReport.OrderCode.ToString();
     string str = string.Concat(new object[] { "拐点补偿-", posReport.IsAutoCalArc, ",是否压缩-", posReport.isCompressed.ToString(), ",压缩上传时间-", posReport.CompressionUpTime, ",间隔-", posReport.LowReportCycle, ",持续-", posReport.ReportTiming, ",汇报类型-", posReport.ReportType, ",停车是否汇报-", posReport.ReportWhenStop });
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType, CarNum, pwd))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (posReport.CheckData(out strErrorMsg) != 0)
     {
         base.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 if ((posReport.isCompressed == CmdParam.IsCompressed.压缩传送) && (posReport.ReportType == CmdParam.ReportType.定次汇报))
                 {
                     posReport.ReportTiming *= 10;
                 }
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", posReport.OrderCode.ToString(), "等待", "", str);
                 if ((info.ProtocolName == SendBase.m_ProtocolName) && (posReport.protocolType == CarProtocolType.交通厅))
                 {
                     posReport.TransformCode = CmdParam.TrafficProtocolCodeExchange2((int) posReport.ReportType);
                     string conntent = "";
                     string str4 = posReport.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode, "SetPosReport", ref conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, posReport.TransformCode, (int) commMode, str4);
                 }
                 else
                 {
                     response.ResultCode = SendBase.CarCmdSend.icar_SetPosReport(base.WorkId, newOrderId, info.SimNum, posReport.ReportType, posReport.ReportTiming, posReport.ReportCycle, posReport.IsAutoCalArc, posReport.isCompressed, posReport.ReportWhenStop);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetPosReport";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", posReport.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 else
                 {
                     base.userInfo.CarFilter.UpdatePosSearchFlag(posReport.OrderCode.ToString(), newOrderId, info.CarId);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 25
0
 public Response icar_SetCommArg(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, CommArgs commArgs_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetCommArg";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     string str = string.Concat(new object[] {
         "通讯方式-", commArgs_0.CommMode.ToString(), ",TCPIP-", commArgs_0.strTCPIP, ",TCP端口-", commArgs_0.TCPPort, ",UDPIP-", commArgs_0.strUDPIP, ",UDP端口-", commArgs_0.UDPPort, ",拨号用户名-", commArgs_0.strUser, ",是否使用代理-", commArgs_0.IsUseProxy.ToString(), ",代理IP-", commArgs_0.strProxyIP,
         ",代理端口-", commArgs_0.TCPPort, ",服务器类型-", commArgs_0.ServerType
      });
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (commArgs_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", commArgs_0.OrderCode.ToString(), "等待", "", str);
                 new Car().InsertComArsgIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId, (int) commArgs_0.CommMode, commArgs_0.strAPNAddr, commArgs_0.strUser, commArgs_0.strPassword, commArgs_0.strTCPIP, commArgs_0.TCPPort.ToString(), commArgs_0.strUDPIP, commArgs_0.UDPPort.ToString(), (int) commArgs_0.IsUseProxy, commArgs_0.strProxyIP, commArgs_0.ProxyPort.ToString(), commArgs_0.ServerType.ToString());
                 if (info.ProtocolName == SendBase.m_ProtocolName)
                 {
                     commArgs_0.TransformCode = CmdParam.TrafficProtocolCodeExchange((int) commArgs_0.OrderCode);
                     string conntent = "";
                     string str4 = commArgs_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetCommArg", ref conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, commArgs_0.TransformCode, (int) commMode_0, str4);
                 }
                 else
                 {
                     response.ResultCode = SendBase.CarCmdSend.icar_SetCommArg(base.WorkId, newOrderId, info.SimNum, commArgs_0.CommMode, commArgs_0.strAPNAddr, commArgs_0.strUser, commArgs_0.strPassword, commArgs_0.strTCPIP, commArgs_0.TCPPort, commArgs_0.strUDPIP, commArgs_0.UDPPort, commArgs_0.IsUseProxy, commArgs_0.strProxyIP, commArgs_0.ProxyPort);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetCommArg";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", commArgs_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 26
0
        /// <summary>
        /// 设置区域报警
        /// </summary>
        /// <param name="ParamType"></param>
        /// <param name="CarValues"></param>
        /// <param name="CarPw"></param>
        /// <param name="CommMode"></param>
        /// <param name="regionAlarmList"></param>
        /// <returns></returns>
        public Response icar_SetRegionAlarm(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, RegionAlarmList regionAlarmList)
        {
            Response response = new Response();
            base.logMsg.FunctionName = "icar_SetRegionAlarm";
            base.logMsg.Msg = "发送:类型-" + ParamType.ToString() + ",车辆-" + CarValues;
            base.log.WriteLog(base.logMsg);
            if (!base.CheckCar(ParamType, CarValues, CarPw))
            {
                response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
                base.log.WriteAlarm(base.alarmMsg);
                return response;
            }
            if (base.isStartCommon())
            {
                Car car = new Car();
                foreach (Bussiness.CarInfo info in base.carInfoList)
                {
                    try
                    {
                        RegionAlarm alarm;
                        int num = -1;
                        for (int i = 0; i < regionAlarmList.Count; i++)
                        {
                            alarm = (RegionAlarm) regionAlarmList[i];
                            ///////////////////////////////////////////
                            //进行反纠偏处理
                            string LatLngString = alarm.AlarmRegionDot;
                            string[] latlng = LatLngString.Trim(new char[]{'\\'}).Split('\\');
                            LatLngString = latlng[0].ToString() + "\\";
                            for (int j = 0; j < (latlng.Length-1) / 2; j++)
                            {
                                double lng = Convert.ToDouble(latlng[j * 2 + 1]);
                                double lat = Convert.ToDouble(latlng[j * 2 + 2]);
                                GoogleOffset.getMars(ref lng, ref lat);
                                LatLngString = LatLngString + lng.ToString() + "\\" + lat.ToString() + "\\";
                            }
                            if ((latlng.Length/2)*2 == latlng.Length)
                            {
                                LatLngString = LatLngString + latlng[latlng.Length - 1];
                            }
                            alarm.AlarmRegionDot = LatLngString.Trim(new char[]{'\\'});
                            ///////////////////////////////////////////
                            DataTable table = car.GetNewRegionId(info.CarId, alarm.PathName, num);
                            if ((table == null) || (table.Rows.Count == 0))
                            {
                                base.errMsg.ErrorText = string.Format("\"{0}\"获取报警区域ID失败!", info.CarNum);
                                response.ErrorMsg = base.errMsg.ErrorText;
                                base.log.WriteError(base.errMsg);
                                return response;
                            }
                            int num3 = int.Parse(table.Rows[0][0].ToString());
                            alarm.newRegionId = num3;
                            num = num3;
                        }
                        object pvRegions = null;
                        if (regionAlarmList.protocolType == CarProtocolType.非交通厅)
                        {
                            pvRegions = regionAlarmList.pvRegions;
                        }
                        int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                        base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                        string orderIDParam = response.OrderIDParam;
                        response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                        if ((info.ProtocolName != SendBase.m_ProtocolName) && (regionAlarmList.protocolType == CarProtocolType.交通厅))
                        {
                            base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", regionAlarmList.OrderCode.ToString(), "失败", "", "终端不支持该协议!");
                            response.ResultCode = 0L;
                            return response;
                        }
                        base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", regionAlarmList.OrderCode.ToString(), "等待", "", "");
                        car.InsertRegionIntoGisCar(info.CarId, base.WorkId, newOrderId, regionAlarmList.AlarmRegionDot, regionAlarmList.RegionFeature.ToString());
                        RegionAlarmList list = new RegionAlarmList();
                        RegionAlarmList list2 = new RegionAlarmList();
                        RegionAlarmList list3 = new RegionAlarmList();
                        for (int j = 0; j < regionAlarmList.Count; j++)
                        {
                            alarm = (RegionAlarm) regionAlarmList[j];
                            switch (alarm.GetSharpe())
                            {
                                case 1:
                                    list.Add(alarm);
                                    break;

                                case 2:
                                    list2.Add(alarm);
                                    break;

                                case 3:
                                    list3.Add(alarm);
                                    break;
                            }
                            car.UpdateRegionParam(base.WorkId, newOrderId, int.Parse(info.CarId), alarm.RegionID, alarm.param, alarm.toEndTime, alarm.toBackTime, alarm.RegionType & 15, alarm.BeginTime, alarm.EndTime, regionAlarmList.RegionFeature, alarm.AlarmCondition.ToString(), alarm.PlanUpTime, alarm.PlanDownTime, alarm.newRegionId, alarm.AlarmFlag, alarm.MaxSpeed, alarm.HodeTime);
                        }
                        if (regionAlarmList.RegionFeature == 1)
                        {
                            if ((info.ProtocolName == SendBase.m_ProtocolName) && (regionAlarmList.protocolType == CarProtocolType.交通厅))
                            {
                                if (list.Count > 0)
                                {
                                    string content = "";
                                    list.OrderCode = regionAlarmList.OrderCode;
                                    string str2 = list.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) CommMode, "SetRegionAlarm", ref content);
                                    if (!string.IsNullOrEmpty(content))
                                    {
                                        response.ErrorMsg = content + "经纬度数据有问题";
                                        response.ResultCode = -1L;
                                        return response;
                                    }
                                    response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) list.OrderCode, (int) CommMode, str2);
                                }
                                if (list2.Count > 0)
                                {
                                    string str3 = "";
                                    list2.OrderCode = regionAlarmList.OrderCode;
                                    string str4 = list2.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) CommMode, "SetRegionAlarm", ref str3);
                                    if (!string.IsNullOrEmpty(str3))
                                    {
                                        response.ErrorMsg = str3 + "经纬度数据有问题";
                                        response.ResultCode = -1L;
                                        return response;
                                    }
                                    response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) list2.OrderCode, (int) CommMode, str4);
                                }
                                if (list3.Count > 0)
                                {
                                    string str5 = "";
                                    list3.OrderCode = regionAlarmList.OrderCode;
                                    string str6 = list3.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) CommMode, "SetRegionAlarm", ref str5);
                                    if (!string.IsNullOrEmpty(str5))
                                    {
                                        response.ErrorMsg = str5 + "经纬度数据有问题";
                                        response.ResultCode = -1L;
                                        return response;
                                    }
                                    response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) list3.OrderCode, (int) CommMode, str6);
                                }
                            }
                            else
                            {
                                response.ResultCode = SendBase.CarCmdSend.icar_SimpleCmd(base.WorkId, newOrderId, info.SimNum, regionAlarmList.CmdCode, ref pvRegions);
                            }
                        }
                        else
                        {
                            response.ResultCode = SendBase.CarCmdSend.icar_SetMultiRegionAlarm(base.WorkId, newOrderId, info.SimNum, ref pvRegions);
                        }
                        if (response.ResultCode != 0L)
                        {
                            base.alarmMsg.FunctionName = "icar_SetRegionAlarm";
                            base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", regionAlarmList.OrderCode });
                            base.alarmMsg.Code = response.ResultCode.ToString();
                            base.log.WriteAlarm(base.alarmMsg);
                        }
                        response.ResultCode = 0L;
                        continue;
                    }
                    catch (Exception exception)
                    {
                        base.errMsg.ErrorText = "下发消息指令时发生错误!";
                        response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                        base.log.WriteError(base.errMsg, exception);
                    }
                }
                return response;
            }
            response.ErrorMsg = base.ErrorMsg;
            return response;
        }
Ejemplo n.º 27
0
 public Response icar_SetLastDotQuery(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, CmdParam.OrderCode orderCode_0)
 {
     string format = "车辆{0}末次位置查询未找到该车辆轨迹";
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetLastDotQuery";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + orderCode_0.ToString();
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 DataRow lastDotData = new Car().GetLastDotData(info.SimNum);
                 if (lastDotData == null)
                 {
                     base.alarmMsg.FunctionName = "icar_SetLastDotQuery";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", orderCode_0.ToString() });
                     base.alarmMsg.Code = "-1";
                     base.log.WriteAlarm(base.alarmMsg);
                     base.userInfo.DownCommd.AddCarNewLogData(0, info.CarNum, "信息", "提示信息", "", "", string.Format(format, info.CarNum));
                 }
                 else
                 {
                     CmdParam.CommMode mode = CmdParam.CommMode.短信;
                     CarPartInfo info2 = this.method_5(lastDotData, out mode);
                     base.userInfo.DownCommd.AddCarNewLogData(0, info.CarNum, "接收", orderCode_0.ToString(), "成功", mode.ToString(), info2.GetCarCurrentInfo(), info2.Lon, info2.Lat, info2.AccOn, info2.Speed, info2.IsFill, info2.GpsValid, info.CarId, info2.Direct, info2.ReceTime, info2.GpsTime);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 response.ErrorMsg = base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 28
0
 public Response icar_SetTransportReport(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, TransportReport transportReport_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetTransportReport";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + transportReport_0.OrderCode.ToString();
     string paramDisc = transportReport_0.GetParamDisc();
     base.logMsg.Msg = base.logMsg.Msg + "," + paramDisc;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     string strErrorMsg = string.Empty;
     if (transportReport_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", transportReport_0.OrderCode.ToString(), "等待", "", paramDisc);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetTransportReport(base.WorkId, newOrderId, info.SimNum, transportReport_0.ReportFlag, transportReport_0.nStatuFree, transportReport_0.nStatuBusy, transportReport_0.nStatuTask);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetPosReport";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", transportReport_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Ejemplo n.º 29
0
        public Response icar_SetMultiSegSpeedAlarm(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, PathAlarmList pathAlarmList)
        {
            Response response = new Response();
            base.logMsg.FunctionName = "icar_SetMultiSegSpeedAlarm";
            base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
            base.log.WriteLog(base.logMsg);
            if (!base.CheckCar(paramType_0, string_1, string_2))
            {
                response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
                base.log.WriteAlarm(base.alarmMsg);
                return response;
            }
            if (base.isStartCommon())
            {
                foreach (Bussiness.CarInfo info in base.carInfoList)
                {
                    try
                    {
                        Car car = new Car();
                        int num = -1;
                        for (int i = 0; i < pathAlarmList.Count; i++)
                        {
                            PathAlarm alarm = (PathAlarm) pathAlarmList[i];
                            DataTable table = car.GetNewPathId(info.CarId, alarm.PathName, num);
                            if (table == null)
                            {
                                response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"获取偏移路线ID失败!", info.CarNum);
                                base.log.WriteError(base.errMsg);
                                return response;

                            }
                            int num3 = int.Parse(table.Rows[0][0].ToString());
                            if (-1 == num3)
                            {
                                response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"偏移路线ID已满,请删除部分偏移路线!", info.CarNum);
                                base.log.WriteError(base.errMsg);
                                return response;
                            }
                            num = int.Parse(table.Rows[0][1].ToString());
                            alarm.ID = num3;
                        }
                        object pvRegions = pathAlarmList.pvRegions;
                        int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                        base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                        string orderIDParam = response.OrderIDParam;
                        response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                        if ((info.ProtocolName != SendBase.m_ProtocolName) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                        {
                            base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "接收", pathAlarmList.OrderCode.ToString(), "失败", "", "终端不支持该协议!");
                            base.errMsg.ErrorText = "下发消息指令时发生错误!";
                            response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                            return response;
                        }
                        base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", pathAlarmList.OrderCode.ToString(), "等待", "", "");
                        car.InsertPathIntoGisCar(info.CarId, base.WorkId, newOrderId, pathAlarmList.AlarmPathDot);
                        if (pathAlarmList.OrderCode == CmdParam.OrderCode.设置分路段超速报警)
                        {
                            for (int j = 0; j < pathAlarmList.Count; j++)
                            {
                                PathAlarm alarm2 = (PathAlarm) pathAlarmList[j];
                                if (((alarm2.PathSegmentAlarmList != null) && (alarm2.PathSegmentAlarmList.Count != 0)) || !(info.ProtocolName == SendBase.m_ProtocolName))
                                {
                                    car.UpdateTrafficPathAlarm_tmp(base.WorkId, newOrderId, info.CarId, alarm2.PathName, 1, alarm2.Speed, alarm2.Time, alarm2.ID, (alarm2.BeginTime == null) ? "" : alarm2.BeginTime.ToString(), (alarm2.EndTime == null) ? "" : alarm2.EndTime.ToString(), alarm2.PathFlag, alarm2.DriEnough, alarm2.DriNoEnough);
                                }
                            }
                        }
                        if ((info.ProtocolName == SendBase.m_ProtocolName) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                        {
                            for (int k = 0; k < pathAlarmList.Count; k++)
                            {
                                PathAlarm alarm3 = (PathAlarm) pathAlarmList[k];
                                string conntent = "";
                                alarm3.OrderCode = pathAlarmList.OrderCode;
                                string str2 = alarm3.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetPathAlarm", ref conntent);
                                response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) alarm3.OrderCode, (int) commMode_0, str2);
                            }
                        }
                        else
                        {
                            if ((info.ProtocolName != SendBase.m_ProtocolName) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                            {
                                base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "接收", pathAlarmList.OrderCode.ToString(), "失败", "", "终端不支持该协议!");
                                response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                                response.ResultCode = 0L;
                                return response;
                            }
                            response.ResultCode = SendBase.CarCmdSend.icar_SimpleCmd(base.WorkId, newOrderId, info.SimNum, CmdParam.CmdCode.设置分段超速报警, ref pvRegions);
                        }
                        if (response.ResultCode != 0L)
                        {
                            base.alarmMsg.FunctionName = "icar_SetMultiSegSpeedAlarm";
                            base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", pathAlarmList.OrderCode });
                            base.alarmMsg.Code = response.ResultCode.ToString();
                            base.log.WriteAlarm(base.alarmMsg);
                        }
                        int num7 = 0;
                        while (true)
                        {
                            if (num7 >= pathAlarmList.Count)
                            {
                                break;
                            }
                            PathAlarm alarm4 = (PathAlarm) pathAlarmList[num7];
                            if ((pathAlarmList.OrderCode == CmdParam.OrderCode.设置分路段超速报警) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                            {
                                try
                                {
                                    if ((info.ProtocolName == SendBase.m_ProtocolName) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                                    {
                                        for (int m = 0; m < alarm4.PathSegmentAlarmList.Count; m++)
                                        {
                                            car.InsertTrafficSegmentParam(info.CarId, alarm4.ParentID, alarm4.PathSegmentAlarmList[m].PathSegmentID, alarm4.PathSegmentAlarmList[m].TopSpeed, alarm4.PathSegmentAlarmList[m].HoldTime, alarm4.PathSegmentAlarmList[m].DriEnough, alarm4.PathSegmentAlarmList[m].DriNoEnough, alarm4.PathSegmentAlarmList[m].Flag, alarm4.PathSegmentAlarmList[m].PathWidth);
                                        }
                                    }
                                }
                                catch (Exception exception)
                                {
                                    base.log.WriteError(base.errMsg, exception);
                                }
                            }
                            num7++;
                        }
                        response.ResultCode = 0L;
                        continue;
                    }
                    catch (Exception exception2)
                    {
                        base.errMsg.ErrorText = "下发消息指令时发生错误!";
                        response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                        base.log.WriteError(base.errMsg, exception2);
                    }
                }
                return response;
            }
            response.ErrorMsg = base.ErrorMsg;
            return response;
        }
Ejemplo n.º 30
0
        public Response icar_SimpleCmd(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, SimpleCmd simpleCmd)
        {
            Response response = new Response();
            string paramDisc = simpleCmd.GetParamDisc();
            base.WriteLog(ParamType.ToString(), CarValues + paramDisc);
            if (!base.CheckCar(ParamType, CarValues, CarPw))
            {
                response.ErrorMsg = base.ErrorMsg;
                return response;
            }
            string strErrorMsg = string.Empty;
            if (simpleCmd.CheckData(out strErrorMsg) != 0)
            {
                response.ErrorMsg = strErrorMsg;
                return response;
            }
            if (!base.isStartCommon())
            {
                response.ErrorMsg = base.ErrorMsg;
                return response;
            }
            object pvArg = null;
            int newOrderId = -1;
            foreach (Bussiness.CarInfo info in base.carInfoList)
            {
                try
                {
                    if (simpleCmd.OrderCode == CmdParam.OrderCode.设置车台参数)
                    {
                        response.ResultCode = new Car().UpdateCarconfigOnDuty(info.CarId, simpleCmd.OnDuty, simpleCmd.CloseGSM, simpleCmd.CloseDail);
                    }
                    newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                    base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                    string orderIDParam = response.OrderIDParam;
                    response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                    base.AddUpDataLog(newOrderId, info.CarNum, simpleCmd.OrderCode.ToString(), paramDisc);
                    switch (simpleCmd.CmdCode)
                    {
                        case CmdParam.CmdCode.取消区域报警:
                            new Car().InsertRegionIdsIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId.ToString(), simpleCmd.RegionIds);
                            break;

                        case CmdParam.CmdCode.取消路线报警:
                            new Car().InsertPathIdsIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId.ToString(), simpleCmd.RegionIds.Trim(new char[] { '\\' }).Equals("0") ? "" : simpleCmd.RegionIds);
                            break;

                        case CmdParam.CmdCode.配置串口参数:
                            if (response.ResultCode == 0L)
                            {
                                new Car().InsertGpsCarDeviceParam(info.CarId, base.WorkId, newOrderId, simpleCmd.Com1Device, simpleCmd.Com2Device);
                            }
                            break;
                    }
                    if (info.ProtocolName == SendBase.m_ProtocolName)
                    {
                        int orderID = base.CalOrderId(base.WorkId, newOrderId);
                        string conntent = string.Empty;
                        simpleCmd.TransformCode = CmdParam.TrafficProtocolCodeExchange2((int) simpleCmd.OrderCode);
                        string str4 = string.Empty;
                        if (simpleCmd.CmdCode == CmdParam.CmdCode.取消区域报警)
                        {
                            try
                            {
                                string[] strArray = simpleCmd.RegionIds.Split(@"\".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                                string[] strArray2 = simpleCmd.RegionTypes.Split(@"\".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                                if (strArray2.Length <= 0)
                                {
                                    throw new Exception();
                                }
                                List<string> list = new List<string>();
                                List<string> list2 = new List<string>();
                                for (int i = 1; i <= 3; i++)
                                {
                                    for (int j = 0; j < strArray2.Length; j++)
                                    {
                                        if (strArray2[j].Equals(i.ToString()))
                                        {
                                            list.Add(strArray[j]);
                                            list2.Add(i.ToString());
                                        }
                                    }
                                    if (list.Count != 0)
                                    {
                                        simpleCmd.RegionIds = string.Join(@"\", list.ToArray());
                                        simpleCmd.RegionTypes = string.Join(@"\", list2.ToArray());
                                        str4 = simpleCmd.ToXmlString(orderID, info.SimNum, SendBase.m_ProtocolName, (int) CommMode, "SimpleCmd", ref conntent);
                                        list.Clear();
                                        list2.Clear();
                                        response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, simpleCmd.TransformCode, (int) CommMode, str4);
                                    }
                                }
                            }
                            catch (Exception)
                            {
                                base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", simpleCmd.OrderCode.ToString(), "失败", "", "终端不支持该命令");
                                response.ErrorMsg = "终端不支持该命令";
                            }
                        }
                        else if ((simpleCmd.OrderCode != CmdParam.OrderCode.取消出入口分段超速报警) && (simpleCmd.OrderCode != CmdParam.OrderCode.取消所有关键区域))
                        {
                            if ((simpleCmd.OrderCode == CmdParam.OrderCode.取消偏移路线报警) && simpleCmd.RegionIds.Trim(new char[] { '\\' }).Equals("0"))
                            {
                                simpleCmd.RegionIds = "";
                            }
                            str4 = simpleCmd.ToXmlString(orderID, info.SimNum, SendBase.m_ProtocolName, (int) CommMode, "SimpleCmd", ref conntent);
                            response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, simpleCmd.TransformCode, (int) CommMode, str4);
                        }
                        else
                        {
                            TrafficRawPackage package = new TrafficRawPackage {
                                OrderCode = CmdParam.OrderCode.命令透传,
                                SubOrderCode = simpleCmd.OrderCode,
                                strText = ""
                            };
                            str4 = package.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, -1, "SendRawPackage", ref conntent);
                            response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) package.OrderCode, -1, str4);
                        }
                    }
                    else
                    {
                        pvArg = simpleCmd.pvArg;
                        response.ResultCode = SendBase.CarCmdSend.icar_SimpleCmd(base.WorkId, newOrderId, info.SimNum, simpleCmd.CmdCode, ref pvArg);
                    }
                    if (response.ResultCode != 0L)
                    {
                        base.WriteError(base.WorkId.ToString(), info.SimNum, simpleCmd.OrderCode.ToString());
                    }
                    response.ResultCode = 0L;
                }
                catch (Exception exception)
                {
                    response.ErrorMsg = "下发消息指令时发生错误,错误详细信息:" + exception.Message;
                }
            }
            return response;
        }