|
|
@ -1580,87 +1580,87 @@ namespace BatCharging.Service
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour1));
|
|
|
|
lstContent.Add(CMD.startHour1);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute1));
|
|
|
|
lstContent.Add(CMD.startMinute1);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour1));
|
|
|
|
lstContent.Add(CMD.endHour1);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute1));
|
|
|
|
lstContent.Add(CMD.endMinute1);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate1));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour2));
|
|
|
|
lstContent.Add(CMD.startHour2);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute2));
|
|
|
|
lstContent.Add(CMD.startMinute2);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour2));
|
|
|
|
lstContent.Add(CMD.endHour2);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute2));
|
|
|
|
lstContent.Add(CMD.endMinute2);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate2));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate2));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate2));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate2));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour3));
|
|
|
|
lstContent.Add(CMD.startHour3);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute3));
|
|
|
|
lstContent.Add(CMD.startMinute3);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour3));
|
|
|
|
lstContent.Add(CMD.endHour3);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute3));
|
|
|
|
lstContent.Add(CMD.endMinute3);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate3));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate3));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate3));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate3));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour4));
|
|
|
|
lstContent.Add(CMD.startHour4);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute4));
|
|
|
|
lstContent.Add(CMD.startMinute4);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour4));
|
|
|
|
lstContent.Add(CMD.endHour4);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute4));
|
|
|
|
lstContent.Add(CMD.endMinute4);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate4));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate4));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate4));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate4));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour5));
|
|
|
|
lstContent.Add(CMD.startHour5);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute5));
|
|
|
|
lstContent.Add(CMD.startMinute5);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour5));
|
|
|
|
lstContent.Add(CMD.endHour5);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute5));
|
|
|
|
lstContent.Add(CMD.endMinute5);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate5));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate5));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate5));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate5));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour6));
|
|
|
|
lstContent.Add(CMD.startHour6);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute6));
|
|
|
|
lstContent.Add(CMD.startMinute6);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour6));
|
|
|
|
lstContent.Add(CMD.endHour6);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute6));
|
|
|
|
lstContent.Add(CMD.endMinute6);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate6));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate6));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate6));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate6));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour7));
|
|
|
|
lstContent.Add(CMD.startHour7);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute7));
|
|
|
|
lstContent.Add(CMD.startMinute7);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour7));
|
|
|
|
lstContent.Add(CMD.endHour7);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute7));
|
|
|
|
lstContent.Add(CMD.endMinute7);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate7));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate7));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate7));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate7));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour8));
|
|
|
|
lstContent.Add(CMD.startHour8);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute8));
|
|
|
|
lstContent.Add(CMD.startMinute8);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour8));
|
|
|
|
lstContent.Add(CMD.endHour8);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute8));
|
|
|
|
lstContent.Add(CMD.endMinute8);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate8));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate8));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate8));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate8));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour9));
|
|
|
|
lstContent.Add(CMD.startHour9);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute9));
|
|
|
|
lstContent.Add(CMD.startMinute9);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour9));
|
|
|
|
lstContent.Add(CMD.endHour9);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute9));
|
|
|
|
lstContent.Add(CMD.endMinute9);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate9));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate9));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate9));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate9));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour10));
|
|
|
|
lstContent.Add(CMD.startHour10);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute10));
|
|
|
|
lstContent.Add(CMD.startMinute10);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour10));
|
|
|
|
lstContent.Add(CMD.endHour10);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute10));
|
|
|
|
lstContent.Add(CMD.endMinute10);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate10));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate10));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate10));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate10));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour11));
|
|
|
|
lstContent.Add(CMD.startHour11);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute11));
|
|
|
|
lstContent.Add(CMD.startMinute11);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour11));
|
|
|
|
lstContent.Add(CMD.endHour11);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute11));
|
|
|
|
lstContent.Add(CMD.endMinute11);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate11));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate11));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate11));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate11));
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startHour12));
|
|
|
|
lstContent.Add(CMD.startHour12);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.startMinute12));
|
|
|
|
lstContent.Add(CMD.startMinute12);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endHour12));
|
|
|
|
lstContent.Add(CMD.endHour12);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.endMinute12));
|
|
|
|
lstContent.Add(CMD.endMinute12);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate12));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.rate12));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate12));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserveRate12));
|
|
|
|
|
|
|
|
|
|
|
@ -1738,8 +1738,28 @@ namespace BatCharging.Service
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 针对CMD1301 充电卡号 不足30byte补\0
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="byteArray"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public byte[] AddByteArray(byte[] byteArray, int len)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
byte[] result = new byte[len];
|
|
|
|
|
|
|
|
if (byteArray != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (byteArray.Length <= len)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Array.Copy(byteArray, result, byteArray.Length);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取鉴权消息体字节数组
|
|
|
|
/// 获取鉴权消息体字节数组
|
|
|
|
|
|
|
|
/// 白名单1-充电卡号 32byte\2-VIN码 17byte
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="auth"></param>
|
|
|
|
/// <param name="auth"></param>
|
|
|
|
/// <returns>鉴权消息体字节数组</returns>
|
|
|
|
/// <returns>鉴权消息体字节数组</returns>
|
|
|
@ -1751,22 +1771,41 @@ namespace BatCharging.Service
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserved1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserved1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserved2));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserved2));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.chargingStationCode));
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.chargingStationCode), 32));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.whitelistType));
|
|
|
|
lstContent.Add(CMD.whitelistType);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.operation));
|
|
|
|
lstContent.Add(CMD.operation);
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.whitelistVersionNum));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.whitelistVersionNum));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.DistributeWhitelistNum));
|
|
|
|
//操作为查询 即=4,后面字段不需要
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum01));
|
|
|
|
if (CMD.operation != 4)
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum02));
|
|
|
|
{
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum03));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.DistributeWhitelistNum));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum04));
|
|
|
|
if (CMD.whitelistType == 1)
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum05));
|
|
|
|
{
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum06));
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum01), 32));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum07));
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum02), 32));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum08));
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum03), 32));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum09));
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum04), 32));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.carVinOrChargCardNum10));
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum05), 32));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum06), 32));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum07), 32));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum08), 32));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum09), 32));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum10), 32));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum01), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum02), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum03), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum04), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum05), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum06), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum07), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum08), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum09), 17));
|
|
|
|
|
|
|
|
lstContent.AddRange(AddByteArray(Encoding.ASCII.GetBytes(CMD.carVinOrChargCardNum10), 17));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
results = lstContent.ToArray();
|
|
|
|
results = lstContent.ToArray();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return results;
|
|
|
|
return results;
|
|
|
@ -1811,8 +1850,19 @@ namespace BatCharging.Service
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
List<byte> lstContent = new List<byte>();
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserved1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserved1));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserved2));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.reserved2));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(CMD.UpgradeSoftwareFileVersionNum));
|
|
|
|
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.ftpServerIPaddress));
|
|
|
|
lstContent.AddRange(BitConverter.GetBytes(Convert.ToUInt16(CMD.UpgradeSoftwareFileVersionNum) * 100));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string[] parts = CMD.ftpServerIPaddress.Split(".");
|
|
|
|
|
|
|
|
if (parts.Length == 4)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
lstContent.Add(byte.Parse(parts[0]));
|
|
|
|
|
|
|
|
lstContent.Add(byte.Parse(parts[1]));
|
|
|
|
|
|
|
|
lstContent.Add(byte.Parse(parts[2]));
|
|
|
|
|
|
|
|
lstContent.Add(byte.Parse(parts[3]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.ftpUserName));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.ftpUserName));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.ftpPassWord));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.ftpPassWord));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.ftpDownloadPath));
|
|
|
|
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.ftpDownloadPath));
|
|
|
|