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; }
private void method_0(IODeviceAttachInfo iodeviceAttachInfo_0) { IODeviceTextMsg msg = iodeviceAttachInfo_0 as IODeviceTextMsg; TxtMsg msg2 = new TxtMsg { OrderCode = CmdParam.OrderCode.调度, MsgType = CmdParam.MsgType.详细调度信息, strMsg = msg.Message }; if (this.downDataIODevice_0 == null) { this.downDataIODevice_0 = new DownDataIODevice(3, false, true, true); } this.downDataIODevice_0.icar_SendTxtMsg(CmdParam.ParamType.SimNum, msg.SimNum, "", CmdParam.CommMode.未知方式, msg2); }
public static Response DownData_icar_SmallArea_FJYD(string leftLon, string leftLat, string rightLon, string rightLat, string tryWay, string stelNumber, ArrayList sendCarlist, TxtMsg MsgContext, CmdParam.CommMode commMode) { Response response; if (RemotingClient.app == null) { return RemotingClient.reResult; } try { response = RemotingClient.app.DownData_icar_SmallArea_FJYD(leftLon, leftLat, rightLon, rightLat, tryWay, stelNumber, sendCarlist, MsgContext, commMode); } catch (SocketException socketException) { Record.execFileRecord("小范围电召(福建移动)", socketException.Message); response = RemotingClient.reResult; } catch (RemotingException remotingException) { Record.execFileRecord("小范围电召(福建移动)", remotingException.Message); response = RemotingClient.reResult; } catch (Exception exception) { Record.execFileRecord("小范围电召(福建移动)", exception.ToString()); response = RemotingClient.reResult; } return response; }
private long SendMsg(string carId, string simnum, string MsgContent, string MsgType) { long num; try { TxtMsg txtMsg = new TxtMsg() { strMsg = MsgContent, MsgType = CmdParam.MsgType.UCS2手机短信, OrderCode = CmdParam.OrderCode.调度, CarId = carId, SimNum = simnum }; long num1 = this.myDownData.icar_SendTxtMsg(CmdParam.ParamType.SimNum, simnum, "", CmdParam.CommMode.短信, txtMsg, 0, MsgType); num = num1; } catch (Exception exception1) { Exception exception = exception1; ErrorMsg errorMsg = new ErrorMsg("SendPZMessage", "SendMsg", "") { ErrorText = exception.Message }; this.logHelper.WriteError(errorMsg); num = (long)-1; } return num; }
public static Response Car_SmallArea_FJYD(string sLeftLon, string sLeftLat, string sRightLon, string sRightLat, string sResWay, string sResPhone, TxtMsg MsgContext, CmdParam.CommMode commMode) { Response response; if (RemotingClient.app == null) { return RemotingClient.reResult; } try { response = RemotingClient.app.Car_SmallArea_FJYD(sLeftLon, sLeftLat, sRightLon, sRightLat, sResWay, sResPhone, MsgContext, commMode); } catch (SocketException socketException) { Record.execFileRecord("小范围电召(福建移动)", socketException.Message); response = RemotingClient.reResult; } catch (RemotingException remotingException) { Record.execFileRecord("小范围电召(福建移动)", remotingException.Message); response = RemotingClient.reResult; } catch (Exception exception) { Record.execFileRecord("小范围电召(福建移动)", exception.ToString()); response = RemotingClient.reResult; } return response; }
public static Response DownData_icar_SetTextMsg(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, TxtMsg trafficTextMsg) { Response response; if (RemotingClient.app == null) { return RemotingClient.reResult; } try { response = RemotingClient.app.icar_SetTextMsg(ParamType, CarValues, CarPw, CommMode, trafficTextMsg); } catch (Exception exception) { Record.execFileRecord("发送调度信息", exception.Message); response = RemotingClient.reResult; } return response; }
public Response DownData_icar_SmallArea_FJYD(string leftLon, string leftLat, string rightLon, string rightLat, string tryWay, string stelNumber, ArrayList sendCarlist, TxtMsg MsgContext, CmdParam.CommMode commMode) { try { return this.myDownDataYD.icar_SmallArea(leftLon, leftLat, rightLon, rightLat, tryWay, stelNumber, sendCarlist, MsgContext, commMode); } catch (Exception exception) { ErrorMsg msg = new ErrorMsg { ClassName = "RemotingServer", FunctionName = "DownData_icar_SmallArea_FJYD", ErrorText = exception.ToString() + exception.Message }; new LogHelper().WriteError(msg); return new Response(); } }
public static Response Car_SmallArea(string sLongtide, string sLatitude, string sDis, TxtMsg MsgContext) { Response response; if (RemotingClient.app == null) { return RemotingClient.reResult; } try { response = RemotingClient.app.Car_SmallArea(sLongtide, sLatitude, sDis, MsgContext); } catch (SocketException socketException) { Record.execFileRecord("小范围电召", socketException.Message); response = RemotingClient.reResult; } catch (Exception exception) { Record.execFileRecord("小范围电召", exception.ToString()); response = RemotingClient.reResult; } return response; }
public Response icar_SmallArea(string string_1, string string_2, string string_3, string string_4, string string_5, string string_6, TxtMsg txtMsg_0, string string_7, string string_8, CmdParam.CommMode commMode_0) { DataTable table = base.GetCarInfoByArea(string_1, string_2, string_3, string_4, string_7, string_8); ArrayList list = new ArrayList(100); if ((table != null) && (table.Rows.Count > 0)) { foreach (DataRow row in table.Rows) { list.Add(row["telephone"] as string); } } return this.icar_SmallArea(string_1, string_2, string_3, string_4, string_5, string_6, list, txtMsg_0, commMode_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; }
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; }
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; }
private void btnSend_Click(object sender, EventArgs e) { string str = this.txtReNotice.Text.Trim(); if (string.IsNullOrEmpty(str)) { MessageBox.Show("调度信息不能为空!"); } else { TxtMsg txtMsg = new TxtMsg { OrderCode = CmdParam.OrderCode.调度, MsgType = CmdParam.MsgType.详细调度信息, strMsg = str }; Response response = RemotingClient.DownData_SendTxtMsg(CmdParam.ParamType.CarId, this.m_sCarId, this.m_sCarPw, CmdParam.CommMode.未知方式, txtMsg); if (response.ResultCode != 0L) { MessageBox.Show(response.ErrorMsg); } else { this.bSendSuccess = true; response = null; base.Close(); } } }
public Response icar_SetTextMsg(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, TxtMsg trafficTextMsg) { try { return this.myDownDataYD.icar_SetTextMsg(ParamType, CarValues, CarPw, CommMode, trafficTextMsg, this._OnlineUserInfo.AreaCode, this._OnlineUserInfo.UserId); } catch (Exception exception) { this.m_LogHelper.WriteError(new ErrorMsg("RemotingServer", "icar_SetTextMsg", exception.ToString())); return new Response(); } }
public Response DownData_SendTxtMsg(CmdParam.ParamType ParamType, string sCarValue, string sPw, CmdParam.CommMode CommMode, TxtMsg TxtMsg) { try { return this.myDownData.icar_SendTxtMsg(ParamType, sCarValue, sPw, CommMode, TxtMsg); } catch (Exception exception) { this.m_LogHelper.WriteError(new ErrorMsg("RemotingServer", "DownData_SendTxtMsg", exception.ToString())); return new Response(); } }
private void execSendErrMsg(string sErrMsg) { TxtMsg txtMsg = new TxtMsg() { MsgType = CmdParam.MsgType.UCS2手机短信, OrderCode = CmdParam.OrderCode.调度, strMsg = sErrMsg }; Record.execFileRecord("发送故障报警", sErrMsg); string[] strArrays = ReadDataFromXml.Linkman.Split(new char[] { ',' }); for (int i = 0; i < (int)strArrays.Length; i++) { string str = strArrays[i]; if (!string.IsNullOrEmpty(str)) { this.myDownData.icar_SendTxtMsg(CmdParam.ParamType.SimNum, str, "", CmdParam.CommMode.短信, txtMsg, 0, "故障检测通知"); } } MailMessage mailMessage = new MailMessage(); if (string.IsNullOrEmpty(ReadDataFromXml.sLinkmanMailTo)) { return; } string[] strArrays1 = ReadDataFromXml.sLinkmanMailTo.Split(new char[] { ';' }); for (int j = 0; j < (int)strArrays1.Length; j++) { string str1 = strArrays1[j]; if (!string.IsNullOrEmpty(str1)) { string[] strArrays2 = str1.Split(new char[] { '(' }); if ((int)strArrays2.Length == 2) { MailAddressCollection to = mailMessage.To; string str2 = strArrays2[1]; char[] chrArray = new char[] { ')' }; ((Collection<MailAddress>)to).Add(new MailAddress(str2.Trim(chrArray), strArrays2[0])); } else if ((int)strArrays2.Length == 1) { mailMessage.To.Add(strArrays2[0]); } } } string[] strArrays3 = ReadDataFromXml.sLinkmanMailCC.Split(new char[] { ';' }); for (int k = 0; k < (int)strArrays3.Length; k++) { string str3 = strArrays3[k]; if (!string.IsNullOrEmpty(str3)) { string[] strArrays4 = str3.Split(new char[] { '(' }); if ((int)strArrays4.Length == 2) { MailAddressCollection cC = mailMessage.CC; string str4 = strArrays4[1]; char[] chrArray1 = new char[] { ')' }; ((Collection<MailAddress>)cC).Add(new MailAddress(str4.Trim(chrArray1), strArrays4[0])); } else if ((int)strArrays4.Length == 1) { mailMessage.CC.Add(strArrays4[0]); } } } mailMessage.From = new MailAddress("*****@*****.**", "车务通检测平台", Encoding.Default); mailMessage.Subject = "故障检测通知"; DateTime now = DateTime.Now; mailMessage.Body = string.Format("时间:{0}\r\n{1}", now.ToString("yyyy-MM-dd HH:mm:ss"), sErrMsg); mailMessage.SubjectEncoding = Encoding.GetEncoding(936); mailMessage.BodyEncoding = Encoding.GetEncoding(936); SmtpClient smtpClient = new SmtpClient("mail.star-net.cn") { Credentials = new NetworkCredential("*****@*****.**", "zb1234") }; try { smtpClient.UseDefaultCredentials = false; smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; smtpClient.Send(mailMessage); (new LogHelper()).WriteText("故障邮件发送成功"); } catch (Exception exception) { ErrorMsg errorMsg = new ErrorMsg("故障检测通知", "发送故障邮件", exception.Message) { ClassName = "execSendErrMsg" }; (new LogHelper()).WriteError(errorMsg); } }
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; }
private void execSendMsg(DataRow dr) { LogMsg logMsg = new LogMsg(); if (string.IsNullOrEmpty(this.sSendMsg)) { logMsg.Msg = "短息内容为空,不下发短信通知。"; this.logHelper.WriteLog(logMsg); return; } logMsg.Msg = "开始发送短信通信通知..."; this.logHelper.WriteLog(logMsg); bool flag = this.sSendMsg.IndexOf("(C)") >= 0; string str = dr["StarCondition"].ToString(); string str1 = dr["Longitude"].ToString(); string str2 = dr["Latitude"].ToString(); string str3 = dr["CarNum"].ToString(); string str4 = dr["CarId"].ToString(); string str5 = dr["telephone"].ToString(); dr["FirstConnectorName"].ToString(); string str6 = dr["FirstConnectTele"].ToString(); dr["ConnectorName"].ToString(); string str7 = dr["ConnectTele"].ToString(); string str8 = ""; string str9 = ""; TxtMsg txtMsg = new TxtMsg(); try { str1 = str1.Substring(0, str1.IndexOf('.') + 7); str2 = str2.Substring(0, str2.IndexOf('.') + 7); } catch { } if (flag) { str8 = ReadDataFromGis.QueryAllLayerByPoint(str1, str2); } str9 = (str != "1" ? "未定位" : "定位"); this.sSendMsg = this.sSendMsg.Replace("(A)", str3); string str10 = this.sSendMsg; DateTime now = DateTime.Now; this.sSendMsg = str10.Replace("(B)", now.ToString("yyyyMMdd HH:mm:ss")); this.sSendMsg = this.sSendMsg.Replace("(C)", str8); this.sSendMsg = this.sSendMsg.Replace("(D)", str9); txtMsg.strMsg = this.sSendMsg; txtMsg.MsgType = CmdParam.MsgType.UCS2手机短信; txtMsg.OrderCode = CmdParam.OrderCode.调度; txtMsg.CarId = str4; txtMsg.SimNum = str5; if (!string.IsNullOrEmpty(str6)) { this.myDownData.icar_SendTxtMsg(CmdParam.ParamType.SimNum, str6, "", CmdParam.CommMode.短信, txtMsg, 0, "禁驾报警通知第一联系人"); } if (!string.IsNullOrEmpty(str7)) { this.myDownData.icar_SendTxtMsg(CmdParam.ParamType.SimNum, str7, "", CmdParam.CommMode.短信, txtMsg, 0, "禁驾报警通知第二联系人"); } }
public Response Car_SmallArea(string sLongtide, string sLatitude, string sDis, TxtMsg MsgContext) { try { return this.myDownData.icar_SmallArea(sLongtide, sLatitude, sDis, MsgContext, this._OnlineUserInfo.AreaCode, this._OnlineUserInfo.UserId); } catch (Exception exception) { new LogHelper().WriteError(new ErrorMsg("RemotingServer", "Car_SmallArea", exception.ToString() + exception.Message)); return new Response(); } }
public GpsResponse iSendTxtMess(int ParamType, string sCarValue, string sPw, int iMessageType, string sMsgTxt) { try { TxtMsg txtMsg = new TxtMsg { MsgType = (CmdParam.MsgType) iMessageType, strMsg = sMsgTxt, OrderCode = CmdParam.OrderCode.调度 }; Response result = RemotingClient.DownData_SendTxtMsg((CmdParam.ParamType) ParamType, sCarValue, sPw, CmdParam.CommMode.未知方式, txtMsg); return this.execToResponse(result); } catch (Exception exception) { Record.execFileRecord("插件操作->向车台终端发送文本消息", exception.Message); return new GpsResponse(-1L) { ErrorMsg = exception.Message }; } }
public Response Car_SmallArea_FJYD(string sLeftLon, string sLeftLat, string sRightLon, string sRightLat, string sResWay, string stelNumber, TxtMsg MsgContext, CmdParam.CommMode CommMode) { try { return this.myDownDataYD.icar_SmallArea(sLeftLon, sLeftLat, sRightLon, sRightLat, sResWay, stelNumber, MsgContext, this._OnlineUserInfo.AreaCode, this._OnlineUserInfo.UserId, CommMode); } catch (Exception exception) { new LogHelper().WriteError(new ErrorMsg("RemotingServer", "Car_SmallArea_FJYD", exception.ToString() + exception.Message)); return new Response(); } }
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; }
private void worder_DoWork(object sender, DoWorkEventArgs e) { string str = this.txtContent.Text.Trim(); string text = this.txtLeftLon.Text; string sLeftLat = this.txtLeftLat.Text; string sRightLon = this.txtRightLon.Text; string sRightLat = this.txtRightLat.Text; string sResWay = e.Argument.ToString(); string text1 = this.txtOrderId.Text; string sResPhone = this.txtPhone.Text.Trim(); TxtMsg msgContext = new TxtMsg { OrderCode = CmdParam.OrderCode.点对点电召, MsgType = CmdParam.MsgType.电召信息, strMsg = str }; try { this.worder.ReportProgress(10, "正在发送抢答,请稍候……"); Response response = RemotingClient.Car_SmallArea_FJYD(text, sLeftLat, sRightLon, sRightLat, sResWay, sResPhone, msgContext, CmdParam.CommMode.未知方式); if (response.ResultCode != 0L) { this.worder.ReportProgress(100, "发送抢答失败!"); this.sParam = ""; this.m_OderId = ""; MessageBox.Show(response.ErrorMsg); } else { this.worder.ReportProgress(100, "发送抢答成功!"); this.sParam = response.OrderIDParam; this.m_OderId = response.SvcContext; } Record.execFileRecord("电召指令", sResWay + "," + sResPhone + "," + msgContext.strMsg); } catch (Exception exception) { Record.execFileRecord("电召->异步发送抢答", exception.Message); } }