|
@@ -1573,12 +1573,9 @@ internal partial class ProfileHandler
|
|
|
|
|
|
try
|
|
|
{
|
|
|
- GetConfigurationConfirmation _confirm = confirm as GetConfigurationConfirmation;
|
|
|
- // GetConfigurationRequest _request = _confirm.GetRequest() as GetConfigurationRequest;
|
|
|
-
|
|
|
- List<Task> updateTasks = new List<Task>();
|
|
|
+ GetConfigurationConfirmation _confirm = confirm as GetConfigurationConfirmation;
|
|
|
List<MachineConfigurations> configure = await mainDbService.GetMachineConfiguration(session.ChargeBoxId);
|
|
|
-
|
|
|
+ string customId = string.Empty;
|
|
|
if (_confirm.configurationKey != null)
|
|
|
{
|
|
|
foreach (var item in _confirm.configurationKey)
|
|
@@ -1591,8 +1588,12 @@ internal partial class ProfileHandler
|
|
|
|
|
|
var foundConfig = configure.Find(x => x.ConfigureName == item.key);
|
|
|
var updateValue = string.IsNullOrEmpty(item.value) ? string.Empty : item.value;
|
|
|
+ if (item.key == "CentralChargeBoxId" || item.key == "ChargeBoxId")
|
|
|
+ {
|
|
|
+ customId = item.value;
|
|
|
+ }
|
|
|
|
|
|
- if (foundConfig == null)
|
|
|
+ if (foundConfig == null)
|
|
|
{
|
|
|
await mainDbService.AddMachineConfiguration(session.ChargeBoxId, item.key, updateValue, item.IsReadOnly);
|
|
|
}
|
|
@@ -1606,7 +1607,7 @@ internal partial class ProfileHandler
|
|
|
if (foundConfig.ConfigureName == "SecurityProfile")
|
|
|
{
|
|
|
oldValue = foundConfig.ConfigureSetting;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
await mainDbService.UpdateMachineConfiguration(session.ChargeBoxId, item.key, updateValue, item.IsReadOnly);
|
|
|
}
|
|
@@ -1641,11 +1642,15 @@ internal partial class ProfileHandler
|
|
|
operation.EvseStatus = 1;
|
|
|
operation.EvseValue = JsonConvert.SerializeObject(_confirm.configurationKey, Formatting.None);
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
await db.SaveChangesAsync();
|
|
|
|
|
|
}
|
|
|
+ if (!string.IsNullOrEmpty(customId))
|
|
|
+ {
|
|
|
+ await mainDbService.UpdateCustomId(customId, session.ChargeBoxId);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|