From 7bb43fd6a2d62060c2f622e8d9396329ebaf4794 Mon Sep 17 00:00:00 2001
From: hwh <332078369@qq.com>
Date: 星期四, 05 九月 2024 11:17:02 +0800
Subject: [PATCH] Merge branch 'master' of http://47.95.120.53:8083/r/WCSNet6

---
 Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
index 5860a85..e2eef27 100644
--- a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
@@ -10,7 +10,6 @@
 {
     private readonly SqlSugarRepository<WcsAlarmInfo> _wcsAlarmInfoRep;
     private readonly IHubContext<PlcHub, IPlcHub> _plcHubContext;
-
     public WcsAlarmInfoService(SqlSugarRepository<WcsAlarmInfo> wcsAlarmInfoRep, IHubContext<PlcHub, IPlcHub> plcHubContext)
     {
         _wcsAlarmInfoRep = wcsAlarmInfoRep;
@@ -51,6 +50,7 @@
     public async Task<long> Add(AddWcsAlarmInfoInput input)
     {
         var entity = input.Adapt<WcsAlarmInfo>();
+        entity.Status = YesNoEnum.N;
         await _wcsAlarmInfoRep.InsertAsync(entity);
         return entity.Id;
     }
@@ -108,7 +108,7 @@
     public async Task<List<WcsAlarmInfoOutput>> List([FromQuery] PageWcsAlarmInfoInput input)
     {
         return await _wcsAlarmInfoRep.AsQueryable()
-            //.WhereIF(!input.Status.IsNullOrEmpty(), s => s.Status == input.Status)
+            .WhereIF(!input.Status.IsNullOrEmpty(), s => s.Status == input.Status)
             .Select<WcsAlarmInfoOutput>().ToListAsync();
     }
 
@@ -124,9 +124,10 @@
     public async Task Reset()
     {
         //娴嬭瘯鎺ㄦ暟鎹敤鐨�
-        await _plcHubContext.Clients.All.PublicAlarm(new WcsAlarmInfoOutput() { Id = new Random().Next(), StationNum = "205", AlarmCode = "MB102", AlarmName = "鏈夌墿鍝侀伄鎸�", AlarmTime = DateTime.Now });
-        //throw Oops.Bah("寮�鍙戜腑");
+        await _plcHubContext.Clients.All.PublicAlarm(new List<WcsAlarmInfo>() { new WcsAlarmInfo() { Id = 100, StationNum = "260", AlarmCode = "MB102", AlarmName = "鏈夌墿鍝侀伄鎸�", AlarmTime = DateTime.Now, Status = YesNoEnum.N } });
+        //await _plcHubContext.Clients.All.PublicAlarm(new WcsAlarmInfo() { Id = 100, StationNum = "260", AlarmCode = "MB102", AlarmName = "鏈夌墿鍝侀伄鎸�", AlarmTime = DateTime.Now, Status = YesNoEnum.Y });
 
+        //throw Oops.Bah("寮�鍙戜腑");
     }
 
 

--
Gitblit v1.8.0