From bdc874134383da1eb7c919fdefe745fea473b060 Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周三, 11 12月 2024 16:54:44 +0800
Subject: [PATCH] 细节
---
CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs b/CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs
index 7031278..774a7be 100644
--- a/CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs
+++ b/CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs
@@ -1,4 +1,5 @@
-锘縰sing iWareCommon.Common.Globle;
+锘縰sing Admin.NET.Application;
+using iWareCommon.Common.Globle;
using iWareCommon.Utils;
using iWareModel;
using iWareSql.WmsDBModel;
@@ -27,7 +28,10 @@
{
using (WmsDBModel edm = new WmsDBModel())
{
- dbList = edm.wms_config_device_warning.ToList();
+ //娉ㄦ剰锛氬彧鏌ヨ 瀹夊叏鎶ヨ銆佺‖浠舵姤璀︿俊鎭�
+ var query1 = (int)DeviceWarningTypeEnum.瀹夊叏鎶ヨ;
+ var query2 = (int)DeviceWarningTypeEnum.纭欢鎶ヨ;
+ dbList = edm.wms_config_device_warning.Where(x => x.DeviceWarningType == query1 || x.DeviceWarningType == query2).ToList();
}
foreach (var item in dbList)
{
@@ -54,7 +58,7 @@
/// <param name="deviceName"></param>
/// <param name="warningCode"></param>
/// <param name="warningContent"></param>
- public static void SaveWarning(EDevice device, LogType _LogType, string warningCode, int deviceAreaCode, string warningContent,int deviceWarningType)
+ public static void SaveWarning(EDevice device, LogType _LogType, string warningCode, int deviceAreaCode, string warningContent, int deviceWarningType)
{
Task.Run(() =>
{
@@ -69,7 +73,7 @@
WarningTime = DateTime.Now,
CreateUserName = SysGloble.WCSSystem,
DeviceAreaCode = deviceAreaCode,
- DeviceWarningType= deviceWarningType,
+ DeviceWarningType = deviceWarningType,
DurationTime = "",
CreateTime = DateTime.Now,
@@ -100,23 +104,22 @@
/// <param name="deviceId">璁惧鍖哄煙</param>
/// <param name="_LogType"></param>
/// <returns></returns>
- public static void AutoCloseWarning(EDevice device, LogType _LogType, System.Collections.Generic.List<string> warningAddressList)
+ public static void AutoCloseWarning(EDevice device, LogType _LogType, System.Collections.Generic.List<string> warningCodeList)
{
Task.Run(() =>
{
try
{
- string deviceCode = ((int)device).ToString();
using (WmsDBModel edm = new WmsDBModel())
{
- var dataList = edm.wms_record_device_warning.Where(x => x.WarningCode == deviceCode && x.DeviceWarningStatus == 0).ToList();
+ var dataList = edm.wms_record_device_warning.Where(x => x.DeviceWarningStatus == 0).ToList();
if (dataList != null && dataList.Count > 0)
{
var msg = "";
var nowDate = DateTime.Now;
foreach (var detail in dataList)
{
- if (!warningAddressList.Contains(detail.WarningCode))
+ if (!warningCodeList.Contains(detail.WarningCode))
{
nowDate = DateTime.Now;
detail.DeviceWarningStatus = 1; //鐘舵�侊紙0锛氭柊寤� 1锛氬凡澶勭悊锛�
--
Gitblit v1.9.3