From 9ebee1fb61dbc37fc386362686c66a4a9603cc98 Mon Sep 17 00:00:00 2001 From: xjl <2595686544@qq.com> Date: Tue, 23 Jul 2024 15:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E4=BF=AE=E6=94=B9=E6=B6=89?= =?UTF-8?q?=E5=8F=8A=E7=9A=84=E5=B0=96=E5=B3=B0=E5=B9=B3=E8=B0=B7=E4=B8=8B?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Charger/ChargerService.cs | 2 +- Service/Charger/Client/ChargerClient.cs | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Service/Charger/ChargerService.cs b/Service/Charger/ChargerService.cs index 256f4f6..d4d5d02 100644 --- a/Service/Charger/ChargerService.cs +++ b/Service/Charger/ChargerService.cs @@ -99,7 +99,7 @@ public class ChargerService { if (chargerClientsValue.Connected) { - chargerClientsValue.SendSetPeakValleyTime(BulidSetPeakValleyTimeObj(version)); + chargerClientsValue.SendSetPeakValleyTime(chargerClientsValue.BulidSetPeakValleyTimeObj(version)); } } diff --git a/Service/Charger/Client/ChargerClient.cs b/Service/Charger/Client/ChargerClient.cs index 58fd2d2..5adb998 100644 --- a/Service/Charger/Client/ChargerClient.cs +++ b/Service/Charger/Client/ChargerClient.cs @@ -766,7 +766,7 @@ public class ChargerClient : TcpClient public SetPeakValleyTime BulidSetPeakValleyTimeObj(int version) { List elecPriceModelVersionDetails = - _elecPriceModelVersionDetailRepository.QueryListByClause(u => u.Version == version, u => u.StartHour, + _elecPriceModelVersionDetailRepository.QueryListByClause(u => u.Version == version, u => u.Id, OrderByType.Asc); SetPeakValleyTime setPeakValleyTime = new SetPeakValleyTime() { @@ -779,6 +779,13 @@ public class ChargerClient : TcpClient StartHH6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].StartHour):0), StartHH7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].StartHour):0), StartHH8 = (byte)(elecPriceModelVersionDetails.Count > 7?Convert.ToByte(elecPriceModelVersionDetails[7].StartHour) : 0), + StartHH9 = (byte)(elecPriceModelVersionDetails.Count > 8?Convert.ToByte(elecPriceModelVersionDetails[8].StartHour) : 0), + StartHH10 = (byte)(elecPriceModelVersionDetails.Count > 9?Convert.ToByte(elecPriceModelVersionDetails[9].StartHour) : 0), + StartHH11 = (byte)(elecPriceModelVersionDetails.Count > 10?Convert.ToByte(elecPriceModelVersionDetails[10].StartHour) : 0), + StartHH12 = (byte)(elecPriceModelVersionDetails.Count > 11?Convert.ToByte(elecPriceModelVersionDetails[11].StartHour) : 0), + StartHH13 = (byte)(elecPriceModelVersionDetails.Count > 12?Convert.ToByte(elecPriceModelVersionDetails[12].StartHour) : 0), + StartHH14 = (byte)(elecPriceModelVersionDetails.Count > 13?Convert.ToByte(elecPriceModelVersionDetails[13].StartHour) : 0), + StartMM1 = (byte)(elecPriceModelVersionDetails.Count > 0?Convert.ToByte(elecPriceModelVersionDetails[0].StartMinute):0), StartMM2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].StartMinute):0), StartMM3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].StartMinute):0), @@ -787,6 +794,14 @@ public class ChargerClient : TcpClient StartMM6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].StartMinute):0), StartMM7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].StartMinute) : 0), StartMM8 = (byte)(elecPriceModelVersionDetails.Count > 7 ? Convert.ToByte(elecPriceModelVersionDetails[7].StartMinute) : 0), + StartMM9 = (byte)(elecPriceModelVersionDetails.Count > 8 ? Convert.ToByte(elecPriceModelVersionDetails[8].StartMinute) : 0), + StartMM10 = (byte)(elecPriceModelVersionDetails.Count > 9 ? Convert.ToByte(elecPriceModelVersionDetails[9].StartMinute) : 0), + StartMM11 = (byte)(elecPriceModelVersionDetails.Count > 10 ? Convert.ToByte(elecPriceModelVersionDetails[10].StartMinute) : 0), + StartMM12 = (byte)(elecPriceModelVersionDetails.Count > 11 ? Convert.ToByte(elecPriceModelVersionDetails[11].StartMinute) : 0), + StartMM13 = (byte)(elecPriceModelVersionDetails.Count > 12 ? Convert.ToByte(elecPriceModelVersionDetails[12].StartMinute) : 0), + StartMM14 = (byte)(elecPriceModelVersionDetails.Count > 13 ? Convert.ToByte(elecPriceModelVersionDetails[13].StartMinute) : 0), + + TimePeak1 = (byte)(elecPriceModelVersionDetails.Count > 0 ? Convert.ToByte(elecPriceModelVersionDetails[0].Type):0), TimePeak2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].Type):0), TimePeak3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].Type):0), @@ -794,7 +809,13 @@ public class ChargerClient : TcpClient TimePeak5 = (byte)(elecPriceModelVersionDetails.Count > 4?Convert.ToByte(elecPriceModelVersionDetails[4].Type):0), TimePeak6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].Type):0), TimePeak7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].Type):0), - TimePeak8 = (byte)(elecPriceModelVersionDetails.Count > 7?Convert.ToByte(elecPriceModelVersionDetails[7].Type):0) + TimePeak8 = (byte)(elecPriceModelVersionDetails.Count > 7?Convert.ToByte(elecPriceModelVersionDetails[7].Type):0), + TimePeak9 = (byte)(elecPriceModelVersionDetails.Count > 8?Convert.ToByte(elecPriceModelVersionDetails[8].Type):0), + TimePeak10 = (byte)(elecPriceModelVersionDetails.Count > 9?Convert.ToByte(elecPriceModelVersionDetails[9].Type):0), + TimePeak11 = (byte)(elecPriceModelVersionDetails.Count > 10 ? Convert.ToByte(elecPriceModelVersionDetails[10].Type):0), + TimePeak12 = (byte)(elecPriceModelVersionDetails.Count > 11?Convert.ToByte(elecPriceModelVersionDetails[11].Type):0), + TimePeak13 = (byte)(elecPriceModelVersionDetails.Count > 12?Convert.ToByte(elecPriceModelVersionDetails[12].Type):0), + TimePeak14 = (byte)(elecPriceModelVersionDetails.Count > 13?Convert.ToByte(elecPriceModelVersionDetails[13].Type):0), }; return setPeakValleyTime; }