Ver Fonte

1. stopTransaction Auth 去後台驗證

Jessica Tseng há 3 anos atrás
pai
commit
f620e8a93e
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      EVCB_OCPP.WSServer/Message/CoreProfileHandler.cs

+ 3 - 2
EVCB_OCPP.WSServer/Message/CoreProfileHandler.cs

@@ -199,7 +199,7 @@ namespace EVCB_OCPP.WSServer.Message
 
                             // });
 
-                            var confirm = new HeartbeatConfirmation() { currentTime = DateTime.Now };
+                            var confirm = new HeartbeatConfirmation() { currentTime = DateTime.Now.AddHours(-6) };
                             result.Message = confirm;
                             result.Success = true;
                         }
@@ -328,7 +328,8 @@ namespace EVCB_OCPP.WSServer.Message
                             int _ConnectorId = 0;
 
                             var businessService = BusinessServiceFactory.CreateBusinessService(session.CustomerId.ToString());
-                            var _idTagInfo = new IdTagInfo() { status = AuthorizationStatus.Accepted };
+                            var _idTagInfo = _request.idTag == "Backend" ? new IdTagInfo() { expiryDate = DateTime.UtcNow.AddDays(1), status = AuthorizationStatus.Accepted } : await businessService.Authorize(session.ChargeBoxId, _request.idTag);
+
 
 
                             using (var db = new MainDBContext())