Beispiel #1
0
        public bool Execute()
        {
            try
            {

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

                CZW_61506_0426_02_Mod Cm = CZW_61506_0426_02_Dal.GetMod(this._content);
                Cm.基站编号 = (uint)StationId;
                Cm.平台时间 = this.PlatformTime;

                Pro_InDatabase_NFC_Mod info = CZW_61506_0426_02_Dal.Get_Pro_Mod(Cm);

                Pro_InDatabase_NFC_Bll c = new Pro_InDatabase_NFC_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 CZW_61506_0426_02_Mod GetMod(byte[] content)
        {
            CZW_61506_0426_02_Mod info = new CZW_61506_0426_02_Mod();

            info.设备时间 = ConverUtil.Time(content, 0);
            info.中继号  = content[6].ToString();
            info.设备类型 = ConverUtil.ByteToInt_2(content, 7);
            info.设备编号 = ConverUtil.ByteToInt_4(content, 9);
            info.命令字  = content[13];

            info.卡类型   = content[14];
            info.卡号    = ConverUtil.ByteToStr_Q(content, 15, 8);
            info.软件版本号 = content[33];
            info.RSSI  = content[34];

            return(info);
        }
        public static Pro_InDatabase_NFC_Mod Get_Pro_Mod(CZW_61506_0426_02_Mod info)
        {
            Pro_InDatabase_NFC_Mod m = new Pro_InDatabase_NFC_Mod();

            m.PI_STATIONNO   = info.基站编号.ToString();
            m.PI_SERVICETIME = info.平台时间;

            m.PI_DEVICETIME   = info.设备时间;
            m.PI_RELAYNO      = info.中继号;
            m.PI_DEVICETYPE   = info.设备类型.ToString();
            m.PI_DEVICECODE   = info.设备编号.ToString();
            m.PI_PROTOCOLTYPE = info.命令字.ToString();

            m.PI_CARDTYPE = info.卡类型.ToString();
            if (m.PI_CARDTYPE == "9")
            {
                m.PI_CARDID = info.卡号;
            }
            else if (m.PI_CARDTYPE == "10")
            {
                m.PI_CARDID = info.卡号;
            }
            else if (m.PI_CARDTYPE == "0")
            {
                m.PI_CARDID = info.卡号;
            }
            else
            {
                m.PI_CARDID = GetCardId(info.卡号);
            }

            m.PI_VERSION = info.软件版本号.ToString();
            m.PI_RSSI    = info.RSSI.ToString();

            return(m);
        }