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); }