コード例 #1
0
ファイル: DownData.cs プロジェクト: lexzh/Myproject
 public Response icar_SmallArea(string string_1, string string_2, string string_3, TxtMsg txtMsg_0, string string_4, string string_5)
 {
     Response response = new Response();
     DataTable table = base.GetCarInfoByArea(string_1, string_2, string_3, string_4, string_5);
     if ((table != null) && (table.Rows.Count != 0))
     {
         string str = "信息-" + txtMsg_0.strMsg + ",信息类型-" + txtMsg_0.MsgType.ToString();
         string strErrorMsg = string.Empty;
         if (txtMsg_0.CheckData(out strErrorMsg) != 0)
         {
             response.ErrorMsg = strErrorMsg;
             return response;
         }
         base.errMsg.FunctionName = base.logMsg.FunctionName = "icar_SmallArea";
         string str3 = string.Empty;
         ArrayList list = new ArrayList(100);
         foreach (DataRow row in table.Rows)
         {
             if (!base.CheckCar(CmdParam.ParamType.SimNum, row["telephone"].ToString(), ""))
             {
                 base.logMsg.Msg = "simNum:" + row["telephone"].ToString() + ",错误信息:" + base.ErrorMsg;
                 base.log.WriteLog(base.logMsg);
             }
             else if ((base.carInfoList != null) && (base.carInfoList.Count > 0))
             {
                 Bussiness.CarInfo info = base.carInfoList[0] as Bussiness.CarInfo;
                 str3 = "," + info.SimNum;
                 list.Add(info);
             }
         }
         if (str3.Length <= 0)
         {
             response.ErrorMsg = "没有符合的车辆!";
             return response;
         }
         base.logMsg.Msg = "发送:类型-" + CmdParam.ParamType.SimNum.ToString() + ",车辆-" + str3.Substring(1) + ",指令-" + txtMsg_0.OrderCode.ToString();
         base.logMsg.Msg = base.logMsg.Msg + "," + str;
         base.log.WriteLog(base.logMsg);
         if (base.isStartCommon())
         {
             foreach (Bussiness.CarInfo info2 in list)
             {
                 try
                 {
                     int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                     base.SaveCmdParm(newOrderId.ToString() + "|" + info2.CarId.ToString() + ";");
                     string orderIDParam = response.OrderIDParam;
                     response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info2.CarId.ToString() + ";";
                     response.ResultCode = SendBase.CarCmdSend.icar_RemoteDial(base.WorkId, newOrderId, info2.SimNum, "6", "电召");
                     if (response.ResultCode != 0L)
                     {
                         base.alarmMsg.FunctionName = "icar_SmallArea";
                         base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info2.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;
     }
     response.ErrorMsg = "该范围内未找到车辆!";
     return response;
 }
コード例 #2
0
ファイル: DownData.cs プロジェクト: lexzh/Myproject
 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;
 }
コード例 #3
0
ファイル: DownDataFJYD.cs プロジェクト: lexzh/Myproject
 public Response icar_SmallArea(string string_1, string string_2, string string_3, string string_4, string string_5, string string_6, ArrayList arrayList_0, TxtMsg txtMsg_0, CmdParam.CommMode commMode_0)
 {
     Response response = new Response();
     if ((arrayList_0 != null) && (arrayList_0.Count > 0))
     {
         string strErrorMsg = string.Empty;
         if (txtMsg_0.CheckData(out strErrorMsg) != 0)
         {
             response.ErrorMsg = strErrorMsg;
             return response;
         }
         base.errMsg.FunctionName = base.logMsg.FunctionName = "icar_SmallArea";
         string str2 = string.Empty;
         ArrayList list = new ArrayList(100);
         foreach (string str3 in arrayList_0)
         {
             if (!base.CheckCar(CmdParam.ParamType.SimNum, str3, ""))
             {
                 base.logMsg.Msg = "simNum:" + str3 + ",错误信息:" + base.ErrorMsg;
                 base.log.WriteLog(base.logMsg);
             }
             else if ((base.carInfoList != null) && (base.carInfoList.Count > 0))
             {
                 Bussiness.CarInfo info = base.carInfoList[0] as Bussiness.CarInfo;
                 str2 = "," + info.SimNum;
                 list.Add(info);
             }
         }
         if (str2.Length <= 0)
         {
             response.ErrorMsg = "没有符合的车辆!";
             return response;
         }
         string str4 = "信息-" + txtMsg_0.strMsg + ",信息类型-" + txtMsg_0.MsgType.ToString();
         base.logMsg.Msg = "发送:类型-" + CmdParam.ParamType.SimNum.ToString() + ",车辆-" + str2.Substring(1) + ",指令-" + txtMsg_0.OrderCode.ToString();
         base.logMsg.Msg = base.logMsg.Msg + "," + str4;
         base.log.WriteLog(base.logMsg);
         if (!base.isStartCommon())
         {
             response.ErrorMsg = base.ErrorMsg;
             return response;
         }
         int newOrderId = -1;
         object obj2 = null;
         string str5 = base.WorkId.ToString() + SendBase.CarCmdSend.GetNewOrderId().ToString();
         response.SvcContext = str5;
         foreach (Bussiness.CarInfo info2 in list)
         {
             try
             {
                 newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info2.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info2.CarId.ToString() + ";";
                 obj2 = this.method_9(info2.SimNum, string_6, txtMsg_0.strMsg, str5, string_5, string_1 + "," + string_2 + "," + string_3 + "," + string_4);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info2.SimNum, CmdParam.CmdCode.电召指令, ref obj2, commMode_0);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SmallArea_FJYD";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info2.SimNum, ",OrderCode-", CmdParam.OrderCode.电召指令.ToString() });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             catch (Exception exception)
             {
                 response.ErrorMsg = base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = "没有存在下发的车辆!";
     return response;
 }