Browse Source

1. ** Fix 系統時間下發問題
2.stopTransaction 如果電樁沒有提供Idtag 驗證內容就回null

Jessica Tseng 3 years ago
parent
commit
87b474189f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      EVCB_OCPP.WSServer/Message/CoreProfileHandler.cs

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

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