Przeglądaj źródła

1. 台泥版寫死DC/AC 個別費率 固定格式AC:$ 1/kWh;DC:$ 2/kWh

Jessica Tseng 3 lat temu
rodzic
commit
8536d34a2f

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

@@ -53,6 +53,10 @@ namespace EVCB_OCPP.WSServer.Message
 
         public int readerStatus { set; get; }
 
+        public string VEMData { set; get; }
+
+        public DateTime Timestamp { set; get; }
+
 
 
 
@@ -117,8 +121,26 @@ namespace EVCB_OCPP.WSServer.Message
                             {
                                 if (session.CustomerId == new Guid("009E603C-79CD-4620-A2B8-D9349C0E8AD8"))
                                 {
-                                    var creditDeductResult = JsonConvert.DeserializeObject<ID_ReaderStatus>(_request.data);
-                                    logger.Debug(JsonConvert.SerializeObject(creditDeductResult));
+                                    //var preauth_status = JsonConvert.DeserializeObject<ID_ReaderStatus>(_request.data);
+                                    //var report = new
+                                    //{
+                                    //    ChargeBoxId = session.ChargeBoxId,
+                                    //    ConnectorId = preauth_status.ConnectorId,
+                                    //    CreditNo = preauth_status.creditNo,
+                                    //    readerStatus = preauth_status.readerStatus,
+                                    //    SerialNo = preauth_status.SerialNo,
+                                    //    ApprovalNo = preauth_status.VEMData,
+                                    //    Timestamp = preauth_status.Timestamp                                    
+
+                                    //};
+
+                                    //var response = await httpClient.Post(GlobalConfig.TCC_API_URL + "preauth_status", new Dictionary<string, string>()
+                                    //    {
+                                    //        { "PartnerId",session.CustomerId.ToString()}
+
+                                    //    }, report, GlobalConfig.TCC_SALTKEY);
+
+                                    //logger.Debug(JsonConvert.SerializeObject(response));
                                     confirm.status = DataTransferStatus.Accepted;
                                 }
                             }

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

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("0f7be57")]
+[assembly: AssemblyInformationalVersion("39f88b4")]

+ 53 - 3
EVCB_OCPP.WSServer/ProtalServer.cs

@@ -812,8 +812,8 @@ namespace EVCB_OCPP.WSServer
                                                     OutRequest = JsonConvert.SerializeObject(
                                                          new ChangeConfigurationRequest()
                                                          {
-                                                              key= "TimeOffset",
-                                                              value= "+08:00"
+                                                             key = "TimeOffset",
+                                                             value = "+08:00"
 
                                                          },
                                                          new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore, Formatting = Formatting.None }),
@@ -1513,7 +1513,7 @@ namespace EVCB_OCPP.WSServer
 
                 if (min_Interval > 30)
                 {
-                   // Console.WriteLine("in...............ServerWeatherNotificationTrigger");
+                    // Console.WriteLine("in...............ServerWeatherNotificationTrigger");
                     BasicMessageHandler msgAnalyser = new BasicMessageHandler();
                     Dictionary<string, ClientData> _copyClientDic = null;
                     lock (_lockClientDic)
@@ -1839,6 +1839,56 @@ namespace EVCB_OCPP.WSServer
                 client.Currency = stationPrice.Currency;
                 client.ParkingFee = stationPrice.ParkingFee;
                 client.IsBilling = true;
+
+
+                if (client.CustomerId == new Guid("009E603C-79CD-4620-A2B8-D9349C0E8AD8"))
+                {
+                    if (displayPriceText.StartsWith("AC") || displayPriceText.StartsWith("DC"))
+                    {
+
+                        if (client.ChargeBoxId.StartsWith("D"))
+                        {
+
+                            var unitWords = displayPriceText.Split(';').ToList();
+                            int dcIndex = unitWords.FindIndex(x => x.Contains("DC"));
+                            displayPriceText = unitWords[dcIndex].Replace("DC:", "");
+                            var priceText = displayPriceText.Split('$')[1].TrimStart(' ').Split('/')[0]; ;
+                            var dc_UnitPrice = int.Parse(priceText);
+                            client.ChargingPrices = new List<ChargingPrice>()
+                          {
+                              new ChargingPrice()
+                              {
+                                   EndTime="23:59",
+                                   StartTime="00:00",
+                                   Fee=dc_UnitPrice
+                              }
+                          };
+
+
+                        }
+                        else
+                        {
+                            var unitWords = displayPriceText.Split(';').ToList();
+                            int dcIndex = unitWords.FindIndex(x => x.Contains("AC"));
+                            displayPriceText = unitWords[dcIndex].Replace("AC:", "");
+                            var priceText = displayPriceText.Split('$')[1].TrimStart(' ').Split('/')[0]; ;
+                            var ac_UnitPrice = int.Parse(priceText);
+                            client.ChargingPrices = new List<ChargingPrice>()
+                          {
+                              new ChargingPrice()
+                              {
+                                   EndTime="23:59",
+                                   StartTime="00:00",
+                                   Fee=ac_UnitPrice
+                              }
+                          };
+                            Console.WriteLine("Chargeboxid=>" + client.ChargeBoxId);
+                        }
+
+
+                    }
+
+                }
             }
 
             return displayPriceText;