| | |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; |
| | | |
| | | namespace WIDESEAWCS_QuartzJob.Service |
| | | { |
| | |
| | | { |
| | | private readonly IDeviceProtocolRepository _deviceProtocolRepository; |
| | | private readonly IDeviceInfoRepository _deviceInfoRepository; |
| | | private readonly ICacheService _cacheService; |
| | | |
| | | /// <summary> |
| | | /// 路由配置业务层 |
| | |
| | | /// <param name="BaseDal"></param> |
| | | /// <param name="deviceProtocolRepository"></param> |
| | | /// <param name="deviceInfoRepository"></param> |
| | | public RouterService(IRouterRepository BaseDal, IDeviceProtocolRepository deviceProtocolRepository, IDeviceInfoRepository deviceInfoRepository) : base(BaseDal) |
| | | public RouterService(IRouterRepository BaseDal, IDeviceProtocolRepository deviceProtocolRepository, IDeviceInfoRepository deviceInfoRepository, ICacheService cacheService) : base(BaseDal) |
| | | { |
| | | _deviceProtocolRepository = deviceProtocolRepository; |
| | | _deviceInfoRepository = deviceInfoRepository; |
| | | _cacheService = cacheService; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | // 创建一个字符串列表,用于存储所有位置 |
| | | List<string> positions = new List<string>(); |
| | | var device = _cacheService.Get<List<string>>($"DevicePositions:{deviceCode}"); |
| | | if (device.IsNullOrEmpty()) |
| | | { |
| | | |
| | | try |
| | | { |
| | | // 查询所有进入路由器的位置 |
| | |
| | | { |
| | | |
| | | } |
| | | } |
| | | else |
| | | positions = device; |
| | | // 返回位置列表 |
| | | return positions; |
| | | } |