change - 保存报警信息

master
wenjy 1 year ago
parent 245656cc68
commit 440d9564c2

@ -31,7 +31,7 @@ namespace Mesnac.Action.ChemicalWeighing.Alarm.LRAlarmLog
IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl; IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (startdate != null && starttime != null) if (startdate != null && starttime != null)
{ {
sbSql.AppendLine(@"AND LR_Alarmlog.Alarm_OccurTime>='" + Convert.ToDateTime(startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(starttime.MCValue).ToShortTimeString() + "' "); sbSql.AppendLine(@"AND CONVERT(datetime, LR_Alarmlog.Alarm_OccurTime)>='" + Convert.ToDateTime(startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(starttime.MCValue).ToShortTimeString() + "' ");
} }
else else
{ {
@ -42,7 +42,7 @@ namespace Mesnac.Action.ChemicalWeighing.Alarm.LRAlarmLog
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl; IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (enddate != null && endtime != null) if (enddate != null && endtime != null)
{ {
sbSql.AppendLine(@"AND LR_Alarmlog.Alarm_OccurTime<='" + Convert.ToDateTime(enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endtime.MCValue).ToShortTimeString() + "' "); sbSql.AppendLine(@"AND CONVERT(datetime, LR_Alarmlog.Alarm_OccurTime)<='" + Convert.ToDateTime(enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endtime.MCValue).ToShortTimeString() + "' ");
} }
else else
{ {

@ -145,9 +145,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper
alarmLogData.Alarm_Status = 1; alarmLogData.Alarm_Status = 1;
alarmLogData.Alarm_GUID = Guid.NewGuid().ToString().ToUpper(); alarmLogData.Alarm_GUID = Guid.NewGuid().ToString().ToUpper();
Alarm.AlarmHelper.InsertAlarmLogData(alarmLogData); //这里保存数据库有问题 Alarm.AlarmHelper.InsertAlarmLogData(alarmLogData);
ICSharpCode.Core.LoggingService<AlarmSaveHelper>.Error("这里保存数据库有问题");
Global.PublicVar.Instance.AlarmStrList.Add(alarmInfo.AlarmName); Global.PublicVar.Instance.AlarmStrList.Add(alarmInfo.AlarmName);
Global.PublicVar.Instance.isFlashFlag = true; Global.PublicVar.Instance.isFlashFlag = true;
Global.PublicVar.Instance.isFlashFlagExtend = true; Global.PublicVar.Instance.isFlashFlagExtend = true;

Loading…
Cancel
Save