1
hutongqing
2025-01-24 2aef482fa7431fb47eef94081ff23ec220f89820
WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/DispatchInfoService.cs
@@ -31,10 +31,17 @@
namespace WIDESEAWCS_QuartzJob.Service
{
    /// <summary>
    /// 调度服务配置业务层
    /// </summary>
    public class DispatchInfoService : ServiceBase<Dt_DispatchInfo, IDispatchInfoRepository>, IDispatchInfoService
    {
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly IDeviceInfoRepository _deviceInfoRepository;
        /// <summary>
        /// 调度服务配置业务层
        /// </summary>
        public DispatchInfoService(IDispatchInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IDeviceInfoRepository deviceInfoRepository) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
@@ -47,7 +54,7 @@
        /// <returns>返回调度服务JobDTO集合。</returns>
        public List<DispatchInfoDTO> QueryDispatchInfos()
        {
            return Db.Queryable<Dt_DispatchInfo>().LeftJoin<Dt_DeviceInfo>((a, b) => a.JobGroup == b.DeviceType).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,
@@ -65,26 +72,7 @@
                Remark = a.Remark,
                DeviceType = b.DeviceType,
                Enable = (b.DeviceStatus) ?? (((int)DeviceStatusEnum.Enable).ToString())
            }).ToList();
            //return Db.Queryable<Dt_DispatchInfo, Dt_DeviceInfo>((a, b) => a.JobGroup == b.DeviceType && b.DeviceStatus == ((int)DeviceStatusEnum.Enable).ToString()).Select((a, b) => new DispatchInfoDTO
            //{
            //    JobGroup = a.JobGroup,
            //    AssemblyName = a.AssemblyName,
            //    BeginTime = a.BeginTime,
            //    ClassName = a.ClassName,
            //    CreateDate = a.CreateDate,
            //    Creater = a.Creater,
            //    CycleHasRunTimes = 0,
            //    EndTime = a.EndTime,
            //    Id = b.Id,
            //    IntervalSecond = a.IntervalSecond,
            //    Modifier = a.Modifier,
            //    ModifyDate = a.ModifyDate,
            //    Name = a.Name,
            //    Remark = a.Remark,
            //    DeviceType = b.DeviceType
            //}).ToList();
            }).ToList().Where(b => b.Enable == ((int)DeviceStatusEnum.Enable).ToString()).ToList();
        }
    }
}