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 { 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); }
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 (_content.Length != 9) { MyLibrary.Log.Debug(NAME + "长度错误:" + " 原始代码:" + OriginalCode); return(true); } DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间 string VersionNum = ConverUtil.ByteToStr_2(_content, 6); //版本号 string SignalStrength = _content[8].ToString(); //信号强度 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "5"; //0x0005 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = ""; info.pi_version = VersionNum; info.pi_param1 = SignalStrength; 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 (_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); }
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); }
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); }
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 { 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); }
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 (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); }
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); }
public bool Execute() { try { DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间。 string HomeCardType = _content[6].ToString(); //房东卡类型。 string HomeIdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8); //房东身份Id. string CardType = _content[15].ToString(); //卡类型。 string pi_cardid = ""; byte[] ShenFenZhengID = new byte[8]; Array.Copy(_content, 16, ShenFenZhengID, 0, 8); if (CardType == "5") { pi_cardid = (Convert.ToUInt64(ConverUtil.ByteToStr_A(ShenFenZhengID), 16)).ToString(); } if (CardType == "9") { pi_cardid = ConverUtil.ByteToStr_A(ShenFenZhengID); } string HomeNum = _content[24].ToString(); //房东编号。 string RoomNum = ConverUtil.ByteToStr_2(_content, 25); //房间号。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61443"; //0xF004 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = "7"; //0x01 info.pi_lordcardtype = HomeCardType; info.pi_lordidentitycardid = HomeIdentitycardId; info.pi_cardtype = CardType; info.pi_cardid = pi_cardid; 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); }
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); }
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); }
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); }
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 != 23) { MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode); return(true); } Pro_CZW_XiaFa_Mod info = new Pro_CZW_XiaFa_Mod(); info.pi_Protocol = "1"; info.pi_Guid = ConverUtil.ByteToStr_Q(_content, 4, 16); //Guid info.pi_CmdId = ConverUtil.ByteToStr_2(_content, 20); //命令字。 info.pi_Result = _content[22].ToString(); //结果。 string Result = ""; int resultnum; string reason; Pro_CZW_XiaFa_Dal.Exec(info, out resultnum, out reason); if (resultnum == 0) { Result = "0"; } else { Result = reason; } 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 != 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); }
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); }
public bool Execute() { try { DateTime DeviceTime = ConverUtil.Time(_content, 0); //设备时间。 string HomeCardType = _content[6].ToString(); //房东卡类型。 string HomeIdentitycardId = ConverUtil.ByteToStr_Q(_content, 7, 8); //房东身份证Id. string CardType = _content[15].ToString(); //卡类型。 string Identitycard = SFZUtil.ByteToStr(_content, 16); //身份证。 string HomeNum = _content[25].ToString(); //房东编号。 string RoomNum = ConverUtil.ByteToStr_2(_content, 26); //房间号。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "61443"; //0xF003 info.pi_devicetime = DeviceTime; info.pi_devicecode = StationId.ToString(); info.pi_protocoltype = "8"; //0x01 info.pi_lordcardtype = HomeCardType; info.pi_lordidentitycardid = HomeIdentitycardId; info.pi_cardtype = CardType; 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); }
public bool Execute() { try { if (_content.Length != 20) { MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode); return(true); } string DeviceType = ConverUtil.ByteToStr_2(_content, 0); //设备类型 string DeviceId = ConverUtil.ByteToStr_4(_content, 2); //设备Id DateTime time = ConverUtil.Time(_content, 6); //设备时间 string IdentityId = ConverUtil.ByteToStr_Q(_content, 12, 8); //身份证Id Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod(); info.pi_bigtype = "10"; info.pi_devicetime = time; info.pi_devicetype = DeviceType; info.pi_devicecode = DeviceId; info.pi_protocoltype = "519"; info.pi_param1 = IdentityId; 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 (RepeatData.IsRepeatData(_content)) { MyLibrary.Log.RepeatDataInfo("基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode); return(true); } 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_cardtype = _content[14].ToString(); //卡类型 info.pi_cardid = info.pi_cardtype == "0" ? ConverUtil.ByteToStr_Q(_content, 15, 8) : ConverUtil.ByteToStr_4(_content, 19);; info.pi_HEADCOUNT = _content[23].ToString(); //房间内人数 info.pi_OPENTIMES = _content[24].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); }
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 = "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_stationno = StationId.ToString(); info.pi_servicetime = PlatformTime; info.pi_param1 = _content[14].ToString(); //门状态。 info.pi_param2 = ConverUtil.ZF_Value(_content[15]); //房间内人数 info.pi_param3 = _content[16].ToString(); //每天开门次数 info.pi_param4 = Battery(_content[17]); //电池电压。 info.pi_param5 = _content[18].ToString(); //防拆。 info.pi_param6 = ConverUtil.ZF_Value(_content[19]); //温度。 info.pi_version = _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() { string SubCmd = _content[0].ToString(); int Length = Convert.ToInt32(ConverUtil.ByteToStr_2(_content, 1)); byte[] Content = new byte[Length]; Array.Copy(_content, 3, Content, 0, Length); ICommand cmd; switch (SubCmd) { case "1": cmd = new HU_3_1(Content, StationId, PlatformTime); break; default: cmd = new IgnoreCommand(); break; } cmd.Execute(); return(true); }
public bool Execute() { try { if (_content.Length != 17) { MyLibrary.Log.Debug(Name + "长度无效:原始代码:" + OriginalCode); return(true); } Pro_IndateBase_Sec_Mod info = new Pro_IndateBase_Sec_Mod(); info.pi_bigtype = "9"; info.pi_protocoltype = "518"; info.pi_devicetime = ConverUtil.Time(_content, 6); //设备时间 info.pi_devicetype = ConverUtil.ByteToStr_2(_content, 0); //设备类型 info.pi_devicecode = ConverUtil.ByteToStr_4(_content, 2); //设备Id info.pi_param1 = ConverUtil.ByteToStr_4(_content, 12); //房间号 info.pi_param2 = _content[16].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); }
public bool Execute() { try { if (_content.Length != 6) { MyLibrary.Log.Debug(NAME + "长度错误:" + " 原始代码:" + OriginalCode); return(true); } string DoorState = _content[0].ToString(); //门状态。 string DoorOpenTime = ConverUtil.ByteToStr_2(_content, 1); //门敞开时间。 string LookSpeedState = _content[3].ToString(); //锁加速度状态。 string BigChangeValue = ConverUtil.ByteToStr_2(_content, 4); //最大变哈值。 MenJinInfo info = new MenJinInfo(); info.pi_bigtype = "22"; //0x0016 info.pi_devicetime = PlatformTime; info.pi_devicecode = StationId.ToString(); info.pi_param1 = DoorState; info.pi_param2 = DoorOpenTime; info.pi_param3 = LookSpeedState; info.pi_param4 = BigChangeValue; 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); }