Esempio n. 1
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;
 }
Esempio n. 2
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;
 }
Esempio n. 3
0
 public static Response DownData_SetPosReport(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, PosReport posReport)
 {
     Response response;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         response = RemotingClient.app.DownData_SetPosReport(ParamType, CarValues, CarPw, CommMode, posReport);
     }
     catch (Exception exception)
     {
         Record.execFileRecord("车辆定位汇报", exception.Message);
         response = RemotingClient.reResult;
     }
     return response;
 }
Esempio n. 4
0
 protected override void btnOK_Click(object sender, EventArgs e)
 {
     base.btnOK_Click(sender, e);
     if (!string.IsNullOrEmpty(base.sValue))
     {
         this.getParam();
         if (base.OrderCode != CmdParam.OrderCode.设置重点监控)
         {
             if (base.OrderCode == CmdParam.OrderCode.末次位置查询)
             {
                 base.reResult = RemotingClient.DownData_SetLastDotQuery(base.ParamType, base.sValue, base.sPw, this.m_CommondMode, base.OrderCode);
             }
             else if (base.OrderCode == CmdParam.OrderCode.远程升级车台软件)
             {
                 base.reResult = RemotingClient.DownData_RemoteUpdate(base.ParamType, base.sValue, base.sPw, this.m_CommondMode);
             }
             else if (base.OrderCode == CmdParam.OrderCode.实时点名查询)
             {
                 PosReport posReport = new PosReport
                 {
                     OrderCode = CmdParam.OrderCode.位置查询,
                     CompressionUpTime = 0,
                     isCompressed = CmdParam.IsCompressed.单次传送,
                     ReportType = CmdParam.ReportType.定次汇报,
                     ReportTiming = 1,
                     LowReportCycle = 60,
                     ReportWhenStop = CmdParam.ReportWhenStop.汇报,
                     IsAutoCalArc = 0,
                     protocolType = CarProtocolType.交通厅
                 };
                 base.reResult = RemotingClient.DownData_SetPosReport(CmdParam.ParamType.CarNum, base.sCarNum, "", CmdParam.CommMode.未知方式, posReport);
                 if (base.reResult.ResultCode == 0L)
                 {
                     foreach (string str2 in base.sCarId.Split(new char[] { ',' }))
                     {
                         if (MainForm.htBatchName == null)
                         {
                             MainForm.htBatchName = new Hashtable();
                         }
                         if (!MainForm.htBatchName.ContainsKey(str2))
                         {
                             MainForm.htBatchName.Add(str2, null);
                         }
                     }
                 }
             }
             else if (base.OrderCode == CmdParam.OrderCode.取消定时抓拍图像监控)
             {
                 string sCarSimNum = base.sCarSimNum;
                 if (base.sCarSimNum.IndexOf(',') > 0)
                 {
                     sCarSimNum = sCarSimNum.Replace(",", "','");
                 }
                 sCarSimNum = "'" + sCarSimNum + "'";
                 string sql = "delete from GpsCarPicParam where SimNum in (" + sCarSimNum + ")";
                 base.reResult = RemotingClient.ExecNoQuery(sql);
                 string sOrderResult = "成功";
                 if (base.reResult.ResultCode != 0L)
                 {
                     sOrderResult = "失败";
                 }
                 string dBCurrentDateTime = RemotingClient.GetDBCurrentDateTime();
                 if (string.IsNullOrEmpty(dBCurrentDateTime))
                 {
                     dBCurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                 }
                 string sOrderId = "0";
                 string sOrderType = "发送";
                 string sOrderName = base.OrderCode.ToString();
                 string sMsg = "";
                 MainForm.myLogForms.myNewLog.AddUserMessageToNewLog(dBCurrentDateTime, base.sCarNum, sOrderId, sOrderType, sOrderName, sOrderResult, sMsg);
             }
             else
             {
                 base.reResult = RemotingClient.DownData_SimpleCmd(base.ParamType, base.sValue, base.sPw, this.m_CommondMode, this.m_SimpleCmd);
             }
         }
         else
         {
             string[] strArray = base.sCarNum.Split(new char[] { ',' });
             if (strArray.Length > int.Parse(Variable.sImportCarMax))
             {
                 MessageBox.Show(string.Format("监控车辆车辆不能超过{0}辆", Variable.sImportCarMax));
             }
             foreach (string str in strArray)
             {
                 if (MainForm.myCarList.setCarChecked(str, true) != 0)
                 {
                     MessageBox.Show("更新重点监控参数失败");
                     return;
                 }
             }
             int num2 = RemotingClient.Car_UpdateImportWatch(base.sCarSimNum, 1);
             base.reResult = new Response();
             if (num2 < 0)
             {
                 MessageBox.Show("更新重点监控参数失败");
             }
             base.reResult.ResultCode = 0L;
         }
     }
     if ((base.reResult != null) && (base.reResult.ResultCode != 0L))
     {
         MessageBox.Show(base.reResult.ErrorMsg);
     }
     else
     {
         base.DialogResult = DialogResult.OK;
     }
 }
Esempio n. 5
0
 public Response DownData_SetPosReport(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, PosReport posReport)
 {
     try
     {
         return this.myDownData.icar_SetPosReport(ParamType, CarValues, CarPw, CommMode, posReport);
     }
     catch (Exception exception)
     {
         this.m_LogHelper.WriteError(new ErrorMsg("RemotingServer", "DownData_SetPosReport", exception.ToString()));
         return new Response();
     }
 }
Esempio n. 6
0
 private void RealTimePlaceQuery()
 {
     string selectedCarNum = myCarList.SelectedCarNum;
     PosReport posReport = new PosReport
     {
         OrderCode = CmdParam.OrderCode.位置查询,
         CompressionUpTime = 0,
         isCompressed = CmdParam.IsCompressed.单次传送,
         ReportType = CmdParam.ReportType.定次汇报,
         ReportTiming = 1,
         LowReportCycle = 60,
         ReportWhenStop = CmdParam.ReportWhenStop.汇报,
         IsAutoCalArc = 0,
         protocolType = CarProtocolType.交通厅
     };
     Response response = RemotingClient.DownData_SetPosReport(CmdParam.ParamType.CarNum, selectedCarNum, "", CmdParam.CommMode.未知方式, posReport);
     if (response.ResultCode != 0L)
     {
         MessageBox.Show(response.ErrorMsg);
     }
     else
     {
         RemotingClient.Car_SaveFormCmdParam(response.OrderIDParam, "实时位置查询", "");
     }
 }