Exemple #1
0
        public override string Parse()
        {
            string str  = string.Empty;
            string str2 = NumHelper.GetStringFromBase16ASCII(base.MessageAlarmText.Substring(0));

            return(str + "自定义信息:" + str2);
        }
Exemple #2
0
        public void GetEletroryRecordReportData(DataRow dataRow_0)
        {
            int    length = NumHelper.Convert16To10(this.protocolDrData_0.ContextData.Substring(0, 8)) * 2;
            string str    = NumHelper.GetStringFromBase16ASCII(this.protocolDrData_0.ContextData.Substring(8, length));

            dataRow_0["OrderName"] = "电子运单上报信息应答";
            dataRow_0["Describe"]  = "电子运单内容:" + str;
        }
Exemple #3
0
        public void GetDriverInfomationUpData(DataRow dataRow_0)
        {
            string str2 = NumHelper.Convert16To10ToString(this.protocolDrData_0.ContextData.Substring(2, 6));
            string str3 = NumHelper.GetStringFromBase16ASCII(this.protocolDrData_0.ContextData.Substring(8, 0x24)).Replace("\0", "");

            dataRow_0["OrderName"] = "驾驶员身份数据应答";
            dataRow_0["Describe"]  = "驾驶员编号:" + str2 + ",机动车驾驶证号:" + str3;
        }
Exemple #4
0
        public void GetRemotingParameterAboutVINUpData(DataRow dataRow_0)
        {
            string str  = NumHelper.GetStringFromBase16ASCII(this.protocolDrData_0.ContextData.Substring(2, 0x22)).Replace("\0", "");
            string str2 = NumHelper.GetStringFromBase16ASCII(this.protocolDrData_0.ContextData.Substring(0x24, 0x18)).Replace("\0", "");
            string str3 = NumHelper.GetStringFromBase16ASCII(this.protocolDrData_0.ContextData.Substring(60)).Replace("\0", "");

            dataRow_0["OrderName"] = "采集车辆VIN号车牌号码车牌分类应答";
            dataRow_0["Describe"]  = "VIN号码:" + str + ",车牌号码:" + str2 + ",车牌分类:" + str3;
        }
Exemple #5
0
        public void GetDownPlatRequestUpData(DataRow dataRow_0)
        {
            string str  = NumHelper.Convert16To10ToString(this.protocolDrData_0.ContextData.Substring(0, 2));
            string str2 = NumHelper.GetStringFromBase16ASCII(this.protocolDrData_0.ContextData.Substring(2, 0x18)).Replace("\0", "");
            string str3 = NumHelper.Convert16To10ToString(this.protocolDrData_0.ContextData.Substring(0x1a, 8));
            string s    = NumHelper.Convert16To10ToString(this.protocolDrData_0.ContextData.Substring(0x22, 8));
            string str5 = NumHelper.GetStringFromBase16ASCII(this.protocolDrData_0.ContextData.Substring(0x2a, int.Parse(s) * 2)).Replace("\0", "");

            dataRow_0["OrderName"]   = "下发平台间报文请求";
            dataRow_0["CarNum"]      = "";
            dataRow_0["msgType"]     = "4911";
            dataRow_0["Describe"]    = "消息ID:" + str3 + ",消息内容:" + str5.Replace(",", ",") + ",查岗对象类型:" + str + ",查岗对象的ID:" + str2;
            dataRow_0["OrderType"]   = "接收";
            dataRow_0["OBJECT_TYPE"] = str;
            dataRow_0["OBJECT_ID"]   = str2;
        }
Exemple #6
0
        private static string GetContextDesc(int int_0, string string_0)
        {
            string gpsOff = string.Empty;
            int    num    = int_0;

            switch (num)
            {
            case 1:
            case 2:
            case 3:
            case 5:
            case 6:
            case 7:
            case 0x35:
                return(NumHelper.GetStringFromBase16ASCII(string_0));

            case 4:
                return(NumHelper.ConvertToInt(string_0).ToString());

            case 8:
            case 9:
                return(string_0);

            case 10:
            case 11:
                return(GetIpAndPort(string_0));

            case 12:
            case 13:
            case 14:
                return(NumHelper.GetStringFromBase16ASCII(FilterZeroData(string_0)));

            case 50:
                return(string_0);

            case 0x33:
                return(GetSpeedType(string_0));

            case 0x34:
                return(GetSpeedType(string_0) + "k/m");
            }
            if (num == 240)
            {
                gpsOff = GetGpsOff(string_0);
            }
            return(gpsOff);
        }
Exemple #7
0
        public string GetAlarmDirectionMessage()
        {
            if (string.IsNullOrEmpty(this.SourceData))
            {
                return(string.Empty);
            }
            string str = string.Empty;

            str = "报警督办ID:" + NumHelper.Convert16To10(this.SourceData.Substring(0x16, 8)) + ",";
            int num = Convert.ToInt16(this.SourceData.Substring(0, 2));

            str = str + "报警信息来源:" + this.method_1(num) + ",";
            int num2 = NumHelper.Convert16To10(this.SourceData.Substring(2, 4));

            str = ((str + "报警类型:" + this.method_2(num2) + ",") + "报警时间:" + NumHelper.ConvertStringToDatetime(this.SourceData.Substring(6, 0x10)) + ",") + "报警截止时间:" + NumHelper.ConvertStringToDatetime(this.SourceData.Substring(30, 0x10)) + ",";
            int num3 = Convert.ToInt16(this.SourceData.Substring(0x2e, 2));

            return((((str + "督办级别:" + this.method_0(num3) + ",") + "督办人:" + NumHelper.GetStringFromBase16ASCII(this.SourceData.Substring(0x30, 0x20)).Replace("\0", "") + ",") + "督办联系电话:" + NumHelper.GetStringFromBase16ASCII(this.SourceData.Substring(80, 40)).Replace("\0", "") + ",") + "督办人联系电子邮件:" + NumHelper.GetStringFromBase16ASCII(this.SourceData.Substring(120)).Replace("\0", "") + ",");
        }
Exemple #8
0
        public void GetCar2DayOverSpeedUpData(DataRow dataRow_0)
        {
            dataRow_0["OrderName"] = "查询2个日历天内超时驾驶情况应答";
            string str  = this.protocolDrData_0.ContextData.Substring(2);
            string str2 = "";

            while (str.Length > 0)
            {
                DataRow row         = dataRow_0;
                string  str3        = NumHelper.GetStringFromBase16ASCII(str.Substring(0, 0x24));
                string  bCDDataTime = NumHelper.GetBCDDataTime(str.Substring(0x24, 10));
                string  str5        = NumHelper.GetBCDDataTime(str.Substring(0x2e, 10));
                string  str6        = str2;
                str2 = str6 + "驾驶证号:" + str3.Replace("\0", "") + ", 开始时间:" + bCDDataTime + " 结束时间:" + str5 + ";";
                object obj2 = row["Describe"];
                (row = dataRow_0)["Describe"] = string.Concat(new object[] { obj2, "驾驶证号:", str3.Replace("\0", ""), ", 开始时间:", bCDDataTime, " 结束时间:", str5, ";" });
                str = str.Substring(0x38);
            }
            dataRow_0["Describe"] = str2;
        }
Exemple #9
0
 public void GetTransportDataUpData(DataRow dataRow_0)
 {
     dataRow_0["OrderName"] = "终端数据透传";
     dataRow_0["Describe"]  = "透传消息类型:" + this.protocolDrData_0.ContextData.Substring(0, 2) + ",透传数据:" + NumHelper.GetStringFromBase16ASCII(this.protocolDrData_0.ContextData.Substring(2));
 }
Exemple #10
0
        /// <summary>
        /// 平台查岗请求处理
        /// </summary>
        /// <param name="dr"></param>
        public void GetPlatRequestUpData(DataRow dr)
        {
            //对应存储过程WebGpsClient_GetOutEquipmentData返回列propertyData除掉前4个字符,定义见Protocol.ProtocolDrData
            string contextData = this.protocolDrData_0.ContextData;
            //查岗对象类型 OBJECT_TYPE, 重庆运管定义1为自动查岗,2为手动查岗
            string sObjectType = NumHelper.Convert16To10ToString(contextData.Substring(0, 2));
            //重庆运管要求:
            //OBJECT_TYPE 为1 时OBJECT_ID 为查岗对象ID, 值为5000000+ 平台接入码( 行政区划码+ 平台唯一编码)
            //当OBJECT_TYPE 为2,OBJECT_ID 为业户经营许可证号;
            //当OBJECT_TYPE为3 时,OBJECT_ID值为5000000+平台接入码(行政区划码+平台唯一编码),例如50000008960
            string sObjectId = NumHelper.GetStringFromBase16ASCII(contextData.Substring(2, 24)).Replace("\0", "");
            //信息ID
            string sIndex = NumHelper.Convert16To10ToString(contextData.Substring(26, 8));
            //内容长度
            string sLen = NumHelper.Convert16To10ToString(contextData.Substring(34, 8));
            //取得内容
            string sContant           = NumHelper.GetStringFromBase16ASCII(contextData.Substring(42, int.Parse(sLen) * 2)).Replace("\0", "");
            string userIdByRegionCode = string.Empty;
            string workIdByUserId     = string.Empty;

            if (sObjectType.Equals("1"))
            {
                if (!string.IsNullOrEmpty(sContant) && (sContant.IndexOf("请回复当前全部在线业户") != -1))
                {
                    workIdByUserId = "-1";
                    string str10 = this.method_3(sObjectType, sObjectId, sIndex, "当前在线业户列表:=" + AskConfigerParameter.GetAutoRelyInfoString());
                    try
                    {
                        AskConfigerParameter.InsertCommandParameterToDB("8613489997299", 999, 16900, str10);
                        //修改如果自动查岗,则不发送消息到客户端 huzh 2014.1.22
                        workIdByUserId = "-2";
                        dr["WrkId"]    = workIdByUserId;
                        return;
                        //修改如果为重庆运管自动查岗则不需要发送到客户端,by huzh 2014.1.8
                        //goto Label_0147;
                    }
                    catch (Exception exception)
                    {
                        throw new Exception("自动回答发生错误:" + exception.Message + exception.StackTrace);
                    }
                }
                userIdByRegionCode = AskConfigerParameter.GetUserIdByRegionCode(sObjectId);
            }
            else if (sObjectType.Equals("2"))
            {
                if (!string.IsNullOrEmpty(sContant) && (sContant.IndexOf("OBJECT_ID:=") != -1))
                {
                    //重庆运管要求,由于营运证长度最长为15位,因此INFO_CONTENT内容格式改为:
                    //OBJECT_ID:=500101000001-3;手工查岗问题及答案:=问题|1,答案1;2,答案2;3,答案3;4,答案4
                    //因此替换查岗对象
                    string[] array = sContant.Split(new char[] { ';' });
                    sObjectId = array[0].Substring(array[0].IndexOf('=') + 1);
                }
                userIdByRegionCode = AskConfigerParameter.GetUserIdByYYZCarId(sObjectId);
            }
            else if (sObjectType.Equals("3"))
            {
                workIdByUserId = "0";
            }
            //Label_0147:
            if (string.IsNullOrEmpty(workIdByUserId) && !string.IsNullOrEmpty(userIdByRegionCode))
            {
                workIdByUserId = AskConfigerParameter.GetWorkIdByUserId(userIdByRegionCode);
            }
            if (string.IsNullOrEmpty(workIdByUserId))
            {
                workIdByUserId = "-1";
            }
            dr["WrkId"]     = workIdByUserId;
            dr["msgType"]   = "4353";
            dr["CarNum"]    = "";
            dr["OrderName"] = "平台查岗请求";
            dr["Describe"]  = "消息ID:" + sIndex + ",消息内容:" + sContant.Replace(",", ",") + ",查岗对象类型:" + sObjectType + ",查岗对象的ID:" + sObjectId;
            dr["OrderType"] = "接收";
            LogMsg msg = new LogMsg("JTBDataParse", "GetPlatRequestUpData", dr["Describe"].ToString() + " workIdByUserId: " + workIdByUserId + " userIdByRegionCode: " + userIdByRegionCode);

            new LogHelper().WriteLog(msg);
        }
Exemple #11
0
        public void GetCarDriverData(DataRow dataRow_0)
        {
            string contextData = this.protocolDrData_0.ContextData;

            try
            {
                int num = NumHelper.ConvertToInt(contextData.Substring(0, 2));
                if ((num != 1) && (num != 2))
                {
                    throw new Exception();
                }
                string   str2   = (num == 1) ? "插卡" : "拔卡";
                DateTime time   = DateTime.Parse(NumHelper.GetBCDDataTime(contextData.Substring(2, 12)));
                int      num2   = 0;
                string   str3   = "";
                int      length = 0;
                string   str4   = "";
                string   str5   = "";
                int      num4   = 0;
                string   str6   = "";
                DateTime time2  = Convert.ToDateTime("1970-01-01");
                string   format = "";
                if (num == 1)
                {
                    num2 = NumHelper.ConvertToInt(contextData.Substring(14, 2));
                    if ((num2 > 3) || (num2 < 0))
                    {
                        throw new Exception();
                    }
                    switch (num2)
                    {
                    case 0:
                        str3 = "IC卡读卡成功";
                        break;

                    case 1:
                        str3 = "读卡失败,原因为卡片密钥认证未通过";
                        break;

                    case 2:
                        str3 = "读卡失败,原因为卡片已被锁定";
                        break;

                    case 3:
                        str3 = "读卡失败,原因为卡内信息为空";
                        break;
                    }
                    if (num2 == 0)
                    {
                        length = NumHelper.ConvertToInt(contextData.Substring(0x10, 2)) * 2;
                        str4   = NumHelper.GetStringFromBase16ASCII(contextData.Substring(0x12, length));
                        str5   = NumHelper.GetStringFromBase16ASCII(contextData.Substring(0x12 + length, 40));
                        num4   = NumHelper.Convert16To10(contextData.Substring(0x3a + length, 2)) * 2;
                        str6   = NumHelper.GetStringFromBase16ASCII(contextData.Substring(60 + length, num4));
                        time2  = DateTime.Parse(NumHelper.GetBCDDate(contextData.Substring((60 + length) + num4, 8)));
                        format = "驾驶员姓名:{0},状态:{6},时间:{5},IC卡读取结果:{1},从业资格证:{2},发证机构名称:{3},证件有效期:{4}";
                        format = string.Format(format, new object[] { str4, str3, str5, str6, time2.ToString("yyyy-MM-dd"), time, str2 });
                    }
                    else
                    {
                        format = "驾驶员姓名:{0},状态:{3},时间:{2},IC卡读取结果:{1}";
                        format = string.Format(format, new object[] { str4, str3, time, str2 });
                    }
                    format = format.Replace("\0", "");
                }
                else
                {
                    format = "状态:{0},时间:{1}";
                    format = string.Format(format, str2, time);
                }
                dataRow_0["OrderName"] = "驾驶员身份信息应答";
                dataRow_0["Describe"]  = format;
                int    num5 = (dataRow_0["CarId"] == DBNull.Value) ? 0 : int.Parse(dataRow_0["CarId"].ToString());
                int    num6 = UpdataInsertDBInfor.UpdateDriverInfor(num5, num, time, num2, str4.Replace("\0", ""), str5.Replace("\0", ""), str6, time2);
                string str8 = "";
                if (num == 1)
                {
                    str8 = "驾驶员登陆成功";
                    if (num2 != 0)
                    {
                        str8 = "驾驶员登录失败," + str3;
                    }
                    else if (num6 == 0)
                    {
                        str8 = "驾驶员登录失败,原因为驾驶员身份信息无效";
                    }
                }
                else
                {
                    str8 = "驾驶员取卡成功";
                }
                IODeviceTextMsg msg = new IODeviceTextMsg {
                    InfoID  = 1,
                    Message = str8,
                    SimNum  = dataRow_0["SimNum"].ToString()
                };
                this.IODeviceAttachInfo.Add(msg);
            }
            catch (Exception)
            {
                int    startIndex = 0;
                int    num8       = NumHelper.Convert16To10(contextData.Substring(0, 2)) * 2;
                string str9       = NumHelper.GetStringFromBase16ASCII(contextData.Substring(2, num8));
                string str10      = NumHelper.GetStringFromBase16ASCII(contextData.Substring(2 + num8, 40));
                startIndex = (2 + num8) + 40;
                string str11 = NumHelper.GetStringFromBase16ASCII(contextData.Substring(startIndex, 80));
                startIndex += 80;
                int num9 = NumHelper.Convert16To10(contextData.Substring(startIndex, 2)) * 2;
                startIndex += 2;
                string str12 = NumHelper.GetStringFromBase16ASCII(contextData.Substring(startIndex, num9));
                string str13 = "驾驶员姓名:{0},驾驶员身份证编码:{1},从业资格证:{2},发证机构名称:{3}";
                str13 = string.Format(str13, new object[] { str9, str10, str11, str12 }).Replace("\0", "");
                dataRow_0["OrderName"] = "驾驶员身份信息应答";
                dataRow_0["Describe"]  = str13;
                int num10 = (dataRow_0["CarId"] == DBNull.Value) ? 0 : int.Parse(dataRow_0["CarId"].ToString());
                if (UpdataInsertDBInfor.UpdateDriverInfor(num10, str10.Replace("\0", ""), str11.Replace("\0", ""), str9.Replace("\0", ""), str12.Replace("\0", "")) == 0)
                {
                    IODeviceTextMsg msg3 = new IODeviceTextMsg {
                        InfoID  = 1,
                        Message = "驾驶员身份信息无效",
                        SimNum  = dataRow_0["SimNum"].ToString()
                    };
                    this.IODeviceAttachInfo.Add(msg3);
                }
            }
        }
Exemple #12
0
        public string GetPreAlarmMessage()
        {
            if (string.IsNullOrEmpty(this.SourceData))
            {
                return(string.Empty);
            }
            string str = string.Empty;
            int    num = Convert.ToInt16(this.SourceData.Substring(0, 2));

            str = "报警信息来源:" + this.method_1(num) + ",";
            int num2 = NumHelper.Convert16To10(this.SourceData.Substring(2, 4));

            return(((str + "报警类型:" + this.method_2(num2) + ",") + "报警时间:" + NumHelper.ConvertStringToDatetime(this.SourceData.Substring(6, 0x10)) + ",") + "警情信息:" + NumHelper.GetStringFromBase16ASCII(this.SourceData.Substring(30)).Replace("\0", "") + ",");
        }