public bool Execute()
        {
            try
            {
                DateTime DeviceTime     = ConverUtil.Time(_content, 0);           //设备时间。
                string   CardType       = _content[6].ToString();                 //卡类型。
                string   IdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8); //身份证Id.
                string   Identitycard   = SFZUtil.ByteToStr(_content, 15);
                string   HomeNum        = _content[24].ToString();                //房东编号



                MenJinInfo info = new MenJinInfo();
                info.pi_bigtype        = "61443"; //0xF004
                info.pi_devicetime     = DeviceTime;
                info.pi_devicecode     = StationId.ToString();
                info.pi_protocoltype   = "1"; //0x01
                info.pi_cardtype       = CardType;
                info.pi_identitycardid = IdentitycardId;
                info.pi_identitycard   = Identitycard;
                info.pi_houseno        = HomeNum;
                info.pi_servicetime    = PlatformTime;
                string Result = IMj2Dal.Insert(info);
                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);
        }
Exemplo n.º 3
0
        public bool Execute()
        {
            try
            {
                DateTime DeviceTime        = ConverUtil.Time(_content, 0);            //设备时间。
                string   RoomCardType      = _content[6].ToString();                  //房卡类型。
                string   OldIdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8);  //原身份证Id.
                string   NewCardType       = _content[15].ToString();                 //房卡类型。
                string   NewIdentitycardId = ConverUtil.ByteToStr_Q(_content, 16, 8); //新身份证Id.
                string   NewIdentitycard   = SFZUtil.ByteToStr(_content, 24);         //新身份证。

                MenJinInfo info = new MenJinInfo();
                info.pi_bigtype            = "61443"; //0xF003
                info.pi_devicetime         = DeviceTime;
                info.pi_devicecode         = StationId.ToString();
                info.pi_protocoltype       = "9"; //0x01
                info.pi_lordcardtype       = RoomCardType;
                info.pi_lordidentitycardid = OldIdentitycardId;
                info.pi_cardtype           = NewCardType;
                info.pi_identitycardid     = NewIdentitycardId;
                info.pi_identitycard       = NewIdentitycard;
                info.pi_servicetime        = PlatformTime;
                string Result = IMj2Dal.Insert(info);
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
Exemplo n.º 4
0
 public static string SFZ_Str(byte[] value, int start)
 {
     if (ConverUtil.ByteToStr_A(value) != "FFFFFFFFFFFFFFFFFF")
     {
         return(SFZUtil.ByteToStr(value, start));
     }
     else
     {
         return("");
     }
 }
        public bool Execute()
        {
            try
            {
                DateTime DeviceTime             = ConverUtil.Time(_content, 0);           //设备时间。
                string   HomeCardType           = _content[6].ToString();                 //房东卡类型.
                string   HomeCardIdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8); //房东卡身份证ID.
                string   CardType   = _content[15].ToString();                            //卡类型。
                string   CardId     = "";
                byte[]   EJUcardNum = new byte[4];                                        //E居卡卡号
                Array.Copy(_content, 16, EJUcardNum, 0, 4);
                if (CardType == "9")
                {
                    CardId = ConverUtil.ByteToStr_A(EJUcardNum);
                }
                else
                {
                    CardId = (Convert.ToUInt32(ConverUtil.ByteToStr_A(EJUcardNum), 16)).ToString();
                }
                string UserIdentitycardId = ConverUtil.ByteToStr_Q(_content, 20, 8); //用户身份证ID。
                string Identitycard       = SFZUtil.ByteToStr(_content, 28);         //身份证。
                string HomeNum            = _content[37].ToString();                 //房东编号。
                string RoomNum            = ConverUtil.ByteToStr_2(_content, 38);    //房间号。

                MenJinInfo info = new MenJinInfo();
                info.pi_bigtype            = "61443"; //0xF004
                info.pi_devicetime         = DeviceTime;
                info.pi_devicecode         = StationId.ToString();
                info.pi_protocoltype       = "4"; //0x01
                info.pi_lordcardtype       = HomeCardType;
                info.pi_lordidentitycardid = HomeCardIdentitycardId;
                info.pi_cardtype           = CardType;
                info.pi_cardid             = CardId;
                info.pi_identitycardid     = UserIdentitycardId;
                info.pi_identitycard       = Identitycard;
                info.pi_houseno            = HomeNum;
                info.pi_roomno             = RoomNum;
                info.pi_servicetime        = PlatformTime;
                string Result = IMj2Dal.Insert(info);
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
Exemplo n.º 6
0
        public bool Execute()
        {
            try
            {
                DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间。
                string   CardType   = _content[6].ToString();       //卡类型。
                byte[]   CardNum    = new byte[8];
                Array.Copy(_content, 7, CardNum, 0, 8);
                string CardId = "";
                if (CardType == "9")
                {
                    CardId = ConverUtil.ByteToStr_A(CardNum);
                }
                else
                {
                    CardId = Convert.ToUInt64(ConverUtil.ByteToStr_A(CardNum), 16).ToString();
                }
                string Identitycard = SFZUtil.ByteToStr(_content, 15); //身份证号码。

                string HomeNum = _content[24].ToString();              //房东编号
                string RoomNum = ConverUtil.ByteToStr_2(_content, 25); //房间号。

                MenJinInfo info = new MenJinInfo();
                info.pi_bigtype      = "61444"; //0xF004
                info.pi_devicetime   = DeviceTime;
                info.pi_devicecode   = StationId.ToString();
                info.pi_protocoltype = "2"; //0x01
                info.pi_cardtype     = CardType;
                info.pi_cardid       = CardId;
                info.pi_identitycard = Identitycard;
                info.pi_houseno      = HomeNum;
                info.pi_roomno       = RoomNum;
                info.pi_servicetime  = PlatformTime;
                string Result = IMj2Dal.Insert(info);
                if (Result != "0")
                {
                    MyLibrary.Log.Debug(NAME + "出错:" + Result + " 原始代码:" + OriginalCode);
                }
            }
            catch (Exception ex)
            {
                MyLibrary.Log.Error(NAME + "出错:" + ex.Message + " 原始代码:" + OriginalCode);
            }

            return(true);
        }
        private string Data(Type type, byte[] content)
        {
            string Str     = "";
            string Content = "";

            switch (type)
            {
            case Type.房东卡类型:
                Str     = content[6].ToString();
                Content = Str != "FF" ? Str : "-1";
                break;

            case Type.房东卡身份证ID:
                Str     = ConverUtil.ByteToStr_Q(content, 7, 8);
                Content = Str != "FFFFFFFFFFFFFFFF" ? Str : "-1";
                break;

            case Type.E居卡卡类型:
                Str     = content[15].ToString();
                Content = Str != "FF" ? Str : "-1";
                break;

            case Type.E居卡卡号:
                Str     = ConverUtil.ByteToStr_Q(content, 16, 4);
                Content = Str != "FFFFFFFF" ? ConverUtil.ByteToStr_4(content, 16) : "-1";
                break;

            case Type.用户身份证ID:
                Str     = ConverUtil.ByteToStr_Q(content, 20, 8);
                Content = Str != "FFFFFFFFFFFFFFFF" ? Str : "-1";
                break;

            case Type.用户身份证号码:
                Str     = ConverUtil.ByteToStr_Q(content, 28, 9);
                Content = Str != "FFFFFFFFFFFFFFFFFF" ? SFZUtil.ByteToStr(content, 28) : "-1";
                break;

            case Type.用户卡类型:
                Str     = content[37].ToString();
                Content = Str != "FF" ? Str : "-1";
                break;

            case Type.用户卡卡号:
                Str     = ConverUtil.ByteToStr_Q(content, 38, 4);
                Content = Str != "FFFFFFFF" ? ConverUtil.ByteToStr_4(content, 38) : "-1";
                break;

            case Type.房东编号:
                Str     = content[42].ToString();
                Content = Str != "FF" ? Str : "-1";
                break;

            case Type.房间号:
                Str     = ConverUtil.ByteToStr_Q(content, 43, 2);
                Content = Str != "FFFF" ? ConverUtil.ByteToStr_2(content, 43) : "-1";
                break;

            default:
                break;
            }
            return(Content);
        }