|
|
@ -24,29 +24,38 @@ public class ManualSuccState : IState
|
|
|
|
public StateResult Handle(SwappingStateMachine machine)
|
|
|
|
public StateResult Handle(SwappingStateMachine machine)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_log.Info($"'goto ManualSucc");
|
|
|
|
_log.Info($"'goto ManualSucc");
|
|
|
|
machine.ManualSwapSuccFlag = false;
|
|
|
|
try
|
|
|
|
if (machine.SwapOrderBatteryInfo.swapAmtOrder != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
machine.SwapOrderBatteryInfo.swapAmtOrder.Status = (byte)InfoEnum.AmtOrderStatus.SwapFinish;
|
|
|
|
machine.ManualSwapSuccFlag = false;
|
|
|
|
_swapAmtOrderRepository.Update(machine.SwapOrderBatteryInfo.swapAmtOrder);
|
|
|
|
if (machine.SwapOrderBatteryInfo.swapAmtOrder != null)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
machine.SwapOrderBatteryInfo.swapAmtOrder.Status = (byte)InfoEnum.AmtOrderStatus.SwapFinish;
|
|
|
|
|
|
|
|
_swapAmtOrderRepository.Update(machine.SwapOrderBatteryInfo.swapAmtOrder);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (machine.SwapOrder != null)
|
|
|
|
if (machine.SwapOrder != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
machine.SwapOrder.SwapResult = (byte)InfoEnum.SwapOrderResult.Success;
|
|
|
|
machine.SwapOrder.SwapResult = (byte)InfoEnum.SwapOrderResult.Success;
|
|
|
|
machine.SwapOrder.VehicleLeaveTime = DateTime.Now;
|
|
|
|
machine.SwapOrder.VehicleLeaveTime = DateTime.Now;
|
|
|
|
_swapOrderRepository.Update(machine.SwapOrder);
|
|
|
|
_swapOrderRepository.Update(machine.SwapOrder);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_manualOperationRecordRepository.Insert(new ManualOperationRecord()
|
|
|
|
_manualOperationRecordRepository.Insert(new ManualOperationRecord()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Type = 2,
|
|
|
|
|
|
|
|
CreatedBy = UserManager.Account,
|
|
|
|
|
|
|
|
UpdatedBy = UserManager.Account,
|
|
|
|
|
|
|
|
Operator = machine.OperateModel.Operator,
|
|
|
|
|
|
|
|
Reason = machine.OperateModel.Reason,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
machine.Reset();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Type = 2,
|
|
|
|
machine.Reset();
|
|
|
|
CreatedBy = UserManager.Account,
|
|
|
|
_log.Error($"ManualSuccState err={e}");
|
|
|
|
UpdatedBy = UserManager.Account,
|
|
|
|
}
|
|
|
|
Operator = machine.OperateModel.Operator,
|
|
|
|
|
|
|
|
Reason = machine.OperateModel.Reason,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
machine.Reset();
|
|
|
|
|
|
|
|
return new StateResult()
|
|
|
|
return new StateResult()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SwappingState = SwappingState.StationReady
|
|
|
|
SwappingState = SwappingState.StationReady
|
|
|
|