|
@@ -28,6 +28,8 @@ using System.Globalization;
|
|
|
using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
+using Dapper;
|
|
|
+
|
|
|
namespace EVCB_OCPP.WSServer.Message;
|
|
|
|
|
|
public class ID_CreditDeductResult
|
|
@@ -75,6 +77,7 @@ internal partial class ProfileHandler
|
|
|
private readonly IDbContextFactory<MainDBContext> maindbContextFactory;
|
|
|
private readonly IDbContextFactory<MeterValueDBContext> metervaluedbContextFactory;
|
|
|
private readonly IServiceProvider serviceProvider;
|
|
|
+ private readonly string mainDbConnectionString;
|
|
|
private OuterHttpClient httpClient = new OuterHttpClient();
|
|
|
|
|
|
public ProfileHandler(
|
|
@@ -89,16 +92,17 @@ internal partial class ProfileHandler
|
|
|
this.maindbContextFactory = maindbContextFactory;
|
|
|
this.serviceProvider = serviceProvider;
|
|
|
this.metervaluedbContextFactory = metervaluedbContextFactory;
|
|
|
+ this.mainDbConnectionString = configuration.GetConnectionString("MainDBContext");
|
|
|
}
|
|
|
|
|
|
async internal Task<MessageResult> ExecuteCoreRequest(Actions action, ClientData session, IRequest request)
|
|
|
{
|
|
|
Stopwatch watch = new Stopwatch();
|
|
|
- long getDateTimeTime, getServiceTime, getTagInfoTime, dbOpTime = 0;
|
|
|
- if (action == Actions.Heartbeat || action == Actions.StopTransaction)
|
|
|
- {
|
|
|
- watch.Start();
|
|
|
- }
|
|
|
+ //if (action == Actions.Heartbeat || action == Actions.StopTransaction)
|
|
|
+ //{
|
|
|
+ // watch.Start();
|
|
|
+ //}
|
|
|
+ watch.Start();
|
|
|
MessageResult result = new MessageResult() { Success = false };
|
|
|
|
|
|
try
|
|
@@ -183,7 +187,7 @@ internal partial class ProfileHandler
|
|
|
PublicKey = jo["publicKey"].Value<string>()
|
|
|
});
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -200,7 +204,7 @@ internal partial class ProfileHandler
|
|
|
int heartbeat_interval = GlobalConfig.GetHEARTBEAT_INTERVAL();
|
|
|
using (var db = maindbContextFactory.CreateDbContext())
|
|
|
{
|
|
|
- var _machine = await db.Machine.Where(x => x.ChargeBoxId == session.ChargeBoxId).FirstOrDefaultAsync();
|
|
|
+ var _machine = db.Machine.FirstOrDefault(x => x.ChargeBoxId == session.ChargeBoxId);
|
|
|
_machine.ChargeBoxSerialNumber = string.IsNullOrEmpty(_request.chargeBoxSerialNumber) ? string.Empty : _request.chargeBoxSerialNumber;
|
|
|
_machine.ChargePointSerialNumber = string.IsNullOrEmpty(_request.chargePointSerialNumber) ? string.Empty : _request.chargePointSerialNumber;
|
|
|
_machine.ChargePointModel = string.IsNullOrEmpty(_request.chargePointModel) ? string.Empty : _request.chargePointModel;
|
|
@@ -212,12 +216,9 @@ internal partial class ProfileHandler
|
|
|
_machine.MeterSerialNumber = string.IsNullOrEmpty(_request.meterSerialNumber) ? string.Empty : _request.meterSerialNumber;
|
|
|
_machine.MeterType = string.IsNullOrEmpty(_request.meterType) ? string.Empty : _request.meterType;
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
- }
|
|
|
-
|
|
|
+ db.SaveChanges();
|
|
|
+ db.ChangeTracker.Clear();
|
|
|
|
|
|
- using (var db = maindbContextFactory.CreateDbContext())
|
|
|
- {
|
|
|
var configVaule = await db.MachineConfigurations
|
|
|
.Where(x => x.ChargeBoxId == session.ChargeBoxId && x.ConfigureName == StandardConfiguration.HeartbeatInterval)
|
|
|
.Select(x => x.ConfigureSetting)
|
|
@@ -237,16 +238,42 @@ internal partial class ProfileHandler
|
|
|
break;
|
|
|
case Actions.StatusNotification:
|
|
|
{
|
|
|
+ var statusNotificationTimer = Stopwatch.StartNew();
|
|
|
+ long s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0;
|
|
|
//只保留最新上報狀況
|
|
|
StatusNotificationRequest _request = request as StatusNotificationRequest;
|
|
|
int preStatus = 0;
|
|
|
ConnectorStatus _oldStatus;
|
|
|
+
|
|
|
using (var db = maindbContextFactory.CreateDbContext())
|
|
|
{
|
|
|
- _oldStatus = await db.ConnectorStatus.Where(x => x.ChargeBoxId == session.ChargeBoxId
|
|
|
- && x.ConnectorId == _request.connectorId).AsNoTracking().FirstOrDefaultAsync();
|
|
|
+ var con = db.Database.GetDbConnection();
|
|
|
+ s1 = statusNotificationTimer.ElapsedMilliseconds;
|
|
|
+
|
|
|
+ var sqlCommand = """
|
|
|
+ select * from ConnectorStatus
|
|
|
+ where ChargeBoxId = @ChargeBoxId and ConnectorId = @ConnectorId
|
|
|
+ """;
|
|
|
+ var param = new DynamicParameters();
|
|
|
+ param.Add("@ChargeBoxId", session.ChargeBoxId, DbType.String, ParameterDirection.Input, 50);
|
|
|
+ param.Add("@ConnectorId", _request.connectorId, DbType.Int16, ParameterDirection.Input);
|
|
|
+
|
|
|
+ _oldStatus = con.QueryFirst<ConnectorStatus>(sqlCommand, param);
|
|
|
+
|
|
|
+ s2 = statusNotificationTimer.ElapsedMilliseconds;
|
|
|
}
|
|
|
|
|
|
+ //using (var db = maindbContextFactory.CreateDbContext())
|
|
|
+ //{
|
|
|
+ // s1 = statusNotificationTimer.ElapsedMilliseconds;
|
|
|
+
|
|
|
+ // _oldStatus = db.ConnectorStatus.Where(x => x.ChargeBoxId == session.ChargeBoxId
|
|
|
+ // && x.ConnectorId == _request.connectorId).AsNoTracking().FirstOrDefault();
|
|
|
+
|
|
|
+ // s2 = statusNotificationTimer.ElapsedMilliseconds;
|
|
|
+ //}
|
|
|
+
|
|
|
+ s4 = statusNotificationTimer.ElapsedMilliseconds;
|
|
|
|
|
|
if (_oldStatus != null && (_request.status != (ChargePointStatus)_oldStatus.Status || _request.status == ChargePointStatus.Faulted))
|
|
|
{
|
|
@@ -273,7 +300,8 @@ internal partial class ProfileHandler
|
|
|
db.Entry(_oldStatus).Property(x => x.VendorId).IsModified = true;
|
|
|
db.Entry(_oldStatus).Property(x => x.VendorErrorCode).IsModified = true;
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ //db.SaveChanges();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -294,7 +322,9 @@ internal partial class ProfileHandler
|
|
|
Id = Guid.NewGuid().ToString()
|
|
|
};
|
|
|
db.ConnectorStatus.Add(_currentStatus);
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ //db.SaveChanges();
|
|
|
+
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -314,7 +344,9 @@ internal partial class ProfileHandler
|
|
|
VendorErrorCode = string.IsNullOrEmpty(_request.vendorErrorCode) ? string.Empty : _request.vendorErrorCode,
|
|
|
VendorId = string.IsNullOrEmpty(_request.vendorId) ? string.Empty : _request.vendorId
|
|
|
});
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ //db.SaveChanges();
|
|
|
+
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -333,10 +365,17 @@ internal partial class ProfileHandler
|
|
|
|
|
|
});
|
|
|
}
|
|
|
+ s5 = statusNotificationTimer.ElapsedMilliseconds;
|
|
|
|
|
|
var confirm = new StatusNotificationConfirmation() { };
|
|
|
result.Message = confirm;
|
|
|
result.Success = true;
|
|
|
+
|
|
|
+ statusNotificationTimer.Stop();
|
|
|
+ if(statusNotificationTimer.ElapsedMilliseconds/1000 > 3)
|
|
|
+ {
|
|
|
+ logger.LogCritical(string.Format("StatusNotification took {0}/{1}/{2}/{3}/{4}", s1/1000, s2/1000, s3/1000, s4/1000, s5/1000));
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
case Actions.Heartbeat:
|
|
@@ -426,34 +465,31 @@ internal partial class ProfileHandler
|
|
|
try
|
|
|
{
|
|
|
if (session.IsBilling)
|
|
|
- if (session.IsBilling)
|
|
|
+ {
|
|
|
+ using (var db = maindbContextFactory.CreateDbContext())
|
|
|
{
|
|
|
- using (var db = maindbContextFactory.CreateDbContext())
|
|
|
+ db.ServerMessage.Add(new ServerMessage()
|
|
|
{
|
|
|
- db.ServerMessage.Add(new ServerMessage()
|
|
|
- {
|
|
|
- ChargeBoxId = session.ChargeBoxId,
|
|
|
- CreatedBy = "Server",
|
|
|
- CreatedOn = DateTime.UtcNow,
|
|
|
- OutAction = Actions.DataTransfer.ToString(),
|
|
|
- OutRequest = JsonConvert.SerializeObject(
|
|
|
- new DataTransferRequest()
|
|
|
- {
|
|
|
- messageId = "ID_TxEnergy",
|
|
|
- vendorId = "Phihong Technology",
|
|
|
- data = JsonConvert.SerializeObject(new { txId = _request.transactionId, ConnectorId = _request.connectorId })
|
|
|
- },
|
|
|
- new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore, Formatting = Formatting.None }),
|
|
|
- SerialNo = Guid.NewGuid().ToString(),
|
|
|
- InMessage = string.Empty
|
|
|
+ ChargeBoxId = session.ChargeBoxId,
|
|
|
+ CreatedBy = "Server",
|
|
|
+ CreatedOn = DateTime.UtcNow,
|
|
|
+ OutAction = Actions.DataTransfer.ToString(),
|
|
|
+ OutRequest = JsonConvert.SerializeObject(
|
|
|
+ new DataTransferRequest()
|
|
|
+ {
|
|
|
+ messageId = "ID_TxEnergy",
|
|
|
+ vendorId = "Phihong Technology",
|
|
|
+ data = JsonConvert.SerializeObject(new { txId = _request.transactionId, ConnectorId = _request.connectorId })
|
|
|
+ },
|
|
|
+ new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore, Formatting = Formatting.None }),
|
|
|
+ SerialNo = Guid.NewGuid().ToString(),
|
|
|
+ InMessage = string.Empty
|
|
|
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
- }
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -563,7 +599,7 @@ internal partial class ProfileHandler
|
|
|
|
|
|
db.TransactionRecord.Add(_newTransaction);
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
|
|
|
_transactionId = _newTransaction.Id;
|
|
|
logger.LogInformation("***************************************************** ");
|
|
@@ -591,18 +627,21 @@ internal partial class ProfileHandler
|
|
|
break;
|
|
|
case Actions.StopTransaction:
|
|
|
{
|
|
|
+ long getDateTimeTime, getServiceTime, getTagInfoTime, dbOpTime = 0;
|
|
|
+ var stopTrasactionTimer = Stopwatch.StartNew();
|
|
|
+
|
|
|
StopTransactionRequest _request = request as StopTransactionRequest;
|
|
|
|
|
|
int _ConnectorId = 0;
|
|
|
|
|
|
var utcNow = DateTime.UtcNow;
|
|
|
- getDateTimeTime = watch.ElapsedMilliseconds;
|
|
|
+ getDateTimeTime = stopTrasactionTimer.ElapsedMilliseconds;
|
|
|
var businessService = await serviceProvider.GetService<BusinessServiceFactory>().CreateBusinessService(session.CustomerId.ToString());
|
|
|
- getServiceTime = watch.ElapsedMilliseconds;
|
|
|
+ getServiceTime = stopTrasactionTimer.ElapsedMilliseconds;
|
|
|
|
|
|
var _idTagInfo = string.IsNullOrEmpty(_request.idTag) ? null : (_request.idTag == "Backend" ?
|
|
|
new IdTagInfo() { expiryDate = utcNow.AddDays(1), status = AuthorizationStatus.Accepted } : (await businessService.Authorize(session.ChargeBoxId, _request.idTag)).IdTagInfo);
|
|
|
- getTagInfoTime = watch.ElapsedMilliseconds;
|
|
|
+ getTagInfoTime = stopTrasactionTimer.ElapsedMilliseconds;
|
|
|
|
|
|
//特例****飛宏客戶旗下的電樁,若遇到Portal沒回應的狀況 ~允許充電
|
|
|
if (session.CustomerId.ToString().ToUpper() == "8456AED9-6DD9-4BF3-A94C-9F5DCB9506F7" && _idTagInfo != null && _idTagInfo.status == AuthorizationStatus.ConcurrentTx)
|
|
@@ -610,11 +649,11 @@ internal partial class ProfileHandler
|
|
|
_idTagInfo = new IdTagInfo() { expiryDate = utcNow.AddDays(1), status = AuthorizationStatus.Accepted };
|
|
|
}
|
|
|
try
|
|
|
- {
|
|
|
+ {
|
|
|
using (var db = maindbContextFactory.CreateDbContext())
|
|
|
{
|
|
|
- var transaction = await db.TransactionRecord.Where(x => x.Id == _request.transactionId
|
|
|
- && x.ChargeBoxId == session.ChargeBoxId).FirstOrDefaultAsync();
|
|
|
+ var transaction = db.TransactionRecord.Where(x => x.Id == _request.transactionId
|
|
|
+ && x.ChargeBoxId == session.ChargeBoxId).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
|
@@ -676,7 +715,8 @@ internal partial class ProfileHandler
|
|
|
}
|
|
|
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ //db.SaveChanges();
|
|
|
+ db.SaveChanges();
|
|
|
|
|
|
|
|
|
if (session.IsBilling)
|
|
@@ -700,7 +740,8 @@ internal partial class ProfileHandler
|
|
|
|
|
|
});
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ //db.SaveChanges();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
result.Message = confirm;
|
|
@@ -716,37 +757,37 @@ internal partial class ProfileHandler
|
|
|
dbOpTime = watch.ElapsedMilliseconds;
|
|
|
#region Save MeterValue
|
|
|
|
|
|
- if (_request.transactionData != null &&
|
|
|
+ if (_request.transactionData != null &&
|
|
|
_request.transactionData.Count > 0)
|
|
|
{
|
|
|
using (var _meterDb = await metervaluedbContextFactory.CreateDbContextAsync())
|
|
|
{
|
|
|
foreach (var item in _request.transactionData)
|
|
|
- foreach (var sampleVaule in item.sampledValue)
|
|
|
- {
|
|
|
- decimal value = Convert.ToDecimal(sampleVaule.value);
|
|
|
+ foreach (var sampleVaule in item.sampledValue)
|
|
|
+ {
|
|
|
+ decimal value = Convert.ToDecimal(sampleVaule.value);
|
|
|
|
|
|
|
|
|
- string sp = "[dbo].[uspInsertMeterValueRecord] @ChargeBoxId," +
|
|
|
- "@ConnectorId,@Value,@CreatedOn,@ContextId,@FormatId,@MeasurandId,@PhaseId,@LocationId,@UnitId,@TransactionId";
|
|
|
+ string sp = "[dbo].[uspInsertMeterValueRecord] @ChargeBoxId," +
|
|
|
+ "@ConnectorId,@Value,@CreatedOn,@ContextId,@FormatId,@MeasurandId,@PhaseId,@LocationId,@UnitId,@TransactionId";
|
|
|
|
|
|
List<SqlParameter> parameter = new List<SqlParameter>();
|
|
|
parameter.AddInsertMeterValueRecordSqlParameters(
|
|
|
chargeBoxId: session.ChargeBoxId
|
|
|
- ,connectorId: (byte)_ConnectorId
|
|
|
- ,value: value
|
|
|
- ,createdOn: item.timestamp
|
|
|
- ,contextId: sampleVaule.context.HasValue ? (int)sampleVaule.context : 0
|
|
|
- ,formatId: sampleVaule.format.HasValue ? (int)sampleVaule.format : 0
|
|
|
- ,measurandId: sampleVaule.measurand.HasValue ? (int)sampleVaule.measurand : 0
|
|
|
- ,phaseId: sampleVaule.phase.HasValue ? (int)sampleVaule.phase : 0
|
|
|
- ,locationId: sampleVaule.location.HasValue ? (int)sampleVaule.location : 0
|
|
|
- ,unitId: sampleVaule.unit.HasValue ? (int)sampleVaule.unit : 0
|
|
|
- ,transactionId: _request.transactionId
|
|
|
+ , connectorId: (byte)_ConnectorId
|
|
|
+ , value: value
|
|
|
+ , createdOn: item.timestamp
|
|
|
+ , contextId: sampleVaule.context.HasValue ? (int)sampleVaule.context : 0
|
|
|
+ , formatId: sampleVaule.format.HasValue ? (int)sampleVaule.format : 0
|
|
|
+ , measurandId: sampleVaule.measurand.HasValue ? (int)sampleVaule.measurand : 0
|
|
|
+ , phaseId: sampleVaule.phase.HasValue ? (int)sampleVaule.phase : 0
|
|
|
+ , locationId: sampleVaule.location.HasValue ? (int)sampleVaule.location : 0
|
|
|
+ , unitId: sampleVaule.unit.HasValue ? (int)sampleVaule.unit : 0
|
|
|
+ , transactionId: _request.transactionId
|
|
|
);
|
|
|
|
|
|
- _meterDb.Database.ExecuteSqlRaw(sp, parameter.ToArray());
|
|
|
- }
|
|
|
+ _meterDb.Database.ExecuteSqlRaw(sp, parameter.ToArray());
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -763,12 +804,10 @@ internal partial class ProfileHandler
|
|
|
// return result;
|
|
|
}
|
|
|
|
|
|
- watch.Stop();
|
|
|
- if (watch.ElapsedMilliseconds > 1000)
|
|
|
- {
|
|
|
- logger.Log( LogLevel.Critical, "ExecuteCoreRequest {action} {sessisonId} too long {time} sec", action.ToString(), session.SessionID , watch.ElapsedMilliseconds / 1000);
|
|
|
- logger.Log(LogLevel.Critical, "{action} {sessisonId} time {getDateTime}/{serviceTime}/{tagInfoTime}/{dbOpTime}", action.ToString(), session.SessionID, getDateTimeTime/1000 , getServiceTime/1000, getTagInfoTime/1000, dbOpTime/1000);
|
|
|
- }
|
|
|
+ stopTrasactionTimer.Stop();
|
|
|
+ logger.Log(LogLevel.Critical, "ExecuteCoreRequest {action} {sessisonId} took {time} sec", action.ToString(), session.SessionID, stopTrasactionTimer.ElapsedMilliseconds / 1000);
|
|
|
+ logger.Log(LogLevel.Critical, "{action} {sessisonId} time {getDateTime}/{serviceTime}/{tagInfoTime}/{dbOpTime}", action.ToString(), session.SessionID, getDateTimeTime / 1000, getServiceTime / 1000, getTagInfoTime / 1000, dbOpTime / 1000);
|
|
|
+
|
|
|
}
|
|
|
break;
|
|
|
case Actions.Authorize:
|
|
@@ -842,14 +881,14 @@ internal partial class ProfileHandler
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (action == Actions.Heartbeat)
|
|
|
- {
|
|
|
+ //if (action == Actions.Heartbeat)
|
|
|
+ //{
|
|
|
watch.Stop();
|
|
|
if (watch.ElapsedMilliseconds / 1000 > 3)
|
|
|
{
|
|
|
- logger.LogError("Processing Hearbeat costs " + watch.ElapsedMilliseconds / 1000 + " seconds");
|
|
|
+ logger.LogError("Processing " + action.ToString() + " costs " + watch.ElapsedMilliseconds / 1000 + " seconds"); ;
|
|
|
}
|
|
|
- }
|
|
|
+ //}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -876,7 +915,7 @@ internal partial class ProfileHandler
|
|
|
operation.Status = 1;//電樁有回覆
|
|
|
operation.EVSE_Status = (int)_confirm.status;
|
|
|
operation.EVSE_Value = string.IsNullOrEmpty(_confirm.data) ? "" : _confirm.data;
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
if (_request.messageId == "ID_FirmwareVersion")
|
|
@@ -889,7 +928,7 @@ internal partial class ProfileHandler
|
|
|
db.Machine.Attach(machine);
|
|
|
machine.BoardVersions = _confirm.data;
|
|
|
db.Entry(machine).Property(x => x.BoardVersions).IsModified = true;
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1166,7 +1205,7 @@ internal partial class ProfileHandler
|
|
|
|
|
|
}); ;
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
|
|
|
using (var meterdb = await metervaluedbContextFactory.CreateDbContextAsync())
|
|
|
{
|
|
@@ -1251,7 +1290,7 @@ internal partial class ProfileHandler
|
|
|
|
|
|
}); ;
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
|
|
|
using (var meterdb = await metervaluedbContextFactory.CreateDbContextAsync())
|
|
|
{
|
|
@@ -1329,7 +1368,7 @@ internal partial class ProfileHandler
|
|
|
operation.Status = 1;//電樁有回覆
|
|
|
operation.EVSE_Status = (int)_confirm.status;
|
|
|
operation.EVSE_Value = _confirm.status.ToString();
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1351,7 +1390,7 @@ internal partial class ProfileHandler
|
|
|
operation.Status = 1;//電樁有回覆
|
|
|
operation.EVSE_Status = (int)_confirm.status;
|
|
|
operation.EVSE_Value = _confirm.status.ToString();
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1372,7 +1411,7 @@ internal partial class ProfileHandler
|
|
|
operation.Status = 1;//電樁有回覆
|
|
|
operation.EVSE_Status = (int)_confirm.status;
|
|
|
operation.EVSE_Value = _confirm.status.ToString();
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1393,7 +1432,7 @@ internal partial class ProfileHandler
|
|
|
operation.Status = 1;//電樁有回覆
|
|
|
operation.EVSE_Status = (int)_confirm.status;
|
|
|
operation.EVSE_Value = _confirm.status.ToString();
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1414,7 +1453,7 @@ internal partial class ProfileHandler
|
|
|
operation.Status = 1;//電樁有回覆
|
|
|
operation.EVSE_Status = (int)_confirm.status;
|
|
|
operation.EVSE_Value = _confirm.status.ToString();
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1460,7 +1499,7 @@ internal partial class ProfileHandler
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1554,7 +1593,7 @@ internal partial class ProfileHandler
|
|
|
|
|
|
}
|
|
|
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -1580,7 +1619,7 @@ internal partial class ProfileHandler
|
|
|
operation.Status = 1;//電樁有回覆
|
|
|
operation.EVSE_Status = (int)_confirm.status;
|
|
|
operation.EVSE_Value = _confirm.status.ToString();
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1635,7 +1674,7 @@ internal partial class ProfileHandler
|
|
|
operation.Status = 1;//電樁有回覆
|
|
|
operation.EVSE_Status = (int)255;//錯誤
|
|
|
operation.EVSE_Value = errorMsg;
|
|
|
- await db.SaveChangesAsync();
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
|
|
|
}
|