/// <summary> /// 查询人井状态信息 /// </summary> public WellStateInfo GetWellStateInfoByID(int id) { WellStateInfo wellStateInfo = new WellStateInfo(); using (Conn) { using (IDataReader read = Conn.ExecuteReader(SELECT_WELL_STATE_ID, new { ID = id })) { while (read.Read()) { wellStateInfo.ID = int.Parse(read["ID"].ToString()); wellStateInfo.State = read["State"].ToString(); wellStateInfo.Color = read["Color"].ToString(); wellStateInfo.Icon = read["Icon"].ToString(); } } } return(wellStateInfo); }
/// <summary> /// 插入系统日志信息表数据 /// </summary> private static void InsertSystemLogInfo() { systemLogInfo.Happen_Time = wellCurrentStateInfo.Report_Time; systemLogInfo.Terminal_ID = wellInfo.Terminal_ID; wellStateInfo = wellStateService.GetWellStateInfoByID(wellCurrentStateInfo.Well_State_ID); systemLogInfo.Well_State = wellStateInfo.State; systemLogInfo.Electricity = SMSAnalysis.IsElectricityAlarm == true ? "终端低电量报警" : "终端电量正常"; systemLogInfo.Signal_Strength = SMSAnalysis.Signal_Strength; systemLogInfo.Temperature = SMSAnalysis.Temperature; systemLogInfo.Humidity = SMSAnalysis.Humidity; if (SMSAnalysis.SmokeMsg) { systemLogInfo.Smoke_Detector = SMSAnalysis.IsSmokeAlarm == true ? "烟感报警" : "烟感无报警"; systemLogInfo.Smoke_Power = SMSAnalysis.IsSmoke_PowerAlarm == true ? "烟感低电量报警" : "烟感电量正常"; } else { systemLogInfo.Smoke_Detector = "无烟感数据"; systemLogInfo.Smoke_Power = "无烟感电量数据"; } logService.InsertSystemLogInfo(systemLogInfo); }