Browse Source

fix new config not saved

Robert 10 months ago
parent
commit
a3b5167b70
1 changed files with 8 additions and 0 deletions
  1. 8 0
      EVCB_OCPP.WSServer/Service/DbService/MainDbService.cs

+ 8 - 0
EVCB_OCPP.WSServer/Service/DbService/MainDbService.cs

@@ -368,6 +368,8 @@ public class MainDbService : IMainDbService
             ConfigureSetting = string.IsNullOrEmpty(value) ? string.Empty : value,
             ConfigureSetting = string.IsNullOrEmpty(value) ? string.Empty : value,
             Exists = isExists
             Exists = isExists
         });
         });
+
+        await db.SaveChangesAsync();
     }
     }
 
 
     private async Task UpdateTransactionEF(int transactionId, int meterStop, DateTime stopTime, int stopReasonId, string stopReason, string stopIdTag, string receipt, int cost)
     private async Task UpdateTransactionEF(int transactionId, int meterStop, DateTime stopTime, int stopReasonId, string stopReason, string stopIdTag, string receipt, int cost)
@@ -677,6 +679,12 @@ public class MainDbService : IMainDbService
             }
             }
             bundleHandlerData.AddCompletedData(originKey, g.ToList());
             bundleHandlerData.AddCompletedData(originKey, g.ToList());
         }
         }
+        var getConfigChargeboxIds = gReult.Select(x => x.Key);
+        var emptyConfigChargeboxIds = chargeboxIds.Except(getConfigChargeboxIds);
+        foreach (var chargeboxId in emptyConfigChargeboxIds)
+        {
+            bundleHandlerData.AddCompletedData(chargeboxId, new List<MachineConfigurations>());
+        }
     }
     }
 
 
     private async Task UpdateConnectorStatusEF(string Id, ConnectorStatus Status)
     private async Task UpdateConnectorStatusEF(string Id, ConnectorStatus Status)