|
|
@ -10,6 +10,7 @@ using HybirdFrameworkCore.Utils;
|
|
|
|
using HybirdFrameworkDriver.Session;
|
|
|
|
using HybirdFrameworkDriver.Session;
|
|
|
|
using HybirdFrameworkDriver.TcpClient;
|
|
|
|
using HybirdFrameworkDriver.TcpClient;
|
|
|
|
using log4net;
|
|
|
|
using log4net;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Routing.Matching;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Repository.Station;
|
|
|
|
using Repository.Station;
|
|
|
|
using Service.Charger.Codec;
|
|
|
|
using Service.Charger.Codec;
|
|
|
@ -320,8 +321,11 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
|
|
|
|
CurrentCmd = JsonConvert.SerializeObject(remoteStartCharging, Formatting.Indented) + "\r\n" +
|
|
|
|
CurrentCmd = JsonConvert.SerializeObject(remoteStartCharging, Formatting.Indented) + "\r\n" +
|
|
|
|
BitUtls.BytesToHexStr(remoteStartCharging.ToBytes());
|
|
|
|
BitUtls.BytesToHexStr(remoteStartCharging.ToBytes());
|
|
|
|
|
|
|
|
|
|
|
|
AuxiliaryPower auxiliaryPower = new AuxiliaryPower(1);
|
|
|
|
AuxiliaryPower auxiliaryPower0 = new AuxiliaryPower(0);
|
|
|
|
this.Channel.WriteAndFlushAsync(auxiliaryPower);
|
|
|
|
AuxiliaryPower auxiliaryPower1 = new AuxiliaryPower(1);
|
|
|
|
|
|
|
|
this.Channel.WriteAndFlushAsync(auxiliaryPower0);
|
|
|
|
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
|
|
|
|
this.Channel.WriteAndFlushAsync(auxiliaryPower1);
|
|
|
|
this.Channel.WriteAndFlushAsync(remoteStartCharging);
|
|
|
|
this.Channel.WriteAndFlushAsync(remoteStartCharging);
|
|
|
|
return Result<string>.Success(chargeOrderNo);
|
|
|
|
return Result<string>.Success(chargeOrderNo);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -666,7 +670,7 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
|
|
|
|
RedisHelper redisHelper = AppInfo.Container.Resolve<RedisHelper>();
|
|
|
|
RedisHelper redisHelper = AppInfo.Container.Resolve<RedisHelper>();
|
|
|
|
|
|
|
|
|
|
|
|
string? lockKey = redisHelper.GetStrValue($"chargeNo{BinNo}Start");
|
|
|
|
string? lockKey = redisHelper.GetStrValue($"chargeNo{BinNo}Start");
|
|
|
|
if (!string.IsNullOrWhiteSpace(lockKey))
|
|
|
|
if (!string.IsNullOrEmpty(lockKey))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return Result<bool>.Success(true, $"charger-{BinNo} is starting");
|
|
|
|
return Result<bool>.Success(true, $"charger-{BinNo} is starting");
|
|
|
|
}
|
|
|
|
}
|
|
|
|