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(); info.pi_param1 = DataJM.电池电压(_content, 14); //电池电压。 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 { 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_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.gonglvyinsu(_content[15].ToString()); //功率因素。 info.pi_param4 = DataJM.温度(_content[16]).ToString(); //温度。 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 { 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(); char[] ModelStateChar = DataJM.ModelState(_content[14].ToString()); info.pi_param1 = ModelStateChar[0].ToString(); //模块状态 info.pi_param2 = ModelStateChar[1].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 { byte[] DeviceTypeByte = new byte[2]; //设备类型 Array.Copy(_content, 1, DeviceTypeByte, 0, 2); string DeviceType = Convert.ToUInt16(ConverUtil.ByteToStr_A(DeviceTypeByte), 16).ToString(); byte[] DeviceIdByte = new byte[4]; //设备Id Array.Copy(_content, 3, DeviceIdByte, 0, 4); string DeviceId = Convert.ToUInt32(ConverUtil.ByteToStr_A(DeviceIdByte), 16).ToString(); string CommandWord = _content[7].ToString(); //命令字 byte[] XAxisAngleValueByte = new byte[2]; //X轴值 Array.Copy(_content, 8, XAxisAngleValueByte, 0, 2); string XAxisAngleValue = DataJM.GetAngleValue(ConverUtil.ByteToStr_A(XAxisAngleValueByte)); byte[] YAxisAngleValueByte = new byte[2]; //Y轴值 Array.Copy(_content, 10, YAxisAngleValueByte, 0, 2); string YAxisAngleValue = DataJM.GetAngleValue(ConverUtil.ByteToStr_A(YAxisAngleValueByte)); string Version = _content[12].ToString(); //版本号。 CeXieInfo info = new CeXieInfo(); info.DeviceTime = DateTime.Now; info.DeviceType = DeviceType; info.DeviceId = DeviceId; info.ProtocolType = CommandWord; info.Reserved1 = XAxisAngleValue; info.Reserved2 = YAxisAngleValue; info.Version = Version; info.StationNo = StationId.ToString(); info.ServiceTime = PlatformTime; ICeXieDal.Handle(Name, OriginalCode, info); } catch (Exception ex) { MyLibrary.Log.Error(Name + "错误:" + ex.Message + " 基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode); } return(true); }
private void Single(byte[] content) { try { Tb_LKCommunityRecord_Mod info = new Tb_LKCommunityRecord_Mod(); info.DeviceId = StationId.ToString(); info.RecordTime = DateTime.Now; info.DeviceTime = ConverUtil.Time(content, 0); info.CardType = content[6].ToString(); //身份证卡类型09信息为8位,IC卡类型05信息为4位; info.CardId = CardId(info.CardType, content); info.Reserve = ConverUtil.ByteToStr_Q(content, 7, 3); info.IdCard = DataJM.SFZ_Str(content, 18); FileManagementDal.SocialAppTerminal.Tb_LKCommunityRecord_Dal.Insert(info); } catch (Exception ex) { MyLibrary.Log.Error(Name + "错误:" + ex.Message + " 原始代码:" + OriginalCode); } }
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 SmokeFeelState = BitStr[0]; string TemperatureAndHumidityState = BitStr[1]; string temperatureStr = _content[16].ToString(); //设备温度 string HumidityStr = _content[17].ToString(); //设备湿度 string timeStr = time.ToString("yyyy-M-d HH:mm:ss"); QiYeFangHuDal.Insert_XinTiao(DeviceTypeStr, DeviceIdStr, temperatureStr, HumidityStr, timeStr, TemperatureAndHumidityState); } catch (Exception ex) { MyLibrary.Log.Error(Name + "错误:" + ex.Message + " 原始代码:" + OriginalCode); } return(true); }
public bool Execute() { try { #region 测斜统计 DateTime time = ConverUtil.Time(_content, 0); //设备时间。 string ZhongJiId = _content[6].ToString(); //中继号 string DeviceType = ConverUtil.ByteToStr_2(_content, 7); string DeviceId = ConverUtil.ByteToStr_4(_content, 9); // 设备Id string CommandWord = _content[13].ToString(); //命令字 byte[] XAxisAngleValueByte = new byte[2]; //X轴值 Array.Copy(_content, 14, XAxisAngleValueByte, 0, 2); string XAxisAngleValue = DataJM.GetAngleValue(ConverUtil.ByteToStr_A(XAxisAngleValueByte)); byte[] YAxisAngleValueByte = new byte[2]; //Y轴值 Array.Copy(_content, 16, YAxisAngleValueByte, 0, 2); string YAxisAngleValue = DataJM.GetAngleValue(ConverUtil.ByteToStr_A(YAxisAngleValueByte)); string Version = _content[18].ToString(); //版本号。 CeXieInfo info = new CeXieInfo(); info.DeviceTime = time; info.DeviceType = DeviceType; info.DeviceId = DeviceId; info.ProtocolType = CommandWord; info.Reserved1 = XAxisAngleValue; info.Reserved2 = YAxisAngleValue; info.Version = Version; info.StationNo = StationId.ToString(); info.ServiceTime = PlatformTime; CeXieDal.AgreementFormat_Insert(info); #endregion #region 处理后发送短信 //byte[] timeByte = new byte[6]; //设备时间 //Array.Copy(_content, 0, timeByte, 0, 6); //DateTime time = Utils.GetTime(timeByte); //string ZhongJiId = _content[6].ToString(); //中继号 //byte[] DeviceTypeByte = new byte[2]; //设备类型 //Array.Copy(_content, 7, DeviceTypeByte, 0, 2); //string DeviceType = Convert.ToUInt64(ConverUtil.ByteToStr_A(DeviceTypeByte), 16).ToString(); //byte[] DeviceIdByte = new byte[4]; //设备Id //Array.Copy(_content, 9, DeviceIdByte, 0, 4); //string DeviceId = Convert.ToUInt64(ConverUtil.ByteToStr_A(DeviceIdByte), 16).ToString(); //string CommandWord = _content[13].ToString(); //命令字 //byte[] XAxisAngleValueByte = new byte[2]; //X轴值 //Array.Copy(_content, 14, XAxisAngleValueByte, 0, 2); //string XAxisAngleValue = Utils.GetAngleValue(ConverUtil.ByteToStr_A(XAxisAngleValueByte)); //byte[] YAxisAngleValueByte = new byte[2]; //Y轴值 //Array.Copy(_content, 16, YAxisAngleValueByte, 0, 2); //string YAxisAngleValue = Utils.GetAngleValue(ConverUtil.ByteToStr_A(YAxisAngleValueByte)); //string Version = _content[18].ToString(); //版本号。 //CeXieInfo info = new CeXieInfo(); //info.DeviceTime = time; //info.DeviceType = DeviceType; //info.DeviceId = DeviceId; //info.ProtocolType = CommandWord; //info.Reserved1 = XAxisAngleValue; //info.Reserved2 = YAxisAngleValue; //info.Version = Version; //info.StationNo = StationId.ToString(); //info.ServiceTime = PlatformTime; //ICeXieDal.Handle(Name, OriginalCode, info); #endregion } catch (Exception ex) { MyLibrary.Log.Error(Name + "错误:" + ex.Message + " 基站编号:" + StationId.ToString() + " 原始代码:" + OriginalCode); } return(true); }