Beispiel #1
0
        public bool Execute()
        {
            try
            {
                Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod();
                info.pi_bigtype      = "4";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                char[] ModelStateChar = DataJM.ModelState(_content[14].ToString());
                info.pi_param1      = ModelStateChar[0].ToString(); //模块状态
                info.pi_param2      = ModelStateChar[1].ToString(); //模块状态
                info.pi_param3      = DataJM.电池电压(_content, 15);    //电池电压。
                info.pi_version     = _content[18].ToString();
                info.pi_stationno   = StationId.ToString();
                info.pi_servicetime = PlatformTime;
                Other.ChuZuWu.Pro_IndateBase_Sec_Bll c = new Other.ChuZuWu.Pro_IndateBase_Sec_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
Beispiel #2
0
        public bool Execute()
        {
            try
            {
                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype      = "2";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_param1       = ConverUtil.ByteToStr_2(_content, 14); //三轴的模值之和
                info.pi_param2       = _content[16].ToString();              //震动时间
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;
                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
        public bool Execute()
        {
            try
            {
                DateTime time          = ConverUtil.Time(_content, 0);        //设备时间。
                string   DeviceTypeStr = ConverUtil.ByteToStr_2(_content, 7); //设备类型
                string   DeviceIdStr   = ConverUtil.ByteToStr_4(_content, 9); //设备Id

                byte     DeviceState    = _content[14];                       //设备状态
                string[] BitStr         = DataJM.GetBitStr(DeviceState);
                string   OpenCloseState = BitStr[0];
                string   HLW8012State   = BitStr[1];

                string PowerNumStr = _content[15].ToString();  //功率因素

                string timeStr = time.ToString("yyyy-M-d HH:mm:ss");
                QiYeFangHuDal.Insert_XinTiao(DeviceTypeStr, DeviceIdStr, PowerNumStr, "", timeStr, HLW8012State);
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "错误:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod();
                info.pi_bigtype      = "4";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_param1       = ConverUtil.ByteToStr_2(_content, 14); //功率过大阀值
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;
                Other.ChuZuWu.Pro_IndateBase_Sec_Bll c = new Other.ChuZuWu.Pro_IndateBase_Sec_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
        public bool Execute()
        {
            try
            {
                if (FileManagement.Commands.MenJin.Filter_Bll.IsRepeat(this.OriginalCode))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }



                DateTime DeviceTime   = ConverUtil.Time(_content, 0);        //设备时间。
                string   CardId       = ConverUtil.ByteToStr_4(_content, 6); //卡Id
                string   CardType     = _content[10].ToString();
                string   Identitycard = SFZUtil.ByteToStr(_content, 11);     //身份证号。

                MJInfo info = new MJInfo();
                info.Protocol     = "657";
                info.DeviceId     = StationId.ToString();
                info.DeviceTime   = DeviceTime;
                info.CardId       = CardId;
                info.CardType     = CardType;
                info.Identitycard = Identitycard;

                IMjDal.Handle(NAME, OriginalCode, info);
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "错误;" + ex.Message + " 原始代码:" + OriginalCode);
            }
            return(true);
        }
Beispiel #6
0
        public bool Execute()
        {
            try
            {
                if (_content.Length != 11)
                {
                    MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_UploadAlarm_Mod info = new Pro_UploadAlarm_Mod();
                info.pi_protocoltype = "532";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);        //设备时间
                info.pi_roomnum      = ConverUtil.ByteToStr_4(_content, 6); //房间Id
                info.pi_alarmtype    = _content[10].ToString();             //报警类型
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;

                Other.ChuZuWu.Pro_UploadAlarm_Bll c = new Other.ChuZuWu.Pro_UploadAlarm_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
        public static DJJ_2050_Mod GetMod(byte[] content)
        {
            DJJ_2050_Mod info = new DJJ_2050_Mod();

            info.源卡ID   = ConverUtil.ByteToStr_4(content, 0);
            info.姓名     = GetName(content.Skip(4).Take(32).ToArray());
            info.民族     = GetMinZu(content.Skip(36).Take(10).ToArray());
            info.身份信息类型 = content[46].ToString();
            info.号码长度   = content[47];

            info.证件号码 = GetIdCard(content.Skip(48).Take(info.号码长度).ToArray());


            //if (info.号码长度 == content.Length - 48)
            //{

            //}
            //else
            //{
            //    throw er;
            //}



            return(info);
        }
        public bool Execute()
        {
            try
            {
                if (_content.Length != 21)
                {
                    MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_IndateBase_DZMP_Mod info = new Pro_IndateBase_DZMP_Mod();
                info.pi_bigtype      = "2";
                info.pi_protocoltype = "531";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_cardtype     = _content[6].ToString();                                                                                  //卡类型
                info.pi_cardid       = info.pi_cardtype == "0" ? ConverUtil.ByteToStr_Q(_content, 7, 8) : ConverUtil.ByteToStr_4(_content, 11); //设备时间
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 15);                                                                    //设备类型
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 17);                                                                    //设备Id
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;
                Other.ChuZuWu.Pro_IndateBase_DZMP_Bll c = new Other.ChuZuWu.Pro_IndateBase_DZMP_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
        private Pro_IndateBase_MJNew_Mod GetInfo_New()
        {
            Pro_IndateBase_MJNew_Mod info = new Pro_IndateBase_MJNew_Mod();
            int    IsIdentitycard         = Convert.ToInt32(_content[22].ToString());//有无身份证(128:无身份证)
            string CardType = "";
            string ICCard   = "";
            string HouseNum = "";      //房东编号。

            if (IsIdentitycard >= 128)
            {
                CardType = _content[13].ToString();
                ICCard   = ConverUtil.ByteToStr_4(_content, 14); //IC卡。
                HouseNum = (IsIdentitycard - 128).ToString();
            }
            else
            {
                CardType = "0";
                ICCard   = ConverUtil.ByteToStr_Q(_content, 10, 8); //租客身份证。
                HouseNum = IsIdentitycard.ToString();
            }
            info.pi_bigtype      = "2";
            info.pi_devicetime   = ConverUtil.Time(_content, 0);
            info.pi_protocoltype = CmdId;
            info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 6); //门戒编号。
            info.pi_cardtype     = CardType;
            info.pi_cardid       = ICCard;
            info.pi_houseno      = HouseNum;
            info.pi_activecardid = ConverUtil.ByteToStr_4(_content, 18);  //有源卡。
            info.pi_stationno    = StationId.ToString();
            info.pi_servicetime  = PlatformTime;
            return(info);
        }
        public bool Execute()
        {
            try
            {
                string[] GetCardTypeAndHouseNo = DataJM.GetCardTypeAndHouseNo(_content[14].ToString());
                Pro_IndateBase_ZHMJ_Mod info   = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype      = "2";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_houseno      = GetCardTypeAndHouseNo[1]; //房东编号。
                info.pi_cardtype     = GetCardTypeAndHouseNo[0];
                info.pi_cardid       = info.pi_cardtype == "0" ? ConverUtil.ByteToStr_Q(_content, 15, 8) : ConverUtil.ByteToStr_4(_content, 19);;
                info.pi_policecard   = ConverUtil.ByteToStr_4(_content, 23); //警察卡
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;
                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
        public bool Execute()
        {
            try
            {
                if (_content.Length < 12)
                {
                    MyLibrary.Log.Debug(NAME + "数据长度无效:原始代码:" + OriginalCode);
                    return(true);
                }

                if (FileManagement.Commands.MenJin.Filter_Bll.IsRepeat(this.OriginalCode))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                DateTime time   = ConverUtil.Time(_content, 0);        //设备时间。
                string   CardId = ConverUtil.ByteToStr_4(_content, 6); //卡Id

                MJInfo info = new MJInfo();
                info.Protocol   = "2";
                info.DeviceId   = StationId.ToString();
                info.CardId     = CardId;
                info.DeviceTime = time;
                info.CardType   = _content[10].ToString();

                IMjDal.Handle(NAME, OriginalCode, info);
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "错误:" + ex.Message + " 原始代码:" + OriginalCode);
            }
            return(true);
        }
Beispiel #12
0
        public bool Execute()
        {
            try
            {
                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype      = "1";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_param1       = _content[14].ToString();                                            //门状态
                info.pi_param2       = _content[15].ToString();                                            //房间内人数
                info.pi_param3       = _content[16].ToString();                                            //每天开门次数
                info.pi_param4       = (Convert.ToInt32(_content[17].ToString()) * 0.02).ToString("0.00"); //电池电压。
                info.pi_param5       = ((_content[18] >> 7) & 01).ToString();                              //配置标志
                info.pi_version      = _content[26].ToString();
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;

                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
Beispiel #13
0
        public static DJJ_2049_Mod GetMod(byte[] content)
        {
            DJJ_2049_Mod info = new DJJ_2049_Mod();

            info.源卡ID = ConverUtil.ByteToStr_4(content, 0);

            return(info);
        }
        public bool Execute()
        {
            try
            {
                if (_content.Length != 50)
                {
                    MyLibrary.Log.Debug(NAME + "数据长度无效:原始代码:" + OriginalCode);
                    return(true);
                }

                if (FileManagement.Commands.MenJin.Filter_Bll.IsRepeat(this.OriginalCode))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                //    DateTime time = ConverUtil.Time(_content, 0); //设备时间。
                //  string CardId = ConverUtil.ByteToStr_4(_content,6);   //IC卡

                byte[] IdentytyCardNoByte = new byte[9];  //身份证
                Array.Copy(_content, 11, IdentytyCardNoByte, 0, 9);
                string IdCardReplace  = ConverUtil.ByteToStr_A(IdentytyCardNoByte).Replace('b', 'B').Replace('c', 'C').Replace('d', 'D').Replace('e', 'E').Replace('f', 'F');
                string IdentytyCardNo = IdCardReplace.Replace('A', 'X').TrimStart('0');

                byte[] phoneByte = new byte[6];  //电话
                Array.Copy(_content, 20, phoneByte, 0, 6);
                string Phone = ConverUtil.ByteToStr_A(phoneByte).Replace("F", "");

                byte[] addressByte = new byte[24];
                Array.Copy(_content, 26, addressByte, 0, 24);
                string UserRoom = BitConverter.ToString(addressByte).Replace("-", "");

                MJInfo info = new MJInfo();
                info.Protocol     = "1";
                info.DeviceTime   = ConverUtil.Time(_content, 0);        //设备时间。
                info.CardId       = ConverUtil.ByteToStr_4(_content, 6); //IC卡
                info.CardType     = _content[10].ToString();
                info.ChineseName  = "";
                info.Identitycard = IdentytyCardNo;
                info.DeviceId     = StationId.ToString();

                info.DataIntegrity = string.IsNullOrWhiteSpace(IdentytyCardNo) ? "0" : "1";
                info.UserPhoneNum  = Phone;
                info.UserRoom      = UserRoom;

                IMjDal.Handle(NAME, OriginalCode, info);
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "错误:" + ex.Message + " 原始代码:" + OriginalCode);
            }
            return(true);
        }
Beispiel #15
0
        private Pro_IndateBase_MJNew_Mod GetInfo_Old()
        {
            Pro_IndateBase_MJNew_Mod info = new Pro_IndateBase_MJNew_Mod();

            info.pi_bigtype      = "3";
            info.pi_protocoltype = CmdId;
            info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 0);  //门戒ID。
            info.pi_devicetime   = PlatformTime;
            info.pi_stationno    = StationId.ToString();
            info.pi_servicetime  = PlatformTime;
            return(info);
        }
Beispiel #16
0
        public bool Execute()
        {
            try
            {
                if (FileManagementDal.RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_IndataBase_ZNMP_Mod info = new Pro_IndataBase_ZNMP_Mod();
                info.Pi_StationNo    = StationId.ToString();
                info.Pi_ServiceTime  = PlatformTime;
                info.Pi_DeviceTime   = ConverUtil.Time(_content, 0);
                info.Pi_RelayNo      = _content[6].ToString();
                info.Pi_DeviceType   = ConverUtil.ByteToStr_2(_content, 7);
                info.Pi_DeviceCode   = ConverUtil.ByteToStr_4(_content, 9);
                info.Pi_ProtocolType = _content[13].ToString();

                info.Pi_Param1  = _content[14].ToString();              //进门人数
                info.Pi_Param2  = _content[15].ToString();              //第1级别进门累计
                info.Pi_Param3  = _content[16].ToString();              //第1级别出门累计
                info.Pi_Param4  = _content[17].ToString();              //第3级别进门累计
                info.Pi_Param5  = _content[18].ToString();              //第3级别出门累计
                info.Pi_Param6  = _content[19].ToString();              //第5级别进门累计
                info.Pi_Param7  = _content[20].ToString();              //第5级别出门累计
                info.Pi_Param8  = _content[21].ToString();              //驻停时平均身高
                info.Pi_Param9  = _content[22].ToString();              //门下数据波动性特征值1
                info.Pi_Param10 = _content[23].ToString();              //门下数据波形性特征值2
                info.Pi_Param11 = _content[24].ToString();              //本次进出门中最大身高(计算值)
                info.Pi_Param12 = _content[25].ToString();              //本次进出门中最大身高(计算值)
                info.Pi_Param13 = _content[26].ToString();              //对地校准值
                info.Pi_Param14 = _content[27].ToString();              //离开超声波侦测场时身高
                info.Pi_Param15 = ConverUtil.ByteToStr_2(_content, 28); //关联0x15协议的CRC值

                info.Pi_Rssi    = _content[33].ToString();              //RSSI值。
                info.Pi_Version = _content[34].ToString();              //版本号。

                Pro_IndataBase_ZNMP_Bll c = new Pro_IndataBase_ZNMP_Bll(info);
                string Result             = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
Beispiel #17
0
        public bool Execute()
        {
            try
            {
                if (FileManagementDal.RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_IndataBase_ZNMP_Mod info = new Pro_IndataBase_ZNMP_Mod();
                info.Pi_StationNo    = StationId.ToString();
                info.Pi_ServiceTime  = PlatformTime;
                info.Pi_DeviceTime   = ConverUtil.Time(_content, 0);
                info.Pi_RelayNo      = _content[6].ToString();
                info.Pi_DeviceType   = ConverUtil.ByteToStr_2(_content, 7);
                info.Pi_DeviceCode   = ConverUtil.ByteToStr_4(_content, 9);
                info.Pi_ProtocolType = _content[13].ToString();
                info.Pi_Param1       = _content[14].ToString();                          //进门人数
                info.Pi_Param2       = (Convert.ToDouble(_content[15]) / 10).ToString(); //进超声波时刻(热释电触发始)
                info.Pi_Param3       = (Convert.ToDouble(_content[16]) / 10).ToString(); //门下驻停时刻(热释电触发始)
                info.Pi_Param4       = (Convert.ToDouble(_content[17]) / 10).ToString(); //进门时刻(热释电触发始)
                info.Pi_Param5       = (Convert.ToDouble(_content[18]) / 10).ToString(); //最大身高发生时刻(热释电触发始)
                info.Pi_Param6       = (Convert.ToDouble(_content[19]) / 10).ToString(); //开门最初震动时刻(热释电触发始)
                info.Pi_Param7       = (Convert.ToDouble(_content[20]) / 10).ToString(); //开门最大震动时刻(热释电触发始)
                info.Pi_Param8       = (Convert.ToDouble(_content[21]) / 10).ToString(); //开门最后震动时刻(热释电触发始)
                info.Pi_Param9       = (Convert.ToDouble(_content[22]) / 10).ToString(); //关门最初震动时刻(人员进门始)
                info.Pi_Param10      = (Convert.ToDouble(_content[23]) / 10).ToString(); //关门最大震动时刻(人员进门始)
                info.Pi_Param11      = (Convert.ToDouble(_content[24]) / 10).ToString(); //关门最后震动时刻(人员进门始)
                info.Pi_Param12      = ConverUtil.ByteToStr_2(_content, 25);             //开门震动值
                info.Pi_Param13      = ConverUtil.ByteToStr_2(_content, 27);             //关门震动值
                info.Pi_Param14      = _content[29].ToString();                          //进出门校准最大身高
                info.Pi_Param15      = _content[30].ToString();                          //进出门实测最大身高
                info.Pi_Param16      = _content[31].ToString();                          //对地校准值,近似门框高度。
                info.Pi_Rssi         = _content[33].ToString();                          //RSSI值。
                info.Pi_Version      = _content[34].ToString();                          //版本号。

                Pro_IndataBase_ZNMP_Bll c = new Pro_IndataBase_ZNMP_Bll(info);
                string Result             = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
        public bool Execute()
        {

            try
            {

                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return true;
                }


                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype = "2";
                info.pi_devicetime = ConverUtil.Time(_content, 0);
                info.pi_devicetype = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_stationno = StationId.ToString();
                info.pi_servicetime = PlatformTime;
                info.pi_param1 = _content[14].ToString();       //每天开门次数
                string[] DataArray = DoorInfo(_content[15]);   //门状态及数据标志
                info.pi_param2 = DataArray[0];                 //门状态
                info.pi_param3 = DataArray[1];                //数据标志
                info.pi_param4 = _content[16].ToString();     //开门动作时间
                info.pi_param5 = _content[17].ToString();     //开门最大角度

                byte[] Data = new byte[6];
                Array.Copy(_content, 18, Data, 0, 6);
     
                info.pi_param6 = stttt(Data);                //三个加速度。
                info.pi_param7 = _content[24].ToString();    //开盖报警等
                info.pi_version = _content[26].ToString();  //版本号

                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }

            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return true;
        }
        public bool Execute()
        {
            try
            {
                if (FileManagementDal.RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_IndataBase_ZNMP_Mod info = new Pro_IndataBase_ZNMP_Mod();
                info.Pi_StationNo    = StationId.ToString();
                info.Pi_ServiceTime  = PlatformTime;
                info.Pi_DeviceTime   = ConverUtil.Time(_content, 0);
                info.Pi_RelayNo      = _content[6].ToString();
                info.Pi_DeviceType   = ConverUtil.ByteToStr_2(_content, 7);
                info.Pi_DeviceCode   = ConverUtil.ByteToStr_4(_content, 9);
                info.Pi_ProtocolType = _content[13].ToString();
                info.Pi_Param1       = _content[14].ToString();                                                  //环境状态
                info.Pi_Param2       = _content[15].ToString();                                                  //对人校准身高
                info.Pi_Param3       = _content[16].ToString();                                                  //对地校准值
                info.Pi_Param4       = _content[17].ToString();                                                  //工作状态
                info.Pi_Param5       = ConverUtil.ZF_Value(_content[18]);                                        //当前环境温度
                info.Pi_Param6       = _content[19].ToString();                                                  //防拆
                info.Pi_Param7       = Battery(_content[20]);                                                    //电池电压
                info.Pi_Param8       = (Convert.ToUInt16(_content[21]) * 3).ToString();                          //热视电触发次数(从上次心跳到这次心跳之间)
                info.Pi_Param9       = ConverUtil.ByteToStr_2(_content, 22);;                                    //超声波总工作时间
                info.Pi_Param10      = (Convert.ToUInt16(ConverUtil.ByteToStr_2(_content, 24)) * 10).ToString(); //热释电总触发次数
                info.Pi_Param11      = (Convert.ToUInt16(ConverUtil.ByteToStr_2(_content, 26)) * 10).ToString(); //总震动次数
                info.Pi_Param12      = _content[28].ToString();                                                  //每月按键触发次数
                char[] array = DevState(_content[29]);
                info.Pi_Param13 = array[0].ToString();                                                           //超声波故障
                info.Pi_Param14 = array[1].ToString();                                                           //热释电故障
                info.Pi_Rssi    = _content[33].ToString();                                                       //RSSI值
                info.Pi_Version = _content[34].ToString();                                                       //版本号

                Pro_IndataBase_ZNMP_Bll c = new Pro_IndataBase_ZNMP_Bll(info);
                string Result             = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
        public bool Execute()
        {
            try
            {
                if (_content.Length < 28)
                {
                    MyLibrary.Log.Debug(NAME + "数据长度无效:原始代码:" + OriginalCode);
                    return(true);
                }


                if (FileManagement.Commands.MenJin.Filter_Bll.IsRepeat(this.OriginalCode))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                DateTime time   = ConverUtil.Time(_content, 0);        //设备时间。
                string   CardId = ConverUtil.ByteToStr_4(_content, 6); //卡Id

                byte[] IdentytyCardNoByte = new byte[9];               //身份证
                Array.Copy(_content, 11, IdentytyCardNoByte, 0, 9);
                string IdCardReplace  = ConverUtil.ByteToStr_A(IdentytyCardNoByte).Replace('b', 'B').Replace('c', 'C').Replace('d', 'D').Replace('e', 'E').Replace('f', 'F');
                string IdentytyCardNo = IdCardReplace.Replace('A', 'X').TrimStart('0');

                //byte[] phoneByte = new byte[6];  //电话
                //Array.Copy(_content, 20, phoneByte, 0, 6);
                //string phone = ConverUtil.ByteToStr_A(phoneByte).Replace("F", "");

                //byte[] roomIdByte = new byte[2];  //房间Id
                //Array.Copy(_content, 26, roomIdByte, 0, 2);
                MJInfo info = new MJInfo();
                info.Protocol      = "18";
                info.DeviceId      = StationId.ToString();
                info.CardId        = CardId;
                info.CardType      = _content[10].ToString();
                info.Identitycard  = IdentytyCardNo;
                info.IsOpenDoor    = "0";
                info.IsOpenByCard  = "1";
                info.DataIntegrity = "0";
                info.DeviceTime    = time;

                IMjDal.Handle(NAME, OriginalCode, info);
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "错误:" + ex.Message + " 原始代码:" + OriginalCode);
            }
            return(true);
        }
        public bool Execute()
        {
            try
            {
                if (FileManagementDal.RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                Pro_IndataBase_ZNMP_Mod info = new Pro_IndataBase_ZNMP_Mod();
                info.PI_DEVICETIME   = ConverUtil.Time(_content, 0);
                info.PI_RELAYNO      = _content[6].ToString();
                info.PI_DEVICETYPE   = ConverUtil.ByteToStr_2(_content, 7);
                info.PI_DEVID        = ConverUtil.ByteToStr_4(_content, 9);
                info.PI_PROTOCOLTYPE = _content[13].ToString();
                info.PI_STATIONNO    = StationId.ToString();
                info.PI_SERVICETIME  = PlatformTime;
                info.PI_PARAM1       = _content[14].ToString();                          //进门人数
                info.PI_PARAM2       = (Convert.ToDouble(_content[15]) / 10).ToString(); //进超声波时刻(热释电触发始)
                info.PI_PARAM3       = (Convert.ToDouble(_content[16]) / 10).ToString(); //门下驻停时刻(热释电触发始)
                info.PI_PARAM4       = (Convert.ToDouble(_content[17]) / 10).ToString(); //进门时刻(热释电触发始)
                info.PI_PARAM5       = (Convert.ToDouble(_content[18]) / 10).ToString(); //最大身高发生时刻(热释电触发始)
                info.PI_PARAM6       = (Convert.ToDouble(_content[19]) / 10).ToString(); //开门最初震动时刻(热释电触发始)
                info.PI_PARAM7       = (Convert.ToDouble(_content[20]) / 10).ToString(); //开门最大震动时刻(热释电触发始)
                info.PI_PARAM8       = (Convert.ToDouble(_content[21]) / 10).ToString(); //开门最后震动时刻(热释电触发始)
                info.PI_PARAM9       = (Convert.ToDouble(_content[22]) / 10).ToString(); //关门最初震动时刻(人员进门始)
                info.PI_PARAM10      = (Convert.ToDouble(_content[23]) / 10).ToString(); //关门最大震动时刻(人员进门始)
                info.PI_PARAM11      = (Convert.ToDouble(_content[24]) / 10).ToString(); //关门最后震动时刻(人员进门始)
                info.PI_PARAM12      = ConverUtil.ByteToStr_2(_content, 25);;            //开门震动值
                info.PI_PARAM13      = ConverUtil.ByteToStr_2(_content, 27);             //关门震动值
                info.PI_PARAM14      = _content[29].ToString();                          //进出门校准最大身高
                info.PI_PARAM15      = _content[30].ToString();                          //进出门实测最大身高
                info.PI_PARAM16      = _content[31].ToString();                          //对地校准值
                info.PI_VERSION      = _content[34].ToString();                          //版本号
                Other.LvYe.Pro_IndataBase_ZNMP_Bll c = new Other.LvYe.Pro_IndataBase_ZNMP_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "错误:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
Beispiel #22
0
        public bool Execute()
        {
            try
            {
                if (FileManagementDal.RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype      = "2";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);           //设备时间。
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);    //设备类型。
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);    //设备编号。
                info.pi_protocoltype = _content[13].ToString();                //命令字。
                info.pi_stationno    = StationId.ToString();                   //基站编号。
                info.pi_servicetime  = PlatformTime;                           //基站时间。

                info.pi_param1         = _content[14].ToString();              //身高。
                info.pi_param2         = Value_Num_1(_content[15]);            //进出门时间。
                info.pi_param3         = ConverUtil.ZF_Value(_content[16]);    //单次进出人数.
                info.pi_param4         = ConverUtil.ByteToStr_2(_content, 17); //开门震动值。
                info.pi_param5         = ConverUtil.ByteToStr_2(_content, 19); //关门震动值。
                info.pi_param6         = _content[21].ToString();              //房间内人数。
                info.pi_param7         = ConverUtil.ZF_Value(_content[22]);    //温度。
                info.pi_param8         = ConverUtil.ByteToStr_2(_content, 23); //红外触发总次数。
                info.pi_param9         = _content[25].ToString();              //一天红外触发次数。
                info.pi_param10        = ConverUtil.ByteToStr_2(_content, 26); //总震动次数。
                info.pi_houseno        = ConverUtil.ByteToStr_2(_content, 28); //超声波工作时间。
                info.pi_identitycardid = _content[30].ToString();              //空旷距离
                info.pi_policecard     = Battery(_content[31]);                //剩余电量。
                info.pi_version        = _content[32].ToString();              //版本号。

                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
Beispiel #23
0
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_IndataBase_ZNMP_Mod info = new Pro_IndataBase_ZNMP_Mod();
                info.PI_DEVICETIME   = ConverUtil.Time(_content, 0);
                info.PI_RELAYNO      = _content[6].ToString();
                info.PI_DEVICETYPE   = ConverUtil.ByteToStr_2(_content, 7);
                info.PI_DEVID        = ConverUtil.ByteToStr_4(_content, 9);
                info.PI_PROTOCOLTYPE = _content[13].ToString();
                info.PI_STATIONNO    = StationId.ToString();
                info.PI_SERVICETIME  = PlatformTime;
                info.PI_PARAM1       = _content[14].ToString();                         //环境状态
                info.PI_PARAM2       = _content[15].ToString();                         //对人校准身高
                info.PI_PARAM3       = _content[16].ToString();                         //对地校准值
                info.PI_PARAM4       = _content[17].ToString();                         //工作状态
                info.PI_PARAM5       = ConverUtil.ZF_Value(_content[18]);               //当前环境温度
                info.PI_PARAM6       = ConverUtil.GetBin(_content[19], 1);              //防拆
                info.PI_PARAM7       = (Convert.ToInt32(_content[20]) * 20).ToString(); //电池电压
                info.PI_PARAM8       = _content[21].ToString();                         //热视电触发次数(从上次心跳到这次心跳之间)
                info.PI_PARAM9       = ConverUtil.ByteToStr_2(_content, 22);            //超声波总工作时间
                info.PI_PARAM10      = ConverUtil.ByteToStr_2(_content, 24);            //热释电总触发次数
                info.PI_PARAM11      = ConverUtil.ByteToStr_2(_content, 26);            //总震动次数
                info.PI_PARAM12      = _content[28].ToString();                         //每月按键触发次数
                info.PI_PARAM13      = ConverUtil.GetBin(_content[29], 1);              //设备状态_超声波故障
                info.PI_PARAM14      = ConverUtil.GetBin(_content[29], 2);              //设备状态_热释电故障
                info.PI_VERSION      = _content[34].ToString();                         //版本号
                Other.LvYe.Pro_IndataBase_ZNMP_Bll c = new Other.LvYe.Pro_IndataBase_ZNMP_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "错误:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
Beispiel #24
0
        public bool Execute()
        {
            try
            {
                if (RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }


                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype      = "2";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;
                info.pi_param1       = _content[14].ToString();               //变化方向
                info.pi_param2       = _content[15].ToString();               //房间内人数
                info.pi_param3       = _content[16].ToString();               //每天开门次数
                info.pi_param4       = _content[17].ToString();               //门状态
                info.pi_param5       = _content[18].ToString();               //自动撤布防。
                info.pi_param6       = _content[19].ToString();               //布防报警。
                info.pi_param7       = ((_content[20] >> 7) & 01).ToString(); //开门超过十分钟。
                info.pi_param10      = ((_content[20] >> 6) & 01).ToString(); //表示开盖报警。
                info.pi_param9       = _content[21].ToString();               //打开门的角度
                info.pi_version      = _content[26].ToString();


                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
Beispiel #25
0
        public bool Execute()
        {
            try
            {
                if (FileManagementDal.RepeatData.IsRepeatData(_content))
                {
                    MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode);
                    return(true);
                }

                Pro_IndateBase_ZHMJ_Mod info = new Pro_IndateBase_ZHMJ_Mod();
                info.pi_bigtype      = "2";
                info.pi_devicetime   = ConverUtil.Time(_content, 0);
                info.pi_devicetype   = ConverUtil.ByteToStr_2(_content, 7);
                info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 9);
                info.pi_protocoltype = _content[13].ToString();
                info.pi_stationno    = StationId.ToString();
                info.pi_servicetime  = PlatformTime;
                info.pi_param1       = _content[14].ToString();              //门状态
                info.pi_param2       = _content[15].ToString();              //每天开门次数
                info.pi_param3       = ConverUtil.ZF_Value(_content[16]);    //房间内人数
                info.pi_param4       = _content[17].ToString();              //进出门时间
                info.pi_version      = _content[27].ToString();              //版本号。
                info.pi_param9       = ConverUtil.ZF_Value(_content[28]);    //当前温度。
                info.pi_param10      = ConverUtil.ByteToStr_2(_content, 29); //总红外触发次数
                info.pi_policecard   = _content[31].ToString();              //从上次心跳到现在的触发次数

                info.pi_param8 = _content[32].ToString();                    //空旷时距离。
                info.pi_param6 = _content[33].ToString();                    //超声波最大值。
                info.pi_param7 = _content[34].ToString();                    //进出门方向。
                Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll c = new Other.ChuZuWu.Pro_IndateBase_ZHMJ_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
        public bool Execute()
        {
            try
            {
                if (_content.Length != 22)
                {
                    MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode);
                    return(true);
                }

                string   ElectronicsDoorPlate   = ConverUtil.ByteToStr_4(_content, 0);    //电子门牌ID
                string   MasterIdentificationId = ConverUtil.ByteToStr_Q(_content, 4, 8); //房东身份证ID
                string   PoliceCard             = ConverUtil.ByteToStr_4(_content, 12);   // 警察卡ID
                DateTime time = ConverUtil.Time(_content, 16);                            //设备时间


                Pro_IndateBase_DZMP_Mod info = new Pro_IndateBase_DZMP_Mod();
                info.pi_bigtype        = "2";
                info.pi_devicetype     = "1029";
                info.pi_protocoltype   = "522";
                info.pi_devicetime     = time;
                info.pi_stationno      = StationId.ToString();
                info.pi_servicetime    = PlatformTime;
                info.pi_devicecode     = ElectronicsDoorPlate;
                info.pi_identitycardid = MasterIdentificationId;
                info.pi_cardid         = PoliceCard;

                Other.ChuZuWu.Pro_IndateBase_DZMP_Bll c = new Other.ChuZuWu.Pro_IndateBase_DZMP_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }



            return(true);
        }
        private Pro_IndateBase_MJNew_Mod GetInfo_New()
        {
            Pro_IndateBase_MJNew_Mod info = new Pro_IndateBase_MJNew_Mod();
            int Count = (_content.Length - 10) / 13;

            string[] CardTypeArray = new string[Count]; //卡类型数组。
            string[] CardIdArray   = new string[Count]; //是身份证或Ic卡数组。
            string[] HouseNumArray = new string[Count]; //房东号数组。
            string[] ActivecArray  = new string[Count]; //有源卡数组。
            byte[]   Data;
            int      IsIdentitycard;

            for (int i = 0; i < Count; i++)
            {
                Data = new byte[13];
                Array.Copy(_content, (i * 13) + 10, Data, 0, 13);
                IsIdentitycard = Convert.ToInt32(Data[0].ToString());
                if (IsIdentitycard >= 128)
                {
                    CardTypeArray[i] = Data[4].ToString();
                    CardIdArray[i]   = ConverUtil.ByteToStr_4(Data, 5);
                    HouseNumArray[i] = (IsIdentitycard - 128).ToString();
                }
                else
                {
                    CardTypeArray[i] = "0";
                    CardIdArray[i]   = ConverUtil.ByteToStr_Q(Data, 1, 8);
                    HouseNumArray[i] = IsIdentitycard.ToString();
                }
                ActivecArray[i] = ConverUtil.ByteToStr_4(Data, 9);
            }
            info.pi_bigtype      = "2";
            info.pi_protocoltype = CmdId;
            info.pi_devicetime   = ConverUtil.Time(_content, 0);
            info.pi_devicecode   = ConverUtil.ByteToStr_4(_content, 6); //门戒Id。
            info.pi_cardtype     = ConverUtil.GetArrayToStr(CardTypeArray);
            info.pi_cardid       = ConverUtil.GetArrayToStr(CardIdArray);
            info.pi_houseno      = ConverUtil.GetArrayToStr(HouseNumArray);
            info.pi_activecardid = ConverUtil.GetArrayToStr(ActivecArray);
            info.pi_stationno    = StationId.ToString();
            info.pi_servicetime  = PlatformTime;
            return(info);
        }
Beispiel #28
0
        public bool Execute()
        {
            try
            {
                if (_content.Length != 19)
                {
                    MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode);
                    return(true);
                }
                DateTime time       = ConverUtil.Time(_content, 0);        //设备时间。
                string   DeviceType = ConverUtil.ByteToStr_2(_content, 7); //设备类型。
                string   DeviceCode = ConverUtil.ByteToStr_4(_content, 9); //设备编码。
                string   cmdid      = _content[13].ToString();             //命令字。
                string   Sheng      = _content[14].ToString();             //省。
                string   Shi        = _content[15].ToString();             //市。


                // GetStationInfo(StationId.ToString());

                Pro_QiangZhiGuanKong_Mod info = new Pro_QiangZhiGuanKong_Mod();
                info.pi_CmdType     = "2";
                info.pi_ListId      = Guid.NewGuid().ToString("N");
                info.pi_DeviceCode  = DeviceCode;
                info.pi_StationNo   = StationId.ToString();
                info.pi_DeviceTime  = time;
                info.pi_ServiceTime = PlatformTime;
                info.pi_InTime      = DateTime.Now;

                string Result = QiangZhiGuanKongDal.Handle(info);
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }
Beispiel #29
0
        public bool Execute()
        {
            try
            {
                DateTime time                 = ConverUtil.Time(_content, 0);         //设备时间。
                string   DeviceTypeStr        = ConverUtil.ByteToStr_2(_content, 7);  //设备类型
                string   DeviceIdStr          = ConverUtil.ByteToStr_4(_content, 9);  // 设备Id
                string   DeviceStateStr       = _content[14].ToString();              //设备状态
                string   DustConcentrationStr = ConverUtil.ByteToStr_2(_content, 16); //粉尘浓度
                string   timeStr              = time.ToString("yyyy-M-d HH:mm:ss");

                QiYeFangHuDal.Insert_XinTiao(DeviceTypeStr, DeviceIdStr, DustConcentrationStr, "", timeStr, DeviceStateStr);
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "错误:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
Beispiel #30
0
        public bool Execute()
        {
            try
            {
                if (_content.Length != 38)
                {
                    MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode);
                    return(true);
                }



                Pro_IndateBase_DZMP_Mod info = new Pro_IndateBase_DZMP_Mod();
                info.pi_bigtype            = "2";
                info.pi_devicetype         = "1029";
                info.pi_protocoltype       = "524";
                info.pi_devicetime         = ConverUtil.Time(_content, 32);           //设备时间
                info.pi_devicecode         = ConverUtil.ByteToStr_4(_content, 0);     //电子门牌ID
                info.pi_lordidentitycardid = ConverUtil.ByteToStr_Q(_content, 4, 8);  //房东身份证ID
                info.pi_identitycardid     = ConverUtil.ByteToStr_Q(_content, 12, 8); //租客身份证ID
                info.pi_cardid             = ConverUtil.ByteToStr_4(_content, 20);    // e居住卡ID
                info.pi_activecardid       = ConverUtil.ByteToStr_4(_content, 24);    // 有源卡ID
                info.pi_roomno             = ConverUtil.ByteToStr_4(_content, 28);    // 房间ID
                info.pi_stationno          = StationId.ToString();
                info.pi_servicetime        = PlatformTime;

                Other.ChuZuWu.Pro_IndateBase_DZMP_Bll c = new Other.ChuZuWu.Pro_IndateBase_DZMP_Bll(info);
                string Result = c.Exec();
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(Name + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(Name + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }


            return(true);
        }