|
@@ -34,7 +34,19 @@ namespace EVCB_OCPP.WEBAPI.Services
|
|
|
parameters.Add("@MachineId", machineId, DbType.String, ParameterDirection.Input);
|
|
|
parameters.Add("@LastUpdatedTime", lastUpdatedOn, DbType.DateTime, ParameterDirection.Output);
|
|
|
conn.Execute("GetBasicInfoLastUpdatedTimeById", parameters, commandType: System.Data.CommandType.StoredProcedure);
|
|
|
- lastUpdatedOn = DateTime.SpecifyKind(parameters.Get<DateTime>("@LastUpdatedTime"), DateTimeKind.Utc);
|
|
|
+ DateTime? time = null;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ time = parameters.Get<DateTime>("@LastUpdatedTime");
|
|
|
+
|
|
|
+ }
|
|
|
+ catch(Exception ex)
|
|
|
+ {
|
|
|
+ time = DateTime.UtcNow;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ lastUpdatedOn = DateTime.SpecifyKind(time.Value, DateTimeKind.Utc);
|
|
|
|
|
|
|
|
|
}
|
|
@@ -96,11 +108,12 @@ namespace EVCB_OCPP.WEBAPI.Services
|
|
|
{
|
|
|
var parameters = new DynamicParameters();
|
|
|
parameters.Add("@Id", machineId, DbType.String, ParameterDirection.Input);
|
|
|
- string strSql = "Select ChargeBoxId,RatedPower,Online,OfflineOn ,GunAmt,Latitude,Longitude,ConnectorType from [dbo].[Machine] where Id=@Id and IsDelete=0; ";
|
|
|
+ string strSql = "Select ChargeBoxId,ChargePointSerialNumber,ChargePointModel,RatedPower,Online,OfflineOn ,GunAmt,Latitude,Longitude,ConnectorType from [dbo].[Machine] where Id=@Id and IsDelete=0; ";
|
|
|
_machine = conn.Query<Machine>(strSql, parameters).FirstOrDefault();
|
|
|
}
|
|
|
if (_machine != null)
|
|
|
{
|
|
|
+ cp.ChargeBoxSystemID = _machine.ChargePointModel+_machine.ChargePointSerialNumber;
|
|
|
cp.ChargeBoxId = _machine.ChargeBoxId;
|
|
|
cp.NumberofConnectors = _machine.GunAmt;
|
|
|
cp.RatedPower = _machine.RatedPower;
|