更新站控新协议、同步部分字段和cmd

master
tq 1 month ago
parent c9311417ea
commit aba8ee8f68

@ -0,0 +1,61 @@
namespace Entity.Dto.Req;
/// <summary>
/// 上传换电订单电池列表
/// </summary>
public class SwapOrderBatteryRecord
{
/// <summary>
/// 出仓安装电池序列号
/// </summary>
public string outBatteryNo { get; set; }
/// <summary>
/// 出仓安装电池SOC
/// </summary>
public int outSoc { get; set; }
/// <summary>
/// 取车电池上次换电结算时 的SOC
/// </summary>
public int lastSoc { get; set; }
/// <summary>
/// 出仓安装电池的SOE
/// 单位:kWh,保留两位小数
/// </summary>
public float outSoe { get; set; }
/// <summary>
/// 取车电池上次换电结算时 的 SOE
/// 单位:kWh,保留两位小数
/// </summary>
public float lastSoe { get; set; }
/// <summary>
/// 拆卸入仓电池序列号
/// </summary>
public string enterBatteryNo { get; set; }
/// <summary>
/// 拆卸入仓电池SOC
/// 单位:kWh,保留两位小数
/// </summary>
public int enterSoc { get; set; }
/// <summary>
/// 拆卸入仓电池SOE
/// 单位:kWh,保留两位小数
/// </summary>
public float enterSoe { get; set; }
/// <summary>
/// 出仓安装地仓位号
/// </summary>
public int? outBin { get; set; }
/// <summary>
/// 拆卸入仓池仓位号
/// </summary>
public int? enterBin { get; set; }
}

@ -307,13 +307,13 @@ public class CloudClient : IMqttClientConnectedHandler, IMqttApplicationMessageR
{ {
Model<T> model = new Model<T> Model<T> model = new Model<T>
{ {
Header = new Header() header = new Header()
{ {
cmd = data.GetCmd(), cmd = data.GetCmd(),
cipherFlag = Encrypt, cipherFlag = Encrypt,
id = GetIncrementId(), id = GetIncrementId(),
sid = StationNo, stationNo = StationNo,
timeStamp = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000 timestamp = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000
}, },
body = data body = data
}; };
@ -349,7 +349,7 @@ public class CloudClient : IMqttClientConnectedHandler, IMqttApplicationMessageR
NullValueHandling = NullValueHandling.Ignore NullValueHandling = NullValueHandling.Ignore
}; };
string body = JsonConvert.SerializeObject(model.body, settings); string body = JsonConvert.SerializeObject(model.body, settings);
return MD5Util.MD5Encrypt32(body + ":" + model.Header.timeStamp + ":" + model.Header.id).ToLower(); return MD5Util.MD5Encrypt32(body + ":" + model.header.timestamp + ":" + model.header.id).ToLower();
} }
/// <summary> /// <summary>
@ -726,36 +726,36 @@ public class CloudClient : IMqttClientConnectedHandler, IMqttApplicationMessageR
SwapOrder? swapOrder = SwapOrderRepository.QueryByClause(it => it.Sn == swapOrderSn); SwapOrder? swapOrder = SwapOrderRepository.QueryByClause(it => it.Sn == swapOrderSn);
ChargeRecordUpLoad req = new ChargeRecordUpLoad() ChargeRecordUpLoad req = new ChargeRecordUpLoad()
{ {
chrsn = chargeOrder.CloudChargeOrder, chargeOrderNo = chargeOrder.CloudChargeOrder,
son = swapOrder?.CloudSn, swapOrderNo = swapOrder?.CloudSn,
bid = chargeOrder.BatteryNo, batteryNo = chargeOrder.BatteryNo,
st = chargeOrder.StartTime ?? DateTime.Now, startTime = chargeOrder.StartTime ?? DateTime.Now,
et = lastChargeOrder.EndTime ?? DateTime.Now, endTime = lastChargeOrder.EndTime ?? DateTime.Now,
ssoc = chargeOrder.StartSoc ?? 0, startSoc = chargeOrder.StartSoc ?? 0,
esoc = lastChargeOrder.StopSoc ?? 0, endSoc = lastChargeOrder.StopSoc ?? 0,
//ssoe = chargeOrder.soe //ssoe = chargeOrder.soe
//esoe //esoe
dcce =0, directCurrent =0,
acce =0, acMeter =0,
tp = 0, theTipElectric = 0,
pp = 0, peakElectric = 0,
fp = 0, flatElectric = 0,
vp = 0, theValleyElectric = 0,
ct = 0, chargerTime = 0,
cn = orders.Count, chargerFrequency = orders.Count,
sfs = op, reportType = op,
vin = swapOrder?.VehicleVin, vin = swapOrder?.VehicleVin,
sfoc = 0, chargerType = 0,
}; };
foreach (ChargeOrder order in orders) foreach (ChargeOrder order in orders)
{ {
req.dcce += Convert.ToSingle(order.StopDcElec ?? 0 - order.StartDcElec ?? 0); req.directCurrent += Convert.ToSingle(order.StopDcElec ?? 0 - order.StartDcElec ?? 0);
req.acce += Convert.ToSingle(order.StopAcElec ?? 0 - order.StartAcElec ?? 0); req.acMeter += Convert.ToSingle(order.StopAcElec ?? 0 - order.StartAcElec ?? 0);
req.tp += Convert.ToSingle(order.SharpElecCount); req.theTipElectric += Convert.ToSingle(order.SharpElecCount);
req.pp += Convert.ToSingle(order.PeakElecCount); req.peakElectric += Convert.ToSingle(order.PeakElecCount);
req.fp += Convert.ToSingle(order.FlatElecCount); req.flatElectric += Convert.ToSingle(order.FlatElecCount);
req.vp += Convert.ToSingle(order.ValleyElecCount); req.theValleyElectric += Convert.ToSingle(order.ValleyElecCount);
req.ct += ((order.EndTime ?? DateTime.Now).Subtract(order.StartTime ?? DateTime.Now)).Minutes; req.chargerTime += ((order.EndTime ?? DateTime.Now).Subtract(order.StartTime ?? DateTime.Now)).Minutes;
} }
this.SendChargeRecordUpLoad(req); this.SendChargeRecordUpLoad(req);

@ -83,7 +83,7 @@ public class CloudClientMgr
#region 遥测合并上报 #region 遥测合并上报
req.datainfo = new List<DataInfo>(); req.chargeDevDataList = new List<DataInfo>();
redisHelper?.GetSubscriber().Subscribe("UploadTelemetryData", (channel, value) => redisHelper?.GetSubscriber().Subscribe("UploadTelemetryData", (channel, value) =>
{ {
try try
@ -98,48 +98,48 @@ public class CloudClientMgr
BinInfo? binInfo = binInfoRepository.QueryByClause(it => it.ChargerNo == data.ChargerNo); BinInfo? binInfo = binInfoRepository.QueryByClause(it => it.ChargerNo == data.ChargerNo);
//ChargeDevDataInfo req = new ChargeDevDataInfo(); //ChargeDevDataInfo req = new ChargeDevDataInfo();
req.sn = StaticStationInfo.StationNo; req.stationNo = StaticStationInfo.StationNo;
DataInfo dataInfo = new DataInfo(); DataInfo dataInfo = new DataInfo();
dataInfo.en = StaticStationInfo.StationNo + data.ChargerNo; dataInfo.equipmentNo = StaticStationInfo.StationNo + data.ChargerNo;
var areNotEqual = !dataInfo.en.Equals( var areNotEqual = !dataInfo.equipmentNo.Equals(
req.datainfo.Select(d => d.en) req.chargeDevDataList.Select(d => d.equipmentNo)
.ToList() .ToList()
.Any(x => x == dataInfo.en)); .Any(x => x == dataInfo.equipmentNo));
if (areNotEqual)//如果没有重复的 if (areNotEqual)//如果没有重复的
{ {
dataInfo.sd = "A" + int.Parse(binInfo.No); dataInfo.chargerId = "A" + int.Parse(binInfo.No);
dataInfo.mtp = StaticStationInfo.ChargePower; dataInfo.highPower = StaticStationInfo.ChargePower;
dataInfo.mcr = 1; dataInfo.highSpeed = 1;
dataInfo.hb = binInfo?.Exists ?? 0; dataInfo.isThereAnyBattery = binInfo?.Exists ?? 0;
dataInfo.el = 0; dataInfo.electronicStreet = 0;
dataInfo.cno = int.Parse(binInfo.No); dataInfo.chargerNo = int.Parse(binInfo.No);
dataInfo.cs = binInfo.ChargeStatus ?? 0; dataInfo.chargerStatus = binInfo.ChargeStatus ?? 0;
dataInfo.fs = 0; dataInfo.faultStatus = 0;
dataInfo.@as = 0; dataInfo.alarmStatus = 0;
//fc = data., //fc = data.,
//st = data., //st = data.,
dataInfo.ct = data.ChargingTime; dataInfo.chargerTime = data.ChargingTime;
//ssoc = data., //ssoc = data.,
dataInfo.csoc = data.CurrentSoc; dataInfo.soc = data.CurrentSoc;
//ssoe = data., //ssoe = data.,
//csoe = data., //csoe = data.,
dataInfo.cvot = data.BmsChargingVoltage; dataInfo.voltage = data.BmsChargingVoltage;
dataInfo.ccur = data.BmsChargingCurrent; dataInfo.electricCurrent = data.BmsChargingCurrent;
dataInfo.nvot = data.BmsNeedVoltage; dataInfo.bmsVoltage = data.BmsNeedVoltage;
dataInfo.ncur = data.BmsNeedCurrent; dataInfo.bmsElectricCurrent = data.BmsNeedCurrent;
dataInfo.lsv = data.SingleBatteryMinVoltage; dataInfo.lowVoltage = data.SingleBatteryMinVoltage;
dataInfo.hsv = data.SingleBatteryMaxVoltage; dataInfo.highVoltage = data.SingleBatteryMaxVoltage;
dataInfo.lst = data.MinBatteryTemp; dataInfo.lowTemperature = data.MinBatteryTemp;
dataInfo.hst = data.MaxBatteryTemp; dataInfo.highTemperature = data.MaxBatteryTemp;
dataInfo.ws = 0xFF; dataInfo.waterCoolingStatus = 0xFF;
dataInfo.it = 0xFF; dataInfo.intakeTemperature = 0xFF;
dataInfo.ot = 0xFF; dataInfo.outletTemperature = 0xFF;
dataInfo.bt = DateTime.Now; dataInfo.updateTime = DateTime.Now;
if (req.datainfo.Count < 7) if (req.chargeDevDataList.Count < 7)
{ {
req.datainfo.Add(dataInfo); req.chargeDevDataList.Add(dataInfo);
} }
} }
@ -150,12 +150,12 @@ public class CloudClientMgr
} }
_dateTime = DateTime.Now; _dateTime = DateTime.Now;
if (req.datainfo.Count > 0) if (req.chargeDevDataList.Count > 0)
{ {
CloudClient?.SendChargeDevDataInfo(req); CloudClient?.SendChargeDevDataInfo(req);
req = new ChargeDevDataInfo(); req = new ChargeDevDataInfo();
req.datainfo = new List<DataInfo>(); req.chargeDevDataList = new List<DataInfo>();
} }
Log.Info($"receive UploadTelemetryData={value}"); Log.Info($"receive UploadTelemetryData={value}");
@ -197,7 +197,6 @@ public class CloudClientMgr
StartAsyncLoop(); StartAsyncLoop();
} }

@ -14,8 +14,8 @@ public class CloudConst
public static readonly string signInRes = "signInRes"; public static readonly string signInRes = "signInRes";
public static readonly string devList = "devList"; public static readonly string devList = "devList";
public static readonly string devListRep = "devListRep"; public static readonly string devListRep = "devListRep";
public static readonly string staSwapRecord = "staSwapRecord"; public static readonly string staSwapRecord = "uploadSwapOrder";
public static readonly string staSwapRecordRes = "staSwapRecordRes"; public static readonly string staSwapRecordRes = "uploadSwapOrderRes";
public static readonly string ChargeRecordReport = "ChargeRecordReport"; public static readonly string ChargeRecordReport = "ChargeRecordReport";
public static readonly string ChargeRecordReportsRes = "ChargeRecordReportsRes"; public static readonly string ChargeRecordReportsRes = "ChargeRecordReportsRes";
public static readonly string stationRunStatus = "stationRunStatus"; public static readonly string stationRunStatus = "stationRunStatus";
@ -34,10 +34,10 @@ public class CloudConst
public static readonly string eqmStateEndLogInfoRes = "eqmStateEndLogInfoRes"; public static readonly string eqmStateEndLogInfoRes = "eqmStateEndLogInfoRes";
public static readonly string chargeDevDataInfo = "chargeDevDataInfo"; public static readonly string chargeDevDataInfo = "chargeDevDataInfo";
public static readonly string chargeDevDataInfoRes = "chargeDevDataInfoRes"; public static readonly string chargeDevDataInfoRes = "chargeDevDataInfoRes";
public static readonly string batDataInfo = "batDataInfo"; public static readonly string batDataInfo = "batteryDataInfo";
public static readonly string batDataInfoRes = "batDataInfoRes"; public static readonly string batDataInfoRes = "batteryDataInfoRes";
public static readonly string ChargeRecordUpLoad = "ChargeRecordUpLoad"; public static readonly string ChargeRecordUpLoad = "uploadChargeOrder";
public static readonly string ChargeRecordUpLoadRes = "ChargeRecordUploadRes"; public static readonly string ChargeRecordUpLoadRes = "uploadChargeOrderRes";
public static readonly string batteryTotal = "batteryTotal"; public static readonly string batteryTotal = "batteryTotal";
public static readonly string batteryTotalRes = "batteryTotalRes"; public static readonly string batteryTotalRes = "batteryTotalRes";
public static readonly string chargingTotalDis = "chargingTotalDis"; public static readonly string chargingTotalDis = "chargingTotalDis";

@ -0,0 +1,23 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Newtonsoft.Json;
using Service.Cloud.Common;
using Service.Cloud.Msg.Cloud.Resp;
namespace Service.Cloud.Handler;
[Scope("InstancePerDependency")]
public class BatDataInfoResHandler: IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(BatDataInfoResHandler));
public bool CanHandle(string cmd)
{
return CloudConst.batDataInfoRes== cmd;
}
public void Handle(string t)
{
BatDataInfoRes? res = JsonConvert.DeserializeObject<BatDataInfoRes>(t);
Log.Info($"receive BatDataInfoRes res={res} {JsonConvert.SerializeObject(res)}"); }
}

@ -3,6 +3,7 @@ using Newtonsoft.Json;
using Service.Cloud.Client; using Service.Cloud.Client;
using Service.Cloud.Common; using Service.Cloud.Common;
using Service.Cloud.Msg.Cloud.Req; using Service.Cloud.Msg.Cloud.Req;
using Service.Cloud.Msg.Host.Resp;
namespace Service.Cloud.Handler; namespace Service.Cloud.Handler;
@ -18,5 +19,10 @@ public class CarCanStartHandler : IBaseHandler
{ {
CarCanStart? carCanStart = JsonConvert.DeserializeObject<CarCanStart>(t); CarCanStart? carCanStart = JsonConvert.DeserializeObject<CarCanStart>(t);
CloudClientMgr.CloudClient.CarCanStart = carCanStart; CloudClientMgr.CloudClient.CarCanStart = carCanStart;
if (carCanStart!=null)
{
CarCanStartRes resp = new CarCanStartRes(0,carCanStart.channel,carCanStart.order,1);
CloudClientMgr.CloudClient?.Publish(resp);
}
} }
} }

@ -23,9 +23,9 @@ public class ChargeRecordUploadResHandler : IBaseHandler
if (CloudClientMgr.CloudClient != null) if (CloudClientMgr.CloudClient != null)
{ {
CloudClientMgr.CloudClient.ChargeRecordUpLoad.SetResp(res); CloudClientMgr.CloudClient.ChargeRecordUpLoad.SetResp(res);
string? reqChrsn = CloudClientMgr.CloudClient.ChargeRecordUpLoad.Req?.chrsn; string? reqChrsn = res.chargeOrderNo;
Log.Info($"receive ChargeRecordUploadRes chargeOrderNo={reqChrsn} {JsonConvert.SerializeObject(res)}"); Log.Info($"receive ChargeRecordUploadRes chargeOrderNo={reqChrsn} {JsonConvert.SerializeObject(res)}");
if (!string.IsNullOrWhiteSpace(reqChrsn) && res.re == 0) if (!string.IsNullOrWhiteSpace(reqChrsn) && res.result == 0)
{ {
ChargeOrderRepository.Update(it => it.CloudReportStatus == 1, it => it.CloudChargeOrder == reqChrsn); ChargeOrderRepository.Update(it => it.CloudReportStatus == 1, it => it.CloudChargeOrder == reqChrsn);
} }

@ -3,8 +3,10 @@ using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.Autofac.Attribute;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Service.Cloud.Client; using Service.Cloud.Client;
using Service.Cloud.Common; using Service.Cloud.Common;
using Service.Cloud.Msg;
using Service.Cloud.Msg.Cloud.Resp; using Service.Cloud.Msg.Cloud.Resp;
namespace Service.Cloud.Handler; namespace Service.Cloud.Handler;
@ -12,26 +14,23 @@ namespace Service.Cloud.Handler;
[Scope("InstancePerDependency")] [Scope("InstancePerDependency")]
public class SignInRespHandler : IBaseHandler public class SignInRespHandler : IBaseHandler
{ {
public bool CanHandle(string cmd)
{
return CloudConst.signInRes == cmd;
}
public void Handle(string t) public void Handle(string t)
{ {
SignInRes? signInResp = JsonConvert.DeserializeObject<SignInRes>(t); SignInRes? signInResp = JsonConvert.DeserializeObject<SignInRes>(t);
if (signInResp != null) if (signInResp != null)
{ {
CloudClientMgr.CloudClient.Authed = signInResp.re == 0; CloudClientMgr.CloudClient.Authed = signInResp.result == 0;
CloudClientMgr.CloudClient.EquipmentUpload = signInResp.dl_up; CloudClientMgr.CloudClient.EquipmentUpload = signInResp.dl_up;
if (CloudClientMgr.CloudClient.EquipmentUpload != 0) if (CloudClientMgr.CloudClient.EquipmentUpload != 0)
{ {
//上传设备列表 //上传设备列表
CloudClientMgr.SendDevList(1); CloudClientMgr.SendDevList(1);
} }
} }
} }
public bool CanHandle(string cmd)
{
return CloudConst.signInRes == cmd;
}
} }

@ -0,0 +1,25 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Newtonsoft.Json;
using Service.Cloud.Common;
using Service.Cloud.Msg.Cloud.Resp;
namespace Service.Cloud.Handler;
[Scope("InstancePerDependency")]
public class StationChnRunStatusResHandler: IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(StationChnRunStatusResHandler));
public bool CanHandle(string cmd)
{
return CloudConst.stationChnRunStatusRes== cmd;
}
public void Handle(string t)
{
StationChnRunStatusRes? res = JsonConvert.DeserializeObject<StationChnRunStatusRes>(t);
Log.Info($"receive StationChnRunStatusRes res={res} {JsonConvert.SerializeObject(res)}");
}
}

@ -22,9 +22,9 @@ public class UploadSwapOrderResHandler : IBaseHandler
if (CloudClientMgr.CloudClient != null) if (CloudClientMgr.CloudClient != null)
{ {
CloudClientMgr.CloudClient.UploadPowerChange.SetResp(resp); CloudClientMgr.CloudClient.UploadPowerChange.SetResp(resp);
string? reqSon = CloudClientMgr.CloudClient.UploadPowerChange.Req?.son; string? reqSon = CloudClientMgr.CloudClient.UploadPowerChange.Req?.orderNo;
Log.Info($"receive UploadSwapOrderRes swapOrderNo={reqSon} {JsonConvert.SerializeObject(resp)}"); Log.Info($"receive UploadSwapOrderRes swapOrderNo={reqSon} {JsonConvert.SerializeObject(resp)}");
if (!string.IsNullOrWhiteSpace(reqSon) && resp.re == 0) if (!string.IsNullOrWhiteSpace(reqSon) && resp.result == 0)
{ {
SwapOrderRepository.Update(it => it.CloudReportStatus == 1, it => it.Sn == reqSon); SwapOrderRepository.Update(it => it.CloudReportStatus == 1, it => it.Sn == reqSon);
} }

@ -16,23 +16,23 @@ namespace Service.Cloud.Msg.Cloud.Req
/// 订单号 /// 订单号
/// 场站编码12 字节)+时间yyyyMMddHHmmss)14 位 + 2 位 /// 场站编码12 字节)+时间yyyyMMddHHmmss)14 位 + 2 位
/// </summary> /// </summary>
public string on { get; set; } public string order { get; set; }
/// <summary> /// <summary>
/// 车辆所在的换电 通道 /// 车辆所在的换电 通道
/// 从 1 开始递增, 0表示默认单仓单通道 /// 从 1 开始递增, 0表示默认单仓单通道
/// </summary> /// </summary>
public int en { get; set; } public int channel { get; set; }
/// <summary> /// <summary>
/// 车牌号 /// 车牌号
/// 一般车牌规则,当 ty 为 1 时,该字段必须填 /// 一般车牌规则,当 ty 为 1 时,该字段必须填
/// </summary> /// </summary>
public string cn { get; set; } public string carNo { get; set; }
/// <summary> /// <summary>
/// 是否开始换电 1:可以开始换电 2:终止换电 /// 是否开始换电 1:可以开始换电 2:终止换电
/// 1:可以开始换电 2:终止换电(取消换电) /// 1:可以开始换电 2:终止换电(取消换电)
/// <see cref="Entity.Constant.CloudEnum.WhetherToBattery"/> /// <see cref="Entity.Constant.CloudEnum.WhetherToBattery"/>
/// /// </summary> /// /// </summary>
public byte cs { get; set; } public byte swapFlag { get; set; }
public string GetCmd() public string GetCmd()
{ {
return CloudConst.carCanStart; return CloudConst.carCanStart;

@ -9,7 +9,7 @@ public class BatDataInfoRes : ICmd
/// 0:成功 1失败 /// 0:成功 1失败
/// <see cref="Entity.Constant.CloudEnum.Result"/> /// <see cref="Entity.Constant.CloudEnum.Result"/>
/// </summary> /// </summary>
public byte re { get; set; } public byte result { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -23,20 +23,20 @@ namespace Service.Cloud.Msg.Cloud.Resp
/// 6没有招到对应的 rfid 卡号 /// 6没有招到对应的 rfid 卡号
/// <see cref="Entity.Constant.CloudEnum.VehicleAuthResult"/> /// <see cref="Entity.Constant.CloudEnum.VehicleAuthResult"/>
/// </summary> /// </summary>
public int re { get; set; } public int result { get; set; }
/// <summary> /// <summary>
/// 认证方式 /// 认证方式
/// 1 车牌号 2 rfid 卡号 /// 1 车牌号 2 rfid 卡号
/// <see cref="Entity.Constant.CloudEnum.AuthenticationMethod"/> /// <see cref="Entity.Constant.CloudEnum.AuthenticationMethod"/>
/// </summary> /// </summary>
public int ty { get; set; } public int authType { get; set; }
/// <summary> /// <summary>
/// 车牌号 /// 车牌号
/// 当 ty 为 1 时,该字段必须填,其他为可选项,一般车牌规则 /// 当 ty 为 1 时,该字段必须填,其他为可选项,一般车牌规则
/// </summary> /// </summary>
public string cn { get; set; } public string carNo { get; set; }
/// <summary> /// <summary>
/// 卡号 /// 卡号
@ -48,13 +48,13 @@ namespace Service.Cloud.Msg.Cloud.Resp
/// 车辆识别号 /// 车辆识别号
/// 该字段必须填 /// 该字段必须填
/// </summary> /// </summary>
public string vi { get; set; } public string vin { get; set; }
/// <summary> /// <summary>
/// 订单号 /// 订单号
/// 场站编码12 字节)+时间yyyyMMddHHmmss)14 位 + 2 位 /// 场站编码12 字节)+时间yyyyMMddHHmmss)14 位 + 2 位
/// </summary> /// </summary>
public string on { get; set; } public string order { get; set; }
/// <summary> /// <summary>
/// Mac 地址 /// Mac 地址

@ -15,7 +15,7 @@ namespace Service.Cloud.Msg.Cloud.Resp
/// <summary> /// <summary>
/// 应答结果0成功1失败 /// 应答结果0成功1失败
/// </summary> /// </summary>
public byte re { get; set; } public byte result { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -4,7 +4,8 @@ namespace Service.Cloud.Msg.Cloud.Resp;
public class ChargeRecordUploadRes : ICmd public class ChargeRecordUploadRes : ICmd
{ {
public int re { get; set; } public int result { get; set; }
public string chargeOrderNo { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -11,7 +11,7 @@ public class SignInRes : ICmd
/// 0:成功 1:设备不存在 2非法设备 3站控软件版本错误 4.协议版本错误 /// 0:成功 1:设备不存在 2非法设备 3站控软件版本错误 4.协议版本错误
/// <see cref="Entity.Constant.CloudEnum.SignInResult"/> /// <see cref="Entity.Constant.CloudEnum.SignInResult"/>
/// </summary> /// </summary>
public int re { get; set; } public int result { get; set; }
/// <summary> /// <summary>
/// 是否需要上传设备列表 /// 是否需要上传设备列表
/// 2初始上传 1需要重新上传 0不需要上传 /// 2初始上传 1需要重新上传 0不需要上传
@ -22,13 +22,13 @@ public class SignInRes : ICmd
/// 云平台系统时间 /// 云平台系统时间
/// 格式”yyyy-MM-dd HH:mm:ss” /// 格式”yyyy-MM-dd HH:mm:ss”
/// </summary> /// </summary>
public DateTime ti { get; set; } public DateTime cloudTime { get; set; }
/// <summary> /// <summary>
/// 加密方式 /// 加密方式
/// 0:不加密 1AES /// 0:不加密 1AES
/// <see cref="Entity.Constant.CloudEnum.Encryption"/> /// <see cref="Entity.Constant.CloudEnum.Encryption"/>
/// </summary> /// </summary>
public int ew { get; set; } public int encryptType { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -17,11 +17,15 @@ namespace Service.Cloud.Msg.Cloud.Resp
/// 0:成功 1:失败 /// 0:成功 1:失败
/// <see cref="Entity.Constant.CloudEnum.ResultInt"/> /// <see cref="Entity.Constant.CloudEnum.ResultInt"/>
/// </summary> /// </summary>
public int re { get; set; } public int result { get; set; }
/// <summary>
/// 换电订单号
/// </summary>
public string orderNo { get; set; }
/// <summary> /// <summary>
/// 失败原因 /// 失败原因
/// </summary> /// </summary>
public string fr { get; set; } public string causeOfFailure { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -17,12 +17,12 @@ namespace Service.Cloud.Msg.Cloud.Resp
/// 0:成功 1失败 /// 0:成功 1失败
/// <see cref="Entity.Constant.CloudEnum.Result"/> /// <see cref="Entity.Constant.CloudEnum.Result"/>
/// </summary> /// </summary>
public byte re { get; set; } public byte result { get; set; }
/// <summary> /// <summary>
/// 接收失败原因 /// 接收失败原因
/// 比如:解析失败 /// 比如:解析失败
/// </summary> /// </summary>
public byte rs { get; set; } public string resultReason { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -13,7 +13,7 @@ public class Header
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string sid { get; set; } public string stationNo { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -21,5 +21,5 @@ public class Header
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public long timeStamp { get; set; } public long timestamp { get; set; }
} }

@ -10,17 +10,17 @@ namespace Service.Cloud.Msg.Host.Req
/// <summary> /// <summary>
/// 场站编码 换电站唯一码 /// 场站编码 换电站唯一码
/// </summary> /// </summary>
public string sn { get; set; } public string stationNo { get; set; }
/// <summary> /// <summary>
/// 换电站电池包总 数量 /// 换电站电池包总 数量
/// </summary> /// </summary>
public int batn { get; set; } public int batteryQuantity { get; set; }
/// <summary> /// <summary>
/// 电池信息 /// 电池信息
/// </summary> /// </summary>
public List<SingleBatInfo> datainfo { get; set; } public List<SingleBatInfo> dataList { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -18,12 +18,12 @@ namespace Service.Cloud.Msg.Host.Req
/// 1 车牌号 2 rfid 卡号 /// 1 车牌号 2 rfid 卡号
/// <see cref="Entity.Constant.CloudEnum.AuthenticationMethod"/> /// <see cref="Entity.Constant.CloudEnum.AuthenticationMethod"/>
/// </summary> /// </summary>
public int ty { get; set; } public int authType { get; set; }
/// <summary> /// <summary>
/// 车牌号 /// 车牌号
/// 一般车牌规则,当 ty 为 1 时,该字段必须填 /// 一般车牌规则,当 ty 为 1 时,该字段必须填
/// </summary> /// </summary>
public string cn { get; set; } public string carNo { get; set; }
/// <summary> /// <summary>
/// rfid卡号 /// rfid卡号
/// 当 ty 为 2 时,该字段必须填 /// 当 ty 为 2 时,该字段必须填
@ -33,7 +33,7 @@ namespace Service.Cloud.Msg.Host.Req
/// 车辆识别号 /// 车辆识别号
/// 当 ty 为 2 时,该字段必须填,如果字段为空时,需要进行 MAC 地址验证,MAC地址和 vin 不能同时为空。 /// 当 ty 为 2 时,该字段必须填,如果字段为空时,需要进行 MAC 地址验证,MAC地址和 vin 不能同时为空。
/// </summary> /// </summary>
public string vi { get; set; } public string vin { get; set; }
/// <summary> /// <summary>
/// MAC地址 /// MAC地址
/// 当 ty 为 2 时,该字段必须填,如果该字段为空时,需要进行 VIN 验证MAC地址和 vin 不能同时为空。 /// 当 ty 为 2 时,该字段必须填,如果该字段为空时,需要进行 VIN 验证MAC地址和 vin 不能同时为空。
@ -43,17 +43,17 @@ namespace Service.Cloud.Msg.Host.Req
/// 所有车队 /// 所有车队
/// 当 ty 为 2 时,该字段必须填 /// 当 ty 为 2 时,该字段必须填
/// </summary> /// </summary>
public string mc { get; set; } public string teamCode { get; set; }
/// <summary> /// <summary>
/// 车辆所在换电通 道 /// 车辆所在换电通 道
/// 从 1 开始递增 0表示默认单仓单通道 /// 从 1 开始递增 0表示默认单仓单通道
/// </summary> /// </summary>
public int en { get; set; } public int channel { get; set; }
/// <summary> /// <summary>
/// 车辆进入的时间 /// 车辆进入的时间
/// 格式 “yyyy-mm-dd hh:mm:ss” /// 格式 “yyyy-mm-dd hh:mm:ss”
/// </summary> /// </summary>
public DateTime? dt { get; set; } public DateTime? enterTime { get; set; }
/// <summary> /// <summary>
/// 车牌图片 /// 车牌图片
/// 可选项,换电站需将图片进行 base64编码后才能传输后台收到字段进行base64 解码后才能查看 /// 可选项,换电站需将图片进行 base64编码后才能传输后台收到字段进行base64 解码后才能查看

@ -10,9 +10,9 @@ namespace Service.Cloud.Msg.Host.Req
/// <summary> /// <summary>
/// 场站编码 换电站唯一码 /// 场站编码 换电站唯一码
/// </summary> /// </summary>
public string sn { get; set; } public string stationNo { get; set; }
public List<DataInfo> datainfo { get; set; } public List<DataInfo> chargeDevDataList { get; set; }
public string GetCmd() public string GetCmd()
@ -26,144 +26,144 @@ namespace Service.Cloud.Msg.Host.Req
/// <summary> /// <summary>
/// 设备编号 设备编号 /// 设备编号 设备编号
/// </summary> /// </summary>
public string en { get; set; } public string equipmentNo { get; set; }
/// <summary> /// <summary>
/// 充电架 ID 按电池架的编号 A1A2… /// 充电架 ID 按电池架的编号 A1A2…
/// </summary> /// </summary>
public string sd { get; set; } public string chargerId { get; set; }
/// <summary> /// <summary>
/// 充电机最大允许 输出功率 单位 0.1kw /// 充电机最大允许 输出功率 单位 0.1kw
/// </summary> /// </summary>
public float mtp { get; set; } public float highPower { get; set; }
/// <summary> /// <summary>
/// 充电机最大允 许充电速率 单位 0.1C /// 充电机最大允 许充电速率 单位 0.1C
/// </summary> /// </summary>
public float mcr { get; set; } public float highSpeed { get; set; }
/// <summary> /// <summary>
/// 电池架上是否有 电池 0未知 1有电池 2无电池 /// 电池架上是否有 电池 0未知 1有电池 2无电池
/// </summary> /// </summary>
public int hb { get; set; } public int isThereAnyBattery { get; set; }
/// <summary> /// <summary>
/// 电接头连接状态 0未知 1已经连接 2未连接 /// 电接头连接状态 0未知 1已经连接 2未连接
/// </summary> /// </summary>
public int el { get; set; } public int electronicStreet { get; set; }
/// <summary> /// <summary>
/// 充电机序号 从 1 开始递增 /// 充电机序号 从 1 开始递增
/// </summary> /// </summary>
public int cno { get; set; } public int chargerNo { get; set; }
/// <summary> /// <summary>
/// 充电机的工作状态 00H待机 01H工作02H工作完成03H充电暂停 /// 充电机的工作状态 00H待机 01H工作02H工作完成03H充电暂停
/// </summary> /// </summary>
public int cs { get; set; } public int chargerStatus { get; set; }
/// <summary> /// <summary>
/// 故障状态 00H无故障 01H有故障 /// 故障状态 00H无故障 01H有故障
/// </summary> /// </summary>
public int fs { get; set; } public int faultStatus { get; set; }
///告警状态 00H无告警.01H:有告警 ///告警状态 00H无告警.01H:有告警
public int @as { get; set; } public int alarmStatus { get; set; }
/// <summary> /// <summary>
/// 故障码 参考充电机的故障码定义 /// 故障码 参考充电机的故障码定义
/// </summary> /// </summary>
public int fc { get; set; } public int faultCode { get; set; }
/// <summary> /// <summary>
/// 充电开始时间 没有进行充电填空 /// 充电开始时间 没有进行充电填空
/// </summary> /// </summary>
public DateTime st { get; set; } public DateTime startTime { get; set; }
/// <summary> /// <summary>
/// 已经充电时间 单位 分钟 /// 已经充电时间 单位 分钟
/// </summary> /// </summary>
public int ct { get; set; } public int chargerTime { get; set; }
/// <summary> /// <summary>
/// 充电开始 SOC 0-100 单位 0.1 ,没有充电填 0 /// 充电开始 SOC 0-100 单位 0.1 ,没有充电填 0
/// </summary> /// </summary>
public int ssoc { get; set; } public int startSoc { get; set; }
/// <summary> /// <summary>
/// 当前 SOC 单位 0.1 /// 当前 SOC 单位 0.1
/// </summary> /// </summary>
public int csoc { get; set; } public int soc { get; set; }
/// <summary> /// <summary>
/// 充电开始 SOE 单位 0.1kwh,没有充电填 0 /// 充电开始 SOE 单位 0.1kwh,没有充电填 0
/// </summary> /// </summary>
public float ssoe { get; set; } public float startSoe { get; set; }
/// <summary> /// <summary>
/// 当前 SOE 单位 0.1kwh /// 当前 SOE 单位 0.1kwh
/// </summary> /// </summary>
public float csoe { get; set; } public float soe { get; set; }
/// <summary> /// <summary>
/// 当前充电电压 单位 0.1V,没有充电填 0 /// 当前充电电压 单位 0.1V,没有充电填 0
/// </summary> /// </summary>
public float cvot { get; set; } public float voltage { get; set; }
/// <summary> /// <summary>
/// 当前充电电流 单位 0.1A,没有充电填 0 /// 当前充电电流 单位 0.1A,没有充电填 0
/// </summary> /// </summary>
public float ccur { get; set; } public float electricCurrent { get; set; }
/// <summary> /// <summary>
/// BMS 需求电压 单位 0.1V,没有充电填 0 /// BMS 需求电压 单位 0.1V,没有充电填 0
/// </summary> /// </summary>
public float nvot { get; set; } public float bmsVoltage { get; set; }
/// <summary> /// <summary>
/// BMS 需求电流 单位 0.1A,没有充电填 0 /// BMS 需求电流 单位 0.1A,没有充电填 0
/// </summary> /// </summary>
public float ncur { get; set; } public float bmsElectricCurrent { get; set; }
/// <summary> /// <summary>
/// 最低单体电压 单位 0.01V /// 最低单体电压 单位 0.01V
/// </summary> /// </summary>
public float lsv { get; set; } public float lowVoltage { get; set; }
/// <summary> /// <summary>
/// 最高单体电压 单位 0.01V /// 最高单体电压 单位 0.01V
/// </summary> /// </summary>
public float hsv { get; set; } public float highVoltage { get; set; }
/// <summary> /// <summary>
/// 最低单体温度 单位 0.1℃ /// 最低单体温度 单位 0.1℃
/// </summary> /// </summary>
public float lst { get; set; } public float lowTemperature { get; set; }
/// <summary> /// <summary>
/// 最高单体温度 单位 0.1℃ /// 最高单体温度 单位 0.1℃
/// </summary> /// </summary>
public float hst { get; set; } public float highTemperature { get; set; }
/// <summary> /// <summary>
/// 水冷状态 0未知 1开启 2关闭 0xFF 无水冷设备 /// 水冷状态 0未知 1开启 2关闭 0xFF 无水冷设备
/// </summary> /// </summary>
public byte ws { get; set; } public byte waterCoolingStatus { get; set; }
/// <summary> /// <summary>
/// 进水口温度 单位 0.1℃ , 没有水冷设备填 0xFF /// 进水口温度 单位 0.1℃ , 没有水冷设备填 0xFF
/// </summary> /// </summary>
public float it { get; set; } public float intakeTemperature { get; set; }
/// <summary> /// <summary>
/// 出水口温度 单位 0.1℃ , 没有水冷设备填 0xFF /// 出水口温度 单位 0.1℃ , 没有水冷设备填 0xFF
/// </summary> /// </summary>
public float ot { get; set; } public float outletTemperature { get; set; }
/// <summary> /// <summary>
/// 更新时间 格式 ”yyyy-MM-dd HH:mm:ss ” /// 更新时间 格式 ”yyyy-MM-dd HH:mm:ss ”
/// </summary> /// </summary>
public DateTime bt { get; set; } public DateTime updateTime { get; set; }
} }
} }

@ -7,92 +7,92 @@ public class ChargeRecordUpLoad : ICmd
/// <summary> /// <summary>
/// 充电序列号 /// 充电序列号
/// </summary> /// </summary>
public string chrsn { get; set; } public string chargeOrderNo { get; set; }
/// <summary> /// <summary>
/// 换电序列号 /// 换电序列号
/// </summary> /// </summary>
public string son { get; set; } public string swapOrderNo { get; set; }
/// <summary> /// <summary>
/// 电池序列号 /// 电池序列号
/// </summary> /// </summary>
public string bid { get; set; } public string batteryNo { get; set; }
/// <summary> /// <summary>
/// 开始时间 /// 开始时间
/// </summary> /// </summary>
public DateTime st { get; set; } public DateTime startTime { get; set; }
/// <summary> /// <summary>
/// 结束时间 /// 结束时间
/// </summary> /// </summary>
public DateTime et { get; set; } public DateTime endTime { get; set; }
/// <summary> /// <summary>
/// 开始 SOC /// 开始 SOC
/// </summary> /// </summary>
public int ssoc { get; set; } public int startSoc { get; set; }
/// <summary> /// <summary>
/// 结束 SOC /// 结束 SOC
/// </summary> /// </summary>
public int esoc { get; set; } public int endSoc { get; set; }
/// <summary> /// <summary>
/// 开始 SOE /// 开始 SOE
/// </summary> /// </summary>
public float ssoe { get; set; } public float startSoe { get; set; }
/// <summary> /// <summary>
/// 结束 SOE /// 结束 SOE
/// </summary> /// </summary>
public float esoe { get; set; } public float endSoe { get; set; }
/// <summary> /// <summary>
/// 直流电表充电 电量 /// 直流电表充电 电量
/// </summary> /// </summary>
public float dcce { get; set; } public float directCurrent { get; set; }
/// <summary> /// <summary>
/// 交流电表充电 电量 /// 交流电表充电 电量
/// </summary> /// </summary>
public float acce { get; set; } public float acMeter { get; set; }
/// <summary> /// <summary>
/// 尖时段电量 /// 尖时段电量
/// </summary> /// </summary>
public float tp { get; set; } public float theTipElectric { get; set; }
/// <summary> /// <summary>
/// 峰时段电量 /// 峰时段电量
/// </summary> /// </summary>
public float pp { get; set; } public float peakElectric { get; set; }
/// <summary> /// <summary>
/// 平时段电量 /// 平时段电量
/// </summary> /// </summary>
public float fp { get; set; } public float flatElectric { get; set; }
/// <summary> /// <summary>
/// 谷时段电量 /// 谷时段电量
/// </summary> /// </summary>
public float vp { get; set; } public float theValleyElectric { get; set; }
/// <summary> /// <summary>
/// 充电时长 分钟 /// 充电时长 分钟
/// </summary> /// </summary>
public int ct { get; set; } public int chargerTime { get; set; }
/// <summary> /// <summary>
/// 充电次数 /// 充电次数
/// </summary> /// </summary>
public int cn { get; set; } public int chargerFrequency { get; set; }
/// <summary> /// <summary>
/// 1 自动; 2 人工手动 /// 1 自动; 2 人工手动
/// </summary> /// </summary>
public int sfs { get; set; } public int reportType { get; set; }
/// <summary> /// <summary>
/// 车辆vin码 /// 车辆vin码
@ -102,7 +102,7 @@ public class ChargeRecordUpLoad : ICmd
/// <summary> /// <summary>
/// 0:站内充电 1 站外充电 /// 0:站内充电 1 站外充电
/// </summary> /// </summary>
public int sfoc { get; set; } public int chargerType { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -9,50 +9,50 @@ public class SignIn : ICmd
/// <summary> /// <summary>
/// 换电站编码 /// 换电站编码
/// </summary> /// </summary>
public string sn { get; set; } public string stationNo { get; set; }
/// <summary> /// <summary>
/// 供应商识别码 /// 供应商识别码
/// (以中心平台给出为准). 每个厂家对应一个 Key /// (以中心平台给出为准). 每个厂家对应一个 Key
/// </summary> /// </summary>
public string ky { get; set; } public string supplierCode { get; set; }
/// <summary> /// <summary>
/// 换电站类型 /// 换电站类型
/// 01:单道通左 02:单通道右 03:双道通 /// 01:单道通左 02:单通道右 03:双道通
/// <see cref="Entity.Constant.CloudEnum.PowerStationType"/> /// <see cref="Entity.Constant.CloudEnum.PowerStationType"/>
/// </summary> /// </summary>
public string st { get; set; } public string stationType { get; set; }
/// <summary> /// <summary>
/// 设备型号 /// 设备型号
/// </summary> /// </summary>
public string dv { get; set; } public string equipmentType { get; set; }
/// <summary> /// <summary>
/// 软件版本 /// 软件版本
/// 站类型代号(24 个大写字母)_X.XX其中 X 位 0~9 数字,非重大改变,整数数字不改变,小数点后数字单数加 0双数不变依次累加比如A_1.01 /// 站类型代号(24 个大写字母)_X.XX其中 X 位 0~9 数字,非重大改变,整数数字不改变,小数点后数字单数加 0双数不变依次累加比如A_1.01
/// </summary> /// </summary>
public string sv { get; set; } public string version { get; set; }
/// <summary> /// <summary>
/// 换电站服务状态 /// 换电站服务状态
/// 0:未知1:服务状态2:停止服务状态 /// 0:未知1:服务状态2:停止服务状态
/// </summary> /// </summary>
public int ss { get; set; } public int stationStatus { get; set; }
/// <summary> /// <summary>
/// 换电站配电容量 /// 换电站配电容量
/// 单位 0.1kwh /// 单位 0.1kwh
/// </summary> /// </summary>
public float ca { get; set; } public float stationCapacity { get; set; }
/// <summary> /// <summary>
/// 设备列表配置版本 号 /// 设备列表配置版本 号
/// </summary> /// </summary>
public string VS { get; set; } public string equipmentVersion { get; set; }
/// <summary> /// <summary>
/// 充电功率 /// 充电功率
/// </summary> /// </summary>
public int cp { get; set; } public int chargePower { get; set; }
/// <summary> /// <summary>
/// 换电站基础信息版 本号 /// 换电站基础信息版 本号
/// 换电站基础信息版本号(换电站编码+更新时间(yyyyMMddHHmmss) /// 换电站基础信息版本号(换电站编码+更新时间(yyyyMMddHHmmss)
/// </summary> /// </summary>
public string bs { get; set; } public string stationVersion { get; set; }
/// <summary> /// <summary>
/// 经度 /// 经度
/// </summary> /// </summary>
@ -65,21 +65,21 @@ public class SignIn : ICmd
/// 换电通道数量 /// 换电通道数量
/// 换电通道的数目 /// 换电通道的数目
/// </summary> /// </summary>
public int en { get; set; } public int channelNumber { get; set; }
/// <summary> /// <summary>
/// 充电机(仓)数量 /// 充电机(仓)数量
/// </summary> /// </summary>
public int cn { get; set; } public int chargerNumber { get; set; }
/// <summary> /// <summary>
/// 电价模型id /// 电价模型id
/// 服务器分配,默认值为-1 /// 服务器分配,默认值为-1
/// </summary> /// </summary>
public int eid { get; set; } public int electricityId { get; set; }
/// <summary> /// <summary>
/// 电池运营模型id /// 电池运营模型id
/// 服务器分配,默认为值-1 /// 服务器分配,默认为值-1
/// </summary> /// </summary>
public int oid { get; set; } public int billingId { get; set; }
public string GetCmd() public string GetCmd()

@ -7,27 +7,27 @@ public class SingleBatInfo
/// <summary> /// <summary>
/// 电池序列号 /// 电池序列号
/// </summary> /// </summary>
public string bn { get; set; } public string batteryNo { get; set; }
/// <summary> /// <summary>
/// 充电架 ID 按电池架的编号 A1A2… /// 充电机编码
/// </summary> /// </summary>
public string sd { get; set; } public string chargerNo { get; set; }
/// <summary> /// <summary>
/// 所在充电机序号 从 1 开始递增 /// 所在仓编号
/// </summary> /// </summary>
public int cno { get; set; } public int binNo { get; set; }
/// <summary> /// <summary>
/// 是否在充电 0未知 1正在充电 2未电池 /// 是否在充电 0未知 1正在充电 2未电池
/// </summary> /// </summary>
public int hc { get; set; } public int chargeOrNot { get; set; }
/// <summary> /// <summary>
/// 电接头连接状态 0未知 1已经连接 2未连接 /// 电接头连接状态 0未知 1已经连接 2未连接
/// </summary> /// </summary>
public int el { get; set; } public int spliceStatus { get; set; }
/// <summary> /// <summary>
/// 剩余能量 单位 0.1 kwh /// 剩余能量 单位 0.1 kwh
@ -47,22 +47,22 @@ public class SingleBatInfo
/// <summary> /// <summary>
/// 最低单体电压 单位 0.01V /// 最低单体电压 单位 0.01V
/// </summary> /// </summary>
public float lsv { get; set; } public float lowVoltage { get; set; }
/// <summary> /// <summary>
/// 最高单体电压 单位 0.01V /// 最高单体电压 单位 0.01V
/// </summary> /// </summary>
public float hsv { get; set; } public float highVoltage { get; set; }
/// <summary> /// <summary>
/// 最低单体温度 单位 0.1℃ /// 最低单体温度 单位 0.1℃
/// </summary> /// </summary>
public float lst { get; set; } public float lowTemperature { get; set; }
/// <summary> /// <summary>
/// 最高单体温度 单位 0.1℃ /// 最高单体温度 单位 0.1℃
/// </summary> /// </summary>
public float hst { get; set; } public float highTemperature { get; set; }
/// <summary> /// <summary>
/// 单体电池号 从 1 开始递增 /// 单体电池号 从 1 开始递增
@ -72,16 +72,16 @@ public class SingleBatInfo
/// <summary> /// <summary>
/// 单体电压 每一节电芯的单体电压 单位 0.1V 如果没有该节电芯的数据填65535.0 无效值 /// 单体电压 每一节电芯的单体电压 单位 0.1V 如果没有该节电芯的数据填65535.0 无效值
/// </summary> /// </summary>
public float sv { get; set; } public float voltage { get; set; }
/// <summary> /// <summary>
/// 单体温度 每一节电芯的单体温度 单位 0.1℃ ,如果没有该节电芯的数据填65535.0 无效值 /// 单体温度 每一节电芯的单体温度 单位 0.1℃ ,如果没有该节电芯的数据填65535.0 无效值
/// </summary> /// </summary>
public float st { get; set; } public float temperature { get; set; }
/// <summary> /// <summary>
/// 更新时间 格式 ”yyyy-MM-dd HH:mm:ss ” /// 更新时间 格式 ”yyyy-MM-dd HH:mm:ss ”
/// </summary> /// </summary>
public DateTime bt { get; set; } public DateTime updateTime { get; set; }
} }

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Entity.Dto.Req;
namespace Service.Cloud.Msg.Host.Req namespace Service.Cloud.Msg.Host.Req
{ {
@ -16,38 +17,38 @@ namespace Service.Cloud.Msg.Host.Req
/// 换电站编码 /// 换电站编码
/// 换电站唯一码,区域码+类型码+流水号 /// 换电站唯一码,区域码+类型码+流水号
/// </summary> /// </summary>
public string sn { get; set; } public string stationNo { get; set; }
/// <summary> /// <summary>
/// 换电订单号 /// 换电订单号
/// 场站编码+时间yyyyMMddHHmmss)+车牌号,唯一,索引 /// 场站编码+时间yyyyMMddHHmmss)+车牌号,唯一,索引
/// </summary> /// </summary>
public string son { get; set; } public string orderNo { get; set; }
/// <summary> /// <summary>
/// 订单是否取消 /// 订单是否取消
/// 0:正常1:取消 /// 0:正常1:取消
/// <see cref="Entity.Constant.CloudEnum.OrderCancellation"/> /// <see cref="Entity.Constant.CloudEnum.OrderCancellation"/>
/// </summary> /// </summary>
public byte od { get; set; } public byte cancelFlag { get; set; }
/// <summary> /// <summary>
/// 是否成功换电 /// 是否成功换电
/// 本次换电是否成功.0:失败1:成功 /// 本次换电是否成功.0:失败1:成功
/// <see cref="Entity.Constant.CloudEnum.WhetherTheBatterySwapIsSuccessful"/> /// <see cref="Entity.Constant.CloudEnum.WhetherTheBatterySwapIsSuccessful"/>
/// </summary> /// </summary>
public byte ic { get; set; } public byte successFlag { get; set; }
/// <summary> /// <summary>
/// 换电结果 /// 换电结果
/// 0:正常 1失败 /// 0:正常 1失败
/// <see cref="Entity.Constant.CloudEnum.BatterySwapResults"/> /// <see cref="Entity.Constant.CloudEnum.BatterySwapResults"/>
/// </summary> /// </summary>
public byte rs { get; set; } public byte result { get; set; }
/// <summary> /// <summary>
/// 失败原因 /// 失败原因
/// </summary> /// </summary>
public byte fr { get; set; } public byte causeOfFailure { get; set; }
/// <summary> /// <summary>
/// 车牌号 /// 车牌号
/// </summary> /// </summary>
public string cn { get; set; } public string carNo { get; set; }
/// <summary> /// <summary>
/// 车辆VIN码 /// 车辆VIN码
/// 车辆唯一识别码 /// 车辆唯一识别码
@ -61,162 +62,120 @@ namespace Service.Cloud.Msg.Host.Req
/// <summary> /// <summary>
/// 所属车队 /// 所属车队
/// </summary> /// </summary>
public string mC { get; set; } public string teamCode { get; set; }
/// <summary>
/// 出仓安装电池序列号
/// </summary>
public string dbid { get; set; }
/// <summary>
/// 出仓安装电池SOC
/// </summary>
public int dsoc { get; set; }
/// <summary>
/// 取车电池上次换电结算时 的SOC
/// </summary>
public int lsoc { get; set; }
/// <summary>
/// 出仓安装电池的SOE
/// 单位:kWh,保留两位小数
/// </summary>
public float dsoe { get; set; }
/// <summary>
/// 取车电池上次换电结算时 的 SOE
/// 单位:kWh,保留两位小数
/// </summary>
public float lsoe { get; set; }
/// <summary>
/// 拆卸入仓电池序列号
/// </summary>
public string ubid { get; set; }
/// <summary>
/// 拆卸入仓电池SOC
/// 单位:kWh,保留两位小数
/// </summary>
public int usoc { get; set; }
/// <summary>
/// 拆卸入仓电池SOE
/// 单位:kWh,保留两位小数
/// </summary>
public float usoe { get; set; }
/// <summary> /// <summary>
/// 装上电池行驶里程 /// 装上电池行驶里程
/// 单位:kWh,保留两位小数 /// 单位:kWh,保留两位小数
/// </summary> /// </summary>
public float tm { get; set; } public float batteryVtm { get; set; }
/// <summary> /// <summary>
/// 此次换电次序 /// 此次换电次序
/// 本日第几次换电 /// 本日第几次换电
/// </summary> /// </summary>
public int so { get; set; } public int swapDayCount { get; set; }
/// <summary> /// <summary>
/// 车牌识别时间(或车辆进 站时间) /// 车牌识别时间(或车辆进 站时间)
/// 单位:秒 /// 单位:秒
/// </summary> /// </summary>
public DateTime? ct { get; set; } public DateTime? recognizeTime { get; set; }
/// <summary> /// <summary>
/// 换电开始时刻 /// 换电开始时刻
/// 格式”yyyy-MMddHH:mm:ss” /// 格式”yyyy-MMddHH:mm:ss”
/// </summary> /// </summary>
public DateTime? st { get; set; } public DateTime? startTime { get; set; }
/// <summary> /// <summary>
/// 换电结来时刻 /// 换电结来时刻
/// 格式”yyyy-MMddHH:mm:ss” /// 格式”yyyy-MMddHH:mm:ss”
/// </summary> /// </summary>
public DateTime? et { get; set; } public DateTime? endTime { get; set; }
/// <summary> /// <summary>
/// 车辆高开时间 /// 车辆高开时间
/// 格式”yyyy-MMdd /// 格式”yyyy-MMdd
/// </summary> /// </summary>
public DateTime? ot { get; set; } public DateTime? leaveTime { get; set; }
/// <summary> /// <summary>
/// 本次换电时同 /// 本次换电时同
/// 单位:秒 (车辆进站到出站的时间) /// 单位:秒 (车辆进站到出站的时间)
/// </summary> /// </summary>
public int wt { get; set; } public int swapTime { get; set; }
/// <summary>
/// 出仓安装地仓位号
/// </summary>
public int? deno { get; set; }
/// <summary>
/// 拆卸入仓池仓位号
/// </summary>
public int? ueno { get; set; }
/// <summary> /// <summary>
/// 车朝总里程 /// 车朝总里程
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float? vtm { get; set; } public float? vehicleTotalMiles { get; set; }
/// <summary> /// <summary>
/// 车制累计换电次数 /// 车制累计换电次数
/// </summary> /// </summary>
public int vct { get; set; } public int swapCount { get; set; }
/// <summary> /// <summary>
/// 车辆累计放电量 /// 车辆累计放电量
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float vtdc { get; set; } public float carElectricDischarge { get; set; }
/// <summary> /// <summary>
/// 车辆系计回馈电量 /// 车辆系计回馈电量
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float vtfe { get; set; } public float carFeedbackElectricity { get; set; }
/// <summary> /// <summary>
/// 车朝累计插枪充电量 /// 车朝累计插枪充电量
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float vtcc { get; set; } public float chargerTheGunCount { get; set; }
/// <summary> /// <summary>
/// 车制累计综合能耗 /// 车制累计综合能耗
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float vtec { get; set; } public float carEnergyConsumption { get; set; }
/// <summary> /// <summary>
/// 本次实时放电量 /// 本次实时放电量
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float rtdc { get; set; } public float realTimeDischarge { get; set; }
/// <summary> /// <summary>
/// 上一次结算放电量 /// 上一次结算放电量
/// 至少保留两位有效小数 /// 至少保留两位有效小数
/// </summary> /// </summary>
public float lsdc { get; set; } public float lastDischarge { get; set; }
/// <summary> /// <summary>
/// 本次实时回馈电量 /// 本次实时回馈电量
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float rtfc { get; set; } public float realFeedbackPower { get; set; }
/// <summary> /// <summary>
/// 上一才生笙回性中量 /// 上一才生笙回性中量
/// 单位:kWh, 保留两位 /// 单位:kWh, 保留两位
/// </summary> /// </summary>
public float lsfc { get; set; } public float lastFeedback { get; set; }
/// <summary> /// <summary>
/// 本次实时插枪充电量 /// 本次实时插枪充电量
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float rtce { get; set; } public float realChargeCount { get; set; }
/// <summary> /// <summary>
/// 上一次结算插枪充电量 /// 上一次结算插枪充电量
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float lscc { get; set; } public float lastChargeCount { get; set; }
/// <summary> /// <summary>
/// 本次实时综合能耗 /// 本次实时综合能耗
/// 单位:kWh, 保留两位小数 /// 单位:kWh, 保留两位小数
/// </summary> /// </summary>
public float rtec { get; set; } public float realEnergyConsumption { get; set; }
/// <summary> /// <summary>
/// 上报方式 /// 上报方式
/// 1自动2人工手动 /// 1自动2人工手动
/// <see cref="Entity.Constant.CloudEnum.EscalationMethod"/> /// <see cref="Entity.Constant.CloudEnum.EscalationMethod"/>
/// </summary> /// </summary>
public int sfs { get; set; } public int reportType { get; set; }
/// <summary> /// <summary>
/// 是否是离线订单 /// 是否是离线订单
/// 0不是1 /// 0不是1
/// <see cref="Entity.Constant.CloudEnum.OrderType"/> /// <see cref="Entity.Constant.CloudEnum.OrderType"/>
/// </summary> /// </summary>
public int sflx { get; set; } public int offlineFlag { get; set; }
public List<SwapOrderBatteryRecord> batteryList { get; set; }
public string GetCmd() public string GetCmd()
{ {
return CloudConst.staSwapRecord; return CloudConst.staSwapRecord;

@ -16,43 +16,43 @@ namespace Service.Cloud.Msg.Host.Req
/// 换电通道编号 /// 换电通道编号
/// 从 1 开始递增, 0表示默认单仓单通道 /// 从 1 开始递增, 0表示默认单仓单通道
/// </summary> /// </summary>
public int ec { get; set; } public int passageNo { get; set; }
/// <summary> /// <summary>
/// 工作状态 /// 工作状态
/// 0:未知 1空闲 2工作中 3工作完成 /// 0:未知 1空闲 2工作中 3工作完成
/// <see cref="Entity.Constant.CloudEnum.WorkingStatus"/> /// <see cref="Entity.Constant.CloudEnum.WorkingStatus"/>
/// </summary> /// </summary>
public int ws { get; set; } public int status { get; set; }
/// <summary> /// <summary>
/// 换电通道状态 /// 换电通道状态
/// 0:未知 1空闲 2占位 3换电准备 4换电开始 5换电中 6换电完成 7换电中故障等待修复 /// 0:未知 1空闲 2占位 3换电准备 4换电开始 5换电中 6换电完成 7换电中故障等待修复
/// 8换电中故障修复完成 9换电暂停 10换电继续 11:换电完成,车辆未驶离 12:换电完成,车辆驶离 /// 8换电中故障修复完成 9换电暂停 10换电继续 11:换电完成,车辆未驶离 12:换电完成,车辆驶离
/// <see cref="Entity.Constant.CloudEnum.BatterySwapStatus"/> /// <see cref="Entity.Constant.CloudEnum.BatterySwapStatus"/>
/// </summary> /// </summary>
public int cs { get; set; } public int passageStatus { get; set; }
/// <summary> /// <summary>
/// 是否有车 /// 是否有车
/// 0未知 1有车 2无车 /// 0未知 1有车 2无车
/// <see cref="Entity.Constant.CloudEnum.WhetherThereIsACarOrNot"/> /// <see cref="Entity.Constant.CloudEnum.WhetherThereIsACarOrNot"/>
/// </summary> /// </summary>
public int iv { get; set; } public int carFlag { get; set; }
/// <summary> /// <summary>
/// 锁止状态 /// 锁止状态
/// 商用车有效 0未知 1加锁状态 2解锁状态 /// 商用车有效 0未知 1加锁状态 2解锁状态
/// <see cref="Entity.Constant.CloudEnum.LockedState"/> /// <see cref="Entity.Constant.CloudEnum.LockedState"/>
/// </summary> /// </summary>
public int ls { get; set; } public int lockStatus { get; set; }
/// <summary> /// <summary>
/// 换电站通道故障等级 /// 换电站通道故障等级
/// 0 正常 1故障等级一 2故障等级二 3故障等级三 4故障等级四 5故障等级五 6故障等级六 /// 0 正常 1故障等级一 2故障等级二 3故障等级三 4故障等级四 5故障等级五 6故障等级六
/// <see cref="Entity.Constant.CloudEnum.FailureLevel"/> /// <see cref="Entity.Constant.CloudEnum.FailureLevel"/>
/// </summary> /// </summary>
public int fl { get; set; } public int faultLevel { get; set; }
/// <summary> /// <summary>
/// 更新时间 /// 更新时间
/// 格式”yyyy-MM-dd HH:mm:ss” /// 格式”yyyy-MM-dd HH:mm:ss”
/// </summary> /// </summary>
public DateTime ut { get; set; } public DateTime updateTime { get; set; }
public string GetCmd() public string GetCmd()
{ {

@ -17,26 +17,33 @@ namespace Service.Cloud.Msg.Host.Resp
/// 0:成功 1失败 /// 0:成功 1失败
/// <see cref="Entity.Constant.CloudEnum.ResultInt"/> /// <see cref="Entity.Constant.CloudEnum.ResultInt"/>
/// </summary> /// </summary>
public int re { get; set; } public int result { get; set; }
/// <summary> /// <summary>
/// 车辆所在的换电 通道 /// 车辆所在的换电 通道
/// 从 1 开始递增, 0表示默认单仓单通道 /// 从 1 开始递增, 0表示默认单仓单通道
/// </summary> /// </summary>
public int en { get; set; } public int channel { get; set; }
/// <summary> /// <summary>
/// 订单号 /// 订单号
/// 场站编码12 字节)+时间yyyyMMddHHmmss)14 位 + 2 位 /// 场站编码12 字节)+时间yyyyMMddHHmmss)14 位 + 2 位
/// </summary> /// </summary>
public string on { get; set; } public string order { get; set; }
/// <summary> /// <summary>
/// 换电请求应答 /// 换电请求应答
/// 0 无 1 换电请求成功 2 换电请求失败3 取消换电请求成功 4 取消换电请求失败 /// 0 无 1 换电请求成功 2 换电请求失败3 取消换电请求成功 4 取消换电请求失败
/// <see cref="Entity.Constant.CloudEnum.AnsweringTheBatterySwapRequest"/> /// <see cref="Entity.Constant.CloudEnum.AnsweringTheBatterySwapRequest"/>
/// </summary> /// </summary>
public int cs { get; set; } public int swapFlag { get; set; }
public string GetCmd() public string GetCmd()
{ {
return CloudConst.carCanStartRes; return CloudConst.carCanStartRes;
} }
public CarCanStartRes(int result, int channel, string order, int swapFlag)
{
this.result = result;
this.channel = channel;
this.order = order;
this.swapFlag = swapFlag;
}
} }
} }

@ -2,7 +2,7 @@
public class Model<T> where T : ICmd public class Model<T> where T : ICmd
{ {
public Header Header { get; set; } public Header header { get; set; }
public T body { get; set; } public T body { get; set; }
public string dataSign { get; set; } public string dataSign { get; set; }
} }

@ -13,6 +13,7 @@ using Service.Execute.Model;
using Service.Execute.Model.Tbox; using Service.Execute.Model.Tbox;
using Service.Init; using Service.Init;
using System.Security.Cryptography; using System.Security.Cryptography;
using Entity.Dto.Req;
namespace Service.Execute.Api; namespace Service.Execute.Api;
@ -32,13 +33,13 @@ public abstract class CloudApi
{ {
CarAuth carAuth = new() CarAuth carAuth = new()
{ {
ty = 2, authType = 1,
rfid = rfidReadModel.VelVin, rfid = rfidReadModel.VelVin,
cn = rfidReadModel.VelNo, carNo = rfidReadModel.VelNo,
vi = rfidReadModel.VelVin, vin = rfidReadModel.VelVin,
// mac = rfidReadModel.VelMac, // mac = rfidReadModel.VelMac,
en = 0, channel = 0,
dt = swapOrder.VehicleEnterTime, enterTime = swapOrder.VehicleEnterTime,
mode = 0, mode = 0,
}; };
@ -61,37 +62,47 @@ public abstract class CloudApi
/// <param name="rfidReadModel"></param> /// <param name="rfidReadModel"></param>
/// <param name="swapOrder"></param> /// <param name="swapOrder"></param>
/// <returns></returns> /// <returns></returns>
public static int UploadSwapOrder(SwapOrder swapOrder, int seq, SwapOrderBattery swapOrderBattery, int uploadType public static int UploadSwapOrder(SwapOrder swapOrder, int seq, List<SwapOrderBattery> swapOrderBattery, int uploadType
,SwapOrderReportCloud orderReportCloud) ,SwapOrderReportCloud orderReportCloud)
{ {
List<SwapOrderBatteryRecord> swapOrderBatteryList = new List<SwapOrderBatteryRecord>();
foreach (var orderBattery in swapOrderBattery)
{
SwapOrderBatteryRecord batteryRecord = new SwapOrderBatteryRecord();
batteryRecord.outBatteryNo = orderBattery.UpBatteryNo;
batteryRecord.outBin = orderBattery.UpBatteryBinNo;
batteryRecord.outSoc = orderBattery.UpBatterySoc.ToInt();
batteryRecord.enterBatteryNo = orderBattery.DownBatteryNo;
batteryRecord.enterBin = orderBattery.DownBatteryBinNo;
batteryRecord.enterSoc = orderBattery.DownBatterySoc.ToInt();
batteryRecord.outSoe = orderBattery.UpBatterySoe.ToInt();
batteryRecord.enterSoe = orderBattery.DownBatterySoe.ToInt();
swapOrderBatteryList.Add(batteryRecord);
}
StaSwapRecord staSwapRecord = new() StaSwapRecord staSwapRecord = new()
{ {
rfid = swapOrder.VehicleVin, rfid = swapOrder.VehicleVin,
sn = StaticStationInfo.StationNo, stationNo = StaticStationInfo.StationNo,
son = swapOrder.CloudSn, orderNo = swapOrder.CloudSn,
cn = swapOrder.VehicleNo, carNo = swapOrder.VehicleNo,
so = seq, swapDayCount = seq,
ct = swapOrder.VehicleEnterTime, recognizeTime = swapOrder.VehicleEnterTime,
st = swapOrder.SwapBeginTime, startTime = swapOrder.SwapBeginTime,
dbid = swapOrderBattery.UpBatteryNo,
deno = swapOrderBattery.UpBatteryBinNo,
dsoc = swapOrderBattery.UpBatterySoc.ToInt(),
//dsoe = swapOrderBattery.UpBatterySoe.ToInt(), //dsoe = swapOrderBattery.UpBatterySoe.ToInt(),
et = swapOrder.SwapEndTime, endTime = swapOrder.SwapEndTime,
od = 0, cancelFlag = 0,
ot = swapOrder.VehicleLeaveTime, leaveTime = swapOrder.VehicleLeaveTime,
rs = 0, result = 0,
sflx = 0, offlineFlag = 0,
sfs = uploadType, reportType = uploadType,
ubid = swapOrderBattery.DownBatteryNo,
ueno = swapOrderBattery.DownBatteryBinNo,
usoc = swapOrderBattery.DownBatterySoc.ToInt(),
// usoe = swapOrderBattery.DownBatterySoe.ToInt(), // usoe = swapOrderBattery.DownBatterySoe.ToInt(),
vin = swapOrder.VehicleVin, vin = swapOrder.VehicleVin,
wt = new TimeSpan((swapOrder.SwapEndTime.ToDateTime().Ticks - swapOrder.SwapBeginTime.ToDateTime().Ticks)) swapTime = new TimeSpan((swapOrder.SwapEndTime.ToDateTime().Ticks - swapOrder.SwapBeginTime.ToDateTime().Ticks))
.TotalSeconds.ToInt(), .TotalSeconds.ToInt(),
vtm=orderReportCloud.Vtm, vehicleTotalMiles=orderReportCloud.Vtm,
batteryList=swapOrderBatteryList,
}; };
Log.Info( Log.Info(
$" CloudApi UploadSwapOrder seq={seq} SendUploadPowerChangeOrder param={JsonConvert.SerializeObject(staSwapRecord)}"); $" CloudApi UploadSwapOrder seq={seq} SendUploadPowerChangeOrder param={JsonConvert.SerializeObject(staSwapRecord)}");
@ -107,7 +118,7 @@ public abstract class CloudApi
return -1; return -1;
} }
return sendUploadPowerChangeOrder.re; return sendUploadPowerChangeOrder.result;
} }
@ -128,13 +139,13 @@ public abstract class CloudApi
{ {
stationChnRunStatus = new() stationChnRunStatus = new()
{ {
ec = 0, passageNo = 0,
ws = StationSoftMgr.SwappingStateMachine.SwapStatus == 0 ? 2 : 3, status = StationSoftMgr.SwappingStateMachine.SwapStatus == 0 ? 2 : 3,
cs = (int)StationSoftMgr.SwappingStateMachine.BusinessSwappingForCloudState, passageStatus = (int)StationSoftMgr.SwappingStateMachine.BusinessSwappingForCloudState,
iv = StationSoftMgr.SwappingStateMachine.RadarInFlag == true ? 1 : 2, carFlag = StationSoftMgr.SwappingStateMachine.RadarInFlag == true ? 1 : 2,
ls = StationSoftMgr.SwappingStateMachine.VelUnlockFlag == true ? 2 : 1, lockStatus = StationSoftMgr.SwappingStateMachine.VelUnlockFlag == true ? 2 : 1,
fl = Convert.ToInt32(StaticStationInfo.Faultlevel), faultLevel = Convert.ToInt32(StaticStationInfo.Faultlevel),
ut = DateTime.Now, updateTime = DateTime.Now,
}; };
} }
@ -143,13 +154,13 @@ public abstract class CloudApi
stationChnRunStatus = new() stationChnRunStatus = new()
{ {
ec = 0, passageNo = 0,
ws = 1, status = 1,
cs = 1, passageStatus = 1,
iv = 2, carFlag = 2,
ls = 0, lockStatus = 0,
fl = Convert.ToInt32(StaticStationInfo.Faultlevel), faultLevel = Convert.ToInt32(StaticStationInfo.Faultlevel),
ut = DateTime.Now, updateTime = DateTime.Now,
}; };
} }
@ -385,28 +396,26 @@ public abstract class CloudApi
{ {
SignIn signIn = new() SignIn signIn = new()
{ {
sn = StaticStationInfo.StationNo, stationNo = StaticStationInfo.StationNo,
ky = StaticStationInfo.StationSn, supplierCode = StaticStationInfo.StationSn,
st = "02", stationType = "02",
dv = "", equipmentType = "",
sv = StaticStationInfo.StationSftVer, version = StaticStationInfo.StationSftVer,
ss = StaticStationInfo.Sevstatus, stationStatus = StaticStationInfo.Sevstatus,
ca = Convert.ToSingle(StaticStationInfo.DistributionCapacity), stationCapacity = Convert.ToSingle(StaticStationInfo.DistributionCapacity),
VS = "1.0", equipmentVersion = "1.0",
cp = Convert.ToInt32(StaticStationInfo.TotalPower), chargePower = Convert.ToInt32(StaticStationInfo.TotalPower),
bs= StaticStationInfo.StationVersion, stationVersion= StaticStationInfo.StationVersion,
lo= StaticStationInfo.Longitude, lo= StaticStationInfo.Longitude,
la= StaticStationInfo.Latitude, la= StaticStationInfo.Latitude,
en=1, channelNumber=1,
cn=7, chargerNumber=7,
eid= Convert.ToInt32(StaticStationInfo.Ceid), electricityId= Convert.ToInt32(StaticStationInfo.Ceid),
oid = Convert.ToInt32(StaticStationInfo.Oid), billingId = Convert.ToInt32(StaticStationInfo.Oid),
}; };
//CloudClientMgr.CloudClient?.SendSignIn(signIn, CloudClientMgr.CloudClient?.SendSignIn(signIn,
// global::System.TimeSpan.FromSeconds(TimeSpan)); global::System.TimeSpan.FromSeconds(TimeSpan));
} }
/// <summary> /// <summary>

@ -196,7 +196,7 @@ public class CarPrepareState : IState
{ {
CarAuthRes? vehicleCertificationResp = CarAuthRes? vehicleCertificationResp =
CloudApi.VehicleCheck(machine.RfidReadModel, machine.SwapOrder); CloudApi.VehicleCheck(machine.RfidReadModel, machine.SwapOrder);
if (vehicleCertificationResp == null || vehicleCertificationResp.re != 0) if (vehicleCertificationResp == null || vehicleCertificationResp.result != 0)
{ {
_log.Info("cloud check vehicle error"); _log.Info("cloud check vehicle error");
// machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成"); // machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
@ -208,7 +208,7 @@ public class CarPrepareState : IState
machine.CloudVelCheckFlag = true; machine.CloudVelCheckFlag = true;
// machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成"); // machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
machine.SwapOrder.CloudSn = vehicleCertificationResp.on; machine.SwapOrder.CloudSn = vehicleCertificationResp.order;
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.CloudVelCheckFlag, _CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.CloudVelCheckFlag,
machine); machine);
} }

@ -58,14 +58,14 @@ public class SwapCanStartState : IState
if (carCanStart != null) if (carCanStart != null)
{ {
//车牌号 //车牌号
if (carCanStart.cn.Equals(machine.BoxCarInfoModel.CarNo)) if (carCanStart.carNo.Equals(machine.BoxCarInfoModel.CarNo))
{ {
//可以开始换电 //可以开始换电
if (carCanStart.cs == 1) if (carCanStart.swapFlag == 1)
{ {
_log.Info("SwapCanStart ok"); _log.Info("SwapCanStart ok");
//更新换电订单 //更新换电订单
machine.SwapOrder.CloudSn = carCanStart.on; machine.SwapOrder.CloudSn = carCanStart.order;
_swapOrderRepository.Update(machine.SwapOrder.CloudSn); _swapOrderRepository.Update(machine.SwapOrder.CloudSn);
machine.CloudCarCanStartFlag = true; machine.CloudCarCanStartFlag = true;

@ -78,7 +78,7 @@ public class SwapOrderMgr
var count = _swapOrderRepository.GetCount(i => var count = _swapOrderRepository.GetCount(i =>
i.SwapResult == 1 && i.SwapEndTime >= DateTime.Today && i.SwapEndTime < swapOrder.SwapEndTime); i.SwapResult == 1 && i.SwapEndTime >= DateTime.Today && i.SwapEndTime < swapOrder.SwapEndTime);
swapOrderReportClouds.TryGetValue(swapOrder.Id, out SwapOrderReportCloud value); swapOrderReportClouds.TryGetValue(swapOrder.Id, out SwapOrderReportCloud value);
var uploadSwapOrder = CloudApi.UploadSwapOrder(swapOrder, count++, swapOrderBattery, uploadType,value); var uploadSwapOrder = CloudApi.UploadSwapOrder(swapOrder, count++, batterys, uploadType,value);
if (uploadSwapOrder == 0) if (uploadSwapOrder == 0)
{ {

@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Repository.Station; using Repository.Station;
using Service.Cloud.Client; using Service.Cloud.Client;
using Service.Cloud.Msg.Cloud.Resp; using Service.Cloud.Msg.Cloud.Resp;
using Service.Cloud.Msg.Host.Req;
using Service.Execute.Api; using Service.Execute.Api;
using Service.Execute.Model; using Service.Execute.Model;
using SqlSugar; using SqlSugar;
@ -61,6 +62,21 @@ public class GenController : ControllerBase
[HttpGet("CloudTestUploadSwapOrder")] [HttpGet("CloudTestUploadSwapOrder")]
public Result<CarAuthRes> CloudTestUploadSwapOrder() public Result<CarAuthRes> CloudTestUploadSwapOrder()
{ {
var swapOrderBatterList = new List<SwapOrderBattery>()
{
new SwapOrderBattery()
{
DownBatteryNo = "123", DownBatterySoc = 30, DownBatteryBinNo = 2, UpBatteryNo = "456",
UpBatterySoc = 100, UpBatteryBinNo = 3
},
new SwapOrderBattery()
{
DownBatteryNo = "789", DownBatterySoc = 40, DownBatteryBinNo = 4, UpBatteryNo = "987",
UpBatterySoc = 95, UpBatteryBinNo = 5
}
};
var uploadSwapOrder = CloudApi.UploadSwapOrder(new SwapOrder() var uploadSwapOrder = CloudApi.UploadSwapOrder(new SwapOrder()
{ {
VehicleEnterTime = DateTime.Now, VehicleEnterTime = DateTime.Now,
@ -72,11 +88,7 @@ public class GenController : ControllerBase
VehicleLeaveTime = DateTime.Now, VehicleLeaveTime = DateTime.Now,
}, },
1, 1,
new SwapOrderBattery() swapOrderBatterList, 1, new SwapOrderReportCloud()
{
DownBatteryNo = "123", DownBatterySoc = 30, DownBatteryBinNo = 2, UpBatteryNo = "456",
UpBatterySoc = 100, UpBatteryBinNo = 3
}, 1, new SwapOrderReportCloud()
{ {
}); });
@ -107,6 +119,15 @@ public class GenController : ControllerBase
return Result<CarAuthRes>.Success(); return Result<CarAuthRes>.Success();
} }
[HttpGet("CloudTestStationChnRunStatus")]
public Result<CarAuthRes> CloudTestStationChnRunStatus()
{
StationChnRunStatus stationChnRunStatus = new StationChnRunStatus();
stationChnRunStatus.updateTime=DateTime.Now;
CloudClientMgr.CloudClient?.SendChannelStatusReporting(stationChnRunStatus, new TimeSpan());
return Result<CarAuthRes>.Success();
}
[HttpGet("test115")] [HttpGet("test115")]
public void Test115() public void Test115()

Loading…
Cancel
Save