| | |
| | | /// <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(() => |
| | | { |
| | |
| | | WarningTime = DateTime.Now, |
| | | CreateUserName = SysGloble.WCSSystem, |
| | | DeviceAreaCode = deviceAreaCode, |
| | | DeviceWarningType= deviceWarningType, |
| | | DeviceWarningType = deviceWarningType, |
| | | DurationTime = "", |
| | | |
| | | CreateTime = DateTime.Now, |
| | |
| | | /// <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:已处理) |