From 45eb69a8ce2bd04a48206dadf9f5cbc834de42a9 Mon Sep 17 00:00:00 2001 From: rszn <645583145@qq.com> Date: Sat, 29 Jun 2024 15:58:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Repository/Station/BinInfoRepository.cs | 8 ++++---- Service/Execute/Step/SwapDoneState.cs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Repository/Station/BinInfoRepository.cs b/Repository/Station/BinInfoRepository.cs index 14ad7df..5c432cd 100644 --- a/Repository/Station/BinInfoRepository.cs +++ b/Repository/Station/BinInfoRepository.cs @@ -29,7 +29,7 @@ public class BinInfoRepository : BaseRepository QueryListByClause(i => i.CacheBinFlag == 0 && i.CanSwapFlag==1 && i.Exists == 1 && i.Status == 1 && i.AmtLock == (int)InfoEnum.AmtBatLockStatus.UnLock, "in_time asc"); - BinInfo? cacheBinBattery = ChooseCacheBinBattery(); + BinInfo? cacheBinBattery = ChooseCacheBinBattery(swapSoc); if (list.Count <= 0 && cacheBinBattery == null) { selectPackDto.Info = InfoEnum.SelectBinStatusInfo.NoBattery; @@ -81,10 +81,10 @@ public class BinInfoRepository : BaseRepository /// 选择缓存仓的电池 /// /// - public BinInfo? ChooseCacheBinBattery() + public BinInfo? ChooseCacheBinBattery(int swapSoc) { return - QueryByClause(i => i.CacheBinFlag == 1 && i.CanSwapFlag==1 && + QueryByClause(i => i.CacheBinFlag == 1 && i.CanSwapFlag==1 && i.Soc >= swapSoc && i.Exists == 1 && i.Status == 1 && i.AmtLock == (int)InfoEnum.AmtBatLockStatus.UnLock); } -} \ No newline at end of file +} diff --git a/Service/Execute/Step/SwapDoneState.cs b/Service/Execute/Step/SwapDoneState.cs index 94f1f46..569641b 100644 --- a/Service/Execute/Step/SwapDoneState.cs +++ b/Service/Execute/Step/SwapDoneState.cs @@ -56,7 +56,6 @@ public class SwapDoneState : IState machine.PlcSwapFlag = true; }); - if (machine.SwapStatus == (int)InfoEnum.SwapOrderResult.Success) { //上传云平台换电状态 @@ -178,4 +177,4 @@ public class SwapDoneState : IState : (int)InfoEnum.SwapInfo.ErrInfoCarLeave); }, false, () => { }, 10, InvokeStatus.None); } -} \ No newline at end of file +}