From 00a0f3585a64c7010212f60a7d9cf83b7805a58c Mon Sep 17 00:00:00 2001 From: lxw Date: Wed, 25 Sep 2024 09:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8A=E8=87=AA=E5=8A=A8=E6=8D=A2=E7=94=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Execute/Mgr/CommonMgr.cs | 13 +++++++++++++ Service/Execute/Step/SwapDoneState.cs | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/Service/Execute/Mgr/CommonMgr.cs b/Service/Execute/Mgr/CommonMgr.cs index a3ce5ab..873df5d 100644 --- a/Service/Execute/Mgr/CommonMgr.cs +++ b/Service/Execute/Mgr/CommonMgr.cs @@ -33,6 +33,9 @@ public class CommonMgr public MoveBinRecordRepository MoveBinRecordRepository { get; set; } + + public SwapOrderStepRepository SwapOrderStepRepository { get; set; } + /// /// 新增小步状态 /// @@ -88,6 +91,7 @@ public class CommonMgr UpBatterySoc = upBin.Soc, UpBatteryNo = upBin.BatteryNo, UpBatterySoe = upBin.Soe, + //TODO::添加 换上电池的容量 UpBatteryBinNo = int.Parse(upBin.No), UpNominalEnergy = upBin.NominalEnergy, DownBatteryBinNo = int.Parse(inBin.No), @@ -99,6 +103,15 @@ public class CommonMgr _swapOrderBatteryRepository.Insert(swapOrderBattery); } + + //查询是否有手动操作 + public bool QueryHasManual(String swapOrderSn) + { + return SwapOrderStepRepository.GetCount(i => + i.SwapOrderSn == swapOrderSn && i.StepType == (int)SwapConstant.StepType.MANUAL) > 0; + + } + /// /// 1.锁仓 diff --git a/Service/Execute/Step/SwapDoneState.cs b/Service/Execute/Step/SwapDoneState.cs index 30c7e38..a6a5d2d 100644 --- a/Service/Execute/Step/SwapDoneState.cs +++ b/Service/Execute/Step/SwapDoneState.cs @@ -33,6 +33,15 @@ public class SwapDoneState : IState machine.SwapOrder!.SwapResult = machine.SwapStatus; machine.SwapOrder.SwapEndTime = DateTime.Now; machine.SwapOrder.FailReason = machine.SwapFailReason; + //查询是否有手动操作数据 + if (_CommonMgr.QueryHasManual(machine.SwapOrder.Sn)) + { + //半自动 + machine.SwapOrder.SwapWay = 2; + } + + ; + _CommonMgr.UpdateSwapOrder(machine); ////修改预约单