充电机状态显示

master
CZ 2 weeks ago
parent 4ef64d2f0b
commit 3812fa69ce

@ -1,4 +1,5 @@
using DotNetty.Common.Utilities;
using Entity.Constant;
namespace Service.Charger.Common;
@ -47,6 +48,32 @@ public static class ChargerConst
return 0;
}
//充电及数据
//00H待机
//01H工作
//02H工作完成
//03H: 故障
//04H: 启动中
//Desc:充电状态;0-未知1-正在充电2-无电池3-禁用4-充电完成5故障6启动中
/// <summary>
/// 根据充电机状态设置数据库状态
/// </summary>
public static int WorkStatus(int workStatus)
{
switch (workStatus)
{
case 0: return 0;
case 1: return 1;
case 2: return 4;
case 3: return 5;
case 4: return 6;
}
return 0;
}
}
/// <summary>

@ -54,13 +54,9 @@ namespace Service.Charger.Handler
client.TotalWarning = msg.TotalWarning;
client.UploadRemoteSignalData = msg;
//Desc:充电状态;0-未知1-正在充电2-无电池3-禁用4-充电完成
if (msg.WorkStatus == 1)
BinInfoRepository.Update(i => i.ChargeStatus == msg.WorkStatus, i => i.ChargerNo == sn);
else if (msg.WorkStatus == 2 || msg.WorkStatus == 0)
{
BinInfoRepository.Update(i => i.ChargeStatus == 4, i => i.ChargerNo == sn);
}
//充电及数据00H待机01H工作02H工作完成03H: 故障04H: 启动中
//Desc:充电状态;0-未知1-正在充电2-无电池3-禁用4-充电完成5故障6启动中
BinInfoRepository.Update(i => i.ChargeStatus == ChargerConst.WorkStatus(msg.WorkStatus), i => i.ChargerNo == sn);
#region 充电机故障显示

Loading…
Cancel
Save