|
|
|
@ -35,13 +35,19 @@ namespace Service.Charger.Handler
|
|
|
|
|
client.ChargingStatus = (int)ChargingStatus.StartChargingSuccess;
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
if (chargeOrders.Count > 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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|