dev #2
@ -129,7 +129,7 @@ namespace JiShe.CollectBus.Plugins
|
||||
{
|
||||
var messageReceivedLoginEvent = new MessageReceivedLogin
|
||||
{
|
||||
ClientId = client.Id,
|
||||
ClientId = oldClinetId,
|
||||
ClientIp = client.IP,
|
||||
ClientPort = client.Port,
|
||||
MessageHexString = messageHexString,
|
||||
@ -140,11 +140,11 @@ namespace JiShe.CollectBus.Plugins
|
||||
var entity = await _deviceRepository.FindAsync(a => a.Number == deviceNo);
|
||||
if (entity == null)
|
||||
{
|
||||
await _deviceRepository.InsertAsync(new Device(deviceNo, client.Id, DateTime.Now, DateTime.Now, DeviceStatus.Online));
|
||||
await _deviceRepository.InsertAsync(new Device(deviceNo, oldClinetId, DateTime.Now, DateTime.Now, DeviceStatus.Online));
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.UpdateByLoginAndHeartbeat(client.Id);
|
||||
entity.UpdateByLoginAndHeartbeat(oldClinetId);
|
||||
await _deviceRepository.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Application.Services;
|
||||
using static FreeSql.Internal.GlobalFilter;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
@ -113,6 +114,7 @@ namespace JiShe.CollectBus.Workers
|
||||
/// <returns></returns>
|
||||
public virtual Task ScheduledMeterOneMinuteReading()
|
||||
{
|
||||
|
||||
throw new NotImplementedException($"{nameof(ScheduledMeterOneMinuteReading)}请根据不同系统类型进行实现");
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using FreeRedis;
|
||||
using JiShe.CollectBus.Ammeters;
|
||||
using JiShe.CollectBus.Common.Consts;
|
||||
using JiShe.CollectBus.Devices;
|
||||
using JiShe.CollectBus.FreeRedisProvider;
|
||||
using JiShe.CollectBus.FreeSql;
|
||||
using JiShe.CollectBus.Watermeter;
|
||||
@ -12,6 +13,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Domain.Repositories;
|
||||
|
||||
namespace JiShe.CollectBus.Workers
|
||||
{
|
||||
@ -22,6 +24,12 @@ namespace JiShe.CollectBus.Workers
|
||||
//[Route($"/energy/app/scheduled")]
|
||||
public class EnergySystemScheduledMeterReadingService : BasicScheduledMeterReadingService
|
||||
{
|
||||
private readonly IRepository<Device, Guid> _deviceRepository;
|
||||
public EnergySystemScheduledMeterReadingService(IRepository<Device, Guid> deviceRepository)
|
||||
{
|
||||
this._deviceRepository = deviceRepository;
|
||||
}
|
||||
|
||||
public sealed override string SystemType => SystemTypeConst.Energy;
|
||||
|
||||
/// <summary>
|
||||
@ -98,6 +106,5 @@ namespace JiShe.CollectBus.Workers
|
||||
.Ado
|
||||
.QueryAsync<WatermeterInfo>(sql);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user