协议修改涉及的尖峰平谷下发

master
xjl 4 months ago
parent 4f376c5567
commit 9ebee1fb61

@ -99,7 +99,7 @@ public class ChargerService
{ {
if (chargerClientsValue.Connected) if (chargerClientsValue.Connected)
{ {
chargerClientsValue.SendSetPeakValleyTime(BulidSetPeakValleyTimeObj(version)); chargerClientsValue.SendSetPeakValleyTime(chargerClientsValue.BulidSetPeakValleyTimeObj(version));
} }
} }

@ -766,7 +766,7 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
public SetPeakValleyTime BulidSetPeakValleyTimeObj(int version) public SetPeakValleyTime BulidSetPeakValleyTimeObj(int version)
{ {
List<ElecPriceModelVersionDetail> elecPriceModelVersionDetails = List<ElecPriceModelVersionDetail> elecPriceModelVersionDetails =
_elecPriceModelVersionDetailRepository.QueryListByClause(u => u.Version == version, u => u.StartHour, _elecPriceModelVersionDetailRepository.QueryListByClause(u => u.Version == version, u => u.Id,
OrderByType.Asc); OrderByType.Asc);
SetPeakValleyTime setPeakValleyTime = new SetPeakValleyTime() SetPeakValleyTime setPeakValleyTime = new SetPeakValleyTime()
{ {
@ -779,6 +779,13 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
StartHH6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].StartHour):0), StartHH6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].StartHour):0),
StartHH7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].StartHour):0), StartHH7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].StartHour):0),
StartHH8 = (byte)(elecPriceModelVersionDetails.Count > 7?Convert.ToByte(elecPriceModelVersionDetails[7].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), StartMM1 = (byte)(elecPriceModelVersionDetails.Count > 0?Convert.ToByte(elecPriceModelVersionDetails[0].StartMinute):0),
StartMM2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].StartMinute):0), StartMM2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].StartMinute):0),
StartMM3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].StartMinute):0), StartMM3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].StartMinute):0),
@ -787,6 +794,14 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
StartMM6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].StartMinute):0), StartMM6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].StartMinute):0),
StartMM7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].StartMinute) : 0), StartMM7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].StartMinute) : 0),
StartMM8 = (byte)(elecPriceModelVersionDetails.Count > 7 ? Convert.ToByte(elecPriceModelVersionDetails[7].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), TimePeak1 = (byte)(elecPriceModelVersionDetails.Count > 0 ? Convert.ToByte(elecPriceModelVersionDetails[0].Type):0),
TimePeak2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].Type):0), TimePeak2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].Type):0),
TimePeak3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].Type):0), TimePeak3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].Type):0),
@ -794,7 +809,13 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
TimePeak5 = (byte)(elecPriceModelVersionDetails.Count > 4?Convert.ToByte(elecPriceModelVersionDetails[4].Type):0), TimePeak5 = (byte)(elecPriceModelVersionDetails.Count > 4?Convert.ToByte(elecPriceModelVersionDetails[4].Type):0),
TimePeak6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].Type):0), TimePeak6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].Type):0),
TimePeak7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].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; return setPeakValleyTime;
} }

Loading…
Cancel
Save