新增换电成功上报云平台数据

master
lxw 7 months ago
parent 4f3877e683
commit ef0e003a81

@ -21,6 +21,8 @@ public class CommonMgr
public BinInfoRepository _binInfoRepository { get; set; }
public SwapAmtOrderRepository _amtOrderRepository { get; set; }
public SwapOrderBatteryRepository _swapOrderBatteryRepository { get; set; }
public SwapOrderReportCloudRepository _swapOrderReportCloudRepository { get; set; }
/// <summary>
/// 新增小步状态
@ -233,5 +235,21 @@ public class CommonMgr
}
}
/// <summary>
/// 换电完成新增上报云平台记录
/// </summary>
/// <param name="machine"></param>
public void InsertCloudReportForSwapSuccess(SwappingStateMachine machine)
{
SwapOrder? machineSwapOrder = machine.SwapOrder;
_swapOrderReportCloudRepository.Insert(new SwapOrderReportCloud()
{
SwapOrderSn = machineSwapOrder.Sn,
SwapOrderId = machineSwapOrder.Id,
CloudReportStatus = 0,
Vin = machineSwapOrder.VehicleVin
});
}
}

@ -37,7 +37,7 @@ public class SwapDoneState : IState
{
//上传云平台换电状态
machine.BusinessSwappingForCloudState = InfoEnum.BusinessSwappingForCloudState.SwapDoneWithVel;
// CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
// CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
}
//云平台没有匹配的失败状态
@ -56,9 +56,11 @@ public class SwapDoneState : IState
return SwappingStateMachine.ReturnWithInvokeErr(existRadar, ExceptionReason.None);
}
//新增换电成功上报云平台数据
_CommonMgr.InsertCloudReportForSwapSuccess(machine);
//换电成功关于bininfo表的更新
_CommonMgr.UpdateBinInfoForSwapSuccess(machine);
return new StateResult()
{
SwappingState = SwappingState.StationReady
@ -102,7 +104,7 @@ public class SwapDoneState : IState
}
}, () =>
{
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrLockCar.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrLockCar.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrLockCar);
}, false, () => { machine.ExceptionReason = ExceptionReason.LockCarError; }
, 10, InvokeStatus.None);

Loading…
Cancel
Save