修改上报云平台数据 新起线程处理,解决从站控角度处理云平台能立马收到数据

master
lxw 6 months ago
parent 6ab33ee838
commit 1f745b55a7

@ -43,13 +43,16 @@ public class SwapDoneState : IState
_CommonMgr.UpdateAmtOrder(machine); _CommonMgr.UpdateAmtOrder(machine);
} }
//新增换电成功上报云平台数据 Task.Run(() =>
_CommonMgr.InsertCloudReportForSwapSuccess(machine); {
//换电成功关于bininfo表的更新 //新增换电成功上报云平台数据
_CommonMgr.UpdateBinInfoForSwapSuccess(machine); _CommonMgr.InsertCloudReportForSwapSuccess(machine);
//换电成功关于bininfo表的更新
//可人工确认换电成功标识 _CommonMgr.UpdateBinInfoForSwapSuccess(machine);
machine.PlcSwapFlag = true;
//可人工确认换电成功标识
machine.PlcSwapFlag = true;
});
if (machine.SwapStatus == (int)InfoEnum.SwapOrderResult.Success) if (machine.SwapStatus == (int)InfoEnum.SwapOrderResult.Success)
{ {
@ -87,7 +90,7 @@ public class SwapDoneState : IState
/// <returns></returns> /// <returns></returns>
public InvokeStatus LockCar(SwappingStateMachine machine) public InvokeStatus LockCar(SwappingStateMachine machine)
{ {
return Invoker.Invoke("LockCar", 500, 100, machine.IsCanceled,machine.IsManualSwapSucc, return Invoker.Invoke("LockCar", 500, 100, machine.IsCanceled, machine.IsManualSwapSucc,
() => machine.VelLockFlag, () => () => machine.VelLockFlag, () =>
{ {
Task<bool> result = TBoxApi.LockCarManyTimes(machine.RfidReadModel.VelVin); Task<bool> result = TBoxApi.LockCarManyTimes(machine.RfidReadModel.VelVin);
@ -128,7 +131,7 @@ public class SwapDoneState : IState
public InvokeStatus ExistRadar(SwappingStateMachine machine) public InvokeStatus ExistRadar(SwappingStateMachine machine)
{ {
return Invoker.Invoke("wait exist radar", 1000, 5, machine.IsCanceled,machine.IsManualSwapSucc, return Invoker.Invoke("wait exist radar", 1000, 5, machine.IsCanceled, machine.IsManualSwapSucc,
() => machine.RadarOutFlag, () => () => machine.RadarOutFlag, () =>
{ {
if (PlcApi.ExitRadar()) if (PlcApi.ExitRadar())

@ -29,7 +29,7 @@ public class SwapOrderReportCloudTask : ITask
public int Interval() public int Interval()
{ {
return 1000 * 20; return 1000 * 3;
} }
public void Handle() public void Handle()

Loading…
Cancel
Save