|
@@ -275,4 +275,27 @@ public class WebDbService
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ internal async Task UpdateProtocalVersion(string chargeBoxId, CancellationToken token = default)
|
|
|
+ {
|
|
|
+ string setSql = """
|
|
|
+ UPDATE [dbo].[StationMachine]
|
|
|
+ SET [ChargerProtocol] = '1.6'
|
|
|
+ WHERE [ChargeBoxId] = @ChargeBoxId
|
|
|
+ """;
|
|
|
+
|
|
|
+ var parameters = new DynamicParameters();
|
|
|
+ parameters.Add("@ChargeBoxId", chargeBoxId, direction: ParameterDirection.Input);
|
|
|
+
|
|
|
+ using SqlConnection conn = await webDbConnectionFactory.CreateAsync();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ bool? isPeriodEnergyRequired = await conn.QueryFirstOrDefaultAsync<bool?>(new CommandDefinition(setSql, parameters, cancellationToken: token));
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ logger.LogWarning(e.Message);
|
|
|
+ logger.LogWarning(e.StackTrace);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|