#region << 版 本 注 释 >> /*---------------------------------------------------------------- * 命名空间:WIDESEAWCS_QuartzJob * 创建者:胡童庆 * 创建时间:2024/8/2 16:13:36 * 版本:V1.0.0 * 描述:设备信息业务实现层 * * ---------------------------------------------------------------- * 修改人: * 修改时间: * 版本:V1.0.1 * 修改说明: * *----------------------------------------------------------------*/ #endregion << 版 本 注 释 >> using AutoMapper; using HslCommunication; using Newtonsoft.Json; using SixLabors.ImageSharp.ColorSpaces; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Text; using System.Threading.Tasks; using WIDESEA_Common.Log; using WIDESEAWCS_BasicInfoRepository; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseRepository; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_IBasicInfoRepository; using WIDESEAWCS_QuartzJob.DeviceBase; using WIDESEAWCS_QuartzJob.DeviceEnum; using WIDESEAWCS_QuartzJob.DTO; using WIDESEAWCS_QuartzJob.Models; using WIDESEAWCS_QuartzJob.Repository; using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; using static WIDESEAWCS_QuartzJob.Service.DeviceInfoService; namespace WIDESEAWCS_QuartzJob.Service { public class DeviceInfoService : ServiceBase, IDeviceInfoService { private readonly IUnitOfWorkManage _unitOfWorkManage; private readonly IDt_StationManagerRepository _stationManagerRepository; private readonly IMapper _mapper; public DeviceInfoService(IDeviceInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IMapper mapper, IDt_StationManagerRepository stationManagerRepository) : base(BaseDal) { _unitOfWorkManage = unitOfWorkManage; _mapper = mapper; _stationManagerRepository = stationManagerRepository; } public override WebResponseContent AddData(SaveModel saveModel) { return base.AddData(saveModel); } /// /// 查询设备以及对应的协议信息。 /// /// 返回设备信息以及对应协议信息的集合。 public async Task> QueryDeviceProInfos() { List deviceInfos = await Db.Queryable().Where(x => x.DeviceStatus == ((int)DeviceStatusEnum.Enable).ToString()).Includes(x => x.ProtocolList).ToListAsync(); return _mapper.Map>(deviceInfos); } } }