Эх сурвалжийг харах

Fix Authorize 客人回覆 Block 沒有帶UserPrice問題

Jessica Tseng 2 жил өмнө
parent
commit
6c4fbb32dc

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

@@ -431,7 +431,7 @@ namespace EVCB_OCPP.WSServer.Message
                                 var authorization_result = await businessService.Authorize(session.ChargeBoxId, _request.idTag);
                                 _idTagInfo = authorization_result.IdTagInfo;
 
-                                if (authorization_result.ChargePointFee != null)
+                                if (_idTagInfo.status == AuthorizationStatus.Accepted && authorization_result.ChargePointFee != null)
                                 {
                                     var price = authorization_result.ChargePointFee.Where(x => x.IsAC == session.IsAC).First();
                                     if (price != null)
@@ -717,7 +717,7 @@ namespace EVCB_OCPP.WSServer.Message
                                 var authorization_result = await businessService.Authorize(session.ChargeBoxId, _request.idTag);
                                 confirm.idTagInfo = authorization_result.IdTagInfo;
 
-                                if (authorization_result.ChargePointFee != null)
+                                if (confirm.idTagInfo.status== AuthorizationStatus.Accepted && authorization_result.ChargePointFee != null)
                                 {
                                     var price = authorization_result.ChargePointFee.Where(x => x.IsAC == session.IsAC).First();
                                     if (price != null)

+ 1 - 1
EVCB_OCPP.WSServer/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("1.0.6.0")]
 [assembly: AssemblyFileVersion("1.0.6.0")]
 
-[assembly: AssemblyInformationalVersion("20f1995")]
+[assembly: AssemblyInformationalVersion("1f1d0f0")]

+ 1 - 1
EVCB_OCPP.WSServer/ProtalServer.cs

@@ -119,7 +119,7 @@ namespace EVCB_OCPP.WSServer
                 Console.WriteLine("Please check App.Config setting .");
                 return;
             }
-            ReadTCCSetting();
+            //ReadTCCSetting();
             OpenNetwork();
 
             Task serverCommandTask = new Task(ServerMessageTrigger, _ct);

+ 11 - 3
EVCB_OCPP.WSServer/Service/OuterBusinessService.cs

@@ -101,21 +101,29 @@ namespace EVCB_OCPP.WSServer.Service
 
                     if (jo.ContainsKey("ChargePointFee"))
                     {
-                        result.ChargePointFee = new List<ChargePointFee>();
+                       
 
                         for(int i=0;i< jo["ChargePointFee"].Count();i++)
                         {
+                            if(i==0)
+                            {
+                                result.ChargePointFee = new List<ChargePointFee>();
+                            }
                             result.ChargePointFee.Add(jo["ChargePointFee"][i].ToObject<ChargePointFee>());
                         }
                      
                     }
 
                     if (jo.ContainsKey("ChargepointFee"))
-                    {
-                        result.ChargePointFee = new List<ChargePointFee>();
+                    {                       
 
                         for (int i = 0; i < jo["ChargepointFee"].Count(); i++)
                         {
+                            if (i == 0)
+                            {
+                                result.ChargePointFee = new List<ChargePointFee>();
+                            }
+
                             result.ChargePointFee.Add(jo["ChargepointFee"][i].ToObject<ChargePointFee>());
                         }
 

BIN
SuperWebSocket/bin/Debug/SuperWebSocket.dll


BIN
SuperWebSocket/bin/Debug/SuperWebSocket.pdb