#region << 版 本 注 释 >> /*---------------------------------------------------------------- * 命名空间:WIDESEAWCS_QuartzJob * 创建者:胡童庆 * 创建时间:2024/8/2 16:13:36 * 版本:V1.0.0 * 描述:设备信息业务实现层 * * ---------------------------------------------------------------- * 修改人: * 修改时间: * 版本:V1.0.1 * 修改说明: * *----------------------------------------------------------------*/ #endregion << 版 本 注 释 >> using AutoMapper; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseRepository; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_QuartzJob.DeviceEnum; using WIDESEAWCS_QuartzJob.DTO; using WIDESEAWCS_QuartzJob.Models; using WIDESEAWCS_QuartzJob.Repository; namespace WIDESEAWCS_QuartzJob.Service { public class DeviceInfoService : ServiceBase, IDeviceInfoService { private readonly IUnitOfWorkManage _unitOfWorkManage; private readonly IMapper _mapper; public DeviceInfoService(IDeviceInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IMapper mapper) : base(BaseDal) { _unitOfWorkManage = unitOfWorkManage; _mapper = mapper; } 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); } } }