修改导出表格,去除两个字段,去除换电步骤换电失败,发送红绿灯命令

master
赵宝玉 2 months ago
parent bc2c646247
commit 0dcc62299b

@ -246,7 +246,7 @@ namespace Entity.Api.Resp
/// </summary>
public string? UpBatterySocDto
{
get { return UpBatterySoc.HasValue ? $"{UpBatterySoc.Value.ToString("0")}%" : null; }
get { return UpBatterySoc.HasValue ? $"{UpBatterySoc.Value.ToString("0")}" : null; }
}
@ -281,7 +281,7 @@ namespace Entity.Api.Resp
/// </summary>
public string? DownBatterySocDto
{
get { return DownBatterySoc.HasValue ? $"{DownBatterySoc.Value.ToString("0")}%" : null; }
get { return DownBatterySoc.HasValue ? $"{DownBatterySoc.Value.ToString("0")}" : null; }
}
/// <summary>

@ -129,7 +129,7 @@ public class InfoEnum
[Const("安装完成")] FinishNewBatteryFlag,
[Const("车辆上锁")] VelLockFlag,
[Const("换电完成(车辆驶离)")] RadarOutFlag,
[Const("换电失败(车辆驶离)")] RadarOutFailFlag,
// [Const("换电失败(车辆驶离)")] RadarOutFailFlag,
}

@ -39,7 +39,8 @@ public class SwapOrderDto
public string VehicleNo { get; set; }
[ExporterHeader(DisplayName = "车牌号", IsBold = true)]
// [ExporterHeader(DisplayName = "车牌号", IsBold = true)]
[ExporterHeader(IsIgnore = true)]
public string VehicleNoCode { get; set; }
/// <summary>
@ -47,7 +48,8 @@ public class SwapOrderDto
/// Default:
/// Nullable:True
/// </summary>
[ExporterHeader(DisplayName = "所属公司", IsBold = true)]
//[ExporterHeader(DisplayName = "所属公司", IsBold = true)]
[ExporterHeader(IsIgnore = true)]
public string? Company {get;set;}
/// <summary>
@ -180,7 +182,7 @@ public class SwapOrderDto
{
get
{
return UpBatterySoc.HasValue ? $"{UpBatterySoc.Value.ToString("0")}%" : null;
return UpBatterySoc.HasValue ? $"{UpBatterySoc.Value.ToString("0")}" : null;
}
}
@ -223,7 +225,7 @@ public class SwapOrderDto
{
get
{
return DownBatterySoc.HasValue ? $"{DownBatterySoc.Value.ToString("0")}%" : null;
return DownBatterySoc.HasValue ? $"{DownBatterySoc.Value.ToString("0")}" : null;
}
}

@ -80,4 +80,17 @@ public class PlcApi
Log.Info($"PlcApi Init done");
return true;
}
/// <summary>
/// 发送红绿灯
/// </summary>
/// <returns></returns>
public static bool Traffic(byte Light)
{
Log.Info($"PlcApi Init ");
ClientMgr.PlcClient?.SendInboundCommandsReq(Light);
Log.Info($"PlcApi Init done");
return true;
}
}

@ -211,6 +211,7 @@ public class StationReadyState : IState
if (PadarMgr._PadarClient?.CarState == 6 || machine.ManualSkipRadar)
{
// PlcApi.Traffic(0);
LedClient.SendMsgByKey(InfoEnum.SwapInfo.diparkir.GetLed());
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.RadarInFlag,
machine,type: machine.ManualSkipRadar? (int)SwapConstant.StepType.MANUAL :(int)SwapConstant.StepType.AUTO);

@ -300,7 +300,7 @@ public class SwapDoneState : IState
machine.ExceptionReason = ExceptionReason.None;
_log.Info("exist radar true");
// PlcApi.Traffic(1);
//出口写红灯
//更新车辆离场时间,上报云平台
//machine.BusinessSwappingForCloudState =
@ -311,7 +311,7 @@ public class SwapDoneState : IState
_CommonMgr.InsertStep(
machine.SwapStatus == (int)InfoEnum.SwapOrderResult.Success
? InfoEnum.BusinessSwappingStep.RadarOutFlag
: InfoEnum.BusinessSwappingStep.RadarOutFailFlag,
: InfoEnum.BusinessSwappingStep.RadarOutFlag,
machine,type: machine.ManualSkipRadar? (int)SwapConstant.StepType.MANUAL :(int)SwapConstant.StepType.AUTO);
}

@ -239,6 +239,26 @@ public class PlcClient : TcpClient<IBaseHandler, Decoder, Encoder>
/// </summary>
/// <param name="sn">Plc编号</param>
/// <param name="msg">消息</param>
//public Result<bool> SendInboundCommandsReq(byte positionNumber)
//{
// if (!Connected)
// {
// return Result<bool>.Fail($"Plc{Sn}未连接");
// }
// InboundCommandsReq req = new InboundCommandsReq(positionNumber)
// {
// PositionNumber = positionNumber,
// };
// this.Channel.WriteAndFlushAsync(req);
// return Result<bool>.Success();
//}
/// <summary>
/// 发送入库命令修改为红绿灯
/// </summary>
/// <param name="sn">Plc编号</param>
/// <param name="msg">消息</param>
public Result<bool> SendInboundCommandsReq(byte positionNumber)
{
if (!Connected)
@ -253,6 +273,7 @@ public class PlcClient : TcpClient<IBaseHandler, Decoder, Encoder>
return Result<bool>.Success();
}
/// <summary>
/// 发送终止命令
/// </summary>

@ -32,8 +32,5 @@ public class WarehousCompleteReqHandler : SimpleChannelInboundHandler<WarehousCo
Log.Info("Warehousing finish");
ctx.Channel.WriteAndFlushAsync(message: new Msg.Host.Resp.WarehousCompleteResq());
}
}

@ -4,7 +4,7 @@ using HybirdFrameworkCore.Autofac.Attribute;
namespace Service.Charger.Msg.Host.Req;
/// <summary>
/// 入库命令
/// 入库命令改为红绿灯使用
/// </summary>
public class InboundCommandsReq : ASDU {

@ -199,7 +199,7 @@ public class SwapOrderService : BaseServices<SwapOrder>
if (swapOrder.SwapBeginTime != null && swapOrder.SwapEndTime != null)
{
Expression<Func<SwapOrder, bool>> condition2Expr = u => u.SwapBeginTime >= swapOrder.SwapBeginTime && u.SwapBeginTime <= swapOrder.SwapEndTime;
Expression<Func<SwapOrder, bool>> condition2Expr = u => u.VehicleEnterTime >= swapOrder.SwapBeginTime && u.VehicleEnterTime <= swapOrder.SwapEndTime;
where = where == null
? condition2Expr
: Expression.Lambda<Func<SwapOrder, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);

@ -134,7 +134,7 @@ public class PlcController : ControllerBase
{
return chargerClient.SendTrafficLightReq(trafficLight);
}
return Result<bool>.Fail("充电机未连接");
return Result<bool>.Fail("PLC未连接");
}
/// <summary>
@ -185,9 +185,11 @@ public class PlcController : ControllerBase
{
return chargerClient.SendInboundCommandsReq(positionNumber);
}
return Result<bool>.Fail("充电机未连接");
return Result<bool>.Fail("PLC未连接");
}
/// <summary>
/// 发送终止命令
/// </summary>

Loading…
Cancel
Save