|
|
|
@ -28,7 +28,7 @@ namespace HybirdFrameworkServices.Charger.Handler
|
|
|
|
|
public BinInfoRepository BinInfoRepository { get; set; }
|
|
|
|
|
public ChargeOrderRepository ChargeOrderRepository { get; set; }
|
|
|
|
|
public SwapOrderBatteryRepository SwapOrderBatteryRepository { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static readonly ILog Log = LogManager.GetLogger(typeof(FinishStartChargingHandler));
|
|
|
|
|
protected override void ChannelRead0(IChannelHandlerContext ctx, FinishStartCharging msg)
|
|
|
|
|
{
|
|
|
|
@ -47,7 +47,7 @@ namespace HybirdFrameworkServices.Charger.Handler
|
|
|
|
|
{
|
|
|
|
|
ChargeOrderRepository.Update(it => it.SwapOrderSn == swapOrderBattery.SwapOrderSn,
|
|
|
|
|
it => it.Sn == client.ChargeOrderNo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ChargeOrder> orders = ChargeOrderRepository.QueryBySwapOrderAndBatterySn(swapOrderBattery.SwapOrderSn,
|
|
|
|
|
client.BatteryNo);
|
|
|
|
|
if (orders.Count > 0)
|
|
|
|
@ -59,26 +59,26 @@ namespace HybirdFrameworkServices.Charger.Handler
|
|
|
|
|
{
|
|
|
|
|
cloudChargeOrder = order.CloudChargeOrder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(cloudChargeOrder))
|
|
|
|
|
{
|
|
|
|
|
cloudChargeOrder = ChargerUtils.GenChargeOrderSn();
|
|
|
|
|
cloudChargeOrder = ChargerUtils.GenChargeOrderNo(sn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HashSet<int> hashSet = orders.Select(it => it.Id).ToHashSet();
|
|
|
|
|
ChargeOrderRepository.Update(it => it.CloudChargeOrder == cloudChargeOrder,
|
|
|
|
|
it => hashSet.Contains(it.Id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Log.Error($"can not find swapOrderBattery by {client.BatteryNo}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (msg.Result == 1)
|
|
|
|
|
{
|
|
|
|
|