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;
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
{
@ -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;
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
{

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

Loading…
Cancel
Save