From b5d0b35fa947f33b97f9c2232b4f3de3f04c9995 Mon Sep 17 00:00:00 2001 From: liuwf Date: Wed, 9 Oct 2024 17:48:34 +0800 Subject: [PATCH] =?UTF-8?q?fix-=E4=BF=AE=E5=A4=8D=E5=96=B7=E7=A0=81?= =?UTF-8?q?=E6=9C=BA=E8=B6=85=E6=97=B6=E6=8A=A5=E8=AD=A6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.Business/ProdCompletionBusiness.cs | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/SlnMesnac.Business/ProdCompletionBusiness.cs b/SlnMesnac.Business/ProdCompletionBusiness.cs index 07ade6e..d7f07f0 100644 --- a/SlnMesnac.Business/ProdCompletionBusiness.cs +++ b/SlnMesnac.Business/ProdCompletionBusiness.cs @@ -576,9 +576,29 @@ namespace SlnMesnac.Business { dmsRecordAlarmInfo.UpdateTime = DateTime.Now; dmsRecordAlarmInfo.UpdateBy = "SlnMesnac"; + sqlSugarClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmInfo).ExecuteCommand(); } + else + { + DmsBaseAlarmRule dmsBaseAlarmRule = sqlSugarClient.AsTenant().GetConnection("mes").Queryable().First(x => x.AlarmRuleId == warnRuleId); + + dmsRecordAlarmInfo = new DmsRecordAlarmInfo(); + dmsRecordAlarmInfo.DeviceId = dmsRecordAlarmTime.DeviceId; + dmsRecordAlarmInfo.AlarmRuleId = warnRuleId; + dmsRecordAlarmInfo.AlarmBeginTime = DateTime.Now; + dmsRecordAlarmInfo.AlarmStatus = "0"; + dmsRecordAlarmInfo.NoticeStatus = "0"; + dmsRecordAlarmInfo.ContinueTime = dmsBaseAlarmRule.ContinueTime; + dmsRecordAlarmInfo.AlarmReason = dmsBaseAlarmRule.AlarmReason; + dmsRecordAlarmInfo.AlarmReason = dmsBaseAlarmRule.AlarmReason; + dmsRecordAlarmInfo.AlarmData = warnStatusEnum.ToString(); + dmsRecordAlarmInfo.HandleSuggest = dmsBaseAlarmRule.HandleSuggest; + dmsRecordAlarmInfo.CreateBy = "SlnMesnac"; + dmsRecordAlarmInfo.CreateTime = DateTime.Now; + sqlSugarClient.AsTenant().GetConnection("mes").Insertable(dmsRecordAlarmInfo).ExecuteCommand(); + } + sqlSugarClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmTime).ExecuteCommand(); - sqlSugarClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmInfo).ExecuteCommand(); }