站外帧补充

master
tq 5 months ago
parent acbedfb805
commit f20824dd2d

@ -22,7 +22,10 @@ using Service.Cloud.Handler;
using Service.Cloud.Msg;
using Service.Cloud.Msg.Cloud.Req;
using Service.Cloud.Msg.Cloud.Resp;
using Service.Cloud.Msg.Cloud.Resp.OutCharger;
using Service.Cloud.Msg.Host.Req;
using Service.Cloud.Msg.Host.Req.OutCharger;
using Service.Cloud.Msg.Host.Resp.OutCharger;
namespace Service.Cloud.Client;
@ -88,6 +91,10 @@ public class CloudClient : IMqttClientConnectedHandler, IMqttApplicationMessageR
public MsgPair<VehicleDataReporting, VehicleDataReportingResp> VehicleData { get; set; } = new();
public MsgPair<ChargeRecordUpLoad, ChargeRecordUploadRes> ChargeRecordUpLoad { get; set; } = new();
public MsgPair<ChargeDevDataInfo, ChargeDevDataInfoRes> ChargeDevDataInfo { get; set; } = new();
public MsgPair<PileEndCharge, PileEndChargeResp> PileEndCharge { get; set; } = new();
public MsgPair<PileChargeRealtime, PileChargeRealtimeResp> PileChargeRealtime { get; set; } = new();
#endregion
@ -506,6 +513,20 @@ public class CloudClient : IMqttClientConnectedHandler, IMqttApplicationMessageR
this.Publish(req);
return ChargeDevDataInfo.GetResp(timeSpan);
}
public PileEndChargeResp? SendPileEndCharge(PileEndCharge req, TimeSpan? timeSpan = null)
{
this.PileEndCharge.Req = req;
this.Publish(req);
return PileEndCharge.GetResp(timeSpan);
}
public PileChargeRealtimeResp? SendPileChargeRealtime(PileChargeRealtime req, TimeSpan? timeSpan = null)
{
this.PileChargeRealtime.Req = req;
this.Publish(req);
return PileChargeRealtime.GetResp(timeSpan);
}
#endregion
#region business func

@ -65,8 +65,16 @@ public class CloudConst
/// </summary>
public static readonly string pileStartCharge = "pileStartCharge";
public static readonly string pileStartChargeRes = "pileStartChargeRes";
public static readonly string pileStopCharge = "pileStopCharge";
public static readonly string pileRealtimeRes = "pileRealtimeRes";
public static readonly string pileEndCharge = "pileEndCharge";
public static readonly string pileEndChargeRes = "pileEndChargeRes";
public static readonly string pileChargeRealtime = "pileChargeRealtime";
public static readonly string pileChargeRealtimeRes = "pileChargeRealtimeRes";
#endregion
}

@ -4,7 +4,7 @@ using HybirdFrameworkCore.Autofac.Attribute;
using NewLife.Remoting;
using Newtonsoft.Json;
using Service.Cloud.Common;
using Service.Cloud.Msg.Cloud.OutCharger.Req;
using Service.Cloud.Msg.Cloud.Req.OutCharger.Req;
namespace Service.Cloud.Handler.OutCharger;

@ -3,7 +3,7 @@ using Common.Util;
using HybirdFrameworkCore.Autofac.Attribute;
using Newtonsoft.Json;
using Service.Cloud.Common;
using Service.Cloud.Msg.Cloud.OutCharger.Req;
using Service.Cloud.Msg.Cloud.Req.OutCharger.Req;
namespace Service.Cloud.Handler.OutCharger;

@ -1,6 +1,6 @@
using Service.Cloud.Common;
namespace Service.Cloud.Msg.Cloud.OutCharger.Req;
namespace Service.Cloud.Msg.Cloud.Req.OutCharger.Req;
/// <summary>
/// 9.2.1.1 云平台下发开始充电操作

@ -1,6 +1,7 @@
using Service.Cloud.Common;
namespace Service.Cloud.Msg.Cloud.OutCharger.Req;
namespace Service.Cloud.Msg.Cloud.Req.OutCharger.Req;
/// <summary>
/// 9.2.17 云端下发充电枪停止充电

@ -0,0 +1,30 @@
using Service.Cloud.Common;
namespace Service.Cloud.Msg.Cloud.Resp.OutCharger;
/// <summary>
/// 9.2.1.4 云端响应充电枪充电结束事件
/// </summary>
public class PileEndChargeResp : ICmd
{
/// <summary>
/// 应答结果
/// 1:成功 2:失败
/// </summary>
public string re { get; set; }
/// <summary>
/// 故障码
/// </summary>
public string ec { get; set; }
/// <summary>
/// 充电枪编码
/// </summary>
public string pn { get; set; }
public string GetCmd()
{
return CloudConst.pileEndChargeRes;
}
}

@ -0,0 +1,160 @@
using Service.Cloud.Common;
namespace Service.Cloud.Msg.Host.Req.OutCharger;
/// <summary>
/// 9.2.1.7 站控上报充电枪充电遥测数据
/// </summary>
public class PileChargeRealtime : ICmd
{
/// <summary>
/// 换电站编码
/// </summary>
public string sn { get; set; }
/// <summary>
/// 充电订单号
/// 云平台下发的充电订单编号,;当启动模式为本地主动启动(即插即充)时,该 值以 0 填充
/// </summary>
public string con { get; set; }
/// <summary>
/// 充电流水号
/// 充电记录唯一编码
/// </summary>
public string cosn { get; set; }
/// <summary>
/// Desc:充电枪编号
/// Default:
/// Nullable:True
/// </summary>
public string? pn { get; set; }
/// <summary>
/// 需求电压
/// </summary>
public float rv { get; set; }
/// <summary>
/// 需求电流
/// </summary>
public float re { get; set; }
/// <summary>
/// 充电模式 01H:恒压充电、02H恒流充电
/// </summary>
public int cm { get; set; }
/// <summary>
/// 充电电压测量值
/// </summary>
public float cdv { get; set; }
/// <summary>
/// 充电电流测量值
/// </summary>
public float cde { get; set; }
/// <summary>
/// 当前荷电状态 S0C %
/// </summary>
public float soc { get; set; }
/// <summary>
/// 估算剩余充电时间
/// </summary>
public int tr { get; set; }
/// <summary>
/// 电桩电压输岀值
/// </summary>
public float pov { get; set; }
/// <summary>
/// 电桩电流输岀值
/// </summary>
public float poe { get; set; }
/// <summary>
/// 累计充电时间
/// </summary>
public int tct { get; set; }
/// <summary>
/// 最高单体动力 蓄电池电压所 在编号
/// </summary>
public int? hbvn { get; set; }
/// <summary>
/// 最高单体动力 蓄电池电压
/// </summary>
public float? hbv { get; set; }
/// <summary>
/// 最高温度检测 点编号
/// </summary>
public int hbtn { get; set; }
/// <summary>
/// 最高动力蓄电池温度
/// </summary>
public int hbt { get; set; }
/// <summary>
/// 最低单体动力 蓄电池电压所在编号
/// </summary>
public int lbvn { get; set; }
/// <summary>
/// 最低单体动力蓄电池电压
/// </summary>
public float lbv { get; set; }
/// <summary>
/// 最低动力蓄电池温度检测点 编号
/// </summary>
public int lbtn { get; set; }
/// <summary>
/// 最低动力蓄电 池温度
/// </summary>
public int lbt { get; set; }
/// <summary>
/// 单体动力蓄电 池电压过高 / 过低告警
/// </summary>
public int hlbva { get; set; }
/// <summary>
/// 整车动力蓄电 池荷电状态 S0C 过高/过低 告警
/// </summary>
public int hlbsa { get; set; }
/// <summary>
/// 动力蓄电池充电过流告警
/// </summary>
public int baa { get; set; }
/// <summary>
/// 动力蓄电池温度过高告警
/// </summary>
public int bta { get; set; }
/// <summary>
/// 动力蓄电池绝缘状态告警
/// </summary>
public int bia { get; set; }
/// <summary>
/// 动力蓄电池组 输岀连接器连 接状态告警
/// </summary>
public int bca { get; set; }
public string GetCmd()
{
return CloudConst.pileChargeRealtime;
}
}

@ -0,0 +1,103 @@
using Service.Cloud.Common;
namespace Service.Cloud.Msg.Host.Req.OutCharger;
/// <summary>
/// 9.2.1.3 站控上报充电枪充电结束事件
/// </summary>
public class PileEndCharge : ICmd
{
/// <summary>
/// 换电站编码
/// </summary>
public string sn { get; set; }
/// <summary>
/// 充电订单号
/// 云平台下发的充电订单编号,;当启动模式为本地主动启动(即插即充)时,该 值以 0 填充
/// </summary>
public string con { get; set; }
/// <summary>
/// 充电流水号
/// 充电记录唯一编码
/// </summary>
public string cosn { get; set; }
/// <summary>
/// Desc:充电枪编号
/// Default:
/// Nullable:True
/// </summary>
public string? pn { get; set; }
/// <summary>
/// 充电方式
/// 0自动充满为止 1按电量 2按时间 3按金额
/// </summary>
public int ct { get; set; }
/// <summary>
/// 充电参数
/// 按充电方式判断除0外 电量:单位 kWh精确到 0.01 时间:单位 min精确到 0.01 金额:单位 元,精确到 0.01
/// </summary>
public string cp { get; set; }
/// <summary>
/// 启动类型
/// 0运营平台启动1APP 启动2: 本地启动
/// </summary>
public int st { get; set; }
/// <summary>
/// 本次充电订单的开始时间 格式 yyyy-MM-dd HH:mm:ss
/// </summary>
public DateTime cst { get; set; }
/// <summary>
/// 本次充电订单的开始时间 格式 yyyy-MM-dd HH:mm:ss
/// </summary>
public DateTime? cet { get; set; }
/// <summary>
/// 充电电量
/// 至少保留两位有效小数
/// </summary>
public float ceq { get; set; }
/// <summary>
/// Desc:充电开始soc
/// Default:
/// Nullable:True
/// </summary>
public int? cssoc { get; set; }
/// <summary>
/// Desc:充电结束soc
/// Default:
/// Nullable:True
/// </summary>
public int? cesoc { get; set; }
/// <summary>
/// 计费时间段个数
/// </summary>
public int? ctn { get; set; }
/// <summary>
/// 计费时间段列表
/// </summary>
public List<string> ctl { get; set; }
/// <summary>
/// 充电车辆车架号
/// </summary>
public string cvin { get; set; }
public string GetCmd()
{
return CloudConst.pileEndCharge;
}
}

@ -0,0 +1,25 @@
using Service.Cloud.Common;
namespace Service.Cloud.Msg.Host.Resp.OutCharger;
/// <summary>
/// 9.2.1.6 云端响应充电枪充电遥测数据
/// </summary>
public class PileChargeRealtimeResp : ICmd
{
/// <summary>
/// 执行结果
/// </summary>
public string rs { get; set; }
/// <summary>
/// 充电枪编号
/// </summary>
public string pn { get; set; }
public string GetCmd()
{
return CloudConst.pileRealtimeRes;
}
}

@ -6,6 +6,7 @@ using Service.Cloud.Client;
using Service.Cloud.Msg.Cloud.Req;
using Service.Cloud.Msg.Cloud.Resp;
using Service.Cloud.Msg.Host.Req;
using Service.Cloud.Msg.Host.Req.OutCharger;
using Service.Execute.Model;
using Service.Execute.Model.Tbox;
using Service.Init;
@ -153,4 +154,24 @@ public abstract class CloudApi
CloudClientMgr.CloudClient.CarCanStart = null;
return true;
}
/// <summary>
/// 9.2.1.3 站控上报充电枪充电结束事件
/// </summary>
/// <param name="req"></param>
public static void SendPileEndCharge(PileEndCharge req)
{
CloudClientMgr.CloudClient?.SendPileEndCharge(req,
global::System.TimeSpan.FromSeconds(TimeSpan));
}
/// <summary>
/// 9.2.1.7 站控上报充电枪充电遥测数据
/// </summary>
/// <param name="req"></param>
public static void SendPileChargeRealtime(PileChargeRealtime req)
{
CloudClientMgr.CloudClient?.SendPileChargeRealtime(req,
global::System.TimeSpan.FromSeconds(TimeSpan));
}
}

@ -1,7 +1,9 @@
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.Cloud.Client;
using Service.Cloud.Msg.Host.Req.OutCharger;
using Service.Cloud.Msg.Host.Resp.OutCharger;
using Service.Execute.Api;
using Service.Init;
namespace WebStarter.Controllers;
@ -39,4 +41,31 @@ public class OutChargerController
CloudClientMgr.CloudClient?.Publish(req);
return Result<bool>.Success(true);
}
/// <summary>
/// 9.2.1.3 站控上报充电枪充电结束事件
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("SendPileEndCharge")]
public Result<bool> SendPileEndCharge([FromBody] PileEndCharge req)
{
CloudApi.SendPileEndCharge(req);
return Result<bool>.Success(true);
}
/// <summary>
/// 9.2.1.7 站控上报充电枪充电遥测数据
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("SendPileChargeRealtime")]
public Result<bool> SendPileChargeRealtime([FromBody] PileChargeRealtime req)
{
CloudApi.SendPileChargeRealtime(req);
return Result<bool>.Success(true);
}
}
Loading…
Cancel
Save