充电机测试,接收充电启动完成帧handler更新sql更改

zw
CZ 5 months ago
parent 156b49ab9d
commit afcc3bc11f

@ -35,13 +35,19 @@ namespace Service.Charger.Handler
client.ChargingStatus = (int)ChargingStatus.StartChargingSuccess; client.ChargingStatus = (int)ChargingStatus.StartChargingSuccess;
client.ChargingStartTime = DateTime.Now; client.ChargingStartTime = DateTime.Now;
//查找最新的充电订单 //查找最新的充电订单
List<ChargeOrder> chargeOrders = ChargeOrderRepository.QueryListByClause(i => i.BatteryNo == client.BatteryNo, "created_time desc") List<ChargeOrder> chargeOrders = ChargeOrderRepository
.QueryListByClause(i => i.BatteryNo == client.BatteryNo, "created_time desc")
.Take(1).ToList(); .Take(1).ToList();
if (chargeOrders.Count > 0) if (chargeOrders.Count > 0)
{ {
ChargeOrder one = chargeOrders[0]; ChargeOrder one = chargeOrders[0];
ChargeOrderRepository.Update(i => i.CmdStatus == 1 && i.StartTime == client.ChargingStartTime, ChargeOrderRepository.Update(
i => new ChargeOrder()
{
CmdStatus = 1,
StartTime = client.ChargingStartTime
},
it => it.Id == one.Id); it => it.Id == one.Id);
} }
} }

Loading…
Cancel
Save