From 8b80353616063daca90583e78489b9a42e45795e Mon Sep 17 00:00:00 2001 From: CZ Date: Tue, 25 Jun 2024 20:43:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E7=94=B5=E6=9C=BA=E5=8A=9F=E7=8E=87?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Station/BinInfoService.cs | 1 + WebStarter/Controllers/ChargeController.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Service/Station/BinInfoService.cs b/Service/Station/BinInfoService.cs index fef3032..d8b93e9 100644 --- a/Service/Station/BinInfoService.cs +++ b/Service/Station/BinInfoService.cs @@ -16,6 +16,7 @@ public class BinInfoService : BaseServices public BinInfoService(BinInfoRepository binInfoRepository) { _binInfoRepository = binInfoRepository; + this.BaseDal = binInfoRepository; } /// /// 获取仓位数据 diff --git a/WebStarter/Controllers/ChargeController.cs b/WebStarter/Controllers/ChargeController.cs index f8f63fc..3ca32ea 100644 --- a/WebStarter/Controllers/ChargeController.cs +++ b/WebStarter/Controllers/ChargeController.cs @@ -77,13 +77,14 @@ public class ChargeController : ControllerBase return Result.Fail("功率值范围1到360"); } - ChargerClient? chargerClient = ClientMgr.GetBySn(code); + string _code = _binInfoService.QueryByClause(i => i.Code == code).ChargerNo; + ChargerClient? chargerClient = ClientMgr.GetBySn(_code); if (chargerClient != null) { chargerClient.SendPowerRegulation(power); - _equipInfoRepository.Update(i => i.ChargePower == power, it => it.Code == code); + _equipInfoRepository.Update(i => i.ChargePower == power, it => it.Code == _code); return Result.Success(true); }