From 7a884c6b67b6604ee3618effd2ba0decb310c0b2 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 03 九月 2024 16:24:28 +0800
Subject: [PATCH] 新增PLC类型枚举

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

diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
index 5860a85..a5eda3e 100644
--- a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
@@ -1,6 +1,4 @@
-锘縰sing Microsoft.AspNetCore.SignalR;
-
-namespace WCS.Application;
+锘縩amespace WCS.Application;
 
 /// <summary>
 /// 鎶ヨ淇℃伅琛ㄦ湇鍔�
@@ -9,12 +7,9 @@
 public class WcsAlarmInfoService : IDynamicApiController, ITransient
 {
     private readonly SqlSugarRepository<WcsAlarmInfo> _wcsAlarmInfoRep;
-    private readonly IHubContext<PlcHub, IPlcHub> _plcHubContext;
-
-    public WcsAlarmInfoService(SqlSugarRepository<WcsAlarmInfo> wcsAlarmInfoRep, IHubContext<PlcHub, IPlcHub> plcHubContext)
+    public WcsAlarmInfoService(SqlSugarRepository<WcsAlarmInfo> wcsAlarmInfoRep)
     {
         _wcsAlarmInfoRep = wcsAlarmInfoRep;
-        _plcHubContext = plcHubContext;
     }
 
     /// <summary>
@@ -51,6 +46,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 +104,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();
     }
 
@@ -123,10 +119,7 @@
     [DisplayName("澶嶄綅鎶ヨ")]
     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("寮�鍙戜腑");
-
+        throw Oops.Bah("寮�鍙戜腑");
     }
 
 

--
Gitblit v1.8.0