From f142e86b68f5480f342442b1a4ae4c6a4fc3d912 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期二, 17 十二月 2024 09:08:12 +0800
Subject: [PATCH] 1

---
 WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/DispatchInfoService.cs |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/DispatchInfoService.cs b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/DispatchInfoService.cs
index 1e4180e..7e20958 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/DispatchInfoService.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/DispatchInfoService.cs
@@ -41,12 +41,13 @@
             _deviceInfoRepository = deviceInfoRepository;
         }
 
+        /// <summary>
+        /// 鏌ヨ璋冨害鏈嶅姟Job涓庡搴旂殑璁惧淇℃伅銆�
+        /// </summary>
+        /// <returns>杩斿洖璋冨害鏈嶅姟JobDTO闆嗗悎銆�</returns>
         public List<DispatchInfoDTO> QueryDispatchInfos()
         {
-            List<Dt_DispatchInfo> dispatchInfos = BaseDal.QueryData();
-            List<Dt_DeviceInfo> deviceInfos = _deviceInfoRepository.QueryData();
-
-            return Db.Queryable<Dt_DispatchInfo, Dt_DeviceInfo>((a, b) => a.JobGroup == b.DeviceType && b.DeviceStatus == ((int)DeviceStatusEnum.Enable).ToString()).Select((a, b) => new DispatchInfoDTO
+            return Db.Queryable<Dt_DispatchInfo>().LeftJoin<Dt_DeviceInfo>((a, b) => a.Id == b.DispatchId).Select((a, b) => new DispatchInfoDTO
             {
                 JobGroup = a.JobGroup,
                 AssemblyName = a.AssemblyName,
@@ -62,8 +63,9 @@
                 ModifyDate = a.ModifyDate,
                 Name = a.Name,
                 Remark = a.Remark,
-                DeviceStatus = b.DeviceType
-            }).ToList();
+                DeviceType = b.DeviceType,
+                Enable = (b.DeviceStatus) ?? (((int)DeviceStatusEnum.Enable).ToString())
+            }).ToList().Where(b => b.Enable == ((int)DeviceStatusEnum.Enable).ToString()).ToList();
         }
     }
 }

--
Gitblit v1.9.3