From 440d9564c2660ca8988b6a704fc1eaa085ce965a Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 8 Aug 2023 10:54:40 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BF=9D=E5=AD=98=E6=8A=A5?= =?UTF-8?q?=E8=AD=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Alarm/LRAlarmLog/SelectAction.cs | 4 ++-- .../FinishBatch/SaveHelper/AlarmSaveHelper.cs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Alarm/LRAlarmLog/SelectAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Alarm/LRAlarmLog/SelectAction.cs index e8a6d2f..6c50831 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Alarm/LRAlarmLog/SelectAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Alarm/LRAlarmLog/SelectAction.cs @@ -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 { diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/AlarmSaveHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/AlarmSaveHelper.cs index 8573197..81d7503 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/AlarmSaveHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/AlarmSaveHelper.cs @@ -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.Error("这里保存数据库有问题"); - + Alarm.AlarmHelper.InsertAlarmLogData(alarmLogData); Global.PublicVar.Instance.AlarmStrList.Add(alarmInfo.AlarmName); Global.PublicVar.Instance.isFlashFlag = true; Global.PublicVar.Instance.isFlashFlagExtend = true;