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); ////修改预约单