fix-修复喷码机超时报警更新bug

dev
liuwf 3 months ago
parent fb27c8ce1f
commit b5d0b35fa9

@ -576,9 +576,29 @@ namespace SlnMesnac.Business
{ {
dmsRecordAlarmInfo.UpdateTime = DateTime.Now; dmsRecordAlarmInfo.UpdateTime = DateTime.Now;
dmsRecordAlarmInfo.UpdateBy = "SlnMesnac"; dmsRecordAlarmInfo.UpdateBy = "SlnMesnac";
sqlSugarClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmInfo).ExecuteCommand();
} }
else
{
DmsBaseAlarmRule dmsBaseAlarmRule = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<DmsBaseAlarmRule>().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(dmsRecordAlarmTime).ExecuteCommand();
sqlSugarClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmInfo).ExecuteCommand();
} }

Loading…
Cancel
Save